git.iko.soy/typeable/nixpkgs
on master help sign in
trash-cli: 0.12.9.14 -> 0.17.1.14
commit477014fd6a8c88efe314524d465b15c4379c7921 authorndowens <ndowens04@gmail.com> dateThu 2 Mar 2017, 19:44 (10 years ago) parent3d2e118
3 files changed+12−89
pkgs/tools/misc/trash-cli/default.nix+10−14 pkgs/tools/misc/trash-cli/fix_should_output_info_for_multiple_files.patch−60 pkgs/tools/misc/trash-cli/nix-paths.patch+2−15
pkgs/tools/misc/trash-cli/default.nix+10−14
@@ -1,33 +1,29 @@
1−{ stdenv, fetchurl, substituteAll, coreutils, python2, python2Packages }:
1+{ stdenv, fetchFromGitHub, coreutils
2+, python3, python3Packages, substituteAll }:
23
34assert stdenv.isLinux;
45
5−python2Packages.buildPythonApplication rec {
6+python3Packages.buildPythonApplication rec {
67 name = "trash-cli-${version}";
7− version = "0.12.9.14";
8+ version = "0.17.1.14";
89 namePrefix = "";
910
10− src = fetchurl {
11− url = "https://github.com/andreafrancia/trash-cli/archive/${version}.tar.gz";
12− sha256 = "10idvzrlppj632pw6mpk1zy9arn1x4lly4d8nfy9cz4zqv06lhvh";
11+ src = fetchFromGitHub {
12+ owner = "andreafrancia";
13+ repo = "trash-cli";
14+ rev = "${version}";
15+ sha256 = "1bqazna223ibqjwbc1wfvfnspfyrvjy8347qlrgv4cpng72n7gfi";
1316 };
1417
15−
1618 patches = [
17− # Fix paths.
1819 (substituteAll {
1920 src = ./nix-paths.patch;
2021 df = "${coreutils}/bin/df";
21− python = "${python2}/bin/${python2.executable}";
2222 libc = "${stdenv.cc.libc.out}/lib/libc.so.6";
2323 })
24−
25− # Apply https://github.com/JaviMerino/trash-cli/commit/4f45a37a3
26− # to fix failing test case.
27− ./fix_should_output_info_for_multiple_files.patch
2824 ];
2925
30− buildInputs = with python2Packages; [ nose mock ];
26+ buildInputs = with python3Packages; [ nose mock ];
3127
3228 checkPhase = "nosetests";
3329
pkgs/tools/misc/trash-cli/fix_should_output_info_for_multiple_files.patchdeleted−60
@@ -1,60 +0,0 @@
1−From 4f45a37a390d7c844dd9c9b58fff7259a77ffff9 Mon Sep 17 00:00:00 2001
2−From: Javi Merino <merino.jav@gmail.com>
3−Date: Sun, 31 Aug 2014 05:45:17 -0700
4−Subject: [PATCH] Fix should_output_info_for_multiple_files
5−
6−Test should_output_info_for_multiple_files fails because the output is
7−not in the same order as the input. Add assert_equal_any_order() to
8−the OutputCollector, which sorts the expected and actual lines so that
9−the output matches even if the order in which they are shown in
10−trash-list is different.
11−---
12− integration_tests/describe_trash_list.py | 8 +++++---
13− integration_tests/output_collector.py | 8 ++++++++
14− 2 files changed, 13 insertions(+), 3 deletions(-)
15−
16−diff --git a/integration_tests/describe_trash_list.py b/integration_tests/describe_trash_list.py
17−index 6dd8d30..3489a22 100644
18−--- a/integration_tests/describe_trash_list.py
19−+++ b/integration_tests/describe_trash_list.py
20−@@ -73,9 +73,9 @@ def should_output_info_for_multiple_files(self):
21−
22− self.user.run_trash_list()
23−
24−- self.user.should_read_output( "2000-01-01 00:00:01 /file1\n"
25−- "2000-01-01 00:00:02 /file2\n"
26−- "2000-01-01 00:00:03 /file3\n")
27−+ self.user.should_read_output_any_order( "2000-01-01 00:00:01 /file1\n"
28−+ "2000-01-01 00:00:02 /file2\n"
29−+ "2000-01-01 00:00:03 /file3\n")
30−
31− @istest
32− def should_output_unknown_dates_with_question_marks(self):
33−@@ -294,6 +294,8 @@ def error(self):
34− raise ValueError()
35− def should_read_output(self, expected_value):
36− self.stdout.assert_equal_to(expected_value)
37−+ def should_read_output_any_order(self, expected_value):
38−+ self.stdout.assert_equal_any_order(expected_value)
39− def should_read_error(self, expected_value):
40− self.stderr.assert_equal_to(expected_value)
41− def output(self):
42−diff --git a/integration_tests/output_collector.py b/integration_tests/output_collector.py
43−index 06dc002..7f3704f 100644
44−--- a/integration_tests/output_collector.py
45−+++ b/integration_tests/output_collector.py
46−@@ -9,6 +9,14 @@ def write(self,data):
47− self.stream.write(data)
48− def assert_equal_to(self, expected):
49− return self.should_be(expected)
50−+ def assert_equal_any_order(self, expected):
51−+ actual_sorted = sorted(self.stream.getvalue().splitlines(1))
52−+ actual = "".join(actual_sorted)
53−+
54−+ expected_sorted = sorted(expected.splitlines(1))
55−+ expected = "".join(expected_sorted)
56−+
57−+ assert_equals_with_unidiff(expected, actual)
58− def should_be(self, expected):
59− assert_equals_with_unidiff(expected, self.stream.getvalue())
60− def should_match(self, regex):
pkgs/tools/misc/trash-cli/nix-paths.patch+2−15
@@ -1,18 +1,5 @@
1−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
2−--- trash-cli-0.12.9.14-orig/integration_tests/test_trash_rm_script.py 2014-12-23 10:10:43.808470486 +0100
3−+++ trash-cli-0.12.9.14/integration_tests/test_trash_rm_script.py 2014-12-23 10:11:02.688517975 +0100
4−@@ -9,7 +9,7 @@ from pprint import pprint
5− @istest
6− class WhenNoArgs:
7− def setUp(self):
8−- process = Popen(['python', 'trashcli/rm.py'],
9−+ process = Popen(['@python@', 'trashcli/rm.py'],
10− env={'PYTHONPATH':'.'},
11− stdin=None,
12− stdout=PIPE,
13−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
14−--- trash-cli-0.12.9.14-orig/trashcli/list_mount_points.py 2014-12-23 10:10:43.808470486 +0100
15−+++ trash-cli-0.12.9.14/trashcli/list_mount_points.py 2014-12-23 10:19:04.954796457 +0100
1+--- a/trashcli/list_mount_points.py 2014-12-23 10:10:43.808470486 +0100
2++++ a/trashcli/list_mount_points.py 2014-12-23 10:19:04.954796457 +0100
163@@ -12,7 +12,7 @@ def mount_points_from_getmnt():
174
185 def mount_points_from_df():