On 04/15/10 03:28 PM, Danek Duvall wrote:
Shawn Walker wrote:

However, I think this will work intead:

parent_path = os.path.dirname(final_path)
real_parent_path = os.path.realpath(parent_path)
if parent_path != real_parent_path:
         # Now test each component of the parent path until one is found
         # to be a link.  When found, that's the parent that has been
         # redirected to some other location.
         tmp = parent_path
         while 1:

I would compare tmp to "/" or to the image root.  Otherwise you might not
ever exit the loop.

I wasn't expecting "/" to ever return True for os.path.islink(). But given what you said below, that's fine.

                 if os.path.islink(tmp):
                         # We've found the parent that changed locations.
                         break
                 # Drop the final component.
                 tmp = os.path.split(tmp)[0]

You need an "else" here that skips the message if it falls off the end,
signifying that you got up to the top without finding a link.  Note that
the image root might itself be a link and that's probably okay.

Okay, that wasn't clear, but it sounds reasonable. I'll change these two things. After I get Bart's response on the caching bit, I'll post an updated webrev that includes my (hopefully) last set of changes.

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

Reply via email to