Return to repo list

stctpw

Portage-compatible patch maker for suckless tools.
Return to HMagellan.com

commit 1732c574906c0248b3535f681d97470d14a349a1
parent 642ff52b460f7c3b8c1b66a11f86089d86c33824
Author: Erik Letson <hmagellan@hmagellan.com>
Date:   Wed, 29 Jul 2020 01:18:48 -0500

Fixed string issues and got it running

Diffstat:
Mstctpw.sh | 24+++++++++++++++++-------
1 file changed, 17 insertions(+), 7 deletions(-)

diff --git a/stctpw.sh b/stctpw.sh @@ -35,7 +35,7 @@ multidistfileprompt() { while [[ "$#" -gt 0 ]]; do case $1 in -f) - MODFILE=="$2"; shift ;; + MODFILE=$(realpath $2); shift ;; -w|--web) FETCHWEB=1 ;; -i|--install) @@ -67,23 +67,33 @@ cd /var/tmp/stctpw # Get the archive (has potential interactive elements) if [[ $FETCHWEB -ne 1 ]]; then + + # Sub-process substitution so the vars work right numlines=0 - find /var/cache/distfiles/ | grep "^/var/cache/distfiles/$ARG-" | while read line; do + while read -r line; do numlines=$numlines+1 TARGETDISTFILES="$TARGETDISTFILES $line" - done + done < <(find /var/cache/distfiles/ | grep "^/var/cache/distfiles/$ARG-") + if [[ $numlines -ge 2 ]]; then multidistfileprompt $TARGETDISTFILES fi - tar -xvzf /var/cache/distfiles/$TARGETDISTFILES - cp $TARGETDISTFILES a - cp $TARGETDISTFILES b + + tar -xzf $TARGETDISTFILES + + #TODO: This is not a good way to get the dir name... + dirname=$(ls) + + cp -r $dirname a + cp -r $dirname b cp $MODFILE b/config.def.h diff -up a b > $CURRENT_DIR/config.patch + if [[ $INSTALLPATCH -eq 1 ]]; then echo "Will install" fi + cd /var/tmp rm -rd stctpw fi -unset numlines +unset numlines dirname