Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 508508 - sys-apps/portage: repoman should warn when there is a missing file in $FILESDIR
Summary: sys-apps/portage: repoman should warn when there is a missing file in $FILESDIR
Status: RESOLVED WONTFIX
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Repoman (show other bugs)
Hardware: All Linux
: Normal enhancement (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-23 14:01 UTC by Agostino Sarubbo
Modified: 2022-07-12 03:36 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Agostino Sarubbo gentoo-dev 2014-04-23 14:01:38 UTC
Suppose we have an ebuild that uses:

epatch "$FILESDIR/foo.patch"

if foo.patch is missing is FILESDIR, there is no warn/error.
Comment 1 Tom Wijsman (TomWij) (RETIRED) gentoo-dev 2014-04-23 14:10:13 UTC
When you do that; you get something like this, from an earlier failing build:

    >>> Preparing source in /var/tmp/portage/dev-java/icu4j-53.1/work ...

     * Cannot find $EPATCH_SOURCE!  Value for $EPATCH_SOURCE is:
     * 
     *   /usr/portage/dev-java/icu4j/files/icu4j-53.1-fix-test-DataDrivenFormat-ConsistentPivot-1.patch
     *   ( icu4j-53.1-fix-test-DataDrivenFormat-ConsistentPivot-1.patch )

You probably do not have the epatch instruction run in the first place; this can happen due to various mistakes, a summary of the one that are easy to recall:

    1. EAPI doesn't support src_prepare yet;
    2. eutils eclass has not been inherited;
    3. src_prepare redefined later in the ebuild.

Can you make sure it is run (debug with an echo line before it) and try again?
Comment 2 Agostino Sarubbo gentoo-dev 2014-04-23 14:22:44 UTC
You are talking from the build side. I'm talking from the repoman side. 
Example:

~ $ cd gentoo-x86/app-admin/conky/
~ $ $ ls files/conky-1.* | wc -l
7
~ $ cvs rm -f files/conky-1.*                                                                                 
cvs remove: use `cvs commit' to remove these files permanently
~ $ repoman manifest
>>> Creating Manifest for /home/at/gentoo-x86/app-admin/conky
~ $ repoman full                                                                                              
                                                                                                                                               
RepoMan scours the neighborhood...                                                                                                             
>>> Creating Manifest for /home/at/gentoo-x86/app-admin/conky                                                                                  
                                                                                                                                               
Note: use --include-dev (-d) to check dependencies for 'dev' profiles                                                                          
                                                                                                                                               
RepoMan sez: "If everyone were like you, I'd be out of business!"


At this time I'd expect that repoman warns me about the 7 patches missing from FILESDIR, used in the various conky*.ebuild
Comment 3 Tom Wijsman (TomWij) (RETIRED) gentoo-dev 2014-04-23 14:41:16 UTC
Right, my bad; thank you for clarifying that.

A possible problem with this is that you need actual emulation of the ebuild to have this work picture perfect, which is why build failures work out well; you can already get a long way with an eval trick, but I'm not sure whether it would be perfect enough to roll out to anyone given mismatches and false positives.

To get an idea, here is a QA script that I wrote some time ago:

https://gist.github.com/TomWij/b5afafe74b8bf537643a

It gives output like this:

https://gist.github.com/TomWij/762e8c375f9ff2de1ba5

A revised version that can work on a per-package basis:

https://gist.github.com/jlec/88e56e6675b31de4b72f

Please note that these throw quite some false positives.
Comment 4 Arfrever Frehtes Taifersar Arahesis 2014-04-23 15:17:18 UTC
The only reliable way is to execute given code using bash, but it cannot be done due to side effects.
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-07-12 03:18:14 UTC
repoman support has been removed per bug 835013.

Please file a new bug (or, I suppose, reopen this one) if you feel this check is still applicable to pkgcheck and doesn't already exist.