Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 583754 - scanelf path should respect EPREFIX
Summary: scanelf path should respect EPREFIX
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - External Interaction (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS, PATCH
Depends on:
Blocks: prefix-gx86
  Show dependency tree
 
Reported: 2016-05-22 08:15 UTC by Benda Xu
Modified: 2016-06-30 13:47 UTC (History)
1 user (show)

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


Attachments
portage-scanelf-path.patch (portage-2.3.0-scanelf-path.patch,805 bytes, patch)
2016-05-22 08:16 UTC, Benda Xu
Details | Diff
portage-2.3.0-scanelf-path.patch (portage-2.3.0-scanelf-path.patch,818 bytes, patch)
2016-06-02 10:49 UTC, Benda Xu
Details | Diff
portage-2.3.0-scanelf-path.patch (portage-2.3.0-scanelf-path.patch,941 bytes, patch)
2016-06-06 13:22 UTC, Benda Xu
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Benda Xu gentoo-dev 2016-05-22 08:15:30 UTC
This patch prepends EPREFIX to the scanelf path.


Reproducible: Always
Comment 1 Benda Xu gentoo-dev 2016-05-22 08:16:42 UTC
Created attachment 434950 [details, diff]
portage-scanelf-path.patch
Comment 2 Benda Xu gentoo-dev 2016-06-02 09:42:17 UTC
Ping portage team.
Comment 3 Brian Dolbec (RETIRED) gentoo-dev 2016-06-02 10:17:58 UTC
It is normally better to use os.path.join() that simple string addtition.  That way it takes care of extra leading/trailing slashes.

Thank you for the patch.
Comment 4 Benda Xu gentoo-dev 2016-06-02 10:49:19 UTC
Created attachment 436168 [details, diff]
portage-2.3.0-scanelf-path.patch

Updated to os.path.join. Thanks!
Comment 5 Zac Medico gentoo-dev 2016-06-06 07:14:10 UTC
Note that os.path.join has "tricky" behavior for paths that begin with a slash. For example, os.path.join("/foo", "/bar") return "bar". Nice, eh? So what we really want is something like this:

   os.path.join(os.sep, EPREFIX, "usr/bin/scanelf")

or this:

   os.path.join(os.sep, EPREFIX, "usr", "bin", "scanelf")
Comment 6 Benda Xu gentoo-dev 2016-06-06 13:22:36 UTC
Created attachment 436630 [details, diff]
portage-2.3.0-scanelf-path.patch

Thanks for pointing this out, Zac. Updated.  Note that os.sep is used implicitly.
Comment 7 Zac Medico gentoo-dev 2016-06-06 16:09:03 UTC
Thanks, is in the master branch:

https://gitweb.gentoo.org/proj/portage.git/commit/?id=54d3676d4dc90444895c99c0b6c29d6be6a25b77

(In reply to Benda Xu from comment #6)
> Note that os.sep is used implicitly.

You need to include a leading "/" in the case where EPREFIX is empty, so I fixed it up like this, which is how we do it in some other places:

   os.path.join(EPREFIX or "/", "usr/bin/scanelf")
Comment 8 Benda Xu gentoo-dev 2016-06-06 23:44:20 UTC
(In reply to Zac Medico from comment #7)
> Thanks, is in the master branch:
> 
> https://gitweb.gentoo.org/proj/portage.git/commit/
> ?id=54d3676d4dc90444895c99c0b6c29d6be6a25b77
> 
> (In reply to Benda Xu from comment #6)
> > Note that os.sep is used implicitly.
> 
> You need to include a leading "/" in the case where EPREFIX is empty, so I
> fixed it up like this, which is how we do it in some other places:
> 
>    os.path.join(EPREFIX or "/", "usr/bin/scanelf")

Thanks Zac!
Comment 9 Benda Xu gentoo-dev 2016-06-30 13:47:45 UTC
Included in 2.3.0 release.