Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 520756 - perl-module.eclass: Add perl_rm_files utility
Summary: perl-module.eclass: Add perl_rm_files utility
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Perl team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: perl-eclass
  Show dependency tree
 
Reported: 2014-08-24 11:44 UTC by Kent Fredric (IRC: kent\n) (RETIRED)
Modified: 2014-11-01 22:11 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
perl-module.eclass patch (patch,1.29 KB, patch)
2014-08-24 11:44 UTC, Kent Fredric (IRC: kent\n) (RETIRED)
Details | Diff
perl-module.eclass patch (patch,1.87 KB, patch)
2014-08-30 09:00 UTC, Kent Fredric (IRC: kent\n) (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kent Fredric (IRC: kent\n) (RETIRED) gentoo-dev 2014-08-24 11:44:47 UTC
Created attachment 383512 [details, diff]
perl-module.eclass patch

Attached is a small function suggested for use in perl-module.eclass.

It doesn't do very much, but makes this sort of task easier.

Namely:

- perl modules are standard enough we don't have to dick around with ${S} on every path.
- gives basic reporting of removing files.
- removes relevant MANIFEST lines to avoid warnings about "Files missing from your kit", which perl users are accustomed to treating as bugs.

As I said, it doesn't do much, but it reduces about 3 lines of boiler plate into one function call, and makes things nicer overall.

I've probably done something horrible wrt/ POSIX compliance though with MANIFEST augmentation. sed is horrible and I could not find a sensible way to implement "delete a line from a file matching an exact string" in it.

Automated escaping entirely failed because for some reason:

   echo 'Hello world' | sed -e 's|\x5E|yourmom|'

Is entirely backwards, and \x5E is interpreted as a literal regex for the start of the line. And the horribleness of that quickly got out of control where fgrep may just do the trick.
Comment 1 Kent Fredric (IRC: kent\n) (RETIRED) gentoo-dev 2014-08-30 09:00:50 UTC
Created attachment 383948 [details, diff]
perl-module.eclass patch

Revised eclass patch after extensive testing on perl-experimental overlay.

Most significant is the addition of the bash array PERL_RM_FILES that is automatically detected in perl-module_src_prep and applied in the same way as the PATCHES variable does.

This proved much more useful and far less prone to slipups than manually redefinining src_prepare() in all the relevant places.
Comment 2 Patrice Clement gentoo-dev 2014-10-28 23:46:00 UTC
After talking to dilfridge on IRC, we've decided to erase the package without masking it. Indeed, we're only removing a version of the package and not the entire Portage tree directory so it is fine to do so. 

Here's the last ChangeLog entry, as far as perl-core/Test-Simple is concerned:
$ pwd
/home/patrice/gentoo-x86/perl-core/Test-Simple
$ head -6 ChangeLog                                                          
# ChangeLog for perl-core/Test-Simple
# Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
# $Header: /var/cvsroot/gentoo-x86/perl-core/Test-Simple/ChangeLog,v 1.99 2014/10/28 23:26:11 monsieurp Exp $

  28 Oct 2014; Patrice Clement <monsieurp@gentoo.org> -Test-Simple-0.980.5-r1.ebuild:
  Removing this package. See bug 520756.

Thanks Kent!
Comment 3 Patrice Clement gentoo-dev 2014-10-28 23:49:44 UTC
For my last comment. This was for another bug. Holy fuck, I should rest instead of fixing bugs at 1 am. :(
Comment 4 Patrice Clement gentoo-dev 2014-11-01 22:11:34 UTC
Checked in Kent's diff. 

revision 1.145
date: 2014-11-01 23:08:54 +0100;  author: monsieurp;  state: Exp;  lines: +41 -1;  commitid: 3063545559f44567;
Introducing perl_rm_files() function. See #520756.