Bugzilla – Attachment 61798 Details for
Bug 18373
`make upgrade` is broken
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18373: Re-add UpgradeBackup.pm
Bug-18373-Re-add-UpgradeBackuppm.patch (text/plain), 3.51 KB, created by
Jonathan Druart
on 2017-04-03 15:55:02 UTC
(
hide
)
Description:
Bug 18373: Re-add UpgradeBackup.pm
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2017-04-03 15:55:02 UTC
Size:
3.51 KB
patch
obsolete
>From 2f34c391419dbb5894df7203ee754915d15fc49c Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 3 Apr 2017 12:50:27 -0300 >Subject: [PATCH] Bug 18373: Re-add UpgradeBackup.pm > >Bug 18028 removed the install_misc directory but >install_misc/UpgradeBackup.pm was still used by the 'upgrade' rule of >make. > >Other files from install_misc were useless to it may be better not to >reintroduce this directory with only 1 file. > >Test plan: >`make` >`sudo make install` >`make upgrade` >--- > C4/Installer/UpgradeBackup.pm | 94 +++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 94 insertions(+) > create mode 100644 C4/Installer/UpgradeBackup.pm > >diff --git a/C4/Installer/UpgradeBackup.pm b/C4/Installer/UpgradeBackup.pm >new file mode 100644 >index 0000000..99a187c >--- /dev/null >+++ b/C4/Installer/UpgradeBackup.pm >@@ -0,0 +1,94 @@ >+package C4::Installer::UpgradeBackup; >+ >+# Copyright (C) 2008 LibLime >+# >+# This file is part of Koha. >+# >+# Koha is free software; you can redistribute it and/or modify it >+# under the terms of the GNU General Public License as published by >+# the Free Software Foundation; either version 3 of the License, or >+# (at your option) any later version. >+# >+# Koha is distributed in the hope that it will be useful, but >+# WITHOUT ANY WARRANTY; without even the implied warranty of >+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >+# GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License >+# along with Koha; if not, see <http://www.gnu.org/licenses>. >+ >+use strict; >+#use warnings; FIXME - Bug 2505 >+use File::Compare qw(compare); >+use Cwd qw(cwd); >+use File::Copy; >+use File::Find; >+use File::Spec; >+use Exporter; >+ >+use vars qw(@ISA @EXPORT ); >+ >+@ISA = ('Exporter'); >+@EXPORT = ('backup_changed_files'); >+ >+=head1 NAME >+ >+C4::Installer::UpgradeBackup >+ >+=head1 DESCRIPTION >+ >+This is a helper module used during a 'make upgrade' that >+creates backups of files updated during an upgrade. >+ >+=cut >+ >+sub backup_changed_files { >+ my $from_to = shift; >+ my $suffix = shift; >+ my $verbose = shift; >+ my $inc_uninstall = shift; >+ >+ my $cwd = cwd(); >+ foreach my $sourceroot (sort keys %$from_to) { >+ my $targetroot = $from_to->{$sourceroot}; >+ my $currdir = File::Spec->catdir($cwd, $sourceroot); >+ >+ next unless -d $currdir; >+ >+ chdir $currdir or die "could not change to $currdir: $!"; >+ >+ # expand path >+ find(sub { >+ return unless -f $_; >+ my $filename = $_; >+ >+ my $targetdir = File::Spec->catdir($targetroot, $File::Find::dir); >+ my $targetfile = File::Spec->catfile($targetdir, $filename); >+ my $sourcedir = File::Spec->catdir($currdir, $File::Find::dir); >+ my $sourcefile = File::Spec->catfile($sourcedir, $filename); >+ >+ if (-f $targetfile) { >+ my ($size) = (stat $sourcefile)[7]; >+ my $backup = $targetfile . $suffix; >+ unless (-s $targetfile == $size and not compare($sourcefile, $targetfile)) { >+ print "Backed up $targetfile to $backup\n"; >+ File::Copy::copy($targetfile, $backup); >+ } >+ } >+ }, "."); >+ } >+} >+ >+=head1 AUTHOR >+ >+Code based on parts of ExtUtils::Install in order to >+approximately track how it identifies files to >+install. >+ >+Koha Development Team <http://koha-community.org/> >+ >+Galen Charlton <galen.charlton@liblime.com> >+ >+=cut >+ >+1; >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 18373
:
61798
|
61799
|
61840
|
62165