Hi,

Quoting Jakub Wilk (2015-10-15 17:24:45)
> Contents of /etc/sbuild/sbuild.conf depends on the architecture on which 
> this arch:all package was built. This might trigger unnecessary conffile 
> prompts for people who customized the file.
> 
> Diff between packages built on i386 and amd64 is attached.

oh shoot, I know exactly where this is coming from - thanks for the report!

Attached patch should fix this problem.

But are you sure that the diff you attached are all differences? The man page
also contains defaults and should also be affected.

If you have more diffs between the sbuild built on different arches, please
share them. The contents of the sbuild and libsbuild-perl packages should not
be different depending on which architecture the package is built on (or for).

Thanks!

cheers, josch
diff --git a/lib/Sbuild/ConfBase.pm b/lib/Sbuild/ConfBase.pm
index d7640ba..7814cb0 100644
--- a/lib/Sbuild/ConfBase.pm
+++ b/lib/Sbuild/ConfBase.pm
@@ -169,6 +169,10 @@ sub init_allowed_keys {
 	    VARNAME => 'host_arch',
 	    GROUP => 'Build options',
 	    DEFAULT => $native_arch,
+	    # the $native_arch is different depending on the machine where
+	    # sbuild is built but arch:all packages must not differ depending on
+	    # the architecture they are built on, so don't show the default
+	    IGNORE_DEFAULT => 1,
 	    HELP => 'Host architecture (Arch we are building for)'
 	},
 	'BUILD_ARCH'				=> {
@@ -176,6 +180,10 @@ sub init_allowed_keys {
 	    VARNAME => 'build_arch',
 	    GROUP => 'Build options',
 	    DEFAULT => $native_arch,
+	    # the $native_arch is different depending on the machine where
+	    # sbuild is built but arch:all packages must not differ depending on
+	    # the architecture they are built on, so don't show the default
+	    IGNORE_DEFAULT => 1,
 	    HELP => 'Build architecture (Arch we are building on).'
 	},
 	'BUILD_PROFILES'        => {
diff --git a/tools/sbuild-dumpconfig b/tools/sbuild-dumpconfig
index bdf493b..bda5a34 100755
--- a/tools/sbuild-dumpconfig
+++ b/tools/sbuild-dumpconfig
@@ -116,9 +116,13 @@ foreach my $group (@groups) {
 			print "#    $line\n";
 		    }
 		}
-		print wrap("#", "#", Data::Dumper->Dump([$default],
-							["$varname"]))
-		    if (!$ignore_default);
+		if ($ignore_default) {
+			print wrap("#", "#", "$varname = ...;");
+			print("\n");
+		} else {
+			print wrap("#", "#", Data::Dumper->Dump([$default],
+							["$varname"]));
+		}
 		print("\n");
 	    } elsif ($output eq "man") {
 		print ".TP\n";
@@ -139,7 +143,13 @@ foreach my $group (@groups) {
 		    }
 		    print ".RE\n";
 		}
-		if (!$ignore_default) {
+		if ($ignore_default) {
+		    print ".PP\n";
+		    print ".RS\n";
+			print "\\f[CR]$varname = ...;\\fP\n";
+			print ".br\n";
+		    print ".RE\n";
+		} else {
 		    print ".IP\n";
 		    print "Default:\n";
 		    print ".PP\n";

Attachment: signature.asc
Description: signature

Reply via email to