summary refs log tree commit diff
diff options
context:
space:
mode:
authorGuillaume Girol <symphorien@users.noreply.github.com>2021-07-19 19:11:46 +0000
committerGitHub <noreply@github.com>2021-07-19 19:11:46 +0000
commit15f88843905ba344fac89cac17f9d9e5fda63731 (patch)
treef56f8caedc1f668ec3b7ee609d9e314de49da62e
parent23462c694156c5f9f28b44545d1445263c5b7241 (diff)
parent2060a251fe29bc7d3015872880ad48dce6313706 (diff)
downloadnixpkgs-15f88843905ba344fac89cac17f9d9e5fda63731.tar
nixpkgs-15f88843905ba344fac89cac17f9d9e5fda63731.tar.gz
nixpkgs-15f88843905ba344fac89cac17f9d9e5fda63731.tar.bz2
nixpkgs-15f88843905ba344fac89cac17f9d9e5fda63731.tar.lz
nixpkgs-15f88843905ba344fac89cac17f9d9e5fda63731.tar.xz
nixpkgs-15f88843905ba344fac89cac17f9d9e5fda63731.tar.zst
nixpkgs-15f88843905ba344fac89cac17f9d9e5fda63731.zip
Merge pull request #129957 from symphorien/duplicity-udpte
duplicity: 0.8.17 -> 0.8.20
-rw-r--r--pkgs/tools/backup/duplicity/default.nix33
-rw-r--r--pkgs/tools/backup/duplicity/gnutar-in-test.patch10
-rw-r--r--pkgs/tools/backup/duplicity/linux-disable-timezone-test.patch14
-rw-r--r--pkgs/tools/backup/duplicity/use-installed-scripts-in-test.patch44
4 files changed, 72 insertions, 29 deletions
diff --git a/pkgs/tools/backup/duplicity/default.nix b/pkgs/tools/backup/duplicity/default.nix
index 24e1a2954ed..74b80a51524 100644
--- a/pkgs/tools/backup/duplicity/default.nix
+++ b/pkgs/tools/backup/duplicity/default.nix
@@ -1,5 +1,6 @@
 { lib, stdenv
-, fetchurl
+, fetchFromGitLab
+, fetchpatch
 , pythonPackages
 , librsync
 , ncftp
@@ -17,11 +18,13 @@ let
 in
 pythonPackages.buildPythonApplication rec {
   pname = "duplicity";
-  version = "0.8.17";
+  version = "0.8.20";
 
-  src = fetchurl {
-    url = "https://code.launchpad.net/duplicity/${majorMinor version}-series/${majorMinorPatch version}/+download/duplicity-${version}.tar.gz";
-    sha256 = "114rwkf9b3h4fcagrx013sb7krc4hafbwl9gawjph2wd9pkv2wx2";
+  src = fetchFromGitLab {
+    owner = "duplicity";
+    repo = "duplicity";
+    rev = "rel.${version}";
+    sha256 = "13ghra0myq6h6yx8qli55bh8dg91nf1hpd8l7d7xamgrw6b188sm";
   };
 
   patches = [
@@ -31,6 +34,13 @@ pythonPackages.buildPythonApplication rec {
     # Our Python infrastructure runs test in installCheckPhase so we need
     # to make the testing code stop assuming it is run from the source directory.
     ./use-installed-scripts-in-test.patch
+
+    # https://gitlab.com/duplicity/duplicity/-/merge_requests/64
+    # remove on next release
+    (fetchpatch {
+      url = "https://gitlab.com/duplicity/duplicity/-/commit/5c229a9b42f67257c747fbc0022c698fec405bbc.patch";
+      sha256 = "05v931rnawfv11cyxj8gykmal8rj5vq2ksdysyr2mb4sl81mi7v0";
+    })
   ] ++ lib.optionals stdenv.isLinux [
     # Broken on Linux in Nix' build environment
     ./linux-disable-timezone-test.patch
@@ -38,6 +48,15 @@ pythonPackages.buildPythonApplication rec {
 
   SETUPTOOLS_SCM_PRETEND_VERSION = version;
 
+  preConfigure = ''
+    # fix version displayed by duplicity --version
+    # see SourceCopy in setup.py
+    ls
+    for i in bin/*.1 duplicity/__init__.py; do
+      substituteInPlace "$i" --replace '$version' "${version}"
+    done
+  '';
+
   nativeBuildInputs = [
     makeWrapper
     gettext
@@ -50,7 +69,6 @@ pythonPackages.buildPythonApplication rec {
 
   pythonPath = with pythonPackages; [
     b2sdk
-    boto
     boto3
     cffi
     cryptography
@@ -102,6 +120,9 @@ pythonPackages.buildPythonApplication rec {
 
     # Don't run developer-only checks (pep8, etc.).
     export RUN_CODE_TESTS=0
+
+    # check version string
+    duplicity --version | grep ${version}
   '' + lib.optionalString stdenv.isDarwin ''
     # Work around the following error when running tests:
     # > Max open files of 256 is too low, should be >= 1024.
diff --git a/pkgs/tools/backup/duplicity/gnutar-in-test.patch b/pkgs/tools/backup/duplicity/gnutar-in-test.patch
index 694fc881950..ee95b68e2ab 100644
--- a/pkgs/tools/backup/duplicity/gnutar-in-test.patch
+++ b/pkgs/tools/backup/duplicity/gnutar-in-test.patch
@@ -1,9 +1,11 @@
+diff --git a/testing/functional/test_restart.py b/testing/functional/test_restart.py
+index 6d972c82..e8435fd5 100644
 --- a/testing/functional/test_restart.py
 +++ b/testing/functional/test_restart.py
-@@ -323,14 +323,7 @@ class RestartTestWithoutEncryption(RestartTest):
+@@ -350,14 +350,7 @@ class RestartTestWithoutEncryption(RestartTest):
          https://launchpad.net/bugs/929067
          """
-
+ 
 -        if platform.system().startswith(u'Linux'):
 -            tarcmd = u"tar"
 -        elif platform.system().startswith(u'Darwin'):
@@ -13,6 +15,6 @@
 -        else:
 -            raise Exception(u"Platform %s not supported by tar/gtar." % platform.platform())
 +        tarcmd = u"tar"
-
+ 
          # Intial normal backup
-         self.backup("full", "testfiles/blocktartest")
+         self.backup(u"full", u"{0}/testfiles/blocktartest".format(_runtest_dir))
diff --git a/pkgs/tools/backup/duplicity/linux-disable-timezone-test.patch b/pkgs/tools/backup/duplicity/linux-disable-timezone-test.patch
index b5e6df18a15..e322625cdbf 100644
--- a/pkgs/tools/backup/duplicity/linux-disable-timezone-test.patch
+++ b/pkgs/tools/backup/duplicity/linux-disable-timezone-test.patch
@@ -1,10 +1,16 @@
+commit f0142706c377b7c133753db57b5c4c90baa2de30
+Author: Guillaume Girol <symphorien+git@xlumurb.eu>
+Date:   Sun Jul 11 17:48:15 2021 +0200
+
+diff --git a/testing/unit/test_statistics.py b/testing/unit/test_statistics.py
+index 4be5000c..80545853 100644
 --- a/testing/unit/test_statistics.py
 +++ b/testing/unit/test_statistics.py
-@@ -59,6 +59,7 @@ class StatsObjTest(UnitTestCase):
+@@ -63,6 +63,7 @@ class StatsObjTest(UnitTestCase):
          s1 = StatsDeltaProcess()
-         assert s1.get_stat('SourceFiles') == 0
-
+         assert s1.get_stat(u'SourceFiles') == 0
+ 
 +    @unittest.skip("Broken on Linux in Nix' build environment")
      def test_get_stats_string(self):
-         """Test conversion of stat object into string"""
+         u"""Test conversion of stat object into string"""
          s = StatsObj()
diff --git a/pkgs/tools/backup/duplicity/use-installed-scripts-in-test.patch b/pkgs/tools/backup/duplicity/use-installed-scripts-in-test.patch
index c02527cf394..a5ddc4381bd 100644
--- a/pkgs/tools/backup/duplicity/use-installed-scripts-in-test.patch
+++ b/pkgs/tools/backup/duplicity/use-installed-scripts-in-test.patch
@@ -1,48 +1,62 @@
+commit ccd4dd92cd37acce1da20966ad9e4e0c7bcf1709
+Author: Guillaume Girol <symphorien+git@xlumurb.eu>
+Date:   Sun Jul 11 12:00:00 2021 +0000
+
+    use installed duplicity when running tests
+
+diff --git a/setup.py b/setup.py
+index fa474f20..604a242a 100755
 --- a/setup.py
 +++ b/setup.py
-@@ -92,10 +92,6 @@ class TestCommand(test):
+@@ -205,10 +205,6 @@ class TestCommand(test):
                  except Exception:
                      pass
-
+ 
 -        os.environ[u'PATH'] = u"%s:%s" % (
 -            os.path.abspath(build_scripts_cmd.build_dir),
 -            os.environ.get(u'PATH'))
 -
          test.run(self)
-
-     def run_tests(self):
+ 
+ 
+diff --git a/testing/functional/__init__.py b/testing/functional/__init__.py
+index 4221576d..3cf44945 100644
 --- a/testing/functional/__init__.py
 +++ b/testing/functional/__init__.py
-@@ -107,7 +107,7 @@ class FunctionalTestCase(DuplicityTestCase):
-         if basepython is not None:
-             cmd_list.extend([basepython])
+@@ -111,7 +111,7 @@ class FunctionalTestCase(DuplicityTestCase):
+         run_coverage = os.environ.get(u'RUN_COVERAGE', None)
+         if run_coverage is not None:
              cmd_list.extend([u"-m", u"coverage", u"run", u"--source=duplicity", u"-p"])
--        cmd_list.extend([u"../bin/duplicity"])
+-        cmd_list.extend([u"{0}/bin/duplicity".format(_top_dir)])
 +        cmd_list.extend([u"duplicity"])
          cmd_list.extend(options)
          cmd_list.extend([u"-v0"])
          cmd_list.extend([u"--no-print-statistics"])
+diff --git a/testing/functional/test_log.py b/testing/functional/test_log.py
+index 9dfc86a6..b9cb55db 100644
 --- a/testing/functional/test_log.py
 +++ b/testing/functional/test_log.py
-@@ -47,9 +47,9 @@ class LogTest(FunctionalTestCase):
+@@ -49,9 +49,9 @@ class LogTest(FunctionalTestCase):
          # Run actual duplicity command (will fail, because no arguments passed)
          basepython = os.environ.get(u'TOXPYTHON', None)
          if basepython is not None:
--            os.system(u"{} ../bin/duplicity --log-file={} >/dev/null 2>&1".format(basepython, self.logfile))
-+            os.system(u"{} duplicity --log-file={} >/dev/null 2>&1".format(basepython, self.logfile))
+-            os.system(u"{0} {1}/bin/duplicity --log-file={2} >/dev/null 2>&1".format(basepython, _top_dir, self.logfile))
++            os.system(u"{0} duplicity --log-file={1} >/dev/null 2>&1".format(basepython, self.logfile))
          else:
--            os.system(u"../bin/duplicity --log-file={} >/dev/null 2>&1".format(self.logfile))
-+            os.system(u"duplicity --log-file={} >/dev/null 2>&1".format(self.logfile))
+-            os.system(u"{0}/bin/duplicity --log-file={1} >/dev/null 2>&1".format(_top_dir, self.logfile))
++            os.system(u"duplicity --log-file={0} >/dev/null 2>&1".format(self.logfile))
  
          # The format of the file should be:
          # """ERROR 2
+diff --git a/testing/functional/test_rdiffdir.py b/testing/functional/test_rdiffdir.py
+index 0cbfdb33..47acd029 100644
 --- a/testing/functional/test_rdiffdir.py
 +++ b/testing/functional/test_rdiffdir.py
-@@ -42,7 +42,7 @@ class RdiffdirTest(FunctionalTestCase):
+@@ -44,7 +44,7 @@ class RdiffdirTest(FunctionalTestCase):
          basepython = os.environ.get(u'TOXPYTHON', None)
          if basepython is not None:
              cmd_list.extend([basepython])
--        cmd_list.extend([u"../bin/rdiffdir"])
+-        cmd_list.extend([u"{0}/bin/rdiffdir".format(_top_dir)])
 +        cmd_list.extend([u"rdiffdir"])
          cmd_list.extend(argstring.split())
          cmdline = u" ".join([u'"%s"' % x for x in cmd_list])