Hi,

I have made the suggested changes and uploaded the webrev
@ https://cr.opensolaris.org/action/browse/pkg/tk241774/15771543-rev02/webrev/.

1. "15769004 pkg unset-publisher could use a progress tracker"
    The output now looks like:
    root@S12_13:~# pkg unset-publisher solaris
    PHASE                                          ITEMS
    Updating package cache                           1/1

2. 15771543 set-publisher -p error message difficult to understand when publish
    #pkg set-publisher -p /myrepo/repo1 solaris ---- adds the origin.
#pkg set-publisher -p /myrepo/repo1 ---- Also adds the origin.

    I have modified 2 testcases to pass after my changes.

Thanks,
Thejaswini K

Oracle
Thejaswini K
Revenue Product Engineering (RPE), Systems
Phone: +91 8066927709 | Mobile: +91 9663324594
ORACLE India | Off Langford Road | Bangalore | 560025
Green Oracle <http://www.oracle.com/commitment> Oracle is committed to developing practices and products that help protect the environment

On 02/12/13 20:30, Shawn Walker wrote:
No, it should add the new origin to the publisher, it should not remove any origins.

--
Shawn

On Feb 11, 2013, at 10:51 PM, Thejaswini <[email protected] <mailto:[email protected]>> wrote:

This is with regard to bug "*Bug 15771543 - SUNBT7143562 set-publisher -p should simply update existing publisher sources"

*Below is my understanding on how -p should function:
If solaris publisher is already configured on the system:
root@S12_13:~# pkg publisher
PUBLISHER                   TYPE     STATUS P LOCATION
solaris origin online F file:///root/myrepo/*repo1*/

And then I issue the command "pkg set-publisher -p /root/myrepo/repo2 solaris"
this should update the location of the publisher configured.

i.e.
root@S12_13:~# pkg publisher
PUBLISHER                   TYPE     STATUS P LOCATION
solaris origin online F file:///root/myrepo/*repo2*/


Please correct me if I am wrong.

Thanks,
Thejaswini K.
<oracle_sig_logo.gif>
Thejaswini K
Revenue Product Engineering (RPE), Systems
Phone: +91 8066927709 | Mobile: +91 9663324594
ORACLE India | Off Langford Road | Bangalore | 560025
<green-for-email-sig_0.gif> <http://www.oracle.com/commitment> Oracle is committed to developing practices and products that help protect the environment

On 02/11/13 16:53, Thejaswini wrote:
Shawn, Tim, Thanks for looking into this and providing your comments.

In the case of output of the form:
"Removing metadata 1/100"
writing code to compute the goal, i.e. the exact no. of directories removed, is not worth as it will again add on to the performance.

As per the bug, the no. of metadata to be removed is huge:

edp@mcescher$ du -sh /a/var/pkg/publisher/solaris
 3.2G   /a/var/pkg/publisher/solaris
edp@mcescher$ find /a/var/pkg/publisher/solaris -type f | wc -l
  107422
edp@mcescher$ find /a/var/pkg/publisher/solaris -type d | wc -l
    2385

In such cases, as suggested by Shawn something like below would be good enough.
# pkg unset-publisher solaris
PHASE                                          ITEMS
Updating package cache                           1/1

IMO we could add an additional jobitem and use it while calling the progress tracker which would display "Removing package metadata" instead of " Updating package cache".
The output would look something like:
# pkg unset-publisher solaris
PHASE                                          ITEMS
Removing package metadata                        1/1

Is it fine to add this Job item?

Regarding the changes for 15771543, I would remove the check present and see if additional changes needs to be done.

Will send the webrev once I have the changes tested.

Thanks,
Thejaswini K

Oracle
Thejaswini K
Revenue Product Engineering (RPE), Systems
Phone: +91 8066927709 | Mobile: +91 9663324594
ORACLE India | Off Langford Road | Bangalore | 560025
Green Oracle <http://www.oracle.com/commitment> Oracle is committed to developing practices and products that help protect the environment

On 02/11/13 02:45, Tim Foster wrote:
On 02/ 9/13 08:12 AM, Shawn Walker wrote:
On 02/07/13 19:15, Tim Foster wrote:
"Removing metadata 1/100"

The problem with that idea is that we don't know how much metadata there
is to remove and since we're not actually removing the metadata
piece-by-piece (we use rmtree) we can't provide meaningful progress for
each metadata item as it is removed.

We do have some visibility into what we're removing, in some parts of the code[1] we're iterating over several directories looking for candidate directories to remove, calling shutil.rmtree when we need to.

Some shutil.rmtree calls will take longer than others, I'd rather a counter telling me how many directory-trees of content to consider removing are left, than just a random spinning '|/-\|-\'.

You're right in that when we're removing an entire publisher (line 3422), we've no visibility into the metadata removal, but not with the rest of the code (perhaps in that case, metadata removal is so fast it's not worth considering emitting progress?)

    cheers
            tim

[1] http://src.opensolaris.org/source/xref/pkg/gate/src/modules/client/image.py#3424 ish
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss

Reply via email to