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

Bug#729321: keyboard-configuration: changes /etc/default/keyboard upon upgrade without asking



On Fri, Nov 15, 2013 at 02:54:55PM +0000, Steve Cotton wrote:
> 
> The upgrade scripts do lots to preserve configuration changes, but the option
> 
> * keyboard-configuration/unsupported_config_options: false
> 
> has a much longer lifespan than it seems it should.  Answering <false> to the
> debconf prompt below means that it will clobber the options on every upgrade,
> although the intention seems to be that it would only affect the initial
> interactive migration from debian-installer or XOrg settings.

I think there has been a reported bug against a very old version of 
console-setup caused by the fact that when the configuration in 
/etc/default/{console-setup,keyboard} was not supported by the upgrade 
scripts, console-setup refused to ask any question.  So this question is 
necessary - there are cases when the changes in the configuration files 
are not intended and the user might want to use dpkg-reconfigure in 
order to fix the files.

I suppose the attached patch is going to fix this bug but I haven't made 
any tests.  Unfortunately I won't be albe to work on console-setup for 
about a month, so I prefer to keep for now the patch in the BTS rather 
than to commit it (unless, of course, some other developer has the time 
to check whether the patch fixes the bug).

Anton Zinoviev


diff -Naur console-setup-1.103/debian/keyboard-configuration.config console-setup-1.103.new/debian/keyboard-configuration.config
--- console-setup-1.103/debian/keyboard-configuration.config	2013-09-16 08:18:50.000000000 +0300
+++ console-setup-1.103.new/debian/keyboard-configuration.config	2013-11-19 11:05:13.391026477 +0200
@@ -1253,6 +1253,8 @@
                 # the locale or xorg.conf (in which case the user may
                 # be unaware).
 		if [ -f $CONFIGFILE ]; then
+		    db_reset keyboard-configuration/unsupported_config_layout || true
+		    db_fset keyboard-configuration/unsupported_config_layout seen false
 		    db_subst keyboard-configuration/unsupported_config_layout \
 			XKBLAYOUT "$XKBLAYOUT"
 		    db_subst keyboard-configuration/unsupported_config_layout \
@@ -1267,6 +1269,8 @@
 		    fi
 		    db_get keyboard-configuration/unsupported_config_layout
 		else
+		    db_reset keyboard-configuration/unsupported_layout || true
+		    db_fset keyboard-configuration/unsupported_layout seen false
 		    db_subst keyboard-configuration/unsupported_layout \
 			XKBLAYOUT "$XKBLAYOUT"
 		    db_subst keyboard-configuration/unsupported_layout \
@@ -1293,10 +1297,6 @@
 		    unsupported_layout=no
 		fi
 	    else
-		db_reset keyboard-configuration/unsupported_config_layout || true
-		db_fset keyboard-configuration/unsupported_config_layout seen false
-		db_reset keyboard-configuration/unsupported_layout || true
-		db_fset keyboard-configuration/unsupported_layout seen false
 		# skip the question without making Debconf loop
 		STATE=$(( $STATE + $STATE - $old_state ))
 	    fi
@@ -1436,6 +1436,8 @@
 		[ "$unsupported_options" = yes -a "$is_not_debian_installer" ]
 	    then
 		if [ -f $CONFIGFILE ]; then
+		    db_reset keyboard-configuration/unsupported_config_options || true
+		    db_fset keyboard-configuration/unsupported_config_options seen false
 		    db_subst keyboard-configuration/unsupported_config_options \
 			XKBOPTIONS "$XKBOPTIONS"
 		    db_input medium \
@@ -1448,6 +1450,8 @@
 		    fi
 		    db_get keyboard-configuration/unsupported_config_options
 		else
+		    db_reset keyboard-configuration/unsupported_options || true
+		    db_fset keyboard-configuration/unsupported_options seen false
 		    db_subst keyboard-configuration/unsupported_options \
 			XKBOPTIONS "$XKBOPTIONS"
 		    db_input medium keyboard-configuration/unsupported_options || true
@@ -1462,10 +1466,6 @@
 		    unsupported_options=no
 		fi
 	    else
-		db_reset keyboard-configuration/unsupported_config_options || true
-		db_fset keyboard-configuration/unsupported_config_options seen false
-		db_reset keyboard-configuration/unsupported_options || true
-		db_fset keyboard-configuration/unsupported_options seen false
 		# skip the question without making Debconf loop
 		STATE=$(( $STATE + $STATE - $old_state ))
 	    fi

Reply to: