mirror of
https://github.com/moparisthebest/pacman
synced 2024-12-23 08:18:51 -05:00
Use shell builtin to list files for package inclusion
On BSD systems, as super user, the 'ls' command displays all dot files by default, causing these to get included when not intended. If we use the bash glob operator, we can avoid issues with ls on different platforms; however, we need to turn the nullglob shell option on first to ensure we don't have problems in empty directories. Originally-noticed-by: Sebastian Nowicki <sebnow@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
parent
1824bc6ee6
commit
7fc306cd41
@ -36,6 +36,10 @@ export TEXTDOMAINDIR='@localedir@'
|
|||||||
# file -i does not work on Mac OSX unless legacy mode is set
|
# file -i does not work on Mac OSX unless legacy mode is set
|
||||||
export COMMAND_MODE='legacy'
|
export COMMAND_MODE='legacy'
|
||||||
|
|
||||||
|
# when fileglobbing, we want * in an empty directory to expand to the null
|
||||||
|
# string rather than itself
|
||||||
|
shopt -s nullglob
|
||||||
|
|
||||||
myver='@PACKAGE_VERSION@'
|
myver='@PACKAGE_VERSION@'
|
||||||
confdir='@sysconfdir@'
|
confdir='@sysconfdir@'
|
||||||
startdir="$PWD"
|
startdir="$PWD"
|
||||||
@ -849,7 +853,7 @@ create_package() {
|
|||||||
|
|
||||||
local pkg_file="$PKGDEST/${pkgname}-${pkgver}-${pkgrel}-${CARCH}${PKGEXT}"
|
local pkg_file="$PKGDEST/${pkgname}-${pkgver}-${pkgrel}-${CARCH}${PKGEXT}"
|
||||||
|
|
||||||
if ! bsdtar -czf "$pkg_file" $comp_files $(ls); then
|
if ! bsdtar -czf "$pkg_file" $comp_files *; then
|
||||||
error "$(gettext "Failed to create package file.")"
|
error "$(gettext "Failed to create package file.")"
|
||||||
exit 1 # TODO: error code
|
exit 1 # TODO: error code
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user