commit:     ca08ed2aea1532dfd3d970f5a657abfc9e9e6f6f
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Thu May 30 09:50:39 2019 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Thu May 30 10:09:29 2019 +0000
URL:        https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=ca08ed2a

make-tarball: update/fix for latest autotools build

Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>

 make-tarball.sh | 31 +++++++++++++------------------
 1 file changed, 13 insertions(+), 18 deletions(-)

diff --git a/make-tarball.sh b/make-tarball.sh
index 2052985..489ce4b 100755
--- a/make-tarball.sh
+++ b/make-tarball.sh
@@ -1,8 +1,8 @@
-#!/bin/bash
+#!/bin/env bash
 
 set -e
 
-if ! . /etc/init.d/functions.sh 2>/dev/null ; then
+if ! .  ${EPREFIX}/lib/gentoo/functions.sh 2>/dev/null ; then
        einfo() { printf ' * %b\n' "$*"; }
        eerror() { einfo "$@" 1>&2; }
 fi
@@ -26,38 +26,32 @@ git) ver="HEAD" ;;
        fi
        ;;
 esac
-p="portage-utils-${ver#v}"
+p="${TMPDIR:-/var/tmp}/portage-utils-${ver#v}"
 
 rm -rf "${p}"
 mkdir "${p}"
 
 einfo "Checking out clean git sources ..."
 git archive "${ver}" | tar xf - -C "${p}"
-cd "${p}"
+pushd "${p}" >/dev/null
 
 einfo "Building autotools ..."
 sed -i "/^AC_INIT/s:git:${ver#v}:" configure.ac
 sed -i "/^AM_MAINTAINER_MODE/s:(.*)$::" configure.ac
-sed -i "1iPV := ${ver#v}" Makefile
-LC_ALL=C ${MAKE} -s autotools >/dev/null
+./autogen.sh
 rm -rf autom4te.cache
-cd ..
+popd >/dev/null
 
 einfo "Generating tarball ..."
-tar --numeric-owner -cf - "${p}" | xz > "${p}".tar.xz
+pushd "${p%/*}" >/dev/null
+tar --numeric-owner -cf - "${p##*/}" | xz > "${p}".tar.xz
+popd >/dev/null
 rm -r "${p}"
-du -b "${p}".tar.*
 
-einfo "Checking tarball (simple) ..."
+einfo "Checking tarball ..."
+pushd "${p%/*}" >/dev/null
 tar xf "${p}".tar.*
-pushd "${p}" >/dev/null
-v ${MAKE} -s
-v ${MAKE} -s check
 popd >/dev/null
-rm -rf "${p}"
-
-einfo "Checking tarball (autotools) ..."
-tar xf "${p}".tar.*
 pushd "${p}" >/dev/null
 v ./configure -q
 v ${MAKE} -s
@@ -67,6 +61,7 @@ rm -rf "${p}"
 
 echo
 einfo "All ready for distribution!"
-du -b "${p}".tar.*
+mv "${p}".tar.* .
+du -b "${p##*/}".tar.*
 
 exit 0

Reply via email to