#!/usr/bin/perl use strict; use warnings; use vars qw/ @current %data @lines %list $line $c $source $num $limit/; $limit = 150; system ("wget http://release.debian.org/~aba/la/current.txt"); open(CURRENT, "current.txt") or die; @current=; close (CURRENT); foreach $line (@current) { # omit depended-on next if ($line =~ /depended-on/); $line =~ s/:.*$//; chomp ($line); $data{$line}++; } unlink ("current.txt"); system ('bts select package users:codehelp@debian.org tag:la-file-removal|xargs bts status fields:source,bug_num > la-file-removal.txt'); system ("echo >> la-file-removal.txt"); open (LAFILE, "la-file-removal.txt") or die; @lines=; close (LAFILE); foreach $line (@lines) { if ($line =~ /^$/) { $c++; } if ($line =~ /^bug_num\t([0-9]+)$/) { $num = $1; next; } if ($line =~ /^source\t(.*)$/) { $source = $1; $source =~ s/,? .*//; undef $c; next; } if (defined $c and defined $source and defined $num) { $list{$source}=$num; } else { die ($line); } undef $c; undef $source; undef $num; } foreach my $mbf (sort keys %data) { last if ($limit == 0); next if (exists ($list{$mbf})); next if ($mbf =~ /^$/); print "$mbf\n"; $limit--; } unlink ("la-file-removal.txt"); # redirect this output to remove.list then run source.pl but make sure # you've a fast net connection and lots of disc-space! # source.pl is in the same location as source.pl.txt # mass-bug --user codehelp@debian.org --usertags la-file-removal --subject "Getting rid of unneeded *.la / emptying dependency_libs" mbf.txt now.txt