[csw-devel] SF.net SVN: gar:[16050] csw/mgar/gar/v2/bin/find_unpackaged
bdwalton at users.sourceforge.net
bdwalton at users.sourceforge.net
Mon Oct 31 03:46:33 CET 2011
Revision: 16050
http://gar.svn.sourceforge.net/gar/?rev=16050&view=rev
Author: bdwalton
Date: 2011-10-31 02:46:33 +0000 (Mon, 31 Oct 2011)
Log Message:
-----------
mgar/v2: add a script that can detect files installed in DESTDIR that are not in a prototype
Added Paths:
-----------
csw/mgar/gar/v2/bin/find_unpackaged
Added: csw/mgar/gar/v2/bin/find_unpackaged
===================================================================
--- csw/mgar/gar/v2/bin/find_unpackaged (rev 0)
+++ csw/mgar/gar/v2/bin/find_unpackaged 2011-10-31 02:46:33 UTC (rev 16050)
@@ -0,0 +1,40 @@
+#!/opt/csw/bin/perl
+
+# A quick hack of a script to find files that are not added to any
+# package The idea is that we build a list of files from the main
+# prototype file in build-global. Then, we look for each arch
+# specific prototype and remove files that we see there from the
+# global list. Any remaining file is not listed in a package
+# prototype and therefore won't be delivered to client systems.
+
+# We expect a path to build-global as an argument. No error checking
+# is done on this.
+
+chdir $ARGV[0];
+$proc = `uname -p`;
+ at ptypes = glob("*prototype-$proc");
+%ptype_whole = ();
+
+open (MAINPTYPE, "prototype") or die "Couldn't open full prototype.\n";
+while (<MAINPTYPE>) {
+ @parts = split(/\s+/, $_);
+ next if $parts[0] eq 'i';
+ # store references to each file. remove these while traversing
+ # sub-package prototypes
+ $ptype_whole{$parts[2]} = 1;
+}
+close(MAINPTYPE);
+
+foreach $ptype (@ptypes) {
+ open(PTYPE, "$ptype") or die "Couldn't open prototype $ptype.\n";
+ while (<PTYPE>) {
+ @parts = split(/\s+/, $_);
+ next if $parts[0] eq 'i';
+ delete $ptype_whole{$parts[2]};
+ }
+ close(PTYPE);
+}
+
+foreach $k (keys %ptype_whole) {
+ print "$k\n";
+}
Property changes on: csw/mgar/gar/v2/bin/find_unpackaged
___________________________________________________________________
Added: svn:executable
+ *
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the devel
mailing list