Bug 675539 - PATCH: trash-empty fails to respect [days] argument
Summary: PATCH: trash-empty fails to respect [days] argument
Keywords:
Status: CLOSED ERRATA
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:
: 692732 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-02-06 12:36 UTC by "FeRD" (Frank Dana)
Modified: 2011-03-31 23:41 UTC (History)
2 users (show)

See Also:
Fixed In Version: trash-cli-0.11.3-0.2.r315.fc14
Clone Of:
: 692732 692735 (view as bug list)
Environment:
Last Closed: 2011-03-30 19:56:17 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Patch trash-empty command to respect optional days argument (445 bytes, application/octet-stream)
2011-02-06 12:36 UTC, "FeRD" (Frank Dana)
no flags Details
Updated patch to correct trash-empty handling of [days] argument (590 bytes, patch)
2011-02-07 12:02 UTC, "FeRD" (Frank Dana)
no flags Details | Diff

Description "FeRD" (Frank Dana) 2011-02-06 12:36:52 UTC
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

Comment 1 Fedora Update System 2011-02-06 14:04:23 UTC
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

Comment 2 Fedora Update System 2011-02-06 20:20:28 UTC
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

Comment 3 "FeRD" (Frank Dana) 2011-02-07 12:02:55 UTC
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.

Comment 4 Fedora Update System 2011-03-30 19:56:07 UTC
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 5 "FeRD" (Frank Dana) 2011-03-31 23:41:49 UTC
*** Bug 692732 has been marked as a duplicate of this bug. ***


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