On 06/13/12 02:27, Saurabh Vyas wrote:
Hi All,

Please review these trivial fix

CR 7140808 pkgsend traces back on a manifest with a versionless pkg.fmri

webrev :
https://cr.opensolaris.org/action/browse/pkg/saurabhv/7140808-rev0/webrev/

src/publish.py:
  line 367: This must be done *after* pfmri.version.timestr = None.  So
    move this to after line 377.

lines 370-376: This version check shouldn't be done inside of "allow-timestamp" and it could be simplified.

diff --git a/src/publish.py b/src/publish.py
--- a/src/publish.py
+++ b/src/publish.py
@@ -21,7 +21,7 @@
 #

 #
-# Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
 #

 import fnmatch
@@ -364,9 +364,16 @@ def trans_publish(repo_uri, fargs):

         try:
                 pfmri = pkg.fmri.PkgFmri(m["pkg.fmri"], "5.11")
+                if not pfmri.version:
+                        # Cannot have a FMRI without version
+ error(_("The pkg.fmri '%s' in the package manifest " + "must include a version.") % pfmri, cmd="publish")
+                        return 1
                 if not DebugValues["allow-timestamp"]:
                         # If not debugging, timestamps are ignored.
-                        pfmri.version.timestr = None
+                        if pfmri.version:
+                                pfmri.version.timestr = None
+
                 pkg_name = pfmri.get_fmri()
         except KeyError:
                 error(_("Manifest does not set pkg.fmri"))

lines 385-389: I don't think this change is necessary; especially if you change things as I suggested above. If it still is, then I'd like to understand the failure case better and it doesn't make sense to me right now.

-Shawn
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss

Reply via email to