diff --git a/.bin/gpgfile.sh b/.bin/gpgfile.sh index 02b0e64..150ec90 100755 --- a/.bin/gpgfile.sh +++ b/.bin/gpgfile.sh @@ -46,7 +46,7 @@ then && exit 1 # loop at provided files - for item in $@ + for item in "$@" do # Work in a subshell so dir changes won't be persistent. # Due to this, we "return" instead of "continue". @@ -55,8 +55,8 @@ then ( # change working directory - cd "$(dirname $item)" - item="$(basename $item)" + cd "$(dirname "$item")" + item="$(basename "$item")" # don't handle non existant files readlink -f "$item" > /dev/null 2>&1 \ @@ -89,7 +89,7 @@ fi ### handle decryption (set by -d) if [ $encrypt -eq 0 ] then - for item in $@ + for item in "$@" do # Work in a subshell so dir changes won't be persistent. # Due to this, we "return" instead of "continue". @@ -98,8 +98,8 @@ then ( # change working directory - cd "$(dirname $item)" - item="$(basename $item)" + cd "$(dirname "$item")" + item="$(basename "$item")" # don't handle non existant files readlink -f "$item" > /dev/null 2>&1 \ @@ -107,12 +107,12 @@ then && return; } # don't handle files that are not gpg encrypted - [ ${item##*.} != "gpg" ] \ + [ "${item##*.}" != "gpg" ] \ && echo "skipping: $item (reason: not a gpg file)" \ && return # handle file: decrypt with gpg + delete encrypted version - [ ${item##*.} == "gpg" ] \ + [ "${item##*.}" == "gpg" ] \ && echo "$item -> ${item%.*}" \ && gpg -q -d -o "${item%.*}" "$item" \ && rm -f "$item" \ @@ -120,7 +120,7 @@ then # no return: fallthrough to next handler # handle tar: if file ends in tar after decryption, untar it and delete the tar. - [ ${item##*.} == "tar" ] \ + [ "${item##*.}" == "tar" ] \ && echo "$item -> ${item%.*}" \ && tar xf "$item" \ && rm -f "$item" diff --git a/.bin/port-go-modules-update b/.bin/port-go-modules-update new file mode 100755 index 0000000..fc0ad33 --- /dev/null +++ b/.bin/port-go-modules-update @@ -0,0 +1,8 @@ +#!/bin/sh +. ~/.bin/_config + +set -x + +needs go-- + +make MODGO_VERSION=latest modgo-gen-modules > modules.inc diff --git a/.bin/port-jump b/.bin/port-jump new file mode 100755 index 0000000..dc0b6e6 --- /dev/null +++ b/.bin/port-jump @@ -0,0 +1,18 @@ +#!/bin/sh + +find /usr/ports/ \ + -not \( -path "/usr/ports/pobj" -prune \ + -o -path "*/distfiles" -prune \ + -o -path "*/packages" -prune \ + -o -path "*/logs" -prune \ + -o -path "*/CVS" -prune \ + -o -path "*/pkg" -prune \ + -o -path "*/patches" -prune \ + -o -path "*/files" -prune \ + -o -path "*/openbsd-wip" -prune \ + -o -path "*/mystuff" -prune \ + -o -path "*/.git" -prune \ + \) \ + -maxdepth 4 \ + -type d \ + -iname "*$1*" diff --git a/.bin/port-notes b/.bin/port-notes new file mode 100755 index 0000000..fdfd90d --- /dev/null +++ b/.bin/port-notes @@ -0,0 +1,12 @@ +#!/bin/cat + +Update go: +make MODGO_VERSION=v1.49.0 modgo-gen-modules > modules.inc +make MODGO_VERSION=latest modgo-gen-modules > modules.inc + +Update cargo: +make modcargo-gen-crates > crates.inc +make modcargo-gen-crates-licenses > crates.lic && mv crates.lic crates.inc + +Distfile name change: +newname-${V}{oldname}${EXTRACT_SUFX} diff --git a/.bin/port-notes-edit b/.bin/port-notes-edit new file mode 100755 index 0000000..87dd49d --- /dev/null +++ b/.bin/port-notes-edit @@ -0,0 +1,2 @@ +#!/bin/sh +vim /home/sdk/.bin/port-notes diff --git a/.bin/port-search b/.bin/port-search new file mode 100755 index 0000000..1018e0b --- /dev/null +++ b/.bin/port-search @@ -0,0 +1,20 @@ +#!/bin/sh + +if [ -z "$1" ] +then + echo "usage: port-search " + exit 2 +fi +type="$1" +shift + +find /usr/ports/ \ + -not \( -path "/usr/ports/pobj" -prune \ + -o -path "*/distfiles" -prune \ + -o -path "*/packages" -prune \ + -o -path "*/logs" -prune \ + -o -path "*/CVS" -prune \ + \) \ + -type f \ + -iname "$type" \ + -exec ugrep -F -- "$@" {} +