[csw-devel] SF.net SVN: gar:[8837] csw/mgar/gar/v2/lib/python/submit_to_newpkgs.py

wahwah at users.sourceforge.net wahwah at users.sourceforge.net
Fri Feb 26 15:37:15 CET 2010


Revision: 8837
          http://gar.svn.sourceforge.net/gar/?rev=8837&view=rev
Author:   wahwah
Date:     2010-02-26 14:37:15 +0000 (Fri, 26 Feb 2010)

Log Message:
-----------
mGAR v2: submitpkg, rename pkgnames to catalognames

Modified Paths:
--------------
    csw/mgar/gar/v2/lib/python/submit_to_newpkgs.py

Modified: csw/mgar/gar/v2/lib/python/submit_to_newpkgs.py
===================================================================
--- csw/mgar/gar/v2/lib/python/submit_to_newpkgs.py	2010-02-26 14:26:35 UTC (rev 8836)
+++ csw/mgar/gar/v2/lib/python/submit_to_newpkgs.py	2010-02-26 14:37:15 UTC (rev 8837)
@@ -88,9 +88,12 @@
         raise ConfigurationError("Option %s is missing from the configuration."
                            % repr(opt_name))
     parser = optparse.OptionParser()
-    parser.add_option("-p", "--pkgnames",
+    parser.add_option("-p",
                       dest="pkgnames",
-                      help="A comma-separated list of pkgnames: "
+                      help="A deprecated options. Please use --catalognames.")
+    parser.add_option("-c", "--catalognames",
+                      dest="catalognames",
+                      help="A comma-separated list of catalog names: "
                            "cups,cupsdevel,libcups")
     parser.add_option("-d", "--debug",
                       dest="debug", default=False,
@@ -101,7 +104,15 @@
     if options.debug:
       level = logging.DEBUG
     logging.basicConfig(level=level)
-    if not options.pkgnames:
+    if options.pkgnames:
+      logging.warn("The -p option is deprecated. Please use "
+                   "--catalognames or -c")
+      if options.catalognames:
+        options.catalognames = ",".join([options.catalognames,
+                                         options.pkgnames])
+      else:
+        options.catalognames = options.pkgnames
+    if not options.catalognames:
       parser.print_help()
       raise ConfigurationError("You need to specify a package name or names.")
     if config.has_option(CONFIG_RELEASE_SECTION, "release cc"):
@@ -113,11 +124,11 @@
     print CONFIG_INFO
     print e
     sys.exit(1)
-  pkgnames = options.pkgnames.split(",")
+  catalognames = options.catalognames.split(",")
   package_files = []
   staging_dir = opencsw.StagingDir(config.get(CONFIG_RELEASE_SECTION,
                                                   "package dir"))
-  for p in pkgnames:
+  for p in catalognames:
     package_files.extend(staging_dir.GetLatest(p))
   logging.debug("Copying files to the target host:dir")
   remote_package_files = []
@@ -140,11 +151,12 @@
         "Couldn't run %s, is the binary "
         "in the $PATH? The error was: %s" % (repr(args[0]), e))
   if ret:
-    msg = "Copying %s to %s has failed." % (p, dst_arg)
+    msg = ("Copying %s to %s has failed. "
+           "Are you on the login host?" % (p, dst_arg))
     logging.error(msg)
     raise PackageSubmissionError(msg)
   nm = opencsw.NewpkgMailer(
-      pkgnames, remote_package_references,
+      catalognames, remote_package_references,
       release_mgr_name=config.get(CONFIG_RELEASE_SECTION, "release manager name"),
       release_mgr_email=config.get(CONFIG_RELEASE_SECTION, "release manager email"),
       sender_name=config.get(CONFIG_RELEASE_SECTION, "sender name"),


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