[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Changes in code to create debian/control + tasks.desc file



Hi,

to enable building reasonable metapackages I did some changes
in the code which generates the debian/control and tasksel
input file.  The rationale behind this is that while I had some
new tasks added to Debian Med which contain prospective packages
but currently no real existing package inside Debian.  This is
nice for the tasks pages but it makes no sense to build basically
empty metapackages.  So I wanted to leave the metapackages out
and tasksel should not create an additional task.

Because this has an influence on the creation of control files
I would like to announce this publicly to make sure everybody is
happy with this.

Holger, I'm sure you will ask so here the answer in advance:
This only influences unstable and perhaps testing once this code
will enter this dist - there is no influence on Lenny because
there is no chance that blends-dev will enter Lenny.  So no
worry for Debian Edu / Lenny release.

I tried to compare the package creation process between blends-dev
version 0.6.2 (unchanged code to the version in Lenny) and the
future version 0.6.3.  I noticed that in Debian Edu the resulting
control files are byte identical - so concerning this nothing
seems to happen.

But there is a difference in the debian-edu-tasks.desc file
which is attached to this mail as debian-edu-tasks.desc.diff.
The entries for the following tasks are just missing:

   education-lang-he
   education-lang-ja
   education-lang-zh_TW

Regarding the algorithm I implemented this is perfectly intended
behaviour because the tasks do not feature any dependency at all
and the Packages: list in the output of the old (=0.6.2, currently
in unstable) version is empty anyway.  So I actually wonder
what the sense of these entries might be and whether these make
sense at all.  So if you ask me it is rather a feature than a
bug to leave these entries out in the tasksel desc file but I would
like to hear your opinion about this first before I upload the
package.  If the entries are needed for whatever purpose I probably
have to enhance the code to make sure that the tasksel input file
remains unchanged.

You might like to review the code changes in the attached diff
blend-gen-control.diff.

Please make sure that you are happy with this change.

Kind regards

       Andreas.

--
http://fam-tille.de
--- tags/blends/0.6.2/devtools/blend-gen-control	2009-04-02 12:19:21.000000000 +0200
+++ trunk/blends/devtools/blend-gen-control	2009-04-08 16:18:28.000000000 +0200
@@ -16,12 +14,13 @@
 use File::Path;
 
 use vars qw(%opts %available %excluded %included @wanted %missing
-            @tasks $debug);
+            @tasks $debug $suppressempty);
 my @arch = qw(alpha arm i386 ia64 m68k mips mipsel powerpc s390 sparc hppa);
 
 my $debug = 0;
 my $nodepends = 0;
 my $ignoreapterrors = 0;
+my $suppressempty   = 0;
 
 my %taskinfo = ();
 my $tasksdir = "tasks" ;
@@ -58,13 +57,14 @@
    -i               :
    -m               : print missing packages
    -s <sourcefile>  : specify which sources.list file to use
+   -S               : suppress tasks without any recommended package
    -t               : print task descriptions and package list for task
 
 example: $0 -s sources.list.etch -D -c -m -i
 EOF
 }
 
-getopts("cdaemis:tDhA", \%opts);
+getopts("cdaemis:StDhA", \%opts);
 
 usage() and exit if $opts{'h'};
 
@@ -85,6 +85,7 @@
 $debug = 1 if ($opts{'d'});
 $nodepends = 1 if ($opts{'D'});
 $ignoreapterrors = 1 if ($opts{'A'});
+$suppressempty   = 1 if ($opts{'S'});
 
 blend_init();
 
