[pacman-dev] [PATCH] Make sure dot files don't get included in package

Roman Kyrylych roman.kyrylych at gmail.com
Thu Jun 12 04:47:43 EDT 2008


2008/6/11 Dan McGee <dpmcgee at gmail.com>:
>
> Any objections? I can think of one issue- this would pass the literal
> * on to bsdtar if no other files existed (e.g. trying to create a
> no-files package).
>
> diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
> index 457f62d..34f35f3 100644
> --- a/scripts/makepkg.sh.in
> +++ b/scripts/makepkg.sh.in
> @@ -849,7 +849,7 @@ create_package() {
>
>        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.")"
>                exit 1 # TODO: error code
>        fi
>
> So maybe something like this?
>
> diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
> index 457f62d..70d8e15 100644
> --- a/scripts/makepkg.sh.in
> +++ b/scripts/makepkg.sh.in
> @@ -36,6 +36,10 @@ export TEXTDOMAINDIR='@localedir@'
>  # file -i does not work on Mac OSX unless legacy mode is set
>  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@'
>  confdir='@sysconfdir@'
>  startdir="$PWD"
> @@ -849,7 +853,7 @@ create_package() {
>
>        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.")"
>                exit 1 # TODO: error code
>        fi

Looks good to me.

-- 
Roman Kyrylych (Роман Кирилич)


More information about the pacman-dev mailing list