Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

Re: Change how debian-cd include recommended packages?

From: Petter Reinholdtsen <pere(at)hungry.com>
Date: Sat Dec 15 2007 - 07:33:38 EST


[Petter Reinholdtsen]
> Any comments? Any idea how to change debian-cd to make it behave
> this way?

I believe this patch solve it. It will first check all the packages listed in the OR list to see if any of them are already included. If none of them are included, the first of the acceptable packages is added. I'm testing this with Debian Edu now. It got rid of quite a few unwanted packages. :)

diff -Nur --exclude=debian-installer-etch --exclude=debian-installer+kernel-etch --exclude=unexclude-CD2-etch --exclude=.svn --exclude=sid debian-cd.unpatched/tools/list2cds debian-cd/tools/list2cds
--- debian-cd.unpatched/tools/list2cds
+++ debian-cd/tools/list2cds
@@ -564,7 +573,9 @@
 		# If it's an OR
 		if (ref) {
 			my $or_ok = 0;
-			# Loop over each package in the OR
+			# Loop over each package in the OR, see if one of them
+			# already is included
+			my @candidate = ();
 			foreach my $pkg (@{$_}) {
 				next if not accepted ($pkg);
 				# If the package is already included
@@ -577,14 +588,17 @@
 				if (is_in ($pkg, $list)) {
 					$or_ok = 1;
 					last;
-				# Otherwise try to add it
-				} else {
-					#Instead of doing a bad choice I'm
-					#including all packages that do
-					#fit to the needs
+				}
+				push @candidate, $pkg;
+			}
+			# If non of the OR-ed packages are included,
+			# include the first non-excluded one that work.
+			if (!$or_ok) {
+				foreach my $pkg (@candidate) {
 					push (@{$list}, $pkg);
 					if (add_missing ($list, $packages{$pkg}{"Depends"}, $pkg)) {
 						$or_ok = 1;
+						last;
 					} else {
 						pop @{$list};
 					}

Happy hacking,

-- 
Petter Reinholdtsen


-- 
To UNSUBSCRIBE, email to debian-cd-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Received on Sat Dec 15 07:51:19 2007

This archive was generated by hypermail 2.1.8 : Wed Mar 19 2008 - 06:56:37 EDT


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library