[Debtags-commits] [svn] r2216 - tagdb

Enrico Zini enrico at alioth.debian.org
Mon Dec 25 10:52:56 CET 2006


Author: enrico
Date: Mon Dec 25 10:52:55 2006
New Revision: 2216

Modified:
   tagdb/make-overrides
Log:
Clean up tag sets from service tags and use the merged package list for selecting valid packages

Modified: tagdb/make-overrides
==============================================================================
--- tagdb/make-overrides	(original)
+++ tagdb/make-overrides	Mon Dec 25 10:52:55 2006
@@ -8,12 +8,19 @@
 use POSIX qw(strftime);
 
 my $basename = "tag";
+my $allpackages = 'AllPackages-nonexperimental.gz';
 
 my %sects;
 
+# Download the multi-arch package list
+if (! -f $allpackages)
+{
+	system ("wget http://people.debian.org/~enrico/$allpackages") && die "Cannot download the new $allpackages: $!";
+}
+
 # Read the sections
 {
-	open IN, "grep-aptavail -ns 'Package,Section' . |" || die "Can't query grep-aptavail: $!";
+	open IN, "zcat $allpackages | grep-dctrl -ns 'Package,Section' . |" || die "Can't query grep-aptavail: $!";
 	local $/ = "\n\n";
 	while (<IN>)
 	{
@@ -23,6 +30,7 @@
 	close (IN);
 }
 
+# Take a tag list and return a tag list grouped by facet
 sub compress ($)
 {
 	my ($tags) = @_;
@@ -32,6 +40,10 @@
 	my @unfaceted;
 	for my $t (split(', ', $tags))
 	{
+		# Skip unwanted tags
+		next if $t =~ /::special:|:todo$|:not-yet-tagged|completely-tagged/i;
+
+		# Group the tags we want by facet
 		if ($t =~ /^(.+?)::(.+)$/)
 		{
 			$facets{$1} = [] if not exists $facets{$1};
@@ -79,7 +91,7 @@
 
 	if (not exists $sects{$pkg})
 	{
-		print STDERR "Warning: package $pkg not found in APT database\n";
+		print STDERR "Warning: package $pkg not found in the package list\n";
 		next;
 	}
 



More information about the Debtags-commits mailing list