Thread: [Abtlinux-svn] SF.net SVN: abtlinux: [371] src/trunk/abtpackagemanager.rb
Status: Alpha
Brought to you by:
eschabell
From: <esc...@us...> - 2007-07-17 18:59:35
|
Revision: 371 http://svn.sourceforge.net/abtlinux/?rev=371&view=rev Author: eschabell Date: 2007-07-17 11:59:34 -0700 (Tue, 17 Jul 2007) Log Message: ----------- Added todo for install_cached_package that needs to be added. Started to work on remove_package method implementation. Modified Paths: -------------- src/trunk/abtpackagemanager.rb Modified: src/trunk/abtpackagemanager.rb =================================================================== --- src/trunk/abtpackagemanager.rb 2007-07-17 17:31:31 UTC (rev 370) +++ src/trunk/abtpackagemanager.rb 2007-07-17 18:59:34 UTC (rev 371) @@ -94,7 +94,6 @@ # false. ## def install_package( package, verbose=true ) - require "#{$PACKAGE_PATH}#{package}" sw = eval( "#{package.capitalize}.new" ) queuer = AbtQueueManager.new @@ -208,6 +207,8 @@ return true # install completed! end + # TODO: add install_cached_package( package ) + ## # Reinstalls a given package. # @@ -228,6 +229,14 @@ # false. ## def remove_package( package ) + require "#{$PACKAGE_PATH}#{package}" + sw = eval( "#{package.capitalize}.new" ) + logger = AbtLogManager.new + + # get package details. + details = sw.details + + # puts "Removing #{package} now..." end This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <esc...@us...> - 2007-07-17 21:21:03
|
Revision: 377 http://svn.sourceforge.net/abtlinux/?rev=377&view=rev Author: eschabell Date: 2007-07-17 14:21:03 -0700 (Tue, 17 Jul 2007) Log Message: ----------- Implemented remove_package. Modified Paths: -------------- src/trunk/abtpackagemanager.rb Modified: src/trunk/abtpackagemanager.rb =================================================================== --- src/trunk/abtpackagemanager.rb 2007-07-17 21:18:45 UTC (rev 376) +++ src/trunk/abtpackagemanager.rb 2007-07-17 21:21:03 UTC (rev 377) @@ -218,6 +218,7 @@ # otherwise false. ## def reinstall_package( package ) + return false end ## @@ -235,9 +236,28 @@ # get package details. details = sw.details + + # TODO: something with possible /etc or other configure files before removal, check maybe integrity for changes since install? - # - puts "Removing #{package} now..." + # remove listings in install log. + installLog = logger.get_log( package, 'install' ) + + IO.foreach( installLog ) do |line| + if File.exist?( line.chomp ) + FileUtils.rm( line.chomp ) + logger.to_journal( "Removed file #{line.chomp} from #{package} install log.") + else + logger.to_journal( "Unable to remove #{line.chomp} from #{package} install log, does not exist.") + return false + end + end + + logger.to_journal( "Removed files from #{File.basename( installLog )} for #{package}." ) + + # remove entry in install listing. + FileUtils.remove_dir( "#{$PACKAGE_INSTALLED}/#{details['Source location']}" ) + logger.to_journal( "Removed entry from installed packages." ) + return true end ## @@ -251,6 +271,7 @@ # false. ## def downgrade_package( package, version ) + return false end ## @@ -263,6 +284,7 @@ # false. ## def freeze_package( package ) + return false end ## This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <esc...@us...> - 2007-07-19 18:56:53
|
Revision: 383 http://svn.sourceforge.net/abtlinux/?rev=383&view=rev Author: eschabell Date: 2007-07-19 11:56:55 -0700 (Thu, 19 Jul 2007) Log Message: ----------- Fixed problem stopping removal of package. Modified Paths: -------------- src/trunk/abtpackagemanager.rb Modified: src/trunk/abtpackagemanager.rb =================================================================== --- src/trunk/abtpackagemanager.rb 2007-07-19 18:31:29 UTC (rev 382) +++ src/trunk/abtpackagemanager.rb 2007-07-19 18:56:55 UTC (rev 383) @@ -261,17 +261,26 @@ # remove listings in install log. installLog = logger.get_log( package, 'install' ) - IO.foreach( installLog ) do |line| - if File.exist?( line.chomp ) - FileUtils.rm( line.chomp ) - logger.to_journal( "Removed file #{line.chomp} from #{package} install log.") - else - logger.to_journal( "Unable to remove #{line.chomp} from #{package} install log, does not exist.") - return false + # only process install log if it exists, continue on with + # journal log warning. + if File.exist?( installLog ) + IO.foreach( installLog ) do |line| + if File.exist?( line.chomp ) + FileUtils.rm( line.chomp ) + logger.to_journal( "Removed file #{line.chomp} from #{package} install log.") + else + logger.to_journal( "Unable to remove #{line.chomp} from #{package} install log, does not exist.") + # do not return false, removed is ok, just put warning in journal log. + end end + + logger.to_journal( "Removed files from #{File.basename( installLog )} for #{package}." ) + else + puts "Install log missing for #{package}, see journal..." + logger.to_journal( "Install log was missing for #{package}..." ) + logger.to_journal( "...continuing to remove package from install listing, but might have files still installed on system." ) end - logger.to_journal( "Removed files from #{File.basename( installLog )} for #{package}." ) # remove entry in install listing. FileUtils.remove_dir( "#{$PACKAGE_INSTALLED}/#{details['Source location']}" ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <esc...@us...> - 2007-07-23 10:14:49
|
Revision: 396 http://svn.sourceforge.net/abtlinux/?rev=396&view=rev Author: eschabell Date: 2007-07-23 02:32:10 -0700 (Mon, 23 Jul 2007) Log Message: ----------- Fixed typo call to downcase. Modified Paths: -------------- src/trunk/abtpackagemanager.rb Modified: src/trunk/abtpackagemanager.rb =================================================================== --- src/trunk/abtpackagemanager.rb 2007-07-23 07:17:15 UTC (rev 395) +++ src/trunk/abtpackagemanager.rb 2007-07-23 09:32:10 UTC (rev 396) @@ -196,7 +196,7 @@ # remove pacakge from install queue. if ( !queuer.action_package_queue( sw.name.downcase, "install", "remove" ) ) - logger.to_journal( "Failed to remove #{sw.name.donwcase} from install queue." ) + logger.to_journal( "Failed to remove #{sw.name.downcase} from install queue." ) end return true # install completed! This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <esc...@us...> - 2007-12-24 18:13:39
|
Revision: 439 http://abtlinux.svn.sourceforge.net/abtlinux/?rev=439&view=rev Author: eschabell Date: 2007-12-24 10:13:34 -0800 (Mon, 24 Dec 2007) Log Message: ----------- Started implementation of freeze_package method, commented out code that is work in progress. Time for xmas eve festivities 2007 here. Modified Paths: -------------- src/trunk/abtpackagemanager.rb Modified: src/trunk/abtpackagemanager.rb =================================================================== --- src/trunk/abtpackagemanager.rb 2007-12-24 18:12:33 UTC (rev 438) +++ src/trunk/abtpackagemanager.rb 2007-12-24 18:13:34 UTC (rev 439) @@ -309,6 +309,29 @@ # false. ## def freeze_package( package ) + require "#{$PACKAGE_PATH}#{package}" + sw = eval( "#{package.capitalize}.new" ) + myLogger = AbtLogManager.new # TODO: refactor myLogger. + logger = Logger.new( $JOURNAL ) + system = AbtSystemManager.new + + # get package details. + details = sw.details + + #if system.package_installed( package ) + # if system.package_frozen( package ) + # logger.info( "Package #{package} is already frozen!" ) + # return true + # end + + # FIXME: create file in $PACKAGE_INSTALLED frozen.log with date. + #frozen = File.open( "#{$PACKAGE_INSTALLED}/#{sw.srcDir}/frozen.log", "w" ) + #frozen.puts "#{$TIMESTAMP}" + #frozen.close + # end + #end + + #logger.info( "Package #{package} is not installed, unable to freeze it." ) return false end This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <esc...@us...> - 2007-12-27 13:16:23
|
Revision: 445 http://abtlinux.svn.sourceforge.net/abtlinux/?rev=445&view=rev Author: eschabell Date: 2007-12-27 05:16:27 -0800 (Thu, 27 Dec 2007) Log Message: ----------- Fixed a missing logger object instantiation in the downgrade package method. Modified Paths: -------------- src/trunk/abtpackagemanager.rb Modified: src/trunk/abtpackagemanager.rb =================================================================== --- src/trunk/abtpackagemanager.rb 2007-12-26 09:06:20 UTC (rev 444) +++ src/trunk/abtpackagemanager.rb 2007-12-27 13:16:27 UTC (rev 445) @@ -345,6 +345,7 @@ ## def downgrade_package( package, version ) system = AbtSystemManager.new + logger = Logger.new( $JOURNAL ) # check for frozen. if ( system.package_frozen( package ) ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <esc...@us...> - 2007-12-31 11:25:34
|
Revision: 451 http://abtlinux.svn.sourceforge.net/abtlinux/?rev=451&view=rev Author: eschabell Date: 2007-12-31 03:24:54 -0800 (Mon, 31 Dec 2007) Log Message: ----------- Added output text to root login to clarify usage for user. Modified Paths: -------------- src/trunk/abtpackagemanager.rb Modified: src/trunk/abtpackagemanager.rb =================================================================== --- src/trunk/abtpackagemanager.rb 2007-12-30 21:04:18 UTC (rev 450) +++ src/trunk/abtpackagemanager.rb 2007-12-31 11:24:54 UTC (rev 451) @@ -411,6 +411,7 @@ def root_login( arguments ) if ( Process.uid != 0 ) args = "" + puts "\nYou need to be root for accessing the requested functionality.\n" puts "\nEnter root password:" for i in 0...ARGV.length This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |