[Pkg-haskell-commits] darcs: tools: Show missing entries

Joachim Breitner mail at joachim-breitner.de
Sun May 26 10:06:35 UTC 2013


Sun May 26 10:06:12 UTC 2013  Joachim Breitner <mail at joachim-breitner.de>
  * Show missing entries
  Ignore-this: 8949b70297aff668ae9cdcba688347ed

    M ./all-packages/test-packages.pl -2 +11

Sun May 26 10:06:12 UTC 2013  Joachim Breitner <mail at joachim-breitner.de>
  * Show missing entries
  Ignore-this: 8949b70297aff668ae9cdcba688347ed
diff -rN -u old-tools//all-packages/test-packages.pl new-tools//all-packages/test-packages.pl
--- old-tools//all-packages/test-packages.pl	2013-05-26 10:06:35.279038113 +0000
+++ new-tools//all-packages/test-packages.pl	2013-05-26 10:06:35.291037681 +0000
@@ -5,6 +5,7 @@
 
 use version;
 
+my %packages;
 my %versions;
 my %available;
 my %comments;
@@ -18,6 +19,7 @@
 	unless (m/^(.*?) (.*?)(?: (.*))?$/) {
 		print "Ignoring unparseable line $.: $_\n";
 	}
+	$packages{$1}++;
 	$versions{$1} = $2;
 	$comments{$1} = $3 if $3;
 }
@@ -31,13 +33,20 @@
 		print "Ignoring unparseable grep-aptavail output line $.: $_\n";
 	}
 	$available{$1} = $2;
+	$packages{$1}++;
 
 }
 close AVAILABLE;
 
 print "Checking for outdated entries...\n";
-for my $pkg (keys %versions) {
-	if ( version->parse($versions{$pkg}) < version->parse($available{$pkg}) ) {
+for my $pkg (sort keys %packages) {
+	if (! exists($versions{$pkg})) {
+		printf "Missing entry: %s %s\n" ,
+			$pkg, $available{$pkg};
+	} elsif (! exists($versions{$pkg})) {
+		printf "%s is %s here but does not exist in the archive.\n" ,
+			$pkg, $versions{$pkg};
+	} elsif ( version->parse($versions{$pkg}) < version->parse($available{$pkg}) ) {
 		printf "%s is %s here but %s exists in the archive.\n" ,
 			$pkg, $versions{$pkg}, $available{$pkg};
  	}





More information about the Pkg-haskell-commits mailing list