Bug 544738 - cpanspec doesn't escape "/" in --filter-requires leading to bad sed statements
Summary: cpanspec doesn't escape "/" in --filter-requires leading to bad sed statements
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: cpanspec   
(Show other bugs)
Version: 19
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Petr Šabata
QA Contact: Fedora Extras Quality Assurance
URL: https://github.com/silug/cpanspec/pull/6
Whiteboard:
Keywords: Reopened
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-12-06 09:47 UTC by Need Real Name
Modified: 2015-01-12 14:06 UTC (History)
3 users (show)

Fixed In Version: cpanspec-1.78-19.fc19
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-01-12 14:06:50 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Escape slashes in filters (1.27 KB, patch)
2014-11-06 15:54 UTC, Petr Šabata
no flags Details | Diff

Description Need Real Name 2009-12-06 09:47:40 UTC
Description of problem:
cpanspec translates each "--filter-requires some_string" into a corresponding sed statement in the corresponding perl-<module>-requires.sh of form:
    -e '/^some-string$/d'

However, when some_string is a path which then contains a slash "/", this causes the sed statement to mess up.

In particular, one of the fuse modules I was compiling had some example perl scripts which began with the line "#/usr/bin/perl." This caused the build to then require "/usr/bin/perl" which I wanted to eliminate. When I added "--filter-requires /usr/bin/perl", it caused *all* the sed statements to fail with the error:
    sed: -e expression #1, char 4: unknown command: `u'

Either the documentation should warn that "/" must be escaped or *better*, the script should automatically escape the forward slashes since the user has no reason to think that "/" is a special character (and indeed, sed could have used just about any character to demarcate the s program)

Comment 1 Need Real Name 2010-01-19 01:17:01 UTC
Is anybody following these bug reports?
It has been 6 weeks since this was reported!!!

Comment 2 Marcela Mašláňová 2010-01-19 07:28:35 UTC
Maintainer and upstream of this package is working on it in his free time. Feel free to help and propose a patch.

Comment 3 Need Real Name 2010-01-20 03:54:57 UTC
Thanks for the update - my query was not a complaint as much as just trying to find out if anybody out there was following this bug.

Although I am no Perl expert, I believe that Perl has some very useful paradigms for making sure that regex's are appropriately quoted.

Incidentally, it is a bit ironic that this perl-oriented program (it is cpan2spec afterall) uses 'sed' rather than more powerful 'perl' paradigms to filter. Switching to perl should be simple and would solve the problem using something like the \Q...\E expression.

Comment 4 Bug Zapper 2010-11-04 04:11:23 UTC
This message is a reminder that Fedora 12 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 12.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '12'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 12's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 12 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 5 Bug Zapper 2010-12-04 02:08:32 UTC
Fedora 12 changed to end-of-life (EOL) status on 2010-12-02. Fedora 12 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 6 Steven Pritchard 2010-12-07 20:01:58 UTC
Re-opening...  This is still a valid bug that I'll try to get to ASAP.

Comment 7 Fedora End Of Life 2013-04-03 20:16:49 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 19 development cycle.
Changing version to '19'.

(As we did not run this process for some time, it could affect also pre-Fedora 19 development
cycle bugs. We are very sorry. It will help us with cleanup during Fedora 19 End Of Life. Thank you.)

More information and reason for this action is here:
https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora19

Comment 8 Petr Šabata 2014-11-06 15:54:00 UTC
Created attachment 954521 [details]
Escape slashes in filters

Comment 9 Petr Šabata 2014-12-01 15:54:29 UTC
Patch accepted upstream.

Comment 10 Fedora Update System 2014-12-01 16:35:03 UTC
cpanspec-1.78-19.fc21 has been submitted as an update for Fedora 21.
https://admin.fedoraproject.org/updates/cpanspec-1.78-19.fc21

Comment 11 Fedora Update System 2014-12-01 16:35:24 UTC
cpanspec-1.78-19.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/cpanspec-1.78-19.fc20

Comment 12 Fedora Update System 2014-12-01 16:35:40 UTC
cpanspec-1.78-19.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/cpanspec-1.78-19.fc19

Comment 13 Fedora Update System 2014-12-01 16:35:55 UTC
cpanspec-1.78-19.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/cpanspec-1.78-19.el6

Comment 14 Fedora Update System 2014-12-12 04:15:09 UTC
cpanspec-1.78-19.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 15 Fedora Update System 2014-12-12 04:19:47 UTC
cpanspec-1.78-19.fc21 has been pushed to the Fedora 21 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 16 Fedora Update System 2014-12-12 04:34:48 UTC
cpanspec-1.78-19.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 17 Fedora Update System 2014-12-17 05:36:00 UTC
cpanspec-1.78-19.el6 has been pushed to the Fedora EPEL 6 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 18 Fedora End Of Life 2015-01-09 22:28:02 UTC
This message is a notice that Fedora 19 is now at end of life. Fedora 
has stopped maintaining and issuing updates for Fedora 19. It is 
Fedora's policy to close all bug reports from releases that are no 
longer maintained. Approximately 4 (four) weeks from now this bug will
be closed as EOL if it remains open with a Fedora 'version' of '19'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 19 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.


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