Return to repo list

stctpw

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

commit 6b972ea4fcad4d34fe65e162fd431a4d7022305f
parent ffa6beff948b9f16ae5d57a031c32917171c2c3a
Author: Erik Letson <hmagellan@hmagellan.com>
Date:   Tue, 28 Jul 2020 13:14:52 -0500

Begin the logic

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

diff --git a/stctpw.sh b/stctpw.sh @@ -1,8 +1,10 @@ #!/bin/bash +# Vars MODFILE="$HOME/config.def.h" -# Vars +ARG='' +TARGETDISTFILES='' FETCHWEB=0 INSTALLPATCH=0 NUMARGS=0 @@ -17,7 +19,7 @@ while [[ "$#" -gt 0 ]]; do -i|--install) INSTALLPATCH=1 ;; *) - echo "Argument was: $1" + ARG=$1 NUMARGS=$NUMARGS+1 if [[ $NUMARGS -eq 2 ]]; then echo "Too many arguments!" @@ -28,7 +30,17 @@ while [[ "$#" -gt 0 ]]; do shift done -echo "$MODFILE" -echo "fetch online? $FETCHWEB" -echo "install patch? $INSTALLPATCH" +if [[ -z $ARG ]]; then + echo "No argument chosen!" + exit 1 +fi + +# Set up environment +mkdir -p /var/tmp/stctpw +cd /var/tmp/stctpw +cp $MODFILE /var/tmp/stctpw +# Get the archive (has potential interactive elements) +if [[ $FETCHWEB -ne 1 ]]; then + TARGETDISTFILES=$(find /var/cache/distfiles/ | grep "^/var/cache/distfiles/$ARG-") +fi