On 02/05/13 00:21, Thejaswini wrote:
Hi all,

The below webrev contains the fix for the following bugs:

15771543 set-publisher -p error message difficult to understand when
publish
- The fix is that the error message is made more clear.
15769004 pkg unset-publisher could use a progress tracker
- Here I have added progress tracker logs which would appear while
deleting the publisher metadata.

https://cr.opensolaris.org/action/browse/pkg/tk241774/15771543/

I think these should really be separate changesets instead of the same one; they're not really related changes.

To add to that, I think the changes for 15771543 should not be made, or rather, are the wrong set of changes to make.

Among the pkg(5) team, we discussed a long time ago whether -p should simply accept new package sources, and the consensus was that now that we support composition (and package signing), it should be safe to do so. I meant to fix this in S11 FCS but failed to file an RFE for it (or I can't find the RFE I filed).

There is little value in enforcing the current check, so I'd suggest the right change is to instead delete lines 4489-4496 and 4500-4512 in the original src/client.py. So, I'd repurpose the bug as "set-publisher -p should simply update existing publisher sources".

As for the progress changes for 15769004, we shouldn't be adding new methods to the progress tracker unless absolutely necessary. I'd suggest using the generic JOB progress mechanism instead; see the attached patch.

-Shawn
diff --git a/src/modules/client/image.py b/src/modules/client/image.py
--- a/src/modules/client/image.py
+++ b/src/modules/client/image.py
@@ -3419,8 +3419,18 @@ in the environment or by setting simulat
                     if f.publisher == pub.prefix
                 ]
 
+                if not progtrack:
+                        progtrack = progress.NullProgressTracker()
+
+                progtrack.job_start(progtrack.JOB_PKG_CACHE, goal=1)
+
                 if not excluded:
-                        pub.remove_meta_root()
+                        try:
+                                pub.remove_meta_root()
+                        finally:
+                                progtrack.job_add_progress(
+                                    progtrack.JOB_PKG_CACHE)
+                                progtrack.job_done(progtrack.JOB_PKG_CACHE)
                 else:
                         try:
                                 # Discard all publisher metadata except
@@ -3465,6 +3475,10 @@ in the environment or by setting simulat
                                     pub.prefix), ignore_errors=True)
                         except EnvironmentError, e:
                                 raise apx._convert_error(e)
+                        finally:
+                                progtrack.job_add_progress(
+                                    progtrack.JOB_PKG_CACHE)
+                                progtrack.job_done(progtrack.JOB_PKG_CACHE)
 
                 if rebuild:
                         self.__rebuild_image_catalogs(progtrack=progtrack)
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss

Reply via email to