public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Gwyn Ciesla <gwync@protonmail.com>
To: git-commits@fedoraproject.org
Subject: [rpms/duplicity] epel10: Patch for python error.
Date: Fri, 09 Oct 2026 15:24:33 GMT	[thread overview]
Message-ID: <179155947347.1.2329513766491222103.rpms-duplicity-4eb9bc77b116@fedoraproject.org> (raw)

A new commit has been pushed.

Repo   : rpms/duplicity
Branch : epel10
Commit : 4eb9bc77b11691b06c088eeb647fdca2f3aa7ab3
Author : Gwyn Ciesla <gwync@protonmail.com>
Date   : 2020-09-23T10:09:36-05:00
Stats  : +60/-3 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/duplicity/c/4eb9bc77b11691b06c088eeb647fdca2f3aa7ab3?branch=epel10

Log:
Patch for python error.

---
diff --git a/duplicity.spec b/duplicity.spec
index 26f4534..bc50f4d 100644
--- a/duplicity.spec
+++ b/duplicity.spec
@@ -3,11 +3,12 @@
 Summary:        Encrypted bandwidth-efficient backup using rsync algorithm
 Name:           duplicity
 Version:        0.8.15
-Release:        4%{?dist}
+Release:        5%{?dist}
 License:        GPLv2+
 URL:            http://www.nongnu.org/duplicity/
 Source:         https://launchpad.net/duplicity/0.8-series/%{version}/+download/duplicity-%{version}.tar.gz
-Patch:          278270b730302a4e8f04976aa8013d2babc00530.diff
+Patch0:         278270b730302a4e8f04976aa8013d2babc00530.diff
+Patch1:         f6809e8a4e09b70138a0902434d8c88d3c4c8ccb.patch
 Requires:	python3-lockfile
 Requires:	gnupg >= 1.0.6
 Requires:       rsync
@@ -41,7 +42,8 @@ but not hard links.
 
 %prep
 %setup -q
-%patch -p1
+%patch0 -p1
+%patch1 -p1
 
 %build
 %{__python3} setup.py build
@@ -80,6 +82,9 @@ rm -rf    %{buildroot}%{_prefix}/share/doc/duplicity-%{version}/tarfile-LICENSE
 %{_sysconfdir}/%{name}/cacert.pem
 
 %changelog
+* Wed Sep 23 2020 Gwyn Ciesla <gwync@protonmail.com> - 0.8.15-5
+- Patch: Avoid calling stat when checking for exclude-if-present files
+
 * Wed Sep 16 2020 Kalev Lember <klember@redhat.com> - 0.8.15-4
 - Avoid hardcoding /usr prefix
 

diff --git a/f6809e8a4e09b70138a0902434d8c88d3c4c8ccb.patch b/f6809e8a4e09b70138a0902434d8c88d3c4c8ccb.patch
new file mode 100644
index 0000000..b491a44
--- /dev/null
+++ b/f6809e8a4e09b70138a0902434d8c88d3c4c8ccb.patch
@@ -0,0 +1,52 @@
+From f6809e8a4e09b70138a0902434d8c88d3c4c8ccb Mon Sep 17 00:00:00 2001
+From: Michael Terry <mike@mterry.name>
+Date: Sun, 2 Aug 2020 18:42:50 -0400
+Subject: [PATCH] Avoid calling stat when checking for exclude-if-present files
+
+If a folder with rw- permissions (i.e. read and write, but no exec)
+is examined for the presence of an exclude-if-present file, we would
+previously throw an exception when trying to stat the file during
+Path object construction.
+
+But we don't need to stat in this case. This patch just calls
+listdir() and checks if the file is in that result.
+---
+ duplicity/path.py      | 8 ++++++++
+ duplicity/selection.py | 2 +-
+ 2 files changed, 9 insertions(+), 1 deletion(-)
+
+diff --git a/duplicity/path.py b/duplicity/path.py
+index deaac8c3..64d31a05 100644
+--- a/duplicity/path.py
++++ b/duplicity/path.py
+@@ -578,6 +578,14 @@ class Path(ROPath):
+         u"""Return true if path is a directory and is empty"""
+         return self.isdir() and not self.listdir()
+ 
++    def contains(self, child):
++        u"""Return true if path is a directory and contains child"""
++        if isinstance(child, u"".__class__):
++            child = util.fsencode(child)
++        # We don't use append(child).exists() here because that requires exec
++        # permissions as well as read. listdir() just needs read permissions.
++        return self.isdir() and child in self.listdir()
++
+     def open(self, mode=u"rb"):
+         u"""
+         Return fileobj associated with self
+diff --git a/duplicity/selection.py b/duplicity/selection.py
+index fea8f7fe..fb8a34ad 100644
+--- a/duplicity/selection.py
++++ b/duplicity/selection.py
+@@ -453,7 +453,7 @@ probably isn't what you meant.""") %
+                         log.WarningCode.cannot_read, util.escape(path.uc_name))
+                     if diffdir.stats:
+                         diffdir.stats.Errors += 1
+-                elif path.append(filename).exists():
++                elif path.contains(filename):
+                     return 0
+                 else:
+                     return None
+-- 
+GitLab
+

                 reply	other threads:[~2026-10-09 15:24 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179155947347.1.2329513766491222103.rpms-duplicity-4eb9bc77b116@fedoraproject.org \
    --to=gwync@protonmail.com \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox