ltib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Ltib] [patch] dump list of gpp files from listpkginfo


From: Svein Seldal
Subject: [Ltib] [patch] dump list of gpp files from listpkginfo
Date: Wed, 08 Jul 2009 18:40:40 +0200
User-agent: Thunderbird 2.0.0.22 (X11/20090608)

Hello

Here is a patch that will make 'bin/listpkginfo' info dump a list of
files referenced by ltib with the command line option -w. This list
should be representative of the gpp's content (files being used at least).

Please apply if interesting.


- Svein

Index: bin/listpkginfo
===================================================================
RCS file: /sources/ltib/ltib/bin/listpkginfo,v
retrieving revision 1.1.1.9
diff -u -r1.1.1.9 listpkginfo
--- bin/listpkginfo     18 Mar 2009 17:53:28 -0000      1.1.1.9
+++ bin/listpkginfo     8 Jul 2009 16:28:59 -0000
@@ -67,6 +67,7 @@
 $opt_r = '';
 $opt_b = 0;
 $opt_p = '';
+$opt_w = 0;
 $opt_h = 0;
 $usage = <<TXT;
 Usage  listpkgs [ -r <ref> -f <file> ] [ options....]
@@ -76,11 +77,12 @@
     -r pkg.spec : reference (spec) file name (not path)
     -p          : limit to this platform (e.g mpc7448hpcii)
     -b          : basic output
+    -w          : list of files (for wget)
     -h          : show usage
 TXT
 
 # option handling
-getopts('l:f:r:p:bh') or die($usage);
+getopts('l:f:r:p:bhw') or die($usage);
 die($usage) if $opt_h;
 die("-p option not implemented yet\n") if $opt_p;
 $top    = $opt_l if $opt_l;
@@ -112,19 +114,23 @@
 warn("Building a list of spec file sources and patches\n");
 find(\&spec_sources, @dirs);
 
+# List of unique packages seen
+%pkgs = ();
+
 #
 # output the main results and build warnings
 #
-header();
+header() unless $opt_w;
 foreach $lkc (keys %$tcs) {
     last if $opt_r || $opt_p;
     $msg  = "\n---++ $lkc\n";
     foreach $fn (@{$tcs->{$lkc}}) {
+        $pkgs{$fn} = 1;
         $msg .= "      * $fn\n", next if $opt_b;
         $esc_fn = unpack("H*", $fn . '.html');
         $msg .= "[[$esc_fn][$fn]]<br>\n";
     }
-    print $msg;
+    print $msg unless $opt_w;
 }
 foreach $sn (sort keys %$specs) {
     die("null key in specs hash\n") unless $sn;
@@ -168,15 +174,26 @@
     }
     foreach $fn (@srcs) {
         last unless $has_lkcs;
+        $pkgs{$fn} = 1;
         $msg .= "      * $fn\n", next if $opt_b;
         $esc_fn = unpack("H*", $fn . '.html');
         $msg .= "[[$esc_fn][$fn]]<br>\n";
     }
     $unsel .= $msg unless $has_lkcs;
     $prvs  .= $msg if $has_prvs;
-    print $msg if $has_lkcs;
+    print $msg if $has_lkcs && ! $opt_w;
+}
+
+# Dump package filenames
+if($opt_w)
+{
+    foreach $fn (sort keys %pkgs) {
+       print "$fn\n";
+       print "$fn.md5\n";
+    }
 }
-trailer();
+
+trailer() unless $opt_w;
 
 #
 # output errors and warnings to stderr


reply via email to

[Prev in Thread] Current Thread [Next in Thread]