[Abtlinux-svn] SF.net SVN: abtlinux: [317] src/trunk
Status: Alpha
Brought to you by:
eschabell
From: <esc...@us...> - 2007-03-03 13:57:38
|
Revision: 317 http://svn.sourceforge.net/abtlinux/?rev=317&view=rev Author: eschabell Date: 2007-03-03 05:57:38 -0800 (Sat, 03 Mar 2007) Log Message: ----------- Updated all files with ruby code formatter and ensured all lines withing 80 column limit. Modified Paths: -------------- src/trunk/AbtDepEngine.rb src/trunk/AbtDownloadManager.rb src/trunk/AbtLogManager.rb src/trunk/AbtPackageManager.rb src/trunk/AbtQueueManager.rb src/trunk/AbtReportManager.rb src/trunk/AbtSystemManager.rb src/trunk/TestAbtDepEngine.rb src/trunk/TestAbtDownloadManager.rb src/trunk/TestAbtLogManager.rb src/trunk/TestAbtPackage.rb src/trunk/TestAbtPackageManager.rb src/trunk/TestAbtQueueManager.rb src/trunk/TestAbtReportManager.rb src/trunk/TestAbtSystemManager.rb src/trunk/abt.rb src/trunk/testSuiteAbt.rb Modified: src/trunk/AbtDepEngine.rb =================================================================== --- src/trunk/AbtDepEngine.rb 2007-03-03 13:38:48 UTC (rev 316) +++ src/trunk/AbtDepEngine.rb 2007-03-03 13:57:38 UTC (rev 317) @@ -26,13 +26,13 @@ # St, Fifth Floor, Boston, MA 02110-1301 USA ## class AbtDepEngine - -protected - -private - -public - + + protected + + private + + public + ## # Constructor for the AbtDepEngine class. # @@ -40,5 +40,5 @@ ## def initialize end - + end \ No newline at end of file Modified: src/trunk/AbtDownloadManager.rb =================================================================== --- src/trunk/AbtDownloadManager.rb 2007-03-03 13:38:48 UTC (rev 316) +++ src/trunk/AbtDownloadManager.rb 2007-03-03 13:57:38 UTC (rev 317) @@ -26,24 +26,25 @@ # St, Fifth Floor, Boston, MA 02110-1301 USA ## class AbtDownloadManager - -protected -private + protected -public - + private + + public + ## # Constructor for the AbtDownloadManager class. # - # <b>RETURN</b> <i>AbtDownloadManager</i> - an initialized AbtDownloadManager object. + # <b>RETURN</b> <i>AbtDownloadManager</i> - an initialized + # AbtDownloadManager object. ## def initialize end ## # Downloads a given package source. If the file already exists, returns - # true as if download completed. + # true as if download completed. # # <b>PARAM</b> <i>String</i> - the name of the package for which the source # is to be downloaded. @@ -53,22 +54,24 @@ # downloaded, otherwise false. ## def retrievePackageSource( packageName, destination ) - require packageName - logger = AbtLogManager.new - package = eval( packageName.capitalize + '.new' ) - - if ( File.exist?( destination + "/" + File.basename( package.srcUrl ) ) ) - logger.logToJournal( "Download not needed, existing source found for " + packageName ) - return true - end - - Dir.chdir( destination ) - if ( system( "wget #{package.srcUrl}" ) ) - logger.logToJournal( "Download completed for " + packageName ) - return true - end - - return false # download failed. + require packageName + logger = AbtLogManager.new + package = eval( packageName.capitalize + '.new' ) + + if ( File.exist?( + destination + "/" + File.basename( package.srcUrl ) ) ) + logger.logToJournal( "Download not needed, existing source " + + "found for " + packageName ) + return true + end + + Dir.chdir( destination ) + if ( system( "wget #{package.srcUrl}" ) ) + logger.logToJournal( "Download completed for " + packageName ) + return true + end + + return false # download failed. end ## @@ -76,8 +79,8 @@ # # <b>PARAM</b> <i>String</i> - the name of the package tree to be retrieved. # - # <b>RETURN</b> <i>boolean</i> - True if the package tree is retrieved, otherwise - # false. + # <b>RETURN</b> <i>boolean</i> - True if the package tree is retrieved, + # otherwise false. ## def retrievePackageTree( packageTreeName ) end @@ -85,55 +88,58 @@ ## # Retrieves the given feed and displays the news items. # - # <b>PARAM</b> <i>String</i> - the uri of the rss news feed to be retrieved. - # <b>PARAM</b> <i>String</i> - pass the value 'true' to empty the log file, - # otherwise it will be appended. + # <b>PARAM</b> <i>String</i> - the uri of the rss news feed to be retrieved. + # <b>PARAM</b> <i>String</i> - pass the value 'true' to empty the log file, + # otherwise it will be appended. # <b>RETURN</b> <i>boolean</i> - True if the AbTLinux news feed has been # retrieved, otherwise false. ## def retrieveNewsFeed( uri, cleanLog = "false" ) - require 'net/http' - require 'uri' - require 'rss/1.0' - require 'rss/2.0' - newsLog = "" - - # ensure we have our news logfile. - if ( cleanLog == "true" ) - newsLog = File.new( $ABTNEWS_LOG, File::WRONLY|File::TRUNC|File::CREAT, 644 ) - else - newsLog = File.new( $ABTNEWS_LOG, File::WRONLY|File::APPEND|File::CREAT, 644 ) - end - - # pick up the abtlinux.org news feed. - if ( !news = Net::HTTP.get( URI.parse( uri ) ) ) - logger.logToJournal( "Failed to retrieve news feed #{uri}." ) - return false - end - - # display the feeds. - rss = nil - begin - rss = RSS::Parser.parse(news, false) - rescue RSS::Error - end - - if ( rss.nil? ) - logger.logToJournal( "Failed to display news feed as feed #{uri} is not RSS 1.0/2.0." ) - return false - else - newsLog.puts "*** #{rss.channel.title} ***" - - rss.items.each_with_index do |item, itemCount| - itemCount += 1 - newsLog.puts "#{itemCount} #{item.link} #{item.title}" - end - end - - newsLog.puts "\n" - newsLog.close - return true - + require 'net/http' + require 'uri' + require 'rss/1.0' + require 'rss/2.0' + newsLog = "" + + # ensure we have our news logfile. + if ( cleanLog == "true" ) + newsLog = + File.new( $ABTNEWS_LOG, File::WRONLY|File::TRUNC|File::CREAT, 644 ) + else + newsLog = + File.new( $ABTNEWS_LOG, File::WRONLY|File::APPEND|File::CREAT, 644 ) + end + + # pick up the abtlinux.org news feed. + if ( !news = Net::HTTP.get( URI.parse( uri ) ) ) + logger.logToJournal( "Failed to retrieve news feed #{uri}." ) + return false + end + + # display the feeds. + rss = nil + begin + rss = RSS::Parser.parse(news, false) + rescue RSS::Error + end + + if ( rss.nil? ) + logger.logToJournal( "Failed to display news feed as feed #{uri} " + + "is not RSS 1.0/2.0." ) + return false + else + newsLog.puts "*** #{rss.channel.title} ***" + + rss.items.each_with_index do |item, itemCount| + itemCount += 1 + newsLog.puts "#{itemCount} #{item.link} #{item.title}" + end + end + + newsLog.puts "\n" + newsLog.close + return true + end ## Modified: src/trunk/AbtLogManager.rb =================================================================== --- src/trunk/AbtLogManager.rb 2007-03-03 13:38:48 UTC (rev 316) +++ src/trunk/AbtLogManager.rb 2007-03-03 13:57:38 UTC (rev 317) @@ -57,7 +57,7 @@ ## def initialize [$ABT_LOGS, $ABT_CACHES, $ABT_STATE, $BUILD_LOCATION, $PACKAGE_INSTALLED, - $PACKAGE_CACHED, $ABT_TMP, $SOURCES_REPOSITORY].each { |dir| + $PACKAGE_CACHED, $ABT_TMP, $SOURCES_REPOSITORY].each { |dir| if ( ! File.directory?( dir ) ) FileUtils.mkdir_p( dir ) @@ -77,7 +77,8 @@ ## def logPackageInstall( package ) # some dirs we will not add to an install log. - excluded_pattern = Regexp.new( "^(/dev|/proc|/tmp|/var/tmp|/usr/src|/sys)+" ) + excluded_pattern = + Regexp.new( "^(/dev|/proc|/tmp|/var/tmp|/usr/src|/sys)+" ) require package sw = eval( "#{package.capitalize}.new" ) @@ -85,7 +86,8 @@ badLine = false # used to mark excluded lines from installwatch log. # our log locations. - installLog = "#{$PACKAGE_INSTALLED}/#{details['Source location']}/#{details['Source location']}.install" + installLog = "#{$PACKAGE_INSTALLED}/#{details['Source location']}" + + "/#{details['Source location']}.install" tmpInstallLog = "#{$ABT_TMP}/#{details['Source location']}.watch" # get the installed files from the tmp file @@ -97,13 +99,11 @@ # and not part of the excluded range of directories. IO.foreach( tmpInstallLog ) do |line| if ( line.split[1] == 'open' ) - #self.logToJournal( "DEBUG: checking: #{line.split[2]} against #{excluded_pattern}." ) if ( line.split[2] =~ excluded_pattern ) #self.logToJournal( "DEBUG: Found bad logLine!" ) badLine = true else badLine = false - #self.logToJournal( "DEBUG: #{excluded_pattern} not matching #{line.split[2]}") end if ( !badLine ) @@ -134,7 +134,8 @@ require package sw = eval( "#{package.capitalize}.new" ) details = sw.details - buildFile = "#{$PACKAGE_INSTALLED}/#{details['Source location']}/#{details['Source location']}.build" + buildFile = "#{$PACKAGE_INSTALLED}/#{details['Source location']}" + + "/#{details['Source location']}.build" #self.logToJournal( "DEBUG: buildFile is - #{buildFile}" ) # make sure the build file exists. @@ -173,7 +174,9 @@ # <b>RETURN</b> <i>boolean</i> True if logged, otherwise false. ## def logToJournal( message ) - if ( log = File.new( $JOURNAL, File::WRONLY|File::APPEND|File::CREAT, 0644 ) ) + if ( + log = File.new( + $JOURNAL, File::WRONLY|File::APPEND|File::CREAT, 0644 ) ) log.puts "#{$TIMESTAMP} : #{message}" log.close return true Modified: src/trunk/AbtPackageManager.rb =================================================================== --- src/trunk/AbtPackageManager.rb 2007-03-03 13:38:48 UTC (rev 316) +++ src/trunk/AbtPackageManager.rb 2007-03-03 13:57:38 UTC (rev 317) @@ -36,7 +36,8 @@ ## # Constructor for AbtPackageManager. # - # <b>RETURN</b> <i>AbtPackageManager</i> - an initialized AbtPackageManager object. + # <b>RETURN</b> <i>AbtPackageManager</i> - an initialized + # AbtPackageManager object. ## def initialize end @@ -70,7 +71,8 @@ # pre section. puts "\n*** Processing the PRE section for #{package}. ***" if ( !sw.pre ) - logger.logToJournal( "Failed to process pre-section in the package description of #{package}." ) + logger.logToJournal( "Failed to process pre-section in the " + + "package description of #{package}." ) return false else logger.logToJournal( "DEBUG: finished #{package} pre section." ) @@ -79,7 +81,8 @@ # configure section. puts "\n*** Processing the CONFIGURE section for #{package}. ***" if ( !sw.configure ) - logger.logToJournal( "Failed to process configure section in the package description of #{package}." ) + logger.logToJournal( "Failed to process configure section in the " + + "package description of #{package}." ) return false else logger.logToJournal( "DEBUG: finished #{package} configure section." ) @@ -88,7 +91,8 @@ # build section. puts "\n*** Processing the BUILD section for #{package}. ***" if ( !sw.build ) - logger.logToJournal( "Failed to process build section in the package description of #{package}." ) + logger.logToJournal( "Failed to process build section in the " + + "package description of #{package}." ) return false else if ( !logger.logPackageBuild( sw.name.downcase ) ) @@ -101,7 +105,8 @@ # preinstall section. puts "\n*** Processing the PREINSTALL section for #{package}. ***" if ( !sw.preinstall ) - logger.logToJournal( "Failed to process preinstall section in the package description of #{package}." ) + logger.logToJournal( "Failed to process preinstall section in the " + + "package description of #{package}." ) return false else logger.logToJournal( "DEBUG: finished #{package} preinstall section." ) @@ -110,33 +115,37 @@ # install section. puts "\n*** Processing the INSTALL section for #{package}. ***" if ( !sw.install ) - logger.logToJournal( "Failed to process install section in the package description of #{package}." ) + logger.logToJournal( "Failed to process install section in the " + + "package description of #{package}." ) return false else logger.logPackageInstall( sw.name.downcase ) # TODO: logger.logPackageIntegrity( sw.name.downcase ) logger.logToJournal( "DEBUG: finished #{package} install section." ) end - + # post section. puts "\n*** Processing the POST section for #{package}. ***" if ( !sw.post ) - logger.logToJournal( "Failed to process post section in the package description of #{package}." ) + logger.logToJournal( "Failed to process post section in the " + + "package description of #{package}." ) return false else logger.logToJournal( "DEBUG: finished #{package} post section." ) end - + # clean out build sources. puts "\n*** Cleaning up the sources for #{package}. ***" if ( !sw.removeBuild ) - logger.logToJournal( "Failed to remove the build sources for #{package}." ) + logger.logToJournal( "Failed to remove the build sources for " + + "#{package}." ) #return false # commented out as this is not a reason to fail. end - + # remove pacakge from install queue. if ( !queuer.actionPackageQueue( sw.name.downcase, "install", "remove" ) ) - logger.logToJournal( "Failed to remove #{sw.name.donwcase} from install queue." ) + logger.logToJournal( "Failed to remove #{sw.name.donwcase} " + + "from install queue." ) end return true # install completed! @@ -147,8 +156,8 @@ # # <b>PARAM</b> <i>String</i> - the name of the package to be reinstalled. # - # <b>RETURN</b> <i>boolean</i> - True if the package is reinstalled, otherwise - # false. + # <b>RETURN</b> <i>boolean</i> - True if the package is reinstalled, + # otherwise false. ## def reinstallPackage( package ) end Modified: src/trunk/AbtQueueManager.rb =================================================================== --- src/trunk/AbtQueueManager.rb 2007-03-03 13:38:48 UTC (rev 316) +++ src/trunk/AbtQueueManager.rb 2007-03-03 13:57:38 UTC (rev 317) @@ -25,21 +25,22 @@ # St, Fifth Floor, Boston, MA 02110-1301 USA ## class AbtQueueManager - -protected - -private - -public - + + protected + + private + + public + ## # Constructor for the AbtQueueManager class. # - # <b>RETURN</b> <i>AbtQueueManager</i> - an initialized AbtQueueManager object. + # <b>RETURN</b> <i>AbtQueueManager</i> - an initialized + # AbtQueueManager object. ## def initialize end - + ## # Add/Remove a given package to the given queue. # If adding a package already in the queue then it will not @@ -54,7 +55,7 @@ require 'fileutils' logger = AbtLogManager.new queueFile = "" # used to hold the queue location. - + # want to name install queue differently from log files. if ( queue == 'install' ) queueFile = "#{$ABT_LOGS}/#{queue}.queue" @@ -63,26 +64,33 @@ end if ( action == "add") - if ( log = File.new( queueFile, File::WRONLY|File::APPEND|File::CREAT, 0644 ) ) + if ( + log = File.new( + queueFile, File::WRONLY|File::APPEND|File::CREAT, 0644 ) ) # pickup queue contents to ensure no duplicates. checkingQueue = IO.readlines( queueFile ) - + # check if package exists, otherwise add. - if ( ! checkingQueue.collect{ |i| i.split( '|' )[0] }.include?( package ) ) + if ( + !checkingQueue.collect{ |i| i.split( '|' )[0] }.include?( + package ) ) log.puts "#{package}|#{$TIMESTAMP}" logger.logToJournal( "Added #{package} to #{queue} queue." ) else - logger.logToJournal( "Did not add #{package} to #{queue}, already exists." ) + logger.logToJournal( + "Did not add #{package} to #{queue}, already exists." ) end - + log.close return true end end - + if ( action == "remove" ) # remove entry from given queue. - if ( log = File.new( queueFile, File::WRONLY|File::APPEND|File::CREAT, 0644 ) ) + if ( + log = File.new( + queueFile, File::WRONLY|File::APPEND|File::CREAT, 0644 ) ) # use temp file to filter out entry to be removed. temp = File.new(queueFile + ".tmp", "a+") Modified: src/trunk/AbtReportManager.rb =================================================================== --- src/trunk/AbtReportManager.rb 2007-03-03 13:38:48 UTC (rev 316) +++ src/trunk/AbtReportManager.rb 2007-03-03 13:57:38 UTC (rev 317) @@ -26,35 +26,36 @@ # St, Fifth Floor, Boston, MA 02110-1301 USA ## class AbtReportManager - -protected - -private - -public - + + protected + + private + + public + ## # Constructor for the AbtReportManager. # - # <b>RETURN</b> <i>AbtReportManager</i> - an initialized Report1Manager object. + # <b>RETURN</b> <i>AbtReportManager</i> - an initialized + # Report1Manager object. ## def initialize end - + ## # Display all data for a given package. # # <b>PARAM</b> <i>String</i> - Package name. # - # <b>RETURN</b> <i>boolean</i> - True if completes without error, otherwise - # false. + # <b>RETURN</b> <i>boolean</i> - True if completes without error, + # otherwise false. ## def showPackageDetails( package ) require package - + if ( package = eval( "#{package.capitalize}.new" ) ) details = package.details - + puts "|=====================================" puts "| Package name\t: #{details['Package name']}" details.delete( "Package name" ) @@ -70,25 +71,26 @@ details.delete( "Description" ) puts "|=====================================" puts "|=====================================" - + details.each do |name, value| print "| #{name}\t" - + if ( name.length < 14 ) print "\t" end - + puts ": #{value}" end - + puts "|=====================================" return true end - - logger.logToJournal( "[AbtReportManger::showPackageDetails] - failed to show details for ${package}." ) + + logger.logToJournal( "[AbtReportManger::showPackageDetails] - failed" + + "to show details for ${package}." ) return false end - + ## # Display all packages installed and tracked by AbTLinux. # @@ -96,7 +98,7 @@ ## def showInstalledPackages end - + ## # Display the contents of the requested log for a given package. Possible # log types are; install, build and integrity. @@ -112,7 +114,7 @@ # build log # integrity log end - + ## # Display a list of the packages found in the frozen list. # @@ -120,7 +122,7 @@ ## def showFrozenPackages end - + ## # Provides access to dependency checking via the AbTLinux DepEngine. (This # portal to the DepEngine will be expanded in apart sub-project, more @@ -133,7 +135,7 @@ ## def showPackageDependencies( package ) end - + ## # Display all files not part of any installed AbTLinux package. This # delivers a list of files that are not tracked by AbTLinux package @@ -143,7 +145,7 @@ ## def showUntrackedFiles end - + ## # Display the AbTLinux journal file. # @@ -161,13 +163,14 @@ puts "\n\n" else puts "\n\n" - puts "AbtLinux log ( #{File.basename( fileName )} ) is empty at this time." + puts "AbtLinux log ( #{File.basename( fileName )} ) " + + "is empty at this time." puts "\n\n" end - + return true end - + ## # Display the name of the package(s) that own the given file. # @@ -177,7 +180,7 @@ ## def showFileOwner( file ) end - + ## # Searches the installed package trees package descriptions for matching # occurrances of the given search text. @@ -189,7 +192,7 @@ ## def searchPackageDescriptions( searchText ) end - + ## # Displays the contents of the current queue based on the given queue. # @@ -201,7 +204,7 @@ def showQueue( queueType ) case queueType - + when "install" if ( File.exist?( "#{$ABT_LOGS}/#{queueType}.queue" ) ) puts "\n\n" @@ -219,7 +222,7 @@ puts "#{queueType.capitalize} is not an AbTLinux queue." end end - + ## # Reports available updates for a given package or package tree based on the # current system. @@ -232,7 +235,7 @@ ## def showUpdates( target ) end - + ## # Generates an HTML page of installed packages from installed packages list. # @@ -240,5 +243,5 @@ ## def generateHTMLPackageListing end - + end Modified: src/trunk/AbtSystemManager.rb =================================================================== --- src/trunk/AbtSystemManager.rb 2007-03-03 13:38:48 UTC (rev 316) +++ src/trunk/AbtSystemManager.rb 2007-03-03 13:57:38 UTC (rev 317) @@ -27,21 +27,22 @@ # St, Fifth Floor, Boston, MA 02110-1301 USA ## class AbtSystemManager - -protected - -private - -public - + + protected + + private + + public + ## # Constructor for the System manager # - # <b>RETURN</b> <i>AbtSystemManager</i> - an initialized AbtSystemManager object. + # <b>RETURN</b> <i>AbtSystemManager</i> - an initialized + # AbtSystemManager object. ## def initialize end - + ## # Removes all sources for packages that are not currently installed. Makes # use of install listing to determine package sources to keep. @@ -51,7 +52,7 @@ ## def cleanupPackageSources end - + ## # All logs for packages not in install list are cleaned off the system. # @@ -60,29 +61,29 @@ ## def cleanupLogs end - + ## # Checks if files from given package install list are actually installed. # # <b>PARAM</b> <i>String</i> - Package name. # - # <b>RETURN</b> <i>boolean</i> - True if no installed files are missing, otherwise - # false. + # <b>RETURN</b> <i>boolean</i> - True if no installed files are missing, + # otherwise false. ## def verifyInstalledFiles( package ) end - + ## # Checks if given packages installed symlinks are broken or missing. # # <b>PARAM</b> <i>String</i> - Package name. # - # <b>RETURN</b> <i>boolean</i> - True if no symlinks found missing or broken, otherwise - # false. + # <b>RETURN</b> <i>boolean</i> - True if no symlinks found missing + # or broken, otherwise false. ## def verifySymlinks( package ) end - + ## # Checks the given packages dependencies for missing or broken dependencies. # @@ -93,7 +94,7 @@ ## def verifyPackageDepends( package ) end - + ## # Checks the given packages installed files against the integrity log for # changes to installed files. @@ -105,7 +106,7 @@ ## def verifyPackageIntegrity( package ) end - + ## # Fixes the given package. # @@ -116,7 +117,7 @@ ## def fixPackage( package ) end - + ## # Sets the URI of a central repository for pre-compiled packages. # @@ -127,7 +128,7 @@ ## def setCentralRepo( uri ) end - + ## # Sets the location where the package tree is to be downloaded from, can be # set to a local location. Modified: src/trunk/TestAbtDepEngine.rb =================================================================== --- src/trunk/TestAbtDepEngine.rb 2007-03-03 13:38:48 UTC (rev 316) +++ src/trunk/TestAbtDepEngine.rb 2007-03-03 13:57:38 UTC (rev 317) @@ -29,7 +29,7 @@ # St, Fifth Floor, Boston, MA 02110-1301 USA ## class TestAbtDepEngine < Test::Unit::TestCase - + ## # setup method for testing AbtDepEngine. ## Modified: src/trunk/TestAbtDownloadManager.rb =================================================================== --- src/trunk/TestAbtDownloadManager.rb 2007-03-03 13:38:48 UTC (rev 316) +++ src/trunk/TestAbtDownloadManager.rb 2007-03-03 13:57:38 UTC (rev 317) @@ -31,7 +31,7 @@ # St, Fifth Floor, Boston, MA 02110-1301 USA ## class TestAbtDownloadManager < Test::Unit::TestCase - + ## # setup method for testing AbtDownloadManager. ## @@ -49,30 +49,32 @@ # Test method for 'AbtDownloadManager.testRetrievePackageSource()' ## def testRetrievePackageSource() - assert( @download.retrievePackageSource( "ipc", "/tmp" ), "testRetrievePackageSource()" ) + assert( @download.retrievePackageSource( "ipc", "/tmp" ), + "testRetrievePackageSource()" ) end ## # Test method for 'AbtDownloadManager.testRetrievePackageTree()' ## def testRetrievePackageTree() - assert( @download.retrievePackageTree( "dummy" ), "testRetrievePackageTree()" ) + assert( @download.retrievePackageTree( "dummy" ), + "testRetrievePackageTree()" ) end - + ## # Test method for 'AbtDownloadManager.testRetrieveNewsFeed()' ## def testRetrieveNewsFeed() assert( @download.retrieveNewsFeed( $ABTNEWS ), "testRetrieveNewsFeed()" ) end - + ## # Test method for 'AbtDownloadManager.testUpdatePackage()' ## def testUpdatePackage() assert( @download.updatePackage(), "testUpdatePackage()" ) end - + ## # Test method for 'AbtDownloadManager.testUpdatePackageTree()' ## Modified: src/trunk/TestAbtLogManager.rb =================================================================== --- src/trunk/TestAbtLogManager.rb 2007-03-03 13:38:48 UTC (rev 316) +++ src/trunk/TestAbtLogManager.rb 2007-03-03 13:57:38 UTC (rev 317) @@ -30,7 +30,7 @@ # St, Fifth Floor, Boston, MA 02110-1301 USA ## class TestAbtLogManager < Test::Unit::TestCase - + ## # setup method for testing AbtLogManager. ## @@ -59,26 +59,27 @@ #def testLogPackageInstall() # assert( @log.logPackageInstall( "ipc" ), "testLogPackageInstall()" ) #end - + ## # Test method for 'AbtLogManager.testLogPackageBuild()' ## def testLogPackageBuild() assert( @log.logPackageBuild( "ipc" ), "testLogPackageBuild()" ) end - + ## # Test method for 'AbtLogManager.testCachePackage()' ## def testCachePackage() assert( @log.cachePackage( "ipc" ), "testCachePackage()" ) end - + ## # Test method for 'AbtLogManager.testLogToJournal()' ## def testLogToJournal() - assert( @log.logToJournal( "Test message from AbtTestSuite." ), "testLogToJournal()" ) + assert( @log.logToJournal( "Test message from AbtTestSuite." ), + "testLogToJournal()" ) end - + end Modified: src/trunk/TestAbtPackage.rb =================================================================== --- src/trunk/TestAbtPackage.rb 2007-03-03 13:38:48 UTC (rev 316) +++ src/trunk/TestAbtPackage.rb 2007-03-03 13:57:38 UTC (rev 317) @@ -32,11 +32,11 @@ # St, Fifth Floor, Boston, MA 02110-1301 USA ## class TestAbtPackage < Test::Unit::TestCase - + $nameTest = "Ipc" $versionTest = "1.4" $srcDirTest = "#{$nameTest.downcase}-#{$versionTest}" - + $dataTest = { 'name' => $nameTest, 'execName' => $nameTest.downcase, @@ -44,14 +44,14 @@ 'srcDir' => $srcDirTest, 'homepage' => "http://isotopatcalc.sourceforge.net/" } - + ## # setup method for testing AbtPackage. ## def setup @ipc = Ipc.new end - + ## # teardown method to cleanup after testing. ## @@ -62,11 +62,16 @@ # Test method for 'AbtPackage.testDetails()' ## def testDetails - assert_equal( $dataTest['name'], @ipc.details['Package name'], "testDetails()" ) - assert_equal( $dataTest['execName'], @ipc.details['Executable'], "testDetails()" ) - assert_equal( $dataTest['version'], @ipc.details['Version'], "testDetails()" ) - assert_equal( $dataTest['srcDir'], @ipc.details['Source location'], "testDetails()" ) - assert_equal( $dataTest['homepage'], @ipc.details['Homepage'], "testDetails()" ) + assert_equal( $dataTest['name'], @ipc.details['Package name'], + "testDetails()" ) + assert_equal( $dataTest['execName'], @ipc.details['Executable'], + "testDetails()" ) + assert_equal( $dataTest['version'], @ipc.details['Version'], + "testDetails()" ) + assert_equal( $dataTest['srcDir'], @ipc.details['Source location'], + "testDetails()" ) + assert_equal( $dataTest['homepage'], @ipc.details['Homepage'], + "testDetails()" ) end ## @@ -75,7 +80,7 @@ def testPre assert( @ipc.pre(), "testPre()" ) end - + ## # Test method for 'AbtPackage.testConfigure()' ## @@ -85,7 +90,7 @@ end assert( @ipc.configure(), "testConfigure()" ) end - + ## # Test method for 'AbtPackage.testBuild()' ## @@ -98,19 +103,19 @@ end assert( @ipc.build(), "testBuild()" ) end - + ## # Test method for 'AbtPackage.testPreinstall()' ## def testPreinstall assert( @ipc.preinstall(), "testPreinstall()" ) end - + ## # Test method for 'AbtPackage.testInstall()' ## def testInstall - if ( !@ipc.pre() ) + if ( !@ipc.pre() ) assert_equals( true, false, "testInstall()" ) end if ( !@ipc.configure() ) @@ -124,7 +129,7 @@ end assert( @ipc.install(), "testInstall()" ) end - + ## # Test method for 'AbtPackage.testPost()' ## @@ -146,5 +151,5 @@ end assert( @ipc.post(), "testPost()" ) end - + end Modified: src/trunk/TestAbtPackageManager.rb =================================================================== --- src/trunk/TestAbtPackageManager.rb 2007-03-03 13:38:48 UTC (rev 316) +++ src/trunk/TestAbtPackageManager.rb 2007-03-03 13:57:38 UTC (rev 317) @@ -29,14 +29,14 @@ # St, Fifth Floor, Boston, MA 02110-1301 USA ## class TestAbtPackageManager < Test::Unit::TestCase - + ## # setup method for testing AbtPackageManager. ## def setup @pkgMgr = AbtPackageManager.new() end - + ## # teardown method to cleanup after testing. ## @@ -49,33 +49,33 @@ def testInstallPackage assert( @pkgMgr.installPackage( "ipc" ), "testInstallPackage()" ) end - + ## # Test method for 'AbtPackageManager.testReinstallPackage()' ## def testReinstallPackage assert( @pkgMgr.reinstallPackage( "ipc" ), "testReinstallPackage()" ) end - + ## # Test method for 'AbtPackageManager.testRemovePackage()' ## def testRemovePackage assert( @pkgMgr.removePackage( "ipc" ), "testRemovePackage()" ) end - + ## # Test method for 'AbtPackageManager.testDowngradePackage()' ## def testDowngradePackage assert( @pkgMgr.downgradePackage( "ipc", "1.2" ), "testDowngradePackage()" ) end - + ## # Test method for 'AbtPackageManager.testFreezePackage()' ## def testFreezePackage assert( @pkgMgr.freezePackage( "ipc" ), "testFreezePackage()" ) end - + end Modified: src/trunk/TestAbtQueueManager.rb =================================================================== --- src/trunk/TestAbtQueueManager.rb 2007-03-03 13:38:48 UTC (rev 316) +++ src/trunk/TestAbtQueueManager.rb 2007-03-03 13:57:38 UTC (rev 317) @@ -31,7 +31,7 @@ # St, Fifth Floor, Boston, MA 02110-1301 USA ## class TestAbtQueueManager < Test::Unit::TestCase - + ## # setup method for testing AbtQueueManager. ## @@ -49,7 +49,8 @@ # Test method for 'AbtQueueManager.actionPackageQueue()' ## def testActionPackageQueue - assert( @queue.actionPackageQueue( "ipc", "install", "add" ), "testQueueManager()" ) + assert( @queue.actionPackageQueue( "ipc", "install", "add" ), + "testQueueManager()" ) end - + end Modified: src/trunk/TestAbtReportManager.rb =================================================================== --- src/trunk/TestAbtReportManager.rb 2007-03-03 13:38:48 UTC (rev 316) +++ src/trunk/TestAbtReportManager.rb 2007-03-03 13:57:38 UTC (rev 317) @@ -30,14 +30,14 @@ # St, Fifth Floor, Boston, MA 02110-1301 USA ## class TestAbtReportManager < Test::Unit::TestCase - + ## # setup method for testing AbtReportManager. ## def setup @report = AbtReportManager.new() end - + ## # teardown method to cleanup after testing. ## @@ -50,88 +50,92 @@ def testShowPackageDetails assert( @report.showPackageDetails( "ipc" ), "testShowPackageDetails()" ) end - + ## # Test method for 'AbtReportManager.testShowInstalledPackages()' ## def testShowInstalledPackages assert( @report.showInstalledPackages(), "testShowInstalledPackages()" ) end - + ## # Test method for 'AbtReportManager.testShowPackageLog()' ## def testShowPackageLog - assert( @report.showPackageLog( "ipc", "install" ), "testShowPackageLog()" ) + assert( @report.showPackageLog( "ipc", "install" ), + "testShowPackageLog()" ) assert( @report.showPackageLog( "ipc", "build" ), "testShowPackageLog()" ) - assert( @report.showPackageLog( "ipc", "integrity" ), "testShowPackageLog()" ) + assert( @report.showPackageLog( "ipc", "integrity" ), + "testShowPackageLog()" ) end - + ## # Test method for 'AbtReportManager.testShowFrozenPackages()' ## def testShowFrozenPackages assert( @report.showFrozenPackages(), "testShowFrozenPackages()" ) end - + ## # Test method for 'AbtReportManager.testShowPackageDependencies()' ## def testShowPackageDependencies assert( false, "testShowPackageDependencies()" ) end - + ## # Test method for 'AbtReportManager.testShowUntrackedFiles()' ## def testShowUntrackedFiles assert( @report.showUntrackedFiles(), "testShowUntrackedFiles()" ) end - + ## # Test method for 'AbtReportManager.testShowJournal()' ## def testShowJournal assert( @report.showJournal( $JOURNAL ), "testShowJournal()" ) end - + ## # Test method for 'AbtReportManager.testShowFileOwner()' ## def testShowFileOwner assert( @report.showFileOwner( "ipcFile" ), "testShowFileOwner()" ) end - + ## # Test method for 'AbtReportManager.testSearchPackageDescriptions()' ## def testSearchPackageDescriptions - assert( @report.searchPackageDescriptions( "Special text" ), "testSearchPackageDescriptions()" ) + assert( @report.searchPackageDescriptions( "Special text" ), + "testSearchPackageDescriptions()" ) end - + ## # Test method for 'AbtReportManager.testShowQueue()' ## def testShowQueue - if ( @report.showQueue( "install" ) ) - assert(false, "testShowQueue()") - else - assert(true, "testShowQueue()") - end + if ( @report.showQueue( "install" ) ) + assert(false, "testShowQueue()") + else + assert(true, "testShowQueue()") + end end - + ## # Test method for 'AbtReportManager.testShowUpdates()' ## def testShowUpdates assert( @report.showUpdates( "ipc" ), "testShowUpdates()" ) end - + ## # Test method for 'AbtReportManager.testGenerateHTMLPackageListing()' ## def testGenerateHTMLPackageListing - assert( @report.generateHTMLPackageListing(), "testGenerateHTMLPackageListing()" ) + assert( @report.generateHTMLPackageListing(), + "testGenerateHTMLPackageListing()" ) end - + end Modified: src/trunk/TestAbtSystemManager.rb =================================================================== --- src/trunk/TestAbtSystemManager.rb 2007-03-03 13:38:48 UTC (rev 316) +++ src/trunk/TestAbtSystemManager.rb 2007-03-03 13:57:38 UTC (rev 317) @@ -29,81 +29,83 @@ # St, Fifth Floor, Boston, MA 02110-1301 USA ## class TestAbtSystemManager < Test::Unit::TestCase - + ## # setup method for testing AbtSystemManager. ## def setup @sys = AbtSystemManager.new() end - + ## # teardown method to cleanup after testing. ## def teardown end - + ## # Test method for 'AbtSystemManager.testCleanupPackageSources()' ## def testCleanupPackageSources assert( @sys.cleanupPackageSources(), "testCleanupPackageSources()" ) end - + ## # Test method for 'AbtSystemManager.testCleanupLogs()' ## def testCleanupLogs assert( @sys.cleanupLogs(), "testCleanupLogs()" ) end - + ## # Test method for 'AbtSystemManager.testVerifyInstalledFiles()' ## def testVerifyInstalledFiles assert( @sys.verifyInstalledFiles( "dummy" ), "testVerifyInstalledFiles()" ) end - + ## # Test method for 'AbtSystemManager.testVerifySymlinks()' ## def testVerifySymlinks assert( @sys.verifySymlinks( "dummy" ), "testVerifySymlinks()" ) end - + ## # Test method for 'AbtSystemManager.testVerifyPackageDepends()' ## def testVerifyPackageDepends assert( @sys.verifyPackageDepends( "dummy" ), "testVerifyPackageDepends()" ) end - + ## # Test method for 'AbtSystemManager.testVerifyPackageIntegrity()' ## def testVerifyPackageIntegrity - assert( @sys.verifyPackageIntegrity( "dummy" ), "testVerifyPackageIntegrity()" ) + assert( @sys.verifyPackageIntegrity( "dummy" ), + "testVerifyPackageIntegrity()" ) end - + ## # Test method for 'AbtSystemManager.testFixPackage()' ## def testFixPackage assert( @sys.fixPackage( "dummy" ), "testFixPackage()" ) end - + ## # Test method for 'AbtSystemManager.testSetCentralRepo()' ## def testSetCentralRepo assert( @sys.setCentralRepo( "http://localhost" ), "testSetCentralRepo()" ) end - + ## # Test method for 'AbtSystemManager.testSetPackageTreeLocation()' ## def testSetPackageTreeLocation - assert( @sys.setPackageTreeLocation( "/var/lib/ericsPackages" ), "testSetPackageTreeLocation()" ) + assert( @sys.setPackageTreeLocation( "/var/lib/ericsPackages" ), + "testSetPackageTreeLocation()" ) end - + end Modified: src/trunk/abt.rb =================================================================== --- src/trunk/abt.rb 2007-03-03 13:38:48 UTC (rev 316) +++ src/trunk/abt.rb 2007-03-03 13:57:38 UTC (rev 317) @@ -55,331 +55,332 @@ # parse arguments. case ARGV[0] - + # abt [ -i | install ] <package> - when "install", "-i" - if ( ARGV.length == 2 && File.exist?( "#{$PACKAGE_PATH}#{ARGV[1]}.rb" ) ) - options['package'] = ARGV[1] - logger.logToJournal( "Starting to install #{options['package']}" ) - - if ( manager.installPackage( options['package'] ) ) - puts "\n\n" - puts "*** Completed install of #{options['package']}. ***" - puts "\n\n" - logger.logToJournal( "Completed install of #{options['package']}." ) - else - puts "*** #{options['package'].capitalize} install failed, see journal. ***" - end - - #reporter.showQueue( "install" ); # DEBUG. +when "install", "-i" + if ( ARGV.length == 2 && File.exist?( "#{$PACKAGE_PATH}#{ARGV[1]}.rb" ) ) + options['package'] = ARGV[1] + logger.logToJournal( "Starting to install #{options['package']}" ) + + if ( manager.installPackage( options['package'] ) ) + puts "\n\n" + puts "*** Completed install of #{options['package']}. ***" + puts "\n\n" + logger.logToJournal( "Completed install of #{options['package']}." ) else - show.usage( "packages" ) - exit + puts "*** #{options['package'].capitalize} install failed, " + + "see journal. ***" end - - when "reinstall", "-ri" - if ( ARGV.length == 2 ) - options['package'] = ARGV[1] - puts "Reinstalling package : " + options['package'] - else - show.usage( "packages" ) - exit - end - - when "remove", "-r" - if ( ARGV.length == 2 ) - options['package'] = ARGV[1] - puts "Removing package : " + options['package'] - else - show.usage( "packages" ) - exit - end - - when "downgrade", "-dg" - if ( ARGV.length == 3 ) - options['version'] = ARGV[1] - options['package'] = ARGV[2] - print "Downgradinging package : #{options['package']} " - puts "to version : #{options['version']}" - else - show.usage( "packages" ) - exit - end - - when "freeze", "-f" - if ( ARGV.length == 2 ) - options['package'] = ARGV[1] - puts "Holdinging package : #{options['package']} at current version." - else - show.usage( "packages" ) - exit - end - - when "search", "-s" - if ( ARGV.length == 2 ) - options['searchString'] = ARGV[1] - puts "Searching package descriptions for : #{options['searchString']}" - else - show.usage( "queries" ) - exit - end - + + #reporter.showQueue( "install" ); # DEBUG. + else + show.usage( "packages" ) + exit + end + +when "reinstall", "-ri" + if ( ARGV.length == 2 ) + options['package'] = ARGV[1] + puts "Reinstalling package : " + options['package'] + else + show.usage( "packages" ) + exit + end + +when "remove", "-r" + if ( ARGV.length == 2 ) + options['package'] = ARGV[1] + puts "Removing package : " + options['package'] + else + show.usage( "packages" ) + exit + end + +when "downgrade", "-dg" + if ( ARGV.length == 3 ) + options['version'] = ARGV[1] + options['package'] = ARGV[2] + print "Downgradinging package : #{options['package']} " + puts "to version : #{options['version']}" + else + show.usage( "packages" ) + exit + end + +when "freeze", "-f" + if ( ARGV.length == 2 ) + options['package'] = ARGV[1] + puts "Holdinging package : #{options['package']} at current version." + else + show.usage( "packages" ) + exit + end + +when "search", "-s" + if ( ARGV.length == 2 ) + options['searchString'] = ARGV[1] + puts "Searching package descriptions for : #{options['searchString']}" + else + show.usage( "queries" ) + exit + end + # abt -v | --version - when "-v", "--version" - if ( ARGV.length == 1 ) - puts "Abt Package Manager version is : #{$ABT_VERSION}" - else - show.usage( "queries" ) - exit - end - +when "-v", "--version" + if ( ARGV.length == 1 ) + puts "Abt Package Manager version is : #{$ABT_VERSION}" + else + show.usage( "queries" ) + exit + end + # abt show-details <package> - when "show-details" - if ( ARGV.length == 2 && File.exist?( $PACKAGE_PATH + ARGV[1] + ".rb" ) ) - options['pkg'] = ARGV[1] - logger.logToJournal( "Starting show details for #{options['pkg']}" ) - - if ( reporter.showPackageDetails( options['pkg'] ) ) - logger.logToJournal( "Completed show details for #{options['pkg']}" ) - else - puts "Problems processing the details for #{options['pkg']}." - end +when "show-details" + if ( ARGV.length == 2 && File.exist?( $PACKAGE_PATH + ARGV[1] + ".rb" ) ) + options['pkg'] = ARGV[1] + logger.logToJournal( "Starting show details for #{options['pkg']}" ) + + if ( reporter.showPackageDetails( options['pkg'] ) ) + logger.logToJournal( "Completed show details for #{options['pkg']}" ) else - show.usage( "queries" ) + puts "Problems processing the details for #{options['pkg']}." end - - when "show-build" - if ( ARGV.length == 2 ) - options['package'] = ARGV[1] - puts "Display build log for package : " + options['package'] - else - show.usage( "queries" ) - exit - end - - - when "show-depends" - if ( ARGV.length == 2 ) - options['package'] = ARGV[1] - puts "Display dependency tree for package : " + options['package'] - else - show.usage( "queries" ) - exit - end - - when "show-files" - if ( ARGV.length == 2 ) - options['package'] = ARGV[1] - puts "Display installed files from package : " + options['package'] - else - show.usage( "queries" ) - exit - end - - when "show-owner" - if ( ARGV.length == 2 ) - options['fileName'] = ARGV[1] - puts "Display owning package for file : " + options['fileName'] - else - show.usage( "queries" ) - exit - end - - when "show-installed" - puts "Display all installed packages." + else show.usage( "queries" ) - - when "show-frozen" - puts "Display all packages frozen at current version." + end + +when "show-build" + if ( ARGV.length == 2 ) + options['package'] = ARGV[1] + puts "Display build log for package : " + options['package'] + else show.usage( "queries" ) - - when "show-untracked" - puts "Display all files on system not tracked by AbTLinux." + exit + end + + +when "show-depends" + if ( ARGV.length == 2 ) + options['package'] = ARGV[1] + puts "Display dependency tree for package : " + options['package'] + else show.usage( "queries" ) - + exit + end + +when "show-files" + if ( ARGV.length == 2 ) + options['package'] = ARGV[1] + puts "Display installed files from package : " + options['package'] + else + show.usage( "queries" ) + exit + end + +when "show-owner" + if ( ARGV.length == 2 ) + options['fileName'] = ARGV[1] + puts "Display owning package for file : " + options['fileName'] + else + show.usage( "queries" ) + exit + end + +when "show-installed" + puts "Display all installed packages." + show.usage( "queries" ) + +when "show-frozen" + puts "Display all packages frozen at current version." + show.usage( "queries" ) + +when "show-untracked" + puts "Display all files on system not tracked by AbTLinux." + show.usage( "queries" ) + # abt show-journal - when "show-journal" - reporter.showJournal( $JOURNAL ) - - when "show-iqueue" - reporter.showQueue( "install" ) - - when "show-patches" - puts "Display currently available patches for installed package tree." - show.usage( "queries" ) - - when "show-updates" - puts "Display package listing with available update versions." - show.usage( "generation" ) - - when "html" - puts "Generate HTML page from installed packages:" - puts " (package name with link to package website/version installed)" - show.usage( "generation" ) - +when "show-journal" + reporter.showJournal( $JOURNAL ) + +when "show-iqueue" + reporter.showQueue( "install" ) + +when "show-patches" + puts "Display currently available patches for installed package tree." + show.usage( "queries" ) + +when "show-updates" + puts "Display package listing with available update versions." + show.usage( "generation" ) + +when "html" + puts "Generate HTML page from installed packages:" + puts " (package name with link to package website/version installed)" + show.usage( "generation" ) + # abt news | -n - when "news", "-n" - logger.logToJournal( "Starting to retrieve AbTLinux news." ) - - # abtlinux.org news feeds. - puts "\n" - if ( !downloader.retrieveNewsFeed( $ABTNEWS , "true" ) ) - puts "Failed to retrieve the AbTLinux news feed." - end - - puts "\n" - if ( !downloader.retrieveNewsFeed( $ABTNEWS_THREADS ) ) - puts "Failed to retrieve the AbTLinux forum threads news feed." - end - - puts "\n" - if ( !downloader.retrieveNewsFeed( $ABTNEWS_POSTS ) ) - puts "Failed to retrieve the AbTLinux new posts news feed." - end - - # display the file contents. - reporter.showJournal( $ABTNEWS_LOG ) - - logger.logToJournal( "Completed the retrieval of AbTLinux news." ) - +when "news", "-n" + logger.logToJournal( "Starting to retrieve AbTLinux news." ) + + # abtlinux.org news feeds. + puts "\n" + if ( !downloader.retrieveNewsFeed( $ABTNEWS , "true" ) ) + puts "Failed to retrieve the AbTLinux news feed." + end + + puts "\n" + if ( !downloader.retrieveNewsFeed( $ABTNEWS_THREADS ) ) + puts "Failed to retrieve the AbTLinux forum threads news feed." + end + + puts "\n" + if ( !downloader.retrieveNewsFeed( $ABTNEWS_POSTS ) ) + puts "Failed to retrieve the AbTLinux new posts news feed." + end + + # display the file contents. + reporter.showJournal( $ABTNEWS_LOG ) + + logger.logToJournal( "Completed the retrieval of AbTLinux news." ) + # abt [-d | download ] <package> - when "download", "-d" - if ( ARGV.length == 2 && File.exist?( $PACKAGE_PATH + ARGV[1] + ".rb" ) ) - options['pkg'] = ARGV[1] - logger.logToJournal( "Starting to download " + options['pkg'] ) - - manager = AbtDownloadManager.new - - if ( manager.retrievePackageSource( options['pkg'], $SOURCES_REPOSITORY ) ) - logger.logToJournal( "Finished download for " + options['pkg'] ) - puts "\n"; - print "Downloading of #{options['pkg']} to #{$SOURCES_REPOSITORY} " - puts "completed." - puts "\n\n" - else - logger.logToJournal( "FAILURE to download " + options['pkg'] ) - puts "\n" - puts "DOWNLOADING - failed to download source for #{options['pkg']}" - puts "\n\n" - end +when "download", "-d" + if ( ARGV.length == 2 && File.exist?( $PACKAGE_PATH + ARGV[1] + ".rb" ) ) + options['pkg'] = ARGV[1] + logger.logToJournal( "Starting to download " + options['pkg'] ) + + manager = AbtDownloadManager.new + + if ( manager.retrievePackageSource( options['pkg'], $SOURCES_REPOSITORY ) ) + logger.logToJournal( "Finished download for " + options['pkg'] ) + puts "\n"; + print "Downloading of #{options['pkg']} to #{$SOURCES_REPOSITORY} " + puts "completed." + puts "\n\n" else - show.usage( "downloads" ) - exit + logger.logToJournal( "FAILURE to download " + options['pkg'] ) + puts "\n" + puts "DOWNLOADING - failed to download source for #{options['pkg']}" + puts "\n\n" end - - when "update", "-u" - if ( ARGV.length == 2 ) - options['updateItem'] = ARGV[1] - puts "Updating item : #{options['updateItem']}" - else - show.usage( "downloads" ) - exit - end - - when "purge-src" - puts "Remove source caches for packages no longer installed." + else + show.usage( "downloads" ) + exit + end + +when "update", "-u" + if ( ARGV.length == 2 ) + options['updateItem'] = ARGV[1] + puts "Updating item : #{options['updateItem']}" + else + show.usage( "downloads" ) + exit + end + +when "purge-src" + puts "Remove source caches for packages no longer installed." + show.usage( "fix" ) + +when "purge-logs" + puts "Remove log files for packages no longer installed." + show.usage( "fix" ) + +when "verify-files" + if ( ARGV.length == 2 ) + options['package'] = ARGV[1] + puts "Installed files verified for package : " + options['package'] + else show.usage( "fix" ) - - when "purge-logs" - puts "Remove log files for packages no longer installed." + exit + end + +when "verify-symlinks" + if ( ARGV.length == 2 ) + options['package'] = ARGV[1] + puts "Symlinks verified for package : " + options['package'] + else show.usage( "fix" ) - - when "verify-files" - if ( ARGV.length == 2 ) - options['package'] = ARGV[1] - puts "Installed files verified for package : " + options['package'] - else - show.usage( "fix" ) - exit - end - - when "verify-symlinks" - if ( ARGV.length == 2 ) + exit + end + +when "verify-deps" + if ( ARGV.length == 2 ) options['package'] = ARGV[1] puts "Symlinks verified for package : " + options['package'] else show.usage( "fix" ) exit end - - when "verify-deps" - if ( ARGV.length == 2 ) - options['package'] = ARGV[1] - puts "Symlinks verified for package : " + options['package'] + +when "verify-integrity" + if ( ARGV.length == 2 ) + options['pkg'] = ARGV[1] + print "Verifiy integrity of installed files for " + puts "package : #{options['pkg']}" + else + show.usage( "fix" ) + exit + end + +when "fix" + if ( ARGV.length == 2 ) + options['pkg'] = ARGV[1] + puts "Package : #{options['pkg']} is verified and checked if needed." + else + show.usage( "fix" ) + exit + end + +when "build-location" + if ( ARGV.length == 2 ) + options['buildHost'] = ARGV[1] + print "Sets global location for retrieving cached build packages " + puts "to : #{options['buildHost']}" + else + show.usage( "maintenance" ) + exit + end + +when "package-repo" + # sort out that we have enough args. + case ARGV.length + + # add or remove called. + when 3 + options['repoAction'] = ARGV[1] + options['repoUri'] = ARGV[2] + + # list called. + when 2 + if ( ARGV[1] == "list" ) + options['repoAction'] = ARGV[1] else - show.usage( "fix" ) - exit - end - - when "verify-integrity" - if ( ARGV.length == 2 ) - options['pkg'] = ARGV[1] - print "Verifiy integrity of installed files for " - puts "package : #{options['pkg']}" - else - show.usage( "fix" ) - exit - end - - when "fix" - if ( ARGV.length == 2 ) - options['pkg'] = ARGV[1] - puts "Package : #{options['pkg']} is verified and checked if needed." - else - show.usage( "fix" ) - exit - end - - when "build-location" - if ( ARGV.length == 2 ) - options['buildHost'] = ARGV[1] - print "Sets global location for retrieving cached build packages " - puts "to : #{options['buildHost']}" - else show.usage( "maintenance" ) exit end - - when "package-repo" - # sort out that we have enough args. - case ARGV.length - - # add or remove called. - when 3 - options['repoAction'] = ARGV[1] - options['repoUri'] = ARGV[2] - - # list called. - when 2 - if ( ARGV[1] == "list" ) - options['repoAction'] = ARGV[1] - else - show.usage( "maintenance" ) - exit - end - - else - show.usage( "maintenance" ) - exit - end # case ARGV.length. - - # hook location based on action. - case options['repoAction'] - - when "add" - puts "Adding package repository : " + options['repoUri'] - - when "remove" - puts "Remove package repository : " + options['repoUri'] - - when "list" - puts "Display listing of package repositories." - - else - show.usage( "maintenance" ) - exit - end # case repoAction. - + else - show.usage( "all" ) + show.usage( "maintenance" ) + exit + end # case ARGV.length. + + # hook location based on action. + case options['repoAction'] + + when "add" + puts "Adding package repository : " + options['repoUri'] + + when "remove" + puts "Remove package repository : " + options['repoUri'] + + when "list" + puts "Display listing of package repositories." + + else + show.usage( "maintenance" ) + exit + end # case repoAction. + +else + show.usage( "all" ) end # case ARGV[0]. Modified: src/trunk/testSuiteAbt.rb =================================================================== --- src/trunk/testSuiteAbt.rb 2007-03-03 13:38:48 UTC (rev 316) +++ src/trunk/testSuiteAbt.rb 2007-03-03 13:57:38 UTC (rev 317) @@ -1,9 +1,9 @@ #!/usr/bin/ruby -wI./packages if ( Process.uid != 0 ) - puts "Enter root password:" - system( 'su -c ./testSuiteAbt.rb root' ) - exit + puts "Enter root password:" + system( 'su -c ./testSuiteAbt.rb root' ) + exit end require 'test/unit' This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |