[pacman-dev] [PATCH] makepkg: support .tar.Z source packages creation
Allan McRae
allan at archlinux.org
Fri Sep 30 02:18:59 EDT 2011
On 30/09/11 15:30, lolilolicon wrote:
> Also address an uninitialized use of $ret.
> ---
> scripts/makepkg.sh.in | 6 +++++-
> 1 files changed, 5 insertions(+), 1 deletions(-)
>
> diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
> index d426661..8f76656 100644
> --- a/scripts/makepkg.sh.in
> +++ b/scripts/makepkg.sh.in
> @@ -1332,6 +1332,7 @@ create_signature() {
> }
>
> create_srcpackage() {
> + local ret=0
> msg "$(gettext "Creating source package...")"
> local srclinks="$(mktemp -d "$startdir"/srclinks.XXXXXXXXX)"
> mkdir "${srclinks}"/${pkgbase}
> @@ -1369,6 +1370,7 @@ create_srcpackage() {
> *tar.gz) TAR_OPT="z" ;;
> *tar.bz2) TAR_OPT="j" ;;
> *tar.xz) TAR_OPT="J" ;;
> + *tar.Z) TAR_OPT="Z" ;;
> *tar) TAR_OPT="" ;;
> *) warning "$(gettext "'%s' is not a valid archive extension.")" \
> "$SRCEXT" ;;
> @@ -1380,7 +1382,9 @@ create_srcpackage() {
> # tar it up
> msg2 "$(gettext "Compressing source package...")"
> cd "${srclinks}"
> - if ! bsdtar -c${TAR_OPT}Lf "$pkg_file" ${pkgbase}; then
> + bsdtar -c${TAR_OPT}Lf "$pkg_file" ${pkgbase}
> + ret=$?
> + if (( ret )); then
No need for this. Just remove the "if (( !ret ))" as it is unneeded (we
have already exited...) and add "local ret=0".
> error "$(gettext "Failed to create source package file.")"
> exit 1 # TODO: error code
> fi
Allan
More information about the pacman-dev
mailing list