[arch-commits] Commit in backuppc/trunk (2 files)

Sébastien Luttringer seblu at archlinux.org
Sun Mar 12 14:21:21 UTC 2017


    Date: Sunday, March 12, 2017 @ 14:21:20
  Author: seblu
Revision: 215789

upgpkg: backuppc 4.0.0-3

- https://github.com/backuppc/backuppc/issues/56

Added:
  backuppc/trunk/0001-more-robust-checking-that-IO-Dirent-works.-Matches-s.patch
Modified:
  backuppc/trunk/PKGBUILD

-----------------------------------------------------------------+
 0001-more-robust-checking-that-IO-Dirent-works.-Matches-s.patch |   71 ++++++++++
 PKGBUILD                                                        |    8 -
 2 files changed, 76 insertions(+), 3 deletions(-)

Added: 0001-more-robust-checking-that-IO-Dirent-works.-Matches-s.patch
===================================================================
--- 0001-more-robust-checking-that-IO-Dirent-works.-Matches-s.patch	                        (rev 0)
+++ 0001-more-robust-checking-that-IO-Dirent-works.-Matches-s.patch	2017-03-12 14:21:20 UTC (rev 215789)
@@ -0,0 +1,71 @@
+From a5bf0f262d5b8854e614de6e2252d5cedbd86d4a Mon Sep 17 00:00:00 2001
+From: Craig Barratt <craigb at gmail.com>
+Date: Fri, 10 Mar 2017 15:18:39 -0800
+Subject: [PATCH] more robust checking that IO::Dirent works.  Matches similar
+ changes to 3.x that didn't make it into 4.x.  Fixes issue #56.
+
+---
+ ChangeLog              | 11 +++++++++++
+ lib/BackupPC/DirOps.pm | 31 ++++++++++++++++++++++++-------
+ 2 files changed, 35 insertions(+), 7 deletions(-)
+
+diff --git a/lib/BackupPC/DirOps.pm b/lib/BackupPC/DirOps.pm
+index 6d713c1..4e04f87 100644
+--- a/lib/BackupPC/DirOps.pm
++++ b/lib/BackupPC/DirOps.pm
+@@ -67,7 +67,7 @@ require DynaLoader;
+ %EXPORT_TAGS = ('BPC_DT_ALL' => [@EXPORT, @EXPORT_OK]);
+ 
+ BEGIN {
+-    eval "use IO::Dirent qw( readdirent DT_DIR );";
++    eval "use IO::Dirent qw( readdirent );";
+     $IODirentLoaded = 1 if ( !$@ );
+ };
+ 
+@@ -114,21 +114,38 @@ sub dirRead
+         #
+         # Make sure the IO::Dirent really works - some installs
+         # on certain file systems (eg: XFS) don't return a valid type.
++        # and some fail to return valid inode numbers.
+         #
++        # Also create a temporary file to make sure the inode matches.
++        #
++        my $tempTestFile = ".TestFileDirent.$$";
++        my $fullTempTestFile = $bpc->{TopDir} . "/$tempTestFile";
++        if ( open(my $fh, ">", $fullTempTestFile) ) {
++            close($fh);
++        }
+         if ( opendir(my $fh, $bpc->{TopDir}) ) {
+-            my $dt_dir = eval("DT_DIR");
+             foreach my $e ( readdirent($fh) ) {
+-                if ( $e->{name} eq "." && $e->{type} == $dt_dir ) {
+-                    $IODirentOk = 1;
+-                    last;
++                if ( $e->{name} eq "."
++                        && $e->{type} == BPC_DT_DIR
++                        && $e->{inode} == (stat($bpc->{TopDir}))[1] ) {
++                    $IODirentOk |= 0x1;
++                }
++                if ( $e->{name} eq $tempTestFile
++                        && $e->{type} == BPC_DT_REG
++                        && $e->{inode} == (stat($fullTempTestFile))[1] ) {
++                    $IODirentOk |= 0x2;
+                 }
+             }
+             closedir($fh);
+         }
++        unlink($fullTempTestFile) if ( -f $fullTempTestFile );
+         #
+         # if it isn't ok then don't check again.
+         #
+-        $IODirentLoaded = 0 if ( !$IODirentOk );
++        if ( $IODirentOk != 0x3 ) {
++            $IODirentLoaded = 0;
++            $IODirentOk     = 0;
++        }
+     }
+     if ( $IODirentOk ) {
+         @entries = sort({ $a->{inode} <=> $b->{inode} } readdirent($fh));
+-- 
+2.12.0
+

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2017-03-12 14:15:37 UTC (rev 215788)
+++ PKGBUILD	2017-03-12 14:21:20 UTC (rev 215789)
@@ -5,7 +5,7 @@
 pkgver=4.0.0
 _xsver=0.52
 _rbpcver=3.0.9.5
-pkgrel=2
+pkgrel=3
 pkgdesc='Enterprise-grade system for backing up Linux, Windows and MacOS PCs'
 url='https://github.com/backuppc/backuppc/'
 license=('GPL2')
@@ -25,7 +25,8 @@
         "$pkgname.tmpfiles"
         "$pkgname.profile.sh"
         "$pkgname.profile.csh"
-        "$pkgname.httpd")
+        "$pkgname.httpd"
+        '0001-more-robust-checking-that-IO-Dirent-works.-Matches-s.patch')
 install=$pkgname.install
 backup=("etc/$pkgname/config.pl"
         "etc/$pkgname/hosts"
@@ -39,7 +40,8 @@
          'bda3ec3f4c75521c6869279eb16af2f8'
          '67a939aa63740c52d12bbdca72d37891'
          'ef09e4dae5b4197998f5c3a74e0ec86d'
-         '99e641c4f3ba4fbcc53e046ce7290ad5')
+         '99e641c4f3ba4fbcc53e046ce7290ad5'
+         '5b7cd4e425b6fb2c9a5b3b56eb313d5b')
 
 prepare() {
   cd BackupPC-$pkgver



More information about the arch-commits mailing list