From f979ec70158c44681031ed35f8ea195084df42c7 Mon Sep 17 00:00:00 2001 From: psykose Date: Sun, 26 Mar 2023 09:46:43 +0000 Subject: [PATCH] abr: only export when defined, cleanup sccache --- abr/APKBUILD | 4 ++-- abr/abr | 40 ++++++++++++++++++++++------------------ 2 files changed, 24 insertions(+), 20 deletions(-) diff --git a/abr/APKBUILD b/abr/APKBUILD index 29d0159..ef91cb1 100644 --- a/abr/APKBUILD +++ b/abr/APKBUILD @@ -1,6 +1,6 @@ # Maintainer: psykose pkgname=abr -pkgver=1 +pkgver=2 pkgrel=0 pkgdesc="abr~!" url="https://git.ddd.rip/ptrcnull/aports" @@ -40,6 +40,6 @@ package() { } sha512sums=" -1a01d9a9cc3fd29622c803193e7b60c4c5855a65db786cb5d826fdd03a2ab071baff70a6bf01d7cd82e2c638a0691700e7810dca070b30071a0ad4066bc73b13 abr +77ce846c861098f4a3da15768be1aba6ae4a87dbbddca0146f55b2f6c933b05c6891a649db073f49f4fa33c1e083660a61b54aabbc8b548ebbdacb3b9a385568 abr 71d8cb1e5e57ff739915fa4de1f5699afa60ab36e2e5219c4c366af5ceab24dc6ee55e738d29ca2b63dd5e387de7661594fc86bf2183d787932e75b4c03c6a9f apkbuild-anitya " diff --git a/abr/abr b/abr/abr index 6ed42ad..dd01ac9 100755 --- a/abr/abr +++ b/abr/abr @@ -1,25 +1,26 @@ #!/bin/sh -e # clean self and do not pass through any environment -# except env, because it doesn't matter too much for this specific purpose +# except path/home, because it doesn't matter too much for this specific purpose, +# and home is required # and a few that are useful to keep some cache paths if [ -z "$_CLEAN" ]; then exec env -i \ _CLEAN=1 \ - CARGO_HOME="$CARGO_HOME" \ - GNUPGHOME="$GNUPGHOME" \ - GOCACHE="$GOCACHE" \ - GOMODCACHE="$GOMODCACHE" \ - GOPATH="$GOPATH" \ - GOTMPDIR="$GOTMPDIR" \ HOME="$HOME" \ PATH="$PATH" \ - XDG_CACHE_HOME="$XDG_CACHE_HOME" \ - XDG_CONFIG_HOME="$XDG_CONFIG_HOME" \ + ${CARGO_HOME:+CARGO_HOME="$CARGO_HOME"} \ + ${GNUPGHOME:+GNUPGHOME="$GNUPGHOME"} \ + ${GOCACHE:+GOCACHE="$GOCACHE"} \ + ${GOMODCACHE:+GOMODCACHE="$GOMODCACHE"} \ + ${GOPATH:+GOPATH="$GOPATH"} \ + ${GOTMPDIR:+GOTMPDIR="$GOTMPDIR"} \ + ${XDG_CACHE_HOME:+XDG_CACHE_HOME="$XDG_CACHE_HOME"} \ + ${XDG_CONFIG_HOME:+XDG_CONFIG_HOME="$XDG_CONFIG_HOME"} \ "$0" "$@" fi -while getopts "j:fmnx" opt; do +while getopts "j:fmnsx" opt; do case "$opt" in 'j') jobs="$OPTARG" @@ -42,6 +43,9 @@ while getopts "j:fmnx" opt; do 'n') nonice=1 ;; + 's') + nosccache=1 + ;; 'x') # skip checks export ABUILD_BOOTSTRAP=1 @@ -56,18 +60,18 @@ shift "$((OPTIND - 1))" # loop again to check if rootbld for arg; do - if eltest "${arg:-x}" =~ "rootbld"; then - # not available in rootbld - nosccache=1 + if eltest "$arg" =~ "rootbld" || [ -n "$nosccache" ]; then + # pointless in rootbld + # TODO: maybe we can mount something into rootbld without patches + : + else + extra="$extra sccache" + export RUSTC_WRAPPER=sccache fi done -if [ -z "$nosccache" ]; then - export RUSTC_WRAPPER=sccache -fi - if [ -z "$nomemhack" ]; then - extra="scudo-malloc" + extra="$extra scudo-malloc" export LD_PRELOAD="/usr/lib/libscudo.so" fi