From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 7C7B3158009 for ; Sat, 17 Jun 2023 09:04:47 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id BD4E6E0A5E; Sat, 17 Jun 2023 09:04:46 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id A6C32E0A5E for ; Sat, 17 Jun 2023 09:04:46 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id ECD1C340E49 for ; Sat, 17 Jun 2023 09:04:45 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 87AE2A66 for ; Sat, 17 Jun 2023 09:04:44 +0000 (UTC) From: "Fabian Groffen" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Fabian Groffen" Message-ID: <1686992636.ac357a05d5aa49f43504a4ef2acaabc9e8d8daa5.grobian@gentoo> Subject: [gentoo-commits] proj/portage:prefix commit in: / X-VCS-Repository: proj/portage X-VCS-Files: tarball.sh X-VCS-Directories: / X-VCS-Committer: grobian X-VCS-Committer-Name: Fabian Groffen X-VCS-Revision: ac357a05d5aa49f43504a4ef2acaabc9e8d8daa5 X-VCS-Branch: prefix Date: Sat, 17 Jun 2023 09:04:44 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: a7fd0350-d90b-41e4-a1c8-8ff9d7fbbd39 X-Archives-Hash: 57facde9ad9e4d9a6d9ebb37e5bc77d8 commit: ac357a05d5aa49f43504a4ef2acaabc9e8d8daa5 Author: Fabian Groffen gentoo org> AuthorDate: Sat Jun 17 09:03:56 2023 +0000 Commit: Fabian Groffen gentoo org> CommitDate: Sat Jun 17 09:03:56 2023 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=ac357a05 tarball: cleanup script make it flow a bit more natural Signed-off-by: Fabian Groffen gentoo.org> tarball.sh | 56 ++++++++++++++++++++++++++++++++------------------------ 1 file changed, 32 insertions(+), 24 deletions(-) diff --git a/tarball.sh b/tarball.sh index 216c1d17f..7d35dacf8 100755 --- a/tarball.sh +++ b/tarball.sh @@ -9,38 +9,46 @@ if [ -z "$1" ]; then fi export PKG="prefix-portage" -export TMP="/var/tmp" +export TMP="/var/tmp/${PKG}-build.$$" export V="$1" export DEST="${TMP}/${PKG}-${V}" +export TARFILE="/var/tmp/${PKG}-${V}.tar.bz2" -if [[ -e ${DEST} ]]; then - echo ${DEST} already exists, please remove first - exit 1 -fi +# hypothetically it can exist +rm -Rf "${TMP}" + +# create copy of source +install -d -m0755 "${DEST}" +rsync -a --exclude='.git' --exclude='.hg' --exclude="repoman/" . "${DEST}" -install -d -m0755 ${DEST} -rsync -a --exclude='.git' --exclude='.hg' --exclude="repoman/" . ${DEST} +cd "${DEST}" + +# expand version sed -i -e '/^VERSION\s*=/s/^.*$/VERSION = "'${V}_prefix'"/' \ - ${DEST}/lib/portage/__init__.py -sed -i -e "/version = /s/'[^']\+'/'${V}-prefix'/" ${DEST}/setup.py -sed -i -e "1s/VERSION/${V}-prefix/" ${DEST}/man/{,ru/}*.[15] -sed -i -e "s/@version@/${V}/" ${DEST}/configure.ac + lib/portage/__init__.py +sed -i -e "/version = /s/'[^']\+'/'${V}-prefix'/" setup.py +sed -i -e "1s/VERSION/${V}-prefix/" man/{,ru/}*.[15] +sed -i -e "s/@version@/${V}/" configure.ac -cd ${DEST} +# cleanup cruft find -name '*~' | xargs --no-run-if-empty rm -f +find -name '*.#*' | xargs --no-run-if-empty rm -f find -name '*.pyc' | xargs --no-run-if-empty rm -f find -name '*.pyo' | xargs --no-run-if-empty rm -f -cd $TMP -rm -f \ - ${PKG}-${V}/bin/emerge.py \ - ${PKG}-${V}/bin/{pmake,sandbox} \ - ${PKG}-${V}/{bin,lib}/'.#'* \ - ${PKG}-${V}/{bin,lib}/*.{orig,diff} \ - ${PKG}-${V}/{bin,lib}/*.py[oc] -cd $TMP/${PKG}-${V} +find -name '*.orig' | xargs --no-run-if-empty rm -f +rm -Rf autom4te.cache + +# we don't need these (why?) +rm -f bin/emerge.py bin/{pmake,sandbox} + +# generate a configure file chmod a+x autogen.sh && ./autogen.sh || { echo "autogen failed!"; exit -1; }; rm -f autogen.sh tabcheck.py tarball.sh commit -cd $TMP -tar --numeric-owner -jcf ${TMP}/${PKG}-${V}.tar.bz2 ${PKG}-${V} -rm -R ${TMP}/${PKG}-${V} -ls -la ${TMP}/${PKG}-${V}.tar.bz2 + +# produce final tarball +cd "${TMP}" +tar --numeric-owner -jcf "${TARFILE}" ${PKG}-${V} + +cd / +rm -Rf "${TMP}" +ls -la "${TARFILE}"