Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 866962 - app-portage/prefix-toolkit: attempts to unpack itself
Summary: app-portage/prefix-toolkit: attempts to unpack itself
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Prefix
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-08-27 12:36 UTC by Sam James
Modified: 2023-05-27 09:30 UTC (History)
4 users (show)

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 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-08-27 12:36:06 UTC
I stumbled upon the app-portage/prefix-toolkit ebuilds after a user asked a question and stumbled upon something a bit concerning.

The ebuild tries to unpack itself(!) (https://gitweb.gentoo.org/repo/gentoo.git/tree/app-portage/prefix-toolkit/prefix-toolkit-9.ebuild?id=bc7c993287441e2cd6386eb0b63bc7caa992198c#n46)

(There's also the use of non-standard ${EBUILD} variable).

Most of the ebuild is taken up by the files it tries to "unpack" and these should be in files/ or downloaded via SRC_URI.
Comment 1 Ionen Wolkens gentoo-dev 2022-08-27 12:44:52 UTC
Despite being small, my own suggestion would be to give this its own repo and do normal tarball releases, the ebuild would just install that.

Be easier to track changes and give room to add more to this in the future as-needed.
Comment 2 Fabian Groffen gentoo-dev 2022-08-27 13:31:32 UTC
I think we can safely say this practise better is avoided these days.

Moving these scripts into a git-repo somewhere and basing releases on that sounds like a much cleaner and understandable approach.
Comment 3 Ulrich Müller gentoo-dev 2022-08-27 14:54:30 UTC
For the record, the EBUILD variable is documented by PMS as reserved for the package manager. Ebuilds must not use it:
https://dev.gentoo.org/~ulm/pms/head/pms.html#x1-13700012.3.17
Comment 4 Ulrich Müller gentoo-dev 2023-05-11 07:10:50 UTC
(In reply to Fabian Groffen from comment #2)
> I think we can safely say this practise better is avoided these days.
> 
> Moving these scripts into a git-repo somewhere and basing releases on that
> sounds like a much cleaner and understandable approach.

Ping. Will someone do this please?
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-05-26 05:32:11 UTC
I'll take a look.
Comment 6 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-05-26 06:13:28 UTC
(In reply to Sam James from comment #5)
> I'll take a look.

I've tried my best at a faithful conversion at https://gitweb.gentoo.org/proj/prefix/prefix-toolkit.git/ with the ebuilds, extracted contents from them, and original commit authorship & messages (w/ cherry-picked reference to ::gentoo commits).

There's also a 'naive-conversion' branch with just me doing the extraction.
Comment 7 Larry the Git Cow gentoo-dev 2023-05-26 06:23:28 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8a828978763bf24ad1e4e5326788db90fbc00879

commit 8a828978763bf24ad1e4e5326788db90fbc00879
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2023-05-26 06:18:30 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-05-26 06:18:30 +0000

    app-portage/prefix-toolkit: drop crime-against-ebuild (don't self-extract files)
    
    I've tried my best at a faithful conversion at https://gitweb.gentoo.org/proj/prefix/prefix-toolkit.git/
    with the ebuilds, extracted contents from them, and original commit authorship & messages
    (w/ cherry-picked reference to ::gentoo commits).
    
    There's also a 'naive-conversion' branch with just me doing the extraction.
    
    Closes: https://bugs.gentoo.org/866962
    Signed-off-by: Sam James <sam@gentoo.org>

 app-portage/prefix-toolkit/Manifest                |  1 +
 app-portage/prefix-toolkit/prefix-toolkit-9.ebuild | 25 +++-------------------
 2 files changed, 4 insertions(+), 22 deletions(-)
Comment 8 Fabian Groffen gentoo-dev 2023-05-26 06:45:44 UTC
Hi Sam, thanks for working on this.  I was about to drop this package though, as I don't think there's anything in here we can support or need.
Comment 9 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-05-26 06:46:58 UTC
(In reply to Fabian Groffen from comment #8)
> Hi Sam, thanks for working on this.  I was about to drop this package
> though, as I don't think there's anything in here we can support or need.

o :)

Feel free to drop it, I think it was worth doing the repo conversion anyway just for the historical side, so please go ahead!
Comment 10 Fabian Groffen gentoo-dev 2023-05-27 09:23:18 UTC
update

I forgot prefix-toolkit contains startprefix, so this ebuild cannot be dropped.  So, thanks for taking care of the conversion!
Comment 11 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-05-27 09:27:01 UTC
I didn't do such a good job, apparently I didn't actually remove the crap at the end? I thought I had, so maybe I cocked up git add -p.

Fixing..
Comment 12 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-05-27 09:30:10 UTC
commit 3649618556827b046d29993e9ce32ebb52be9a60
Author: Sam James <sam@gentoo.org>
Date:   Sat May 27 10:28:27 2023 +0100

    app-portage/prefix-toolkit: cleanup remnants

    Cloess: https://bugs.gentoo.org/866962
    Fixes: 40925478f0552e5e63c325232b9e66e143540af3
    Fixes: 8a828978763bf24ad1e4e5326788db90fbc00879
    Signed-off-by: Sam James <sam@gentoo.org>

Thanks & done!