Bug 692735 - UPDATED PATCH: trash-empty mishandles [days] argument
Summary: UPDATED PATCH: trash-empty mishandles [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:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-03-31 23:51 UTC by "FeRD" (Frank Dana)
Modified: 2011-05-25 02:36 UTC (History)
2 users (show)

Fixed In Version: trash-cli-0.11.3-0.4.r315.fc14
Doc Type: Bug Fix
Doc Text:
Clone Of: 675539
Environment:
Last Closed: 2011-05-22 23:10:22 UTC


Attachments (Terms of Use)
This patch, which _properly_ fixes the trash-empty command, REPLACES the previous trash-cli-empty_days.patch (It includes the fixes from the previous version.) (590 bytes, application/octet-stream)
2011-03-31 23:51 UTC, "FeRD" (Frank Dana)
no flags Details

Description "FeRD" (Frank Dana) 2011-03-31 23:51:43 UTC
Created attachment 489268 [details]
This patch, which _properly_ fixes the trash-empty command, REPLACES the previous trash-cli-empty_days.patch (It includes the fixes from the previous version.)

+++ This bug was initially created as a clone of Bug #675539 +++

An update I provided to my previous report (bug #675539) looks to have been missed, and wasn't included in that update. I apologize for not catching it the first time around. As a result, even with my patch applied the trash-cli 'trash-empty' command can mishandle its optional [days] argument.

From the previous bug...
--------
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
%
--------

...I am attaching a replacement patch which fixes this issue in addition to the problem addressed in the previous patch.

Comment 1 Ankur Sinha (FranciscoD) 2011-05-12 12:15:17 UTC
Rahul and Frank,

This patch has already been applied. Closing as FIXED.

Thank you for your patch Frank :)

Thanks,
Ankur

Comment 2 "FeRD" (Frank Dana) 2011-05-12 13:32:44 UTC
Ankur,

Apologies if I'm in error here, but I'm reopening this... as best I'm able to determine, *this* patch has NOT been applied.

A previous version of the patch was applied, but it's missing one critical change (the addition of 'parser.exit()' following 'parser.print_usage()' on line 62 of empty.py). That PREVIOUS (not-entirely-correct) patch was included in trash-cli-0.11.3-0.2.r315.fc14.noarch, which appears to be the latest version pushed out to f14-updates.

It was foolish of me, in retrospect, to give both patch files the same filename. (The idea was to indicate that the newer version would replace the other file, but I think it only caused confusion. I apologize for that error.

Anyway, the patch file above — trash-cli-empty_days.patch "version 2.0", which is 19 lines long — is newer and more complete than the patch that was applied in building trash-cli-0.11.3-0.2.r315.fc14.noarch

If the updated patch has indeed been included in the package sources, then I'd like to request that new packages be built and pushed to the repos, so that users will have the complete fix.

Thanks, and apologies again for the confusing situation I created.

Comment 3 Ankur Sinha (FranciscoD) 2011-05-12 15:47:34 UTC
(In reply to comment #2)
> Ankur,
> 
> Apologies if I'm in error here, but I'm reopening this... as best I'm able to
> determine, *this* patch has NOT been applied.
> 
> A previous version of the patch was applied, but it's missing one critical
> change (the addition of 'parser.exit()' following 'parser.print_usage()' on
> line 62 of empty.py). That PREVIOUS (not-entirely-correct) patch was included
> in trash-cli-0.11.3-0.2.r315.fc14.noarch, which appears to be the latest
> version pushed out to f14-updates.
> 
> It was foolish of me, in retrospect, to give both patch files the same
> filename. (The idea was to indicate that the newer version would replace the
> other file, but I think it only caused confusion. I apologize for that error.
> 
> Anyway, the patch file above — trash-cli-empty_days.patch "version 2.0", which
> is 19 lines long — is newer and more complete than the patch that was applied
> in building trash-cli-0.11.3-0.2.r315.fc14.noarch
> 
> If the updated patch has indeed been included in the package sources, then I'd
> like to request that new packages be built and pushed to the repos, so that
> users will have the complete fix.
> 
> Thanks, and apologies again for the confusing situation I created.

Hi Frank,

I just checked up. I had built it with the new patch for f14 too (http://koji.fedoraproject.org/koji/packageinfo?packageID=10024), but I hadn't pushed an update. IIRC, we were waiting to verify the package over rawhide, and then completely forgot about it. The build has been deleted. I'll request a fresh build and push an update over the next few hours. Thank you for bringing this to our notice

Ankur

Comment 4 Fedora Update System 2011-05-12 16:36:10 UTC
trash-cli-0.11.3-0.4.r315.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/trash-cli-0.11.3-0.4.r315.fc14

Comment 5 Fedora Update System 2011-05-13 23:07:11 UTC
Package trash-cli-0.11.3-0.4.r315.fc14:
* should fix your issue,
* was pushed to the Fedora 14 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing trash-cli-0.11.3-0.4.r315.fc14'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/trash-cli-0.11.3-0.4.r315.fc14
then log in and leave karma (feedback).

Comment 6 "FeRD" (Frank Dana) 2011-05-16 17:23:44 UTC
Tested and karma'd, everything looks good. Thanks again, Ankur!

Comment 7 "FeRD" (Frank Dana) 2011-05-22 23:10:22 UTC
Closing this, as the 0.11.3-0.4.r315.fc14 package has reached the updates repo.

Comment 8 Rahul Sundaram 2011-05-22 23:17:35 UTC
For the record,  upstream has fixed this in 

https://code.google.com/p/trash-cli/source/detail?r=317

We should drop these patches when we bump up to the next version

Comment 9 Fedora Update System 2011-05-25 02:35:59 UTC
trash-cli-0.11.3-0.4.r315.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.


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