You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

75 lines
1.9 KiB

#!/usr/bin/perl
#
# doincludes directory
#
# Expands #include directives in files in the directory. This is used
# to let task package pull in the contents of metapackages, keeping the
# contents up-to-date, w/o actually pulling in the metapackages themselves,
# since some metapackages are rather prone to breakage near release time.
my $dir=shift or die "no directory specified\n";
my %depends;
{
local $/="\n\n";
- Updated copyright date range. - Make unselected buttons be the same color as the window itself. Matches look of new, fixed whiptail, and Closes: #122212 - Note in README that the way to get a task added is a bug report against this package. Closes: #144533 - Removed broken python-bobo from python task. Closes: #180925 - The python task is retarget at providing a subset of the more useful python tools, instead of everything. Semi-randomly removed some stuff. Someone who uses python might want to take over maintainership of this task. - Capitalised first letter of every task, in an effort to look "professional". Closes: #183109 - Removed the fortran task, not sufficiently used. - Added mutt and spamassassin to mail server task. - Fixed menu entry to give full path to su-to-root as it is in sbin for some reason. Closes: #188367 - Replace gnome-gnomines with gnome-games in games task, package rename. Closes: #190874 - Replace xtris with the currently popular tetrinet in games task. - Make "available file" message recommend running dselect update. Closes: #153016, #183690 - Replace netenv (with its nasty boot-time prompt) with guessnet (with its slick new ifupdown integration) in laptop task. - Add hdparm to laptop task, since many laptop users will want to use it to speed up (or turn off!) their disks. Closes: #87450 - Add menu to office task. - Added a java task. Closes: #108061 - Removed inlined Spanish translation of spanish task. However we should add translations, it's not like that! - Added a Thai task. Closes: #122663. Needs review since the bug's package list was 2 years old. - Cleaned up bad wording in most of the descriptions of the language-specific tasks. - Added sudo to unix-server. - Added kernel-compile task for custom kernel building. Closes: #184428 - Blessed the idea of putting Maintainer fields in individual task files. - Removed nonexistant packages from tasks: netscape-zh-resource-477, dialdcost, hanterm - Put cxterm-ks in korean task to replace hanterm. I hope that's right. - Rename mozilla-locale-es to mozilla-locale-es-es. - For chinese-t, use doc-linux-zh-text, which provides traditional chinese. doc-linux-zh-t went away. - doincludes.pl and makedesc.pl use apt-cache dumpavail instead of dselect available file, for more up-to-date information.
19 years ago
if (! open (AVAIL, "apt-cache dumpavail |")) {
warn "cannot real available info, so not exanding includes\n";
exit;
}
while (<AVAIL>) {
my ($package)=/Package:\s*(.*?)\n/;
my ($depends)=/Depends:\s*(.*?)\n/;
$depends{$package}=$depends;
}
close AVAIL;
}
use File::Find;
find(\&processfile, $dir);
sub processfile {
my $file=$_; # File::Find craziness.
$file eq 'po' && -d $file && ($File::Find::prune = 1);
return if $File::Find::dir=~/\.svn/;
return unless $file =~ /^[-+_.a-z0-9]+$/ and -f $file;
my @lines;
open (IN, $file) or die "$file: $!";
while (<IN>) {
if (/#\s*endinclude/) {
if ($skipping == 0) {
die "$file: #endinclude without #include\n";
}
$skipping=0;
}
push @lines, $_ unless $skipping == 1;
if (/^#\s*include\s+(\w+)/) {
my $pkg=$1;
if ($skipping) {
die "$file: nested includes near $_\n";
}
if (! exists $depends{$pkg}) {
warn "$file: #include $1 skipped; no such package. Leaving what was there alone.\n";
$skipping=-1;
}
else {
push @lines, "#Automatically added by doincludes.pl; do not edit.\n";
# Split deps and remove alternates and versioned
# deps. Include the metapackage on the list.
push @lines, map { s/[|(].*//; " $_\n" }
split(/,\s+/, $depends{$pkg}), $pkg;
$skipping=1;
}
}
}
close IN;
if ($skipping == 1) {
die "$file: #include without #endinclude";
}
open (OUT, ">$file") or die "$file: $!";
print OUT @lines;
close OUT;
}