[Pkg-xfce-commits] r3547 - scripts

Evgeni Golov evgeni at alioth.debian.org
Tue Oct 6 10:08:22 UTC 2009


Author: evgeni
Date: 2009-10-06 22:08:22 +0000 (Tue, 06 Oct 2009)
New Revision: 3547

Modified:
   scripts/get-sources.pl
Log:
make get-sources.pl able to fetch selected packages only


Modified: scripts/get-sources.pl
===================================================================
--- scripts/get-sources.pl	2009-10-06 21:25:26 UTC (rev 3546)
+++ scripts/get-sources.pl	2009-10-06 22:08:22 UTC (rev 3547)
@@ -8,7 +8,7 @@
 use warnings;
 use File::Basename;
 
-(!$ARGV[0] || $ARGV[0] !~ /goodies|desktop/) and print "Usage: $0 (goodies|desktop)\n" and exit 1;
+(!$ARGV[0] || $ARGV[0] !~ /goodies|desktop/) and print "Usage: $0 (goodies|desktop) [packages]\n" and exit 1;
 
 my $debug = 0;
 if ($debug) {
@@ -29,6 +29,15 @@
 	print STDERR "E: Something REALLY weird happened";
 	exit 1;
 }
+
+my $fetch_all = 1;
+my @fetch_packages = @ARGV;
+if(defined $ARGV[1]) {
+	$fetch_all = 0;
+	shift(@fetch_packages);
+	print "W: only fetching @fetch_packages.\n";
+}
+
 my $tarballs_dir = "$debian_dirs/tarballs";
 
 ! -d $tarballs_dir and print STDERR "E: No tarballs dir ($tarballs_dir) found. Exiting.\n" and exit 1;
@@ -42,6 +51,11 @@
 	chop;
 	my ($pkg, $tarball, $version) = split;
 	! -d "$debian_dirs/$pkg" and next;
+
+	if (!$fetch_all && !grep($_ eq $pkg, @fetch_packages)) {
+		next;
+	}
+
 	if ($tarball =~ /^DUMMY$/i) {
 		print "W: $pkg is a DUMMY package. Skipping\n";
 		next;




More information about the Pkg-xfce-commits mailing list