-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GlobDistdir: check for glob usage with DISTDIR
Resolves: #605 Signed-off-by: Arthur Zamarin <[email protected]>
- Loading branch information
Showing
3 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
testdata/data/repos/standalone/GlobCheck/GlobDistdir/expected.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{"__class__": "GlobDistdir", "category": "GlobCheck", "package": "GlobDistdir", "version": "0", "line": "\"${DISTDIR}\"/foo-*.bar", "lineno": 7} | ||
{"__class__": "GlobDistdir", "category": "GlobCheck", "package": "GlobDistdir", "version": "0", "line": "\"${DISTDIR}\"/\"${DISTDIR}\"/foo-?.bar", "lineno": 8} | ||
{"__class__": "GlobDistdir", "category": "GlobCheck", "package": "GlobDistdir", "version": "0", "line": "\"${DISTDIR}\"/foo-?-*.bar", "lineno": 9} |
15 changes: 15 additions & 0 deletions
15
testdata/repos/standalone/GlobCheck/GlobDistdir/GlobDistdir-0.ebuild
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
DESCRIPTION="Ebuild with unsafe glob around DISTDIR" | ||
HOMEPAGE="https://github.com/pkgcore/pkgcheck" | ||
SLOT="0" | ||
LICENSE="BSD" | ||
|
||
src_install() { | ||
doins "${DISTDIR}"/foo-*.bar # bad | ||
doins "${DISTDIR}"/"${DISTDIR}"/foo-?.bar # bad | ||
doins "${DISTDIR}"/foo-?-*.bar # bad | ||
|
||
doins "${T}"/foo-*.bar # not unsafe dir | ||
doins "${DISTDIR}"/foo-1.bar # no glob | ||
doins "${DISTDIR}"/"foo-*.bar" # quoted | ||
doins "${DISTDIR}"/'foo-*.bar' # quoted | ||
} |