From 1359364c05fec754568c637bf524b2148b9198a1 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Mon, 30 Oct 2023 16:46:57 +0100 Subject: [PATCH] Apply patch to configure.pl to fix incompatibility with Data::Dumper>2.182 --- Dockerfile | 4 ++++ files/datadumper.patch | 35 +++++++++++++++++++++++++++++++++++ files/entrypoint.sh | 4 ++++ 3 files changed, 43 insertions(+) create mode 100644 files/datadumper.patch diff --git a/Dockerfile b/Dockerfile index ee81e60..03e0321 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,6 +14,8 @@ ENV RSYNC_BPC_VERSION="${RSYNC_BPC_VERSION}" RUN apk --no-cache --update add \ rsync tar bash shadow ca-certificates \ supervisor \ + # TODO: Remove patch when appliance of datadumper.path is not needed anymore + patch \ perl perl-archive-zip perl-xml-rss perl-cgi perl-file-listing perl-json-xs \ expat samba-client iputils openssh openssl rrdtool ttf-dejavu \ msmtp lighttpd lighttpd-mod_auth apache2-utils tzdata libstdc++ libgomp \ @@ -50,6 +52,8 @@ COPY files/auth.conf /etc/lighttpd/auth.conf COPY files/auth-ldap.conf /etc/lighttpd/auth-ldap.conf COPY files/entrypoint.sh /entrypoint.sh COPY files/supervisord.conf /etc/supervisord.conf +# TODO: Remove when this patch is not applied anymore in entrypoint.sh +COPY files/datadumper.patch /datadumper.patch EXPOSE 8080 diff --git a/files/datadumper.patch b/files/datadumper.patch new file mode 100644 index 0000000..0034acf --- /dev/null +++ b/files/datadumper.patch @@ -0,0 +1,35 @@ +diff --git a/configure.pl b/configure.pl +index 6826ebc..d5deef5 100755 +--- a/configure.pl ++++ b/configure.pl +@@ -668,7 +668,7 @@ if ( defined($Conf{CgiUserConfigEdit}) ) { + if ( defined($Conf{CgiUserConfigEdit}{$p}) ); + } + $Conf{CgiUserConfigEdit} = $new; +- my $d = Data::Dumper->new([$new], [*value]); ++ my $d = Data::Dumper->new([$new]); + $d->Indent(1); + $d->Terse(1); + $d->Sortkeys(1); +diff --git a/lib/BackupPC/Storage/Text.pm b/lib/BackupPC/Storage/Text.pm +index e9df664..09fcb24 100644 +--- a/lib/BackupPC/Storage/Text.pm ++++ b/lib/BackupPC/Storage/Text.pm +@@ -422,7 +422,7 @@ sub ConfigFileMerge + my $var = $1; + $skipExpr = "\$fakeVar = $2\n"; + if ( exists($newConf->{$var}) ) { +- my $d = Data::Dumper->new([$newConf->{$var}], [*value]); ++ my $d = Data::Dumper->new([$newConf->{$var}]); + $d->Indent(1); + $d->Terse(1); + $d->Sortkeys(1); +@@ -454,7 +454,7 @@ sub ConfigFileMerge + # + foreach my $var ( sort(keys(%$newConf)) ) { + next if ( $done->{$var} ); +- my $d = Data::Dumper->new([$newConf->{$var}], [*value]); ++ my $d = Data::Dumper->new([$newConf->{$var}]); + $d->Indent(1); + $d->Terse(1); + $d->Sortkeys(1); diff --git a/files/entrypoint.sh b/files/entrypoint.sh index e9f5939..d20a55b 100755 --- a/files/entrypoint.sh +++ b/files/entrypoint.sh @@ -43,6 +43,10 @@ if [ -f /firstrun ]; then tar xf "BackupPC-$BACKUPPC_VERSION.tar.gz" cd "/root/BackupPC-$BACKUPPC_VERSION" + # Fix BackupPC code to make it run with Data::Dumper >= 2.182. + # TODO: Remove this patch once https://github.com/backuppc/backuppc/issues/466 has been merged in a new BackupPC release. + patch -p1 < /datadumper.patch && rm -f /datadumper.patch + # Configure WEB UI access configure_admin="" if [ ! -f /etc/backuppc/htpasswd ]; then