@@ -171,6 +172,13 @@
     for $task (sort keys %taskinfo) {
         next if (exists $taskinfo{$task}{'Metapackage'} &&
                         $taskinfo{$task}{'Metapackage'} eq 'false');
+
+	print STDERR "$task: $taskinfo{$task}{'haspackages'}\n" if $debug;
+	# if no package was found in the target distribution suppress this task at all
+	if ( $suppressempty && $taskinfo{$task}{'haspackages'} == 0 ) {
+	    print STDERR "The metapackage $task will not be created because $taskinfo{$task}{'haspackages'} dependant are in the pool and suppressempty was set ($suppressempty)\n" if $debug;
+	    next ;
+	}
         print "Package: $task\n";
 
         my $header;
@@ -239,6 +247,10 @@
         foreach my $task (sort keys %taskinfo) {
                 next if (exists $taskinfo{$task}{'Leaf'} &&
                         $taskinfo{$task}{'Leaf'} eq 'false');
+		if ( $suppressempty && $taskinfo{$task}{'haspackages'} == 0 ) {
+		    print STDERR "The metapackage $task will not be created because $taskinfo{$task}{'haspackages'} dependant are in the pool and suppressempty was set ($suppressempty)\n" if $debug;
+		    next ;
+		}
 
                 print "Task: $task\n";
                 print "Section: $blendname\n";
@@ -396,6 +408,11 @@
         my $alternatecount=0;
         for $package (@alternates) {
             print STDERR "Loading pkg '$package'\n" if $debug;
+	    if ($package =~ /[A-Z]/) {
+		print STDERR "Packages may not contain upper case letters (policy 5.6.7) $package. Name will be turned into ";
+		$package = lc($package);
+		print STDERR "$package\n";
+	    }
             if ($package =~ /^-(.+)$/) {
                 $excluded{$1} = 1;
             } elsif ( !exists $available{$package} ) {
@@ -432,6 +449,7 @@
 
     print STDERR "Loading task $curpkg\n" if $debug;
 
+    my $haspackages = 0;
     while (<TASKFILE>) {
         chomp;
         next if (m/^\#/); # Skip comments
@@ -474,10 +492,13 @@
                 my ($pkglist, $missinglist) = process_pkglist($1);
                 push(@{$taskinfo{$curpkg}{$header}}, @{$pkglist});
 
+		$haspackages += $#{$taskinfo{$curpkg}{$header}} + 1;
+		print STDERR "$curpkg $header:", @{$taskinfo{$curpkg}{$header}}, "($haspackages)\n" if $debug;
                 # Avoid missing packages in Depends lists, allow them
                 # in the two others.  Insert missing depends in
                 # suggests list.
                 if (@{$missinglist}) {
+		    print STDERR "$curpkg: missing = ", @{$missinglist}, "\n" if $debug;
                     if ("Depends" eq $header) {
                         push(@{$taskinfo{$curpkg}{'Suggests'}}, @{$missinglist});
                     } else {
@@ -513,6 +534,8 @@
     }
     close(TASKFILE);
     unless ( $taskinfo{$curpkg}{'Architecture'} ) { $taskinfo{$curpkg}{'Architecture'} = "all" ; }
+    $taskinfo{$curpkg}{'haspackages'} = $haspackages; 
+    print STDERR "$curpkg: haspackages = ", $taskinfo{$curpkg}{'haspackages'}, "\n" if $debug;
 }
 
 sub print_excluded_packages {
--- 0.6.2/debian-edu-tasks.desc	2009-04-08 20:52:06.000000000 +0200
+++ 0.6.3/debian-edu-tasks.desc	2009-04-08 21:01:51.000000000 +0200
@@ -742,15 +742,6 @@
 Packages: list
  kde-i18n-es
 
-Task: education-lang-he
-Section: debian-edu
-Description: Debian Edu applications for Hebrew installs.
- This metapackage depends on various office and desktop applications
- that are useful for teachers and their students.
-Relevance: 10
-Test-always-lang: he
-Packages: list
-
 Task: education-lang-he-desktop
 Section: debian-edu
 Description: Debian Edu Desktop applications for Hebrew installs.
@@ -777,15 +768,6 @@
 Packages: list
  kde-i18n-he
 
-Task: education-lang-ja
-Section: debian-edu
-Description: Debian Edu applications for Japanese installs.
- This metapackage depends on various office and desktop applications
- that are useful for teachers and their students.
-Relevance: 10
-Test-always-lang: ja
-Packages: list
-
 Task: education-lang-ja-desktop
 Section: debian-edu
 Description: Debian Edu Desktop applications for Japanese installs.
@@ -856,15 +838,6 @@
  kde-i18n-nony
  kde-i18n-no
 
-Task: education-lang-zh_TW
-Section: debian-edu
-Description: Debian Edu applications for Traditional Chinese installs.
- This metapackage depends on various office and desktop applications
- that are useful for teachers and their students.
-Relevance: 10
-Test-always-lang: zh_TW
-Packages: list
-
 Task: education-lang-zh_TW-desktop
 Section: debian-edu
 Description: Debian Edu Desktop applications for Traditional Chinese installs.

Reply to: