[Swift-commit] r3321 - in SwiftApps/adem-osg: lib/adem test test/dummy_cache

noreply at svn.ci.uchicago.edu noreply at svn.ci.uchicago.edu
Mon May 3 14:57:05 CDT 2010


Author: aespinosa
Date: 2010-05-03 14:57:05 -0500 (Mon, 03 May 2010)
New Revision: 3321

Added:
   SwiftApps/adem-osg/test/dummy_cache/
   SwiftApps/adem-osg/test/dummy_cache/jbsim3d.pacman
Modified:
   SwiftApps/adem-osg/lib/adem/app.rb
   SwiftApps/adem-osg/test/test_online.rb
Log:
Mocked a dummy pacman cache

Modified: SwiftApps/adem-osg/lib/adem/app.rb
===================================================================
--- SwiftApps/adem-osg/lib/adem/app.rb	2010-05-03 19:57:01 UTC (rev 3320)
+++ SwiftApps/adem-osg/lib/adem/app.rb	2010-05-03 19:57:05 UTC (rev 3321)
@@ -1,5 +1,26 @@
+require 'optparse'
+
 def app(args, conf)
-  "app"
+  options = {}
+  optparse = OptionParser.new do |opts|
+    opts.banner = "Usage: adem app [options]"
+
+    opts.on('-l', '--avail', 'Available packages from cache') do
+      puts "Packages available from #{conf[:pacman_cache]}"
+      puts app_avail(conf[:pacman_cache]).grep /[(\ |\*)]/
+    end
+
+    opts.on('-i', '--install PACKAGE', 'Package to install') do |package|
+      puts "Installing #{package}"
+      app_install package, conf
+    end
+
+    opts.on_tail('-h', '--help', 'Show this help message') do
+      puts opts
+      exit
+    end
+  end
+  optparse.parse!
 end
 
 def app_avail(pacman_cache)
@@ -48,5 +69,3 @@
   File.delete "pacman_install.sh"
   resp
 end
-
-

Added: SwiftApps/adem-osg/test/dummy_cache/jbsim3d.pacman
===================================================================
--- SwiftApps/adem-osg/test/dummy_cache/jbsim3d.pacman	                        (rev 0)
+++ SwiftApps/adem-osg/test/dummy_cache/jbsim3d.pacman	2010-05-03 19:57:05 UTC (rev 3321)
@@ -0,0 +1,8 @@
+description = 'jbsim3d package'
+version('r794')
+platform('linux-rhel-5')
+processor('x86_64');
+{
+  downloadUntarzip('http://www.ci.uchicago.edu/~aespinosa/Cybershake/tarballs/jbsim3d_r794~RHEL5_amd64.tar.gz',
+    'POSTPROC')
+}

Modified: SwiftApps/adem-osg/test/test_online.rb
===================================================================
--- SwiftApps/adem-osg/test/test_online.rb	2010-05-03 19:57:01 UTC (rev 3320)
+++ SwiftApps/adem-osg/test/test_online.rb	2010-05-03 19:57:05 UTC (rev 3321)
@@ -34,9 +34,9 @@
   end
 
   def test_app_avail
-    pacman_cache = @conf[:pacman_cache]
+    pacman_cache = "test/dummy_cache"
     response = <<-eos
-http://www.ci.uchicago.edu/~aespinosa/Cybershake
+test/dummy_cache
     [ ] jbsim3d
     eos
     assert_equal(response, app_avail(pacman_cache))




More information about the Swift-commit mailing list