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
--
Bart Smaalders Solaris Kernel Performance
[email protected] http://blogs.sun.com/barts
"You will contribute more with mercurial than with thunderbird."
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss