[csw-devel] SF.net SVN: opencsw:[467] catalog_signatures/bin

bdwalton at users.sourceforge.net bdwalton at users.sourceforge.net
Thu Jul 21 05:23:17 CEST 2011


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

Log Message:
-----------
mv catalog_gpg to http_gpg_daemon and update APP_DAEMON accordingly

Signed-off-by: Ben Walton <bwalton at opencsw.org>

Modified Paths:
--------------
    catalog_signatures/bin/signing_daemon

Added Paths:
-----------
    catalog_signatures/bin/http_gpg_daemon

Removed Paths:
-------------
    catalog_signatures/bin/catalog_gpg

Deleted: catalog_signatures/bin/catalog_gpg
===================================================================
--- catalog_signatures/bin/catalog_gpg	2011-07-21 03:22:50 UTC (rev 466)
+++ catalog_signatures/bin/catalog_gpg	2011-07-21 03:23:17 UTC (rev 467)
@@ -1,70 +0,0 @@
-#!/usr/bin/env ruby
-
-require 'webrick'
-require 'optparse'
-require 'ostruct'
-
-VALID_TREES = %w(unstable current)
-VALID_ARCHES = %w(i386 sparc)
-VALID_RELEASES = %w(5.9 5.10 5.11)
-
-begin
-  retried = nil
-  require 'csw/gpg_daemon'
-rescue LoadError => e
-  if retried.nil?
-    $:.unshift(File.join(File.dirname($0), '..', 'lib'))
-    retried = 1
-    retry
-  else
-    reraise
-  end
-end
-
-opts = OpenStruct.new
-opts.port = 9981
-opts.mirror_path = File.join(File.dirname($0), '..')
-opts.gpg = OpenStruct.new
-opts.gpg.home = ENV['APP_GPG']
-opts.gpg.bin = '/opt/csw/bin/gpg'
-
-OptionParser.new do |o|
-  o.banner = "Usage: #{File.basename($0)} [options]"
-  o.separator ''
-
-  o.on('-b', '--mirror-path PATH', "Use PATH as the root of the mirror\n" +
-       "\t\t\t\t     tree where catalogs can be found.") do |p|
-    if File.directory?(p)
-      opts.mirror_path = p
-    else
-      $stderr.puts "Invalid mirror path: #{p}"
-      exit 1
-    end
-  end
-  o.on('-h', '--help', 'Display help output.') { puts o; exit 0 }
-  o.on('-p', '--port PORT', "Use a port other than #{opts.port}") { |p| opts.port = p.to_i }
-end.parse!
-
-if opts.gpg.home.nil?
-  $stderr.puts "Can't start daemon without a valid APP_GPG in the environment"
-  exit 1
-end
-
-server = WEBrick::HTTPServer.new({ :Port => opts.port })
-
-# 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, opts.gpg
-      end
-    end
-  end
-end
-
-trap('INT') { server.shutdown }
-
-server.start

Copied: catalog_signatures/bin/http_gpg_daemon (from rev 466, catalog_signatures/bin/catalog_gpg)
===================================================================
--- catalog_signatures/bin/http_gpg_daemon	                        (rev 0)
+++ catalog_signatures/bin/http_gpg_daemon	2011-07-21 03:23:17 UTC (rev 467)
@@ -0,0 +1,70 @@
+#!/usr/bin/env ruby
+
+require 'webrick'
+require 'optparse'
+require 'ostruct'
+
+VALID_TREES = %w(unstable current)
+VALID_ARCHES = %w(i386 sparc)
+VALID_RELEASES = %w(5.9 5.10 5.11)
+
+begin
+  retried = nil
+  require 'csw/gpg_daemon'
+rescue LoadError => e
+  if retried.nil?
+    $:.unshift(File.join(File.dirname($0), '..', 'lib'))
+    retried = 1
+    retry
+  else
+    reraise
+  end
+end
+
+opts = OpenStruct.new
+opts.port = 9981
+opts.mirror_path = File.join(File.dirname($0), '..')
+opts.gpg = OpenStruct.new
+opts.gpg.home = ENV['APP_GPG']
+opts.gpg.bin = '/opt/csw/bin/gpg'
+
+OptionParser.new do |o|
+  o.banner = "Usage: #{File.basename($0)} [options]"
+  o.separator ''
+
+  o.on('-b', '--mirror-path PATH', "Use PATH as the root of the mirror\n" +
+       "\t\t\t\t     tree where catalogs can be found.") do |p|
+    if File.directory?(p)
+      opts.mirror_path = p
+    else
+      $stderr.puts "Invalid mirror path: #{p}"
+      exit 1
+    end
+  end
+  o.on('-h', '--help', 'Display help output.') { puts o; exit 0 }
+  o.on('-p', '--port PORT', "Use a port other than #{opts.port}") { |p| opts.port = p.to_i }
+end.parse!
+
+if opts.gpg.home.nil?
+  $stderr.puts "Can't start daemon without a valid APP_GPG in the environment"
+  exit 1
+end
+
+server = WEBrick::HTTPServer.new({ :Port => opts.port })
+
+# 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, opts.gpg
+      end
+    end
+  end
+end
+
+trap('INT') { server.shutdown }
+
+server.start

Modified: catalog_signatures/bin/signing_daemon
===================================================================
--- catalog_signatures/bin/signing_daemon	2011-07-21 03:22:50 UTC (rev 466)
+++ catalog_signatures/bin/signing_daemon	2011-07-21 03:23:17 UTC (rev 467)
@@ -4,7 +4,7 @@
 
 APP_HOME=/opt/catalog_signatures
 APP_BIN=${APP_HOME}/bin
-APP_DAEMON=${APP_BIN}/http_gpg_proxy
+APP_DAEMON=${APP_BIN}/http_gpg_daemon
 APP_GPG=${APP_HOME}/etc/gpg
 APP_TMP=${APP_HOME}/tmp
 APP_GPG_ENV=${APP_TMP}/gpg-agent-env.conf


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