On Mon 30 Nov 2009 at 07:05PM, Bart Smaalders wrote: > http://cr.opensolaris.org/~barts/pkgdiff/ > > which addresses: > > 12899 Need a nice way of comparing manifests from the command line to > aid publication
So I played with it... file path=usr/sbin/zdump elfarch=i386 elfbits=32 elfhash=fc3a8d192ee7cfe2c298e4dcb3e05cccf8e7b9d6 group=bin mode=0555 owner=root pkg.csize=6618 pkg.size=17320 variant.arch=i386 + 534bb9298fb90fb524de6e44b43de1e60a1e54bb - 55f3143492a9dff1719b377255670c97ae6ca8b7 + chash=84957b2e38ed7b75b49fa51edd85ef35457be4e8 - chash=6e2e712708fc0a16f5106fa9e43c6d08fbafe544 So I realize the first thing is the hash-- should it be labelled somehow as such? --- Usually in unified diff format, the old (or left, or -) precedes the new (or right or +). This seems to be the case at the action level, but at the attribute level it seems to be the opposite. In other words, this makes sense: - depend [email protected] type=require + depend [email protected] type=require This makes less sense: file path=usr/bin/alias elfarch=sparc group=bin mode=0555 owner=root variant.arch=sparc ... + elfbits=64 - elfbits=32 --- Do you think that you need to print the remaining (not-changed) attributes of an action? It seems like if you printed the key_attr, that might be enough? In other words, would this: file path=usr/bin/alias elfarch=sparc group=bin mode=0555 owner=root variant.arch=sparc + 35de0e560c8158285f9ffbb8f072e5560fb0747d - d43bf93c2315def3653b5c55504d510be255ca31 + chash=6d0586fdb13509f412ee349dd6d143a357baf81d - chash=2fa3d4622c81d73556a4f7e8a50f3c476522a7d5 + elfbits=64 - elfbits=32 + elfhash=df1275379c6a60d41ebfdf317f960599295b0955 - elfhash=92702d2194831f11ef804d02f40e03d3a3feccce + pkg.csize=5507 - pkg.csize=3901 + pkg.size=25528 - pkg.size=12424 Be better as follows? I don't know. file path=usr/bin/alias - d43bf93c2315def3653b5c55504d510be255ca31 + 35de0e560c8158285f9ffbb8f072e5560fb0747d - chash=2fa3d4622c81d73556a4f7e8a50f3c476522a7d5 + chash=6d0586fdb13509f412ee349dd6d143a357baf81d - elfbits=32 + elfbits=64 - elfhash=92702d2194831f11ef804d02f40e03d3a3feccce + elfhash=df1275379c6a60d41ebfdf317f960599295b0955 - pkg.csize=3901 + pkg.csize=5507 - pkg.size=12424 + pkg.size=25528 It would certainly make the output more compact and more focused on what changed. --- A complement to -i which acts as a whitelist (-o for *only*?) would be nice. Then I could ask: "What mode changes were there in this build?". --- A command line option which represented: -i hash -i chash -i pkg.size -i pkg.csize -i elfhash -i pkg.elfhash (or which could collapse all of these into a single: * contents changed would be nice. My assumption is that most humans will be diffing to work out changes which are not about the contents. --- Not sure how you are grouping things, but if you sorted all things which had path as their key_attr (files, dirs, links, etc.) by that path, you'd have a nice representation for when things change type... - file 8cf7871af78ec400def7cd7624fbd92aae412cee chash=c0101b2781102d058e85abd2730d3379045c21ae elfarch=i386 elfbits=32 elfhash=034183bf8b7464d187a3b431769f09f3989e52b0 group=bin mode=0555 owner=root path=usr/bin/cksum pkg.csize=5289 pkg.size=13820 variant.arch=i386 + hardlink path=usr/bin/cksum target=../../usr/bin/alias --- Should this enhanced outputter live in an API someplace? I presume that blending this into the GUI, BUI, CLI, etc. would be useful. --- Strange error msg from: $ python2.6 util/publish/pkgdiff.py /etc/motd /dev/null pkgdiff: Action error in file Sun Microsystems Inc. SunOS 5.11 snv_127 November 2008 : Malformed action at position: 21: Sun Microsystems Inc. SunOS 5.11 snv_127 November 2008 ^ I think at 88 error(_("Action error in file %s: %s") % (file1, e)) you want pargs[0]. Ditto at 94 (pargs[1]). 244 print >> sys.stderr, "pkgmogrify: caught %s, %s" % (Exception, __e) pkgmogrify -> pkgdiff -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
