diff -Nru slbackup-0.0.12/debian/changelog slbackup-0.0.12/debian/changelog --- slbackup-0.0.12/debian/changelog 2020-02-23 14:24:31.000000000 +0000 +++ slbackup-0.0.12/debian/changelog 2020-03-29 11:42:52.000000000 +0000 @@ -1,3 +1,22 @@ +slbackup (0.0.12-13) unstable; urgency=medium + + [ Frans Spiesschaert ] + * postinst: create nested block in /etc/slbackup/slbackup.conf and provide + examples. Closes: Bug#955014. + + [ Holger Levsen ] + * d/control: + - drop Morten Werner Forsbring from uploaders, thanks for all your work on + Debian Edu, Werner! + - add myself to uploaders. + * Drop d/prerm from ancient /usr/doc migration times. + * Drop d/preinst needed pre-jessie. + * Drop dpkg-maintscript-helper calls from d/postinst and d/postrm needed + pre-jessie. + * Simplefy d/copyright. + + -- Holger Levsen Sun, 29 Mar 2020 13:42:52 +0200 + slbackup (0.0.12-12) unstable; urgency=medium * Team upload. diff -Nru slbackup-0.0.12/debian/control slbackup-0.0.12/debian/control --- slbackup-0.0.12/debian/control 2020-02-23 14:22:40.000000000 +0000 +++ slbackup-0.0.12/debian/control 2020-03-29 10:03:26.000000000 +0000 @@ -4,7 +4,7 @@ Maintainer: Debian Edu Packaging Team Uploaders: Mike Gabriel , - Morten Werner Forsbring , + Holger Levsen , Build-Depends: debhelper-compat (= 12), Build-Depends-Indep: diff -Nru slbackup-0.0.12/debian/copyright slbackup-0.0.12/debian/copyright --- slbackup-0.0.12/debian/copyright 2020-02-23 14:22:40.000000000 +0000 +++ slbackup-0.0.12/debian/copyright 2020-03-29 10:16:13.000000000 +0000 @@ -20,93 +20,51 @@ adopted from debian/copyright that was shipped until version 0.0.12-8 of this package. -Files: debian/changelog - debian/control - debian/copyright - debian/patches/001_use-getopt-std.patch - debian/patches/series - debian/po/POTFILES.in - debian/po/nb.po - debian/po/sv.po - debian/po/fr.po - debian/po/cs.po - debian/rules - debian/slbackup.config - debian/slbackup.dirs - debian/slbackup.docs - debian/slbackup.install - debian/slbackup.lintian-overrides - debian/slbackup.logrotate - debian/slbackup.postinst - debian/slbackup.postrm - debian/slbackup.preinst - debian/slbackup.prerm - debian/slbackup.templates - debian/source/format - debian/upstream/* - debian/watch -Copyright: 2003-2010, Morten Werner Forsbring - 2012-2018, Mike Gabriel -License: GPL-2 -Comment: - Applying license used for rest of the package files. - Files: debian/po/ja.po debian/po/ru.po debian/po/templates.pot Copyright: YEAR, THE PACKAGE'S COPYRIGHT HOLDER License: GPL-2 -Comment: - Applying license used for rest of the package files. Files: debian/po/vi.po Copyright: 1989, 1991, Free Software Foundation, Inc. 2010, Free Software Foundation, Inc. License: GPL-2 -Comment: - Applying license used for rest of the package files. Files: debian/po/nl.po debian/po/zh_CN.po Copyright: 2010, THE PACKAGE'S COPYRIGHT HOLDER 2011, THE PACKAGE'S COPYRIGHT HOLDER License: GPL-2 -Comment: - Applying license used for rest of the package files. Files: debian/po/it.po Copyright: 2012, Morten Werner Forsbring License: GPL-2 -Comment: - Applying license used for rest of the package files. Files: debian/po/es.po Copyright: 2010, Software in the Public Interest License: GPL-2 -Comment: - Applying license used for rest of the package files. Files: debian/po/pt_BR.po Copyright: 2016, THE slbackup'S COPYRIGHT HOLDER License: GPL-2 -Comment: - Applying license used for rest of the package files. Files: debian/po/pt.po Copyright: 2007, This file is distributed under the same license as the slbackup package. License: GPL-2 -Comment: - Applying license used for rest of the package files. Files: debian/po/da.po Copyright: 2010, slbackup & nedenstående oversættere. License: GPL-2 -Comment: - Applying license used for rest of the package files. Files: debian/po/de.po Copyright: 2007, Helge Kreutzmann License: GPL-2 + +Files: debian/* +Copyright: 2003-2010, Morten Werner Forsbring + 2012-2018, Mike Gabriel +License: GPL-2 Comment: Applying license used for rest of the package files. diff -Nru slbackup-0.0.12/debian/slbackup.postinst slbackup-0.0.12/debian/slbackup.postinst --- slbackup-0.0.12/debian/slbackup.postinst 2020-02-23 14:18:21.000000000 +0000 +++ slbackup-0.0.12/debian/slbackup.postinst 2020-03-29 11:15:40.000000000 +0000 @@ -17,6 +17,40 @@ my ($datafilename, $data) = @_; } +## prepare the introduction of some example configurations +my $example_conf = < +# address localhost +# location /etc +# location /home +# location /var/backups +# exclude /home/**/.local/share/Trash/** +# type local +# user root +# keep 185 +# +# +# address extern.domain +# location /etc +# location /var/backups +# type extern +# user root +# keep 50 +# +# +# address somehost.domain +# location / +# exclude /proc +# exclude /sys +# exclude /tmp +# exclude_regexp \.((?i)mpg|avi|mp3|mpeg|wma|wav)\$ +# type extern +# user root +# keep 30 +# +EOF + ## start postinst if ($ARGV[0] and $ARGV[0] eq "configure") { @@ -65,10 +99,26 @@ $config->{server_address} = $server_address; $config->{server_user} = $server_user; - # write configuration file - my $datafile = new Config::General(); - $datafile->save_file("/etc/slbackup/slbackup.conf", $config); - + # write configuration file + # we no longer do this directly, while since version 2.51 + # of General.pm a configuration that has only one block is written + # as a named block, while slbackup-php expects a nested block. + # So the following method has been commented out while we no longer use it. + # my $datafile = new Config::General(); + # $datafile->save_file("/etc/slbackup/slbackup.conf", $config); + + # Instead we now write the configuration into a variable, + # reshape within that variable the named block as a nested block + # and then write the content to file. + my $datahash = Config::General->new($config); + my $saved_string = $datahash->save_string(); + $saved_string =~ s{\n <}; + $saved_string =~ s{}{ \n$example_conf}; + # now it's ready to be written to file + my $configfilename = "/etc/slbackup/slbackup.conf"; + open(my $fh, '>', $configfilename) or die "Could not open $configfilename: $!"; + print $fh $saved_string; + close $fh; # check if file specifying cron-job exists and if the user wanted to # configure slbackup now, and make one the answers to both questions @@ -90,8 +140,6 @@ } -system("dpkg-maintscript-helper rm_conffile /etc/cron.daily/slbackup 0.0.12-3 -- \"".@ARGV."\""); - system(' #DEBHELPER# '); diff -Nru slbackup-0.0.12/debian/slbackup.postrm slbackup-0.0.12/debian/slbackup.postrm --- slbackup-0.0.12/debian/slbackup.postrm 2019-02-08 21:24:33.000000000 +0000 +++ slbackup-0.0.12/debian/slbackup.postrm 2020-03-29 11:19:50.000000000 +0000 @@ -30,8 +30,6 @@ ;; esac -dpkg-maintscript-helper rm_conffile /etc/cron.daily/slbackup 0.0.12-3 -- "$@" - #DEBHELPER# exit 0 diff -Nru slbackup-0.0.12/debian/slbackup.preinst slbackup-0.0.12/debian/slbackup.preinst --- slbackup-0.0.12/debian/slbackup.preinst 2019-02-08 21:24:33.000000000 +0000 +++ slbackup-0.0.12/debian/slbackup.preinst 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ -#!/bin/sh - -set -e - -dpkg-maintscript-helper rm_conffile /etc/cron.daily/slbackup 0.0.12-3 -- "$@" - -#DEBHELPER# - diff -Nru slbackup-0.0.12/debian/slbackup.prerm slbackup-0.0.12/debian/slbackup.prerm --- slbackup-0.0.12/debian/slbackup.prerm 2019-02-08 21:24:33.000000000 +0000 +++ slbackup-0.0.12/debian/slbackup.prerm 1970-01-01 00:00:00.000000000 +0000 @@ -1,16 +0,0 @@ -#!/bin/sh - -set -e - -# slbackup prerm script -# Modified by Morten Werner Olsen - -if [ "$1" = "upgrade" -o "$1" = "remove" ]; then - if [ -L /usr/doc/slbackup ]; then - rm -f /usr/doc/slbackup - fi -fi - -#DEBHELPER# - -exit 0