Skip to content

Commit

Permalink
Apply patch to configure.pl to fix incompatibility with Data::Dumper>…
Browse files Browse the repository at this point in the history
…2.182
  • Loading branch information
Adrien Ferrand committed Oct 30, 2023
1 parent 9a0afeb commit 1359364
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down Expand Up @@ -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

Expand Down
35 changes: 35 additions & 0 deletions files/datadumper.patch
Original file line number Diff line number Diff line change
@@ -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);
4 changes: 4 additions & 0 deletions files/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1359364

Please sign in to comment.