Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[New Check]: Use of globs on DISTDIR #605

Closed
1 task done
mgorny opened this issue Jul 31, 2023 · 2 comments · Fixed by #610
Closed
1 task done

[New Check]: Use of globs on DISTDIR #605

mgorny opened this issue Jul 31, 2023 · 2 comments · Fixed by #610
Labels

Comments

@mgorny
Copy link
Contributor

mgorny commented Jul 31, 2023

Is there an existing such new check request for this?

  • I have searched the existing issues

Explain

Some ebuilds are using thingies like:

doins "${DISTDIR}"/foo-*.bar

This incorrectly assumes that DISTDIR will only contain files relevant to the current package. To keep things safe, it's best not to allow any globs on DISTDIR.

I think we could basically check for *?[ in the same word as ${DISTDIR}..

Examples

https://github.com/gentoo/gentoo/blob/b003461c15eb7d759059bcaf44961fb87517f59b/dev-dotnet/dotnet-runtime-nugets/dotnet-runtime-nugets-6.0.14.ebuild#L46-L47

Output message

Filename expansion used with DISTDIR

Documentation

Filename expansion could accidentally match irrelevant files in DISTDIR, e.g. from other packages or other versions of the same package.

Result level

warning

@mgorny mgorny added the check label Jul 31, 2023
@thesamesam
Copy link
Member

cc @negril. I remember making this mistake with mpfr..

@negril
Copy link

negril commented Aug 1, 2023

Maybe all variables should be be quoted to prevent globing? See https://www.shellcheck.net/wiki/SC2086

arthurzam added a commit to arthurzam/pkgcheck that referenced this issue Aug 3, 2023
Resolves: pkgcore#605
Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants