On Mon, Aug 25, 2008 at 10:34:31PM -0700, Brock Pytlik wrote:
> Sorry that these are all flying at once.
>
> This fixes the problem where the indexer would blow up if a package had
> a directory which ended in a slash.
>
> CR:
> http://cr.opensolaris.org/~bpytlik/ips-bug-3046-v1/
>
> Bug:
> http://defect.opensolaris.org/bz/show_bug.cgi?id=3046
>
> Thanks,
> Brock
Maybe you can just do:
return {
"basename": os.path.basename(self.attrs["path"].rstrip(os.path.sep))
"path": os.path.sep + self.attrs["path"]
}
I don't think you need the extra checks there, rstrip() will do nothing if
there isn't a "/" on the end (i.e. foo = "bar"; print foo.rstrip("/") ->
"bar"). And maybe change to os.path.sep incase this gets run on other
platforms as well.
Aside from that, looks fine to me.
-Brad
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss