~ubuntubudgie-dev/tasksel/ubuntu-budgie-tasksel-proposal.zesty

127 by Joey Hess
output a list of all packages in all tasks, for testing
1
#!/usr/bin/perl
2
#
1282.1.377 by Joey Hess
revert unncessary code change, will be picked up post-etch
3
# listpackages directory [field]
127 by Joey Hess
output a list of all packages in all tasks, for testing
4
#
5
# This program spits out a list of all the packages listed in the tasks.
6
#
1282.1.377 by Joey Hess
revert unncessary code change, will be picked up post-etch
7
# If you go to auric, this command is then useful:
127 by Joey Hess
output a list of all packages in all tasks, for testing
8
#
160 by Joey Hess
- Shortended the description of c-dev.
9
# for package in $(listpackages); do
127 by Joey Hess
output a list of all packages in all tasks, for testing
10
#   madison -s testing -a "i386 all" $package >/dev/null || echo "No $package!"
11
# done
160 by Joey Hess
- Shortended the description of c-dev.
12
#
13
# Or to see just key packages:
14
#
15
# listpackages tasks key
127 by Joey Hess
output a list of all packages in all tasks, for testing
16
1282.1.377 by Joey Hess
revert unncessary code change, will be picked up post-etch
17
my $dir=shift or die "no directory specified\n";
793 by Joey Hess
- Add a "new-install" test script (and export NEW_INSTALL for test
18
my @toshow=qw{packages-list key};
160 by Joey Hess
- Shortended the description of c-dev.
19
@toshow=@ARGV if @ARGV;
127 by Joey Hess
output a list of all packages in all tasks, for testing
20
1282.1.377 by Joey Hess
revert unncessary code change, will be picked up post-etch
21
use File::Find;
22
find(\&processfile, $dir);
127 by Joey Hess
output a list of all packages in all tasks, for testing
23
24
sub processfile {
1282.1.377 by Joey Hess
revert unncessary code change, will be picked up post-etch
25
	my $file=$_; # File::Find craziness.
26
	$file eq 'po' && -d $file && ($File::Find::prune = 1);
1282.1.658 by Joey Hess
Ignore .git directory in places that ignore .svn.
27
	return if $File::Find::dir=~/\.(svn|git)/;
1282.1.377 by Joey Hess
revert unncessary code change, will be picked up post-etch
28
	return unless $file =~ /^[-+_.a-z0-9]+$/ and -f $file;
127 by Joey Hess
output a list of all packages in all tasks, for testing
29
	open (IN, $file) or die "$file: $!";
30
	my %fields;
31
	my $field="";
32
	while (<IN>) {
33
		chomp;
34
		next if /^\s*#/;
35
		s/#.*//;
36
37
		if (/^\s/) {
38
			$fields{$field}.="\n$_";
39
		}
40
		else {
41
			($field, my $value)=split(/:\s*/, $_, 2);
42
			$field=lc($field);
43
			$fields{$field}=$value;
44
		}
45
	}
46
	close IN;
47
160 by Joey Hess
- Shortended the description of c-dev.
48
	my @list;
49
	push @list, split(' ', $fields{$_}) foreach @toshow;
50
	print join("\n", @list)."\n" if @list;
127 by Joey Hess
output a list of all packages in all tasks, for testing
51
}