summary refs log tree commit diff
diff options
context:
space:
mode:
authorndowens <ndowens04@gmail.com>2017-03-02 19:44:17 -0600
committerRobert Helgesson <robert@rycee.net>2017-03-03 21:08:54 +0100
commit477014fd6a8c88efe314524d465b15c4379c7921 (patch)
treec4f7538c9c9735acc976570fe84653a159d58ac0
parent3d2e118a5554b620bf1c2fb2befaf9fae23a3e34 (diff)
downloadnixlib-477014fd6a8c88efe314524d465b15c4379c7921.tar
nixlib-477014fd6a8c88efe314524d465b15c4379c7921.tar.gz
nixlib-477014fd6a8c88efe314524d465b15c4379c7921.tar.bz2
nixlib-477014fd6a8c88efe314524d465b15c4379c7921.tar.lz
nixlib-477014fd6a8c88efe314524d465b15c4379c7921.tar.xz
nixlib-477014fd6a8c88efe314524d465b15c4379c7921.tar.zst
nixlib-477014fd6a8c88efe314524d465b15c4379c7921.zip
trash-cli: 0.12.9.14 -> 0.17.1.14
-rw-r--r--pkgs/tools/misc/trash-cli/default.nix24
-rw-r--r--pkgs/tools/misc/trash-cli/fix_should_output_info_for_multiple_files.patch60
-rw-r--r--pkgs/tools/misc/trash-cli/nix-paths.patch17
3 files changed, 12 insertions, 89 deletions
diff --git a/pkgs/tools/misc/trash-cli/default.nix b/pkgs/tools/misc/trash-cli/default.nix
index 2a4dae87e185..40fc72a0d713 100644
--- a/pkgs/tools/misc/trash-cli/default.nix
+++ b/pkgs/tools/misc/trash-cli/default.nix
@@ -1,33 +1,29 @@
-{ stdenv, fetchurl, substituteAll, coreutils, python2, python2Packages }:
+{ stdenv, fetchFromGitHub, coreutils
+, python3, python3Packages, substituteAll }:
 
 assert stdenv.isLinux;
 
-python2Packages.buildPythonApplication rec {
+python3Packages.buildPythonApplication rec {
   name = "trash-cli-${version}";
-  version = "0.12.9.14";
+  version = "0.17.1.14";
   namePrefix = "";
 
-  src = fetchurl {
-    url = "https://github.com/andreafrancia/trash-cli/archive/${version}.tar.gz";
-    sha256 = "10idvzrlppj632pw6mpk1zy9arn1x4lly4d8nfy9cz4zqv06lhvh";
+  src = fetchFromGitHub {
+    owner = "andreafrancia";
+    repo = "trash-cli";
+    rev = "${version}";
+    sha256 = "1bqazna223ibqjwbc1wfvfnspfyrvjy8347qlrgv4cpng72n7gfi";
   };
 
-
   patches = [
-    # Fix paths.
     (substituteAll {
       src = ./nix-paths.patch;
       df = "${coreutils}/bin/df";
-      python = "${python2}/bin/${python2.executable}";
       libc = "${stdenv.cc.libc.out}/lib/libc.so.6";
     })
-
-    # Apply https://github.com/JaviMerino/trash-cli/commit/4f45a37a3
-    # to fix failing test case.
-    ./fix_should_output_info_for_multiple_files.patch
   ];
 
-  buildInputs = with python2Packages; [ nose mock ];
+  buildInputs = with python3Packages; [ nose mock ];
 
   checkPhase = "nosetests";
 
diff --git a/pkgs/tools/misc/trash-cli/fix_should_output_info_for_multiple_files.patch b/pkgs/tools/misc/trash-cli/fix_should_output_info_for_multiple_files.patch
deleted file mode 100644
index 17947be74824..000000000000
--- a/pkgs/tools/misc/trash-cli/fix_should_output_info_for_multiple_files.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 4f45a37a390d7c844dd9c9b58fff7259a77ffff9 Mon Sep 17 00:00:00 2001
-From: Javi Merino <merino.jav@gmail.com>
-Date: Sun, 31 Aug 2014 05:45:17 -0700
-Subject: [PATCH] Fix should_output_info_for_multiple_files
-
-Test should_output_info_for_multiple_files fails because the output is
-not in the same order as the input.  Add assert_equal_any_order() to
-the OutputCollector, which sorts the expected and actual lines so that
-the output matches even if the order in which they are shown in
-trash-list is different.
----
- integration_tests/describe_trash_list.py | 8 +++++---
- integration_tests/output_collector.py    | 8 ++++++++
- 2 files changed, 13 insertions(+), 3 deletions(-)
-
-diff --git a/integration_tests/describe_trash_list.py b/integration_tests/describe_trash_list.py
-index 6dd8d30..3489a22 100644
---- a/integration_tests/describe_trash_list.py
-+++ b/integration_tests/describe_trash_list.py
-@@ -73,9 +73,9 @@ def should_output_info_for_multiple_files(self):
- 
-         self.user.run_trash_list()
- 
--        self.user.should_read_output( "2000-01-01 00:00:01 /file1\n"
--                                      "2000-01-01 00:00:02 /file2\n"
--                                      "2000-01-01 00:00:03 /file3\n")
-+        self.user.should_read_output_any_order( "2000-01-01 00:00:01 /file1\n"
-+                                                "2000-01-01 00:00:02 /file2\n"
-+                                                "2000-01-01 00:00:03 /file3\n")
- 
-     @istest
-     def should_output_unknown_dates_with_question_marks(self):
-@@ -294,6 +294,8 @@ def error(self):
-         raise ValueError()
-     def should_read_output(self, expected_value):
-         self.stdout.assert_equal_to(expected_value)
-+    def should_read_output_any_order(self, expected_value):
-+        self.stdout.assert_equal_any_order(expected_value)
-     def should_read_error(self, expected_value):
-         self.stderr.assert_equal_to(expected_value)
-     def output(self):
-diff --git a/integration_tests/output_collector.py b/integration_tests/output_collector.py
-index 06dc002..7f3704f 100644
---- a/integration_tests/output_collector.py
-+++ b/integration_tests/output_collector.py
-@@ -9,6 +9,14 @@ def write(self,data):
-         self.stream.write(data)
-     def assert_equal_to(self, expected):
-         return self.should_be(expected)
-+    def assert_equal_any_order(self, expected):
-+        actual_sorted = sorted(self.stream.getvalue().splitlines(1))
-+        actual = "".join(actual_sorted)
-+
-+        expected_sorted = sorted(expected.splitlines(1))
-+        expected = "".join(expected_sorted)
-+
-+        assert_equals_with_unidiff(expected, actual)
-     def should_be(self, expected):
-         assert_equals_with_unidiff(expected, self.stream.getvalue())
-     def should_match(self, regex):
diff --git a/pkgs/tools/misc/trash-cli/nix-paths.patch b/pkgs/tools/misc/trash-cli/nix-paths.patch
index 29412027b7a5..d7b485eec158 100644
--- a/pkgs/tools/misc/trash-cli/nix-paths.patch
+++ b/pkgs/tools/misc/trash-cli/nix-paths.patch
@@ -1,18 +1,5 @@
-diff -Nurp trash-cli-0.12.9.14-orig/integration_tests/test_trash_rm_script.py trash-cli-0.12.9.14/integration_tests/test_trash_rm_script.py
---- trash-cli-0.12.9.14-orig/integration_tests/test_trash_rm_script.py	2014-12-23 10:10:43.808470486 +0100
-+++ trash-cli-0.12.9.14/integration_tests/test_trash_rm_script.py	2014-12-23 10:11:02.688517975 +0100
-@@ -9,7 +9,7 @@ from pprint import pprint
- @istest
- class WhenNoArgs:
-     def setUp(self):
--        process = Popen(['python', 'trashcli/rm.py'],
-+        process = Popen(['@python@', 'trashcli/rm.py'],
-                     env={'PYTHONPATH':'.'},
-                     stdin=None,
-                     stdout=PIPE,
-diff -Nurp trash-cli-0.12.9.14-orig/trashcli/list_mount_points.py trash-cli-0.12.9.14/trashcli/list_mount_points.py
---- trash-cli-0.12.9.14-orig/trashcli/list_mount_points.py	2014-12-23 10:10:43.808470486 +0100
-+++ trash-cli-0.12.9.14/trashcli/list_mount_points.py	2014-12-23 10:19:04.954796457 +0100
+--- a/trashcli/list_mount_points.py	2014-12-23 10:10:43.808470486 +0100
++++ a/trashcli/list_mount_points.py	2014-12-23 10:19:04.954796457 +0100
 @@ -12,7 +12,7 @@ def mount_points_from_getmnt():
  
  def mount_points_from_df():