r46844 - in /trunk/libconfig-model-perl/debian: dh/config-config-model dh/dh_config_model_upgrade dh/postinst-config-model dh/templates-config-model libconfig-model-perl.install

ddumont-guest at users.alioth.debian.org ddumont-guest at users.alioth.debian.org
Fri Nov 6 13:00:47 UTC 2009


Author: ddumont-guest
Date: Fri Nov  6 12:59:52 2009
New Revision: 46844

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=46844
Log:
lots of bug fixes in templates and scripts

Modified:
    trunk/libconfig-model-perl/debian/dh/config-config-model
    trunk/libconfig-model-perl/debian/dh/dh_config_model_upgrade
    trunk/libconfig-model-perl/debian/dh/postinst-config-model
    trunk/libconfig-model-perl/debian/dh/templates-config-model
    trunk/libconfig-model-perl/debian/libconfig-model-perl.install

Modified: trunk/libconfig-model-perl/debian/dh/config-config-model
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-model-perl/debian/dh/config-config-model?rev=46844&op=diff
==============================================================================
--- trunk/libconfig-model-perl/debian/dh/config-config-model (original)
+++ trunk/libconfig-model-perl/debian/dh/config-config-model Fri Nov  6 12:59:52 2009
@@ -1,9 +1,15 @@
 #!/bin/sh
 
 set -e
+set -x
 
-. /usr/share/debconf/confmodule
+# load confmodule only if required
+if [ `typeset -F db_get` != "db_get" ] ; then
+    . /usr/share/debconf/confmodule
+fi
 
-db_input medium %PACKAGE%/config-model-upgrade || true
+db_set libconfig-model-perl/automatic-upgrade pkg_name %PACKAGE% || true
+db_input medium libconfig-model-perl/automatic-upgrade || true
 
-db_go || true
+db_go || true
+

Modified: trunk/libconfig-model-perl/debian/dh/dh_config_model_upgrade
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-model-perl/debian/dh/dh_config_model_upgrade?rev=46844&op=diff
==============================================================================
--- trunk/libconfig-model-perl/debian/dh/dh_config_model_upgrade (original)
+++ trunk/libconfig-model-perl/debian/dh/dh_config_model_upgrade Fri Nov  6 12:59:52 2009
@@ -81,17 +81,15 @@
 	# should we check that model file is declared in *.install ?
     }
 
+    my $model_sed = 's/%MODEL%/'.$dh{model_name}.'/ ; ' ;
+    my $pack_sed  = 's/%PACKAGE%/'.$package.'/ ; ' ;
+
     # calls autoscript to update pkg.postinst with config-edit command
     autoscript($package,postinst => 'postinst-config-model',
-	       's/%MODEL%/'.$dh{model_name}.'/') ;
-
-    # add debconf template, we'll see later for translations
-    autoscript($package, templates => 'templates-config-model',
-	       's/%PACKAGE%/'.$package.'/') ;
+	       $model_sed.$pack_sed ) ;
 
     # ask debconf question in pre-inst
-    autoscript($package, config => 'config-config-model',
-	       's/%PACKAGE%/'.$package.'/') ;
+    autoscript($package, config => 'config-config-model',$pack_sed);
 }
 
 __END__

Modified: trunk/libconfig-model-perl/debian/dh/postinst-config-model
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-model-perl/debian/dh/postinst-config-model?rev=46844&op=diff
==============================================================================
--- trunk/libconfig-model-perl/debian/dh/postinst-config-model (original)
+++ trunk/libconfig-model-perl/debian/dh/postinst-config-model Fri Nov  6 12:59:52 2009
@@ -8,11 +8,19 @@
 # - fire UI ?
 # - don't upgrade 
 
+set -x 
+
+# load confmodule only if required
+if [ `typeset -F db_get` != "db_get" ] ; then
+    . /usr/share/debconf/confmodule
+fi
+
 # debconf question to check if user want automatic upgrade
-db_get %PACKAGE%/config-model-upgrade
+db_set libconfig-model-perl/automatic-upgrade pkg_name %PACKAGE% || true
+db_get medium libconfig-model-perl/automatic-upgrade || true
 
-if [[ $RET ]] 
+if [ "$RET" = true ]  
 then 
-    echo "Upgrading model %MODEL% with config-model-edit"
+    echo "config-model-edit is upgrading %PACKAGE configuration with model %MODEL%."
     config-edit -model %MODEL% -ui none -save
 fi

Modified: trunk/libconfig-model-perl/debian/dh/templates-config-model
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-model-perl/debian/dh/templates-config-model?rev=46844&op=diff
==============================================================================
--- trunk/libconfig-model-perl/debian/dh/templates-config-model (original)
+++ trunk/libconfig-model-perl/debian/dh/templates-config-model Fri Nov  6 12:59:52 2009
@@ -1,12 +1,12 @@
 # This config-model template snippet is experimental
 # no attempt have been made (yet) for translation
 
-Template: %PACKAGE%/config-model-upgrade
+Template: libconfig-model-perl/automatic-upgrade
 Type: boolean
 Default: true
 _Description: Upgrade config automatically ?
- %PACKAGE% configuration files can be upgraded automatically by merging
- your values with new recommendation from Debian. On the downside, 
+ ${pkg_name} configuration files can be upgraded automatically by merging
+ your values with new recommendations from Debian. On the downside, 
  comments are not preserved. Otherwise automatic configuration upgrade
  is safe (even though still experimental)
 

Modified: trunk/libconfig-model-perl/debian/libconfig-model-perl.install
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-model-perl/debian/libconfig-model-perl.install?rev=46844&op=diff
==============================================================================
--- trunk/libconfig-model-perl/debian/libconfig-model-perl.install (original)
+++ trunk/libconfig-model-perl/debian/libconfig-model-perl.install Fri Nov  6 12:59:52 2009
@@ -2,4 +2,3 @@
 debian/dh/config_model.pm        usr/share/perl5/Debian/Debhelper/Sequence/
 debian/dh/postinst-config-model	 usr/share/debhelper/autoscripts/
 debian/dh/postinst-config-model	 usr/share/debhelper/autoscripts/
-debian/dh/templates-config-model usr/share/debhelper/autoscripts/




More information about the Pkg-perl-cvs-commits mailing list