On Thu 30 Jul 2009 at 07:25PM, Danek Duvall wrote: > On Thu, Jul 30, 2009 at 06:45:10PM -0700, Dan Price wrote: > > > http://cr.opensolaris.org/~dp/pkg-action-fixes/ > > directory.py: > > - Other than the wording changes, I'm ambivalent about the changes here. > If you think it's cleaner somehow, that's fine, but otherwise, they're > unnecessary.
It makes the code pretty much line for line the same as in the file action. That seemed to me to be worth the effort. > link.py: > > - line 97: os.path.exists() does a stat(), not an lstat(), so I don't > think this does what you want. You probably want to do a single > lstat() call, and check first that the pathname exists and second that > it's a symlink. > > - line 98, 100: while I understand the difference between the messages, > why does one have the pathname, and the other not? Should the second > message be "Not a symbolic link"? That's how the directory action > treats the same problem. But a file action says "%s is not a regular > file". This is one of those inconsistencies that I didn't notice. I bit the bullet and did a wider cleanup here. Hopefully this will mean we don't need to touch this again for a while. http://cr.opensolaris.org/~dp/pkg-action-fixes/ I've settled on a format for the messages which gives a one or two word summary followed by some explanation; the explanation should not repeat a path from the previous line. OLD: PACKAGE STATUS pkg:/SUNWcsd ERROR dir: dev Group: 'root' should be 'sys' dir: dev/rmt Directory does not exist link: dev/stderr dev/stderr is not symbolic link link: dev/stdin target=fd/0 NEW: PACKAGE STATUS pkg:/SUNWcsd ERROR dir: dev Group: 'root' should be 'sys' dir: dev/rmt Missing: directory does not exist link: dev/stderr File Type: 'directory' should be 'symbolic link' link: dev/stdin Target: 'fd/0' should be './fd/0' OLD: PACKAGE STATUS pkg:/SUNWcs ERROR file: etc/inet/netmasks Mode: 0444 should be 0644 hardlink: usr/sbin/deallocate Path and Target (usr/sbin/allocate) inodes not the same hardlink: etc/rc2.d/S82mkdtab No such path etc/rc2.d/S82mkdtab NEW: PACKAGE STATUS pkg:/SUNWcs ERROR file: etc/inet/netmasks Mode: 0444 should be 0644 hardlink: usr/sbin/deallocate Broken: Path and Target (usr/sbin/allocate) inodes not the same hardlink: etc/rc2.d/S82mkdtab Missing: object does not exist Thanks, -dp -- Daniel Price, Solaris Kernel Engineering http://blogs.sun.com/dp _______________________________________________ pkg-discuss mailing list [email protected] http://mail.opensolaris.org/mailman/listinfo/pkg-discuss
