[csw-devel] SF.net SVN: opencsw:[410] catalog_signatures

bdwalton at users.sourceforge.net bdwalton at users.sourceforge.net
Thu Jul 21 05:02:14 CEST 2011


Revision: 410
          http://opencsw.svn.sourceforge.net/opencsw/?rev=410&view=rev
Author:   bdwalton
Date:     2011-07-21 03:02:14 +0000 (Thu, 21 Jul 2011)

Log Message:
-----------
define a webrick mount for each valid catalog path and signature type, pass this path to the GPGDaemon object

Signed-off-by: Ben Walton <bwalton at artsci.utoronto.ca>

Modified Paths:
--------------
    catalog_signatures/catalog_gpg
    catalog_signatures/lib/csw/gpg_daemon.rb

Modified: catalog_signatures/catalog_gpg
===================================================================
--- catalog_signatures/catalog_gpg	2011-07-21 03:01:50 UTC (rev 409)
+++ catalog_signatures/catalog_gpg	2011-07-21 03:02:14 UTC (rev 410)
@@ -43,7 +43,20 @@
 end.parse!
 
 server = WEBrick::HTTPServer.new({ :Port => opts.port })
-server.mount "/clearsign", GPGDaemon, opts.mirror_path
-server.mount "/detachsign", GPGDaemon, opts.mirror_path
+
+# create a valid mount for each type of signature we'll return and for
+# each valid catalog path that we'll sign
+%w(clearsign detachsign).each do |signtype|
+  VALID_TREES.each do |tree|
+    VALID_ARCHES.each do |arch|
+      VALID_RELEASES.each do |release|
+        path = "#{tree}/#{arch}/#{release}"
+        server.mount "/#{signtype}/#{path}", GPGDaemon, opts.mirror_path, path
+      end
+    end
+  end
+end
+
 trap('INT') { server.shutdown }
+
 server.start

Modified: catalog_signatures/lib/csw/gpg_daemon.rb
===================================================================
--- catalog_signatures/lib/csw/gpg_daemon.rb	2011-07-21 03:01:50 UTC (rev 409)
+++ catalog_signatures/lib/csw/gpg_daemon.rb	2011-07-21 03:02:14 UTC (rev 410)
@@ -1,8 +1,9 @@
 require 'webrick'
 
 class GPGDaemon < WEBrick::HTTPServlet::AbstractServlet
-  def initialize(server, mirror_path)
+  def initialize(server, mirror_path, catalogpath)
     @mirror_path = mirror_path
+    @catalog_path = catalogpath
     @gpg = "gpg --batch --yes --no-tty -a --output /dev/stdout"
   end
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.


More information about the devel mailing list