[libconfig-model-perl] 07/09: allow packager to use 'cme fix' instead of 'cme migrate'

dod at debian.org dod at debian.org
Fri Jan 17 18:03:50 UTC 2014


This is an automated email from the git hooks/post-receive script.

dod pushed a commit to branch master
in repository libconfig-model-perl.

commit 6f9b25b067d5c3c945d5c9947585023ad5c48ec1
Author: Dominique Dumont <dod at debian.org>
Date:   Sat Jan 11 17:55:41 2014 +0100

    allow packager to use 'cme fix' instead of 'cme migrate'
---
 debian/dh/dh_cme_upgrade | 9 ++++++++-
 debian/dh/postinst-cme   | 2 +-
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/debian/dh/dh_cme_upgrade b/debian/dh/dh_cme_upgrade
index 66f010d..310a984 100644
--- a/debian/dh/dh_cme_upgrade
+++ b/debian/dh/dh_cme_upgrade
@@ -48,7 +48,7 @@ unless (@do_packages) {
 }
 
 my @mandatory  = qw/cme-app-name cme-model-package/;
-my @legal_list = ( @mandatory, qw/cme-model-version cme-options cme-purge/ );
+my @legal_list = ( @mandatory, qw/cme-model-version cme-options cme-purge cme-command/ );
 my %legal      = map { ( $_ => 1 ) } @legal_list;
 
 # debian/config file: foo.config-model
@@ -92,9 +92,11 @@ foreach my $package (@do_packages) {
     addsubstvar( $package, 'misc:Depends', $dep );
 
     my $purge = $cm_config{'cme-purge'};
+    my $command = $cm_config{'cme-command'} || 'migrate' ;
     my $munge_sub = sub {
         s/%APPNAME%/$cm_config{'cme-app-name'}/g;
         s/%PACKAGE%/$package/g;
+        s/%COMMAND%/$command/g;
         no warnings 'uninitialized';
         s/%OPTION%/$cm_config{'cme-options'}/g;
         s/%PURGE%/$purge/g;
@@ -239,6 +241,11 @@ C<cme-app-name>. (mandatory)
 Specifies the minimal version of the package that provides the model.
 (optional)
 
+=item cme-command
+
+Specify the command passed to L<cme>. Defaults to C<migrate>. Another useful value is C<fix> which
+will migrate and fix the configuration file.
+
 =item cme-options
 
 Specify a list of options or command that will be passed verbatim to
diff --git a/debian/dh/postinst-cme b/debian/dh/postinst-cme
index 5f420a4..233477a 100644
--- a/debian/dh/postinst-cme
+++ b/debian/dh/postinst-cme
@@ -8,6 +8,6 @@ db_get  %PACKAGE%/auto-upgrade-config
 # testing perl is required to avoid problem in embedded environments
 if [ "$RET" = true ] && [ -x "/usr/bin/perl" ] && [ -x "/usr/bin/cme" ] 
 then
-	cme migrate %APPNAME% -create -backup dpkg-old -try-app-as-model %OPTION% || \
+	cme %COMMAND% %APPNAME% -create -backup dpkg-old -try-app-as-model %OPTION% || \
 	echo "WARNING: upgrade with cme failed: Run 'sudo cme migrate %APPNAME% %OPTION%'."
 fi

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libconfig-model-perl.git



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