Bug 692732 - PATCH: trash-empty fails to respect [days] argument
Summary: PATCH: trash-empty fails to respect [days] argument
Keywords:
Status: CLOSED DUPLICATE of bug 675539
Alias: None
Product: Fedora
Classification: Fedora
Component: trash-cli
Version: 14
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Rahul Sundaram
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-03-31 23:40 UTC by "FeRD" (Frank Dana)
Modified: 2011-03-31 23:41 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of: 675539
Environment:
Last Closed: 2011-03-31 23:41:49 UTC


Attachments (Terms of Use)

Description "FeRD" (Frank Dana) 2011-03-31 23:40:13 UTC
+++ This bug was initially created as a clone of Bug #675539 +++

Created attachment 477295 [details]
Patch trash-empty command to respect optional days argument

Description of problem:
trash-empty ignores its optional [days] argument, causing it to delete more than intended (in fact, everything) from the trash even when a minimum age is specified. The attached patch fixes handling of trash-empty's [days] argument.

Version-Release number of selected component (if applicable):
0.11.3-0.1.r315

How reproducible:
% date
Sun Feb  6 07:31:03 EST 2011
% trash-list
2011-02-06 07:22:34 <path>/trashcli
2011-01-06 07:22:43 <path>/build
% trash-empty 7  # Should remove contents at least 7 days old
  
Actual results:
%trash-list
%

Expected results:
% trash-list
2011-02-06 07:22:34 <path>/trashcli
% trash-empty
% trash-list
%

Additional info:
This has been reported (by someone else) to the upstream google code project as issue #59, but so far has not been fixed.
http://code.google.com/p/trash-cli/issues/detail?id=59

--- Additional comment from updates@fedoraproject.org on 2011-02-06 09:04:23 EST ---

trash-cli-0.11.3-0.2.r315.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/trash-cli-0.11.3-0.2.r315.fc14

--- Additional comment from updates@fedoraproject.org on 2011-02-06 15:20:28 EST ---

trash-cli-0.11.3-0.2.r315.fc14 has been pushed to the Fedora 14 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update trash-cli'.  You can provide feedback for this update here: https://admin.fedoraproject.org/updates/trash-cli-0.11.3-0.2.r315.fc14

--- Additional comment from ferdnyc@gmail.com on 2011-02-07 07:02:55 EST ---

Created attachment 477398 [details]
Updated patch to correct trash-empty handling of [days] argument

Whoops! Not quite there yet. Entirely my fault... many apologies.

In testing the new build, I caught a further issue with trash-empty that I hadn't noticed before. My first patch inadvertently exposes it.

If the argument passed to [days] is invalid, trash-empty will output usage information, but then continues right through to perform the deletion as if no argument had been passed. This results, once again, in an overzealous removal of all trash: contents.

% trash-list
2011-02-07 06:41:21 <path>/week06b.odp
2011-02-07 06:41:21 <path>/week06b.ppt
% trash-empty 0.5
Usage: trash-empty [days]

% trash-list
%

...Attaching a replacement patch which fixes this issue, as well.

--- Additional comment from updates@fedoraproject.org on 2011-03-30 15:56:07 EDT ---

trash-cli-0.11.3-0.2.r315.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 1 "FeRD" (Frank Dana) 2011-03-31 23:41:49 UTC
Apologies, accidentally submitted on the new-bug form. Disregard everything here.

*** This bug has been marked as a duplicate of bug 675539 ***


Note You need to log in before you can comment on or make changes to this bug.