Actually, looking at the changes... at least at indexing time, we've
been assuming that path was a string for a long time. Specifically,
where we prepend os.path.sep to the front of it. (Sorry if this is
obvious to everyone, I don't know much about how the solaris.py works at
the moment.) Did we use to build "path" as a list, then chop it down to
a single string all during the import phase?
Just trying to figure out if this means there might be a larger issue of
not indexing certain packages if this hasn't shown up before.
Thanks,
Brock
Bart Smaalders wrote:
Brock Pytlik wrote:
Yeah, it should probably be more robust, but was I wrong in assuming
that a) file/directory/link actions only are allowed to have 1 path
and b) that path should be a string?
Just trying to figure out whether the problem with my change is that
it's not robust to bad input, or if it's removed functionality we
actually want.
Well, we were sleazing around in solaris.py w/ the actions; I'm
testing a fix:
diff -r 73558f7d93c2 src/util/distro-import/solaris.py
--- a/src/util/distro-import/solaris.py Fri Mar 13 17:50:15 2009 +0000
+++ b/src/util/distro-import/solaris.py Fri Mar 13 14:37:25 2009 -0700
@@ -279,8 +279,14 @@
# handle insertion/modification case
for f in o:
- a = actions.fromstr(("%s path=%s %s" %
- (self.convert_type(f.type), fname,
line)).rstrip())
+ # create attribute dictionary from line
+ new_type = self.convert_type(f.type)
+ new_attrs = actions._fromstr("%s %s" %
+ (new_type, line.rstrip()))[2]
+ # get path if we're not changing it
+ if "path" not in new_attrs:
+ new_attrs["path"] = fname
+ a = actions.types[new_type](**new_attrs)
if show_debug:
print "Updating attributes on " + \
"'%s' in '%s' with '%s'" % \
@@ -375,10 +381,15 @@
print "Updating attributes on " + \
"'%s' in '%s' with '%s'" % \
(fname, curpkg.name, chattr_line)
- s = "%s path=%s %s" %
(self.convert_type(f.type), \
- fname, chattr_line)
- a = actions.fromstr(s)
+ # create attribute dictionary from line
+ new_type = self.convert_type(f.type)
+ new_attrs = actions._fromstr("%s %s" %
+ (new_type, chattr_line.rstrip()))[2]
+ # get path if we're not changing it
+ if "path" not in new_attrs:
+ new_attrs["path"] = fname
+ a = actions.types[new_type](**new_attrs)
# each chattr produces a dictionary of actions
# including a path=xxxx and whatever
modifications
# are made. Note that the path value may be
a list in
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss