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.

doincludes.pl 1.9 KiB

- 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.
18 years ago
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. #!/usr/bin/perl
  2. #
  3. # doincludes directory
  4. #
  5. # Expands #include directives in files in the directory. This is used
  6. # to let task package pull in the contents of metapackages, keeping the
  7. # contents up-to-date, w/o actually pulling in the metapackages themselves,
  8. # since some metapackages are rather prone to breakage near release time.
  9. my $dir=shift or die "no directory specified\n";
  10. my %depends;
  11. {
  12. local $/="\n\n";
  13. if (! open (AVAIL, "apt-cache dumpavail |")) {
  14. warn "cannot real available info, so not exanding includes\n";
  15. exit;
  16. }
  17. while (<AVAIL>) {
  18. my ($package)=/Package:\s*(.*?)\n/;
  19. my ($depends)=/Depends:\s*(.*?)\n/;
  20. $depends{$package}=$depends;
  21. }
  22. close AVAIL;
  23. }
  24. use File::Find;
  25. find(\&processfile, $dir);
  26. sub processfile {
  27. my $file=$_; # File::Find craziness.
  28. $file eq 'po' && -d $file && ($File::Find::prune = 1);
  29. return if $File::Find::dir=~/\.svn/;
  30. return unless $file =~ /^[-+_.a-z0-9]+$/ and -f $file;
  31. my @lines;
  32. open (IN, $file) or die "$file: $!";
  33. while (<IN>) {
  34. if (/#\s*endinclude/) {
  35. if ($skipping == 0) {
  36. die "$file: #endinclude without #include\n";
  37. }
  38. $skipping=0;
  39. }
  40. push @lines, $_ unless $skipping == 1;
  41. if (/^#\s*include\s+(\w+)/) {
  42. my $pkg=$1;
  43. if ($skipping) {
  44. die "$file: nested includes near $_\n";
  45. }
  46. if (! exists $depends{$pkg}) {
  47. warn "$file: #include $1 skipped; no such package. Leaving what was there alone.\n";
  48. $skipping=-1;
  49. }
  50. else {
  51. push @lines, "#Automatically added by doincludes.pl; do not edit.\n";
  52. # Split deps and remove alternates and versioned
  53. # deps. Include the metapackage on the list.
  54. push @lines, map { s/[|(].*//; " $_\n" }
  55. split(/,\s+/, $depends{$pkg}), $pkg;
  56. $skipping=1;
  57. }
  58. }
  59. }
  60. close IN;
  61. if ($skipping == 1) {
  62. die "$file: #include without #endinclude";
  63. }
  64. open (OUT, ">$file") or die "$file: $!";
  65. print OUT @lines;
  66. close OUT;
  67. }