Article View: linux.gentoo.user
Article #127Re: [gentoo-user] custom ebuild issues: tar archive extraction
From: Eli Schwartz
Date: Thu, 12 Nov 2026 03:40
Date: Thu, 12 Nov 2026 03:40
107 lines
5714 bytes
5714 bytes
This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------bHuaxKZqhurVGw40fVIgBzmi
Content-Type: multipart/mixed; boundary="------------04QWXfossts0mMq9uSRTt40c";
protected-headers="v1"; hp="clear"
Message-ID: <5b98dc99-72af-4439-9caf-72ada84fdd01@gentoo.org>
Date: Wed, 11 Nov 2026 22:31:28 -0500
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [gentoo-user] custom ebuild issues: tar archive extraction
To: gentoo-user@lists.gentoo.org
References: <6efebe75-8e79-4402-b916-6947d93c7869@oldfart.online>
Content-Language: en-US
From: Eli Schwartz <eschwartz@gentoo.org>
Autocrypt: addr=eschwartz@gentoo.org; keydata=
xjMEZmeRNBYJKwYBBAHaRw8BAQdAYNZ7pUDWhx1i2f3p6L2ZLu4FcY18UoeGC04Gq/khqwfN
I0VsaSBTY2h3YXJ0eiA8ZXNjaHdhcnR6QGdlbnRvby5vcmc+wpYEExYKAD4CGwMFCwkIBwMF
FQoJCAsFFgIDAQACHgUCF4AWIQTvUdMIsc4jCIi+DYTqQj6ToWND8QUCauABDQUJCJCIWQAK
CRDqQj6ToWND8bXlAQDhi6hUxiss56cdPbsemrWdVQe3CtkpqlQccxV/4a4/QgD/dUCR+SGn
YxNZj6lir6i/TBr0yfSSrMtKgGO1+lClSwLOOARmZ5E0EgorBgEEAZdVAQUBAQdATT46Z06b
1X9xjXFCYFxmq/Tj3tSEKZInDWTpoHQp4l8DAQgHwn4EGBYKACYCGwwWIQTvUdMIsc4jCIi+
DYTqQj6ToWND8QUCauABGAUJCJCIZAAKCRDqQj6ToWND8c4xAQCWj7iWpgEJUM+wf2bZCkgM
EKEVVdv5aBJrj6Xa22UhIQEA0bIv2t9jUqUeBMHl/6i0L28s5Mrtr0ZSX3Sg/zeyrAM=
X-Clacks-Overhead: GNU Terry Pratchett
In-Reply-To: <6efebe75-8e79-4402-b916-6947d93c7869@oldfart.online>
--------------04QWXfossts0mMq9uSRTt40c
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
On 11/11/26 8:52 PM, Pocket wrote:
> The source archive actually extracts to
> /var/tmp/portage/sys-kernel/linux-rpi-6.18.50/work/linux-stable_2026091=
1/
>=20
> It is looking for
> =C2=A0/var/tmp/portage/sys-kernel/linux-rpi-6.18.50/work/linux-rpi-6.18=
=2E50
>=20
> How do I tweak the ebuild to correct the issue above?
> IE the tar archive extracts to a directory that is not the same as the
> archives filename.=C2=A0 I know how to do this in an archlinux PKGBUILD=
but
> not in a ebuild.
For an archlinux PKGBUILD, you would normally include
```
cd "${srcdir}"/${pkgname}-${pkgver}
```
at the top of each function.
For Gentoo:
- ${srcdir} is ${WORKDIR}
- ${pkgname} is ${PN}
- ${pkgver} is ${PV}
- ${pkgname}-${pkgver} is ${P}
See the various descriptions at:
https://devmanual.gentoo.org/ebuild-writing/variables/index.html
Gentoo also does not use manual `cd`, and instead has an ${S} variable,
and prepare/configure/compile/install will automatically `cd "${S}"` for
you. The default value of ${S} is, unsurprisingly I suppose :)
${WORKDIR}/${P} (so basically exactly the same pattern as a PKGBUILD)
and per the link I provided, you are expected to define
S=3D${WORKDIR}/linux-stable_20260911
so that it can `cd` automatically for you.
> Also the symlink
> /var/tmp/portage/sys-kernel/linux-rpi-6.18.50/work/ files -> /var/db/
> repos/pocket/sys-kernel/linux-rpi/files is broken
>=20
> /var/db/repos/pocket/sys-kernel/linux-rpi/files doesn't exist
The symlink is automatically created for internal reasons. An ebuild
that doesn't have a files/ directory, cannot reference any files via
${FILESDIR} and the symlink will be broken. That is normal and expected.
--=20
Eli Schwartz
--------------04QWXfossts0mMq9uSRTt40c--
--------------bHuaxKZqhurVGw40fVIgBzmi
Content-Type: application/pgp-signature; name="OpenPGP_signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="OpenPGP_signature.asc"
-----BEGIN PGP SIGNATURE-----
wnsEABYIACMWIQTnFNnmK0TPZHnXm3qEp9ErcA0vVwUCavUzEAUDAAAAAAAKCRCEp9ErcA0vV3Ja
AP4ssL7U5K1zi9/opd/Ath5P0mfnlxXKCh6mJtM4z3S32QD/ZQAcwOCCFQKiLXaSMlRufB1XPDhy
jH4H5VMzdSGEQgs=
=Csew
-----END PGP SIGNATURE-----
--------------bHuaxKZqhurVGw40fVIgBzmi--
Technical Details
Message-ID:
<NYtPk-blRW-11@gated-at.bofh.it>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!news-ams.pugleaf.net!srl.newsdeef.eu!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomodReferences:
<NYsgx-bkTc-5@gated-at.bofh.it>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!news-ams.pugleaf.net!srl.newsdeef.eu!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomod From: Eli Schwartz <eschwartz@gentoo.org> Newsgroups: linux.gentoo.user Subject: Re: [gentoo-user] custom ebuild issues: tar archive extraction Date: Thu, 12 Nov 2026 04:40:02 +0100 Message-ID: <NYtPk-blRW-11@gated-at.bofh.it> References: <NYsgx-bkTc-5@gated-at.bofh.it> X-Original-To: gentoo-user@lists.gentoo.org List-ID: Gentoo Linux mail <gentoo-user.gentoo.org> Reply-To: gentoo-user@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US Autocrypt: addr=eschwartz@gentoo.org; keydata= xjMEZmeRNBYJKwYBBAHaRw8BAQdAYNZ7pUDWhx1i2f3p6L2ZLu4FcY18UoeGC04Gq/khqwfN I0VsaSBTY2h3YXJ0eiA8ZXNjaHdhcnR6QGdlbnRvby5vcmc+wpYEExYKAD4CGwMFCwkIBwMF FQoJCAsFFgIDAQACHgUCF4AWIQTvUdMIsc4jCIi+DYTqQj6ToWND8QUCauABDQUJCJCIWQAK CRDqQj6ToWND8bXlAQDhi6hUxiss56cdPbsemrWdVQe3CtkpqlQccxV/4a4/QgD/dUCR+SGn YxNZj6lir6i/TBr0yfSSrMtKgGO1+lClSwLOOARmZ5E0EgorBgEEAZdVAQUBAQdATT46Z06b 1X9xjXFCYFxmq/Tj3tSEKZInDWTpoHQp4l8DAQgHwn4EGBYKACYCGwwWIQTvUdMIsc4jCIi+ DYTqQj6ToWND8QUCauABGAUJCJCIZAAKCRDqQj6ToWND8c4xAQCWj7iWpgEJUM+wf2bZCkgM EKEVVdv5aBJrj6Xa22UhIQEA0bIv2t9jUqUeBMHl/6i0L28s5Mrtr0ZSX3Sg/zeyrAM= X-Clacks-Overhead: GNU Terry Pratchett Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------bHuaxKZqhurVGw40fVIgBzmi" Approved: robomod@news.nic.it Lines: 107 Organization: linux.* mail to news gateway Sender: robomod@news.nic.it X-Original-Date: Wed, 11 Nov 2026 22:31:28 -0500 X-Original-Message-ID: <5b98dc99-72af-4439-9caf-72ada84fdd01@gentoo.org> X-Original-References: <6efebe75-8e79-4402-b916-6947d93c7869@oldfart.online>