[vdr] 03/06: Dropped the automatic migration of the old vdr and plugin config settings and added a note to NEWS.
Tobias Grimm
tiber-guest at moszumanska.debian.org
Sun Sep 20 20:44:53 UTC 2015
This is an automated email from the git hooks/post-receive script.
tiber-guest pushed a commit to annotated tag debian/2.2.0-2_etobi4
in repository vdr.
commit 5d26d1b32239810102863f4a989c7e2dde4c5715
Author: etobi <git at e-tobi.net>
Date: Sun Sep 20 19:30:33 2015 +0200
Dropped the automatic migration of the old vdr and plugin config settings and added a note to NEWS.
This is required because of policy 10.7.3 forbidding the modification of conffiles.
---
debian/dh-addon-vdrplugin/dh_vdrplugin_migrate | 92 ----------------------
.../dh-addon-vdrplugin/postinst-vdrplugin-migrate | 69 ----------------
debian/dh-addon-vdrplugin/postrm-vdrplugin-migrate | 29 -------
.../dh-addon-vdrplugin/preinst-vdrplugin-migrate | 22 ------
debian/dh-addon-vdrplugin/vdrplugin.pm | 2 -
debian/vdr-dev.install | 1 -
debian/vdr.NEWS | 22 +++++-
debian/vdr.postinst | 4 -
8 files changed, 21 insertions(+), 220 deletions(-)
diff --git a/debian/dh-addon-vdrplugin/dh_vdrplugin_migrate b/debian/dh-addon-vdrplugin/dh_vdrplugin_migrate
deleted file mode 100755
index fba6836..0000000
--- a/debian/dh-addon-vdrplugin/dh_vdrplugin_migrate
+++ /dev/null
@@ -1,92 +0,0 @@
-#! /usr/bin/perl -w
-
-=head1 NAME
-
-dh_vdrplugin_migrate - migrates old config files to /etc/vdr/conf.avail
-
-=cut
-
-use strict;
-use Debian::Debhelper::Dh_Lib;
-use Scalar::Util qw(looks_like_number);
-
-=head1 SYNOPSIS
-
-B<dh_vdrplugin_migrate> [S<I<debhelper options>>]
-
-=head1 DESCRIPTION
-
-dh_vdrplugin_migrate is a debhelper program that is responsible for migrating
-the settings from the old config file /etc/vdr/plugins/plugin.*.conf to the
-new config file(s) in /etc/vdr/conf.avail.
-
-=head1 EXAMPLES
-
-dh_vdrplugin is usually called indirectly in a rules file via the dh command.
-
- %:
- dh --with vdrplugin $@
-
-It can also be called directly, prior to calling dh_gencontrol.
-
-=head1 CONFORMS TO
-
-Debian policy, version 3.8.1
-
-=cut
-
-init ();
-
-no locale;
-
-sub get_plugins_from_config {
- my ($config_file) = @_;
- my @plugins;
- open(my $conf, '<', $config_file);
- while(<$conf>) {
- if ($_ =~ /^\[(.+)\]/) {
- push(@plugins, $1);
- }
- }
- close($conf);
- return @plugins;
-}
-
-sub get_plugins_from_lib_dir {
- my ($package_dir) = @_;
- return map { $_ =~ /libvdr-(.+?)\./ && $1 } <$package_dir/usr/lib/vdr/plugins/libvdr-*.so.*>;
-}
-
-foreach my $package (@{$dh{DOPACKAGES}}) {
- my $package_dir=tmpdir($package);
-
- my @old_configs;
- my @old_new_config_pairs;
- foreach my $config_file (<$package_dir/etc/vdr/conf.avail/*.conf>) {
- my @plugins = get_plugins_from_config($config_file);
- foreach my $plugin (@plugins) {
- push(@old_configs, "/etc/vdr/plugins/plugin.$plugin.conf");
- push(@old_new_config_pairs, "/etc/vdr/plugins/plugin.$plugin.conf " . "/etc/vdr/conf.avail/" . basename($config_file));
- }
- }
- if (@old_new_config_pairs) {
- my $oldconfigs = join(' ', @old_configs);
- autoscript($package, "preinst", "preinst-vdrplugin-migrate", "s|#PKGNAME#|$package|; s|#OLDCONFIGS#|$oldconfigs|");
- autoscript($package, "postrm", "postrm-vdrplugin-migrate", "s|#OLDCONFIGS#|$oldconfigs|");
-
- my $configs = join(' ', @old_new_config_pairs);
- autoscript($package, "postinst", "postinst-vdrplugin-migrate", "s|#CONFIGS#|$configs|");
- }
-}
-
-=head1 SEE ALSO
-
-L<debhelper(7)>
-
-This program is not a part of debhelper.
-
-=head1 AUTHOR
-
-Tobias Grimm <tobias.grimm at e-tobi.net>
-
-=cut
diff --git a/debian/dh-addon-vdrplugin/postinst-vdrplugin-migrate b/debian/dh-addon-vdrplugin/postinst-vdrplugin-migrate
deleted file mode 100644
index 389e934..0000000
--- a/debian/dh-addon-vdrplugin/postinst-vdrplugin-migrate
+++ /dev/null
@@ -1,69 +0,0 @@
-#
-# Update new config in /etc/vdr/conf.avail with the settings from the old config
-# /etc/vdr/plugins/plugin.*.conf.
-#
-dh_vdrplugin_migrate_config() {
- perl -e '
- use warnings;
- use strict;
-
- my ($originalConfig, $newConfig, $tmpConfig) = @ARGV;
-
- open(my $originalConfigFile , "<" , $originalConfig);
- open(my $newConfigFile , "<" , $newConfig);
- open(my $modifiedConfigFile , ">" , "$tmpConfig");
-
- my %options = ();
- while(<$originalConfigFile>) {
- if ( $_ =~ /^(\s*-.+?)[\s=]/ ) {
- $options{$1}=$_;
- }
- }
-
- my @updatedOptions;
-
- # Update options in new config with values from old one
- while(<$newConfigFile>) {
- my $line = $_;
- while (my ($key, $value) = each(%options)) {
- if ($line =~ /^$key/) {
- $line = $value;
- push(@updatedOptions,$key);
- }
- }
- print $modifiedConfigFile $line;
- }
-
- # Add additional values from old config to new one
- while (my ($key, $value) = each(%options)) {
- if (! grep {$_ eq $key} @updatedOptions) {
- print $modifiedConfigFile $value;
- }
- }
-
- close($originalConfigFile);
- close($newConfigFile);
- close($modifiedConfigFile);
- ' $@
-}
-
-dh_vdrplugin_migrate_configs() {
- while [ $# -gt 1 ] ; do
- local oldconfig="$1"
- local newconfig="$2"
- shift 2
- rm -f "$oldconfig.dpkg-remove"
- if [ -e "$oldconfig.dpkg-migrate" ]; then
- if [ -e "$newconfig" ] ; then
- mv "$newconfig" "$newconfig.dpkg-dist"
- dh_vdrplugin_migrate_config "$oldconfig.dpkg-migrate" "$newconfig.dpkg-dist" "$newconfig.tmp"
- mv -f "$newconfig.tmp" "$newconfig"
- fi
- mv "$oldconfig.dpkg-migrate" "$oldconfig.dpkg-bak"
- fi
- done
-}
-
-if [ "$1" = configure ]; then
- dh_vdrplugin_migrate_configs #CONFIGS#
-fi
diff --git a/debian/dh-addon-vdrplugin/postrm-vdrplugin-migrate b/debian/dh-addon-vdrplugin/postrm-vdrplugin-migrate
deleted file mode 100644
index 2afd86d..0000000
--- a/debian/dh-addon-vdrplugin/postrm-vdrplugin-migrate
+++ /dev/null
@@ -1,29 +0,0 @@
-dh_vdrplugin_restore_config() {
- while [ $# -gt 0 ] ; do
- local oldconfig="$1"
- shift
- if [ -e "$oldconfig.dpkg-remove" ] ; then
- mv "$oldconfig.dpkg-remove" "$oldconfig"
- fi
- if [ -e "$oldconfig.dpkg-migrate" ] ; then
- mv "$oldconfig.dpkg-migrate" "$oldconfig"
- end
- fi
- done
-}
-
-dh_vdrplugin_cleanup_config_backups() {
- while [ $# -gt 0 ] ; do
- rm -f "$1.dpkg-bak"
- shift
- done
-}
-
-case "$1" in
- abort-install|abort-upgrade)
- dh_vdrplugin_restore_config #OLDCONFIGS#
- ;;
- purge)
- dh_vdrplugin_cleanup_config_backups
- ;;
-esac
diff --git a/debian/dh-addon-vdrplugin/preinst-vdrplugin-migrate b/debian/dh-addon-vdrplugin/preinst-vdrplugin-migrate
deleted file mode 100644
index c37548e..0000000
--- a/debian/dh-addon-vdrplugin/preinst-vdrplugin-migrate
+++ /dev/null
@@ -1,22 +0,0 @@
-dh_vdrplugin_prep_migrate_config() {
- local pkgname="$1"
- shift
- while [ $# -gt 0 ] ; do
- local oldconfig="$1"
- shift
- if [ -e "$oldconfig" ] ; then
- local md5sum="$(md5sum $oldconfig | sed -e 's/ .*//')"
- local old_md5sum="$(dpkg-query -W -f='${Conffiles}' $pkgname | sed -n -e "\' $oldconfig ' { s/ obsolete$//; s/.* //; p }")"
- if [ "$md5sum" = "$old_md5sum" ]; then
- mv "$oldconfig" "$oldconfig.dpkg-remove"
- else
- mv "$oldconfig" "$oldconfig.dpkg-migrate"
- fi
- fi
- done
-}
-
-case "$1" in
- install|upgrade)
- dh_vdrplugin_prep_migrate_config #PKGNAME# #OLDCONFIGS#
-esac
diff --git a/debian/dh-addon-vdrplugin/vdrplugin.pm b/debian/dh-addon-vdrplugin/vdrplugin.pm
index c3a1d90..0ad5f6d 100644
--- a/debian/dh-addon-vdrplugin/vdrplugin.pm
+++ b/debian/dh-addon-vdrplugin/vdrplugin.pm
@@ -6,6 +6,4 @@ insert_after("dh_shlibdeps", "dh_vdrplugin_depends");
insert_after("dh_install", "dh_vdrplugin_enable");
-insert_after("dh_vdrplugin_enable", "dh_vdrplugin_migrate");
-
1
diff --git a/debian/vdr-dev.install b/debian/vdr-dev.install
index 1d0ea39..3ae7963 100644
--- a/debian/vdr-dev.install
+++ b/debian/vdr-dev.install
@@ -12,4 +12,3 @@ debian/dh-addon-vdrplugin/postinst-vdrplugin* usr/share/debhelper/autoscr
debian/dh-addon-vdrplugin/postrm-vdrplugin* usr/share/debhelper/autoscripts/
debian/dh-addon-vdrplugin/dh_vdrplugin_depends usr/bin/
debian/dh-addon-vdrplugin/dh_vdrplugin_enable usr/bin/
-debian/dh-addon-vdrplugin/dh_vdrplugin_migrate usr/bin/
diff --git a/debian/vdr.NEWS b/debian/vdr.NEWS
index 8ad263f..6163319 100644
--- a/debian/vdr.NEWS
+++ b/debian/vdr.NEWS
@@ -1,15 +1,35 @@
vdr (2.2.0-1) unstable; urgency=medium
+ * New VDR configuration file
+
+ All command line options are now configured in /etc/vdr/conf.d/00-vdr.conf.
+ The following config options formerly configured in /etc/default/vdr must
+ manually be moved to 00-vdr.conf:
+
+ VIDEO_DIR (--video), SVDRP_PORT (--port), USER (--user), LIRC (--lirc),
+ VFAT (--vfat), VDR_CHARSET_OVERRID (--chartab)
+
+ See man(1) vdr. You can also run the following command, which will try to
+ migrate these options automatically:
+
+ sh /usr/share/vdr/migrate-old-config.sh || true
+
* Now using /etc/vdr/conf.d for loading plugins
VDR plugin packages now install a config file to /etc/vdr/conf.avail/.
This is basically the same as the old config file
- /etc/vdr/plugins/plugin-<name>.conf and contains contains the command line
+ /etc/vdr/plugins/plugin-<name>.conf and contains the command line
arguments passed to the plugin.
By creating a symlink in /etc/vdr.conf.d/ which points to the config in
conf.avail/ the plugin gets enabled for loading when the vdr daemon is
started.
+ The changed settings from the old config are not automatically migrated to
+ the new config files. You have to do this manually. Basically you can simply
+ copy all options from /etc/vdr/plugins/plugin-<name>.conf to
+ /etc/vdr/conf.avail/<name>.conf. You just have to retain the [<name>] section
+ marker at the top of the new config file.
+
* Support for multiple video directories dropped
The code for distributing recordings over several video directories has been
diff --git a/debian/vdr.postinst b/debian/vdr.postinst
index 25de058..25c2d04 100644
--- a/debian/vdr.postinst
+++ b/debian/vdr.postinst
@@ -120,10 +120,6 @@ case "$1" in
InstallUserAndGroupVdr
ConfigureOwnerShip
-
- if [ -n "$2" ] && dpkg --compare-versions "$2" lt "2.2.0-1"; then
- sh /usr/share/vdr/migrate-old-config.sh || true
- fi
;;
abort-upgrade|abort-remove|abort-deconfigure)
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-vdr-dvb/vdr.git
More information about the pkg-vdr-dvb-changes
mailing list