dot

packages and services management
Log | Files | Refs | README

commit 9f5780b1f9c4eb98b37ebeb0da3ec5bfb0a7b69d
parent ef05622d0fefbae2e1cd531af64b5f4cd95c65a5
Author: Josuah Demangeon <mail@josuah.net>
Date:   Fri, 16 Mar 2018 11:14:51 +0100

added sbase and made pack and io POSIX compliant

Diffstat:
Mbin/back | 2+-
Mbin/io | 2+-
Mbin/mfilter | 2+-
Mbin/pack | 24+++++++++++++-----------
Apack/sbase/build | 2++
Apack/sbase/git | 1+
6 files changed, 19 insertions(+), 14 deletions(-)

diff --git a/bin/back b/bin/back @@ -43,7 +43,7 @@ case "$1" in printf 'apply %s? [Y/n] ' "$2" 1>&2 case "$(sed q)" in (y|Y|'') ;; (*) exit 0 ;; esac - find . -mindepth 1 -maxdepth 1 -exec rm -r {} + + rm -fr * .* while read -r hash path do diff --git a/bin/io b/bin/io @@ -15,7 +15,7 @@ case "$PWD" in ;; esac -exec xdg-open "$(find "$HOME" -maxdepth 1 -mindepth 1 | +exec xdg-open "$(printf '%s\n' "$HOME"/* | sort | cut -c $((${#HOME} + 2))- | xargs -I {} printf '%s/%s\n' "$cache" {} | diff --git a/bin/mfilter b/bin/mfilter @@ -14,5 +14,5 @@ do "$HOME/var/mail/$dir/tmp" printf '%-35s' "$dir" 1>&2 mpick -t "$header ~~~ $glob" < "$HOME/.config/mblaze/seq.mfilter" | - xargs -rI {} mv {} "$HOME/var/mail/$dir/new" + xargs -r {} mv {} "$HOME/var/mail/$dir/new" done 2>&1 | sed 's/, 0 picked././' | less diff --git a/bin/pack b/bin/pack @@ -1,6 +1,6 @@ #!/bin/sh -e -SRC="$PACKROOT/src/$2" +src="$PACKROOT/src/$2" export PREFIX="$PACKROOT/opt/$2" export CFLAGS="-I'$PACKROOT/include'" @@ -10,29 +10,31 @@ mkdir -p "$PACKROOT/src" "$PACKROOT/opt" case "$1" in (tar) - [ -d "$SRC" ] && exit 0 || mkdir -p "$SRC" + [ -d "$src" ] && exit 0 + + mkdir -p "$src" IFS="" read -r url < "$PACK/$2/tar" curl -#L "$url" | case "$url" in (*.tgz|*.tar.gz) gzip -d - ;; (*.tbz|*.tar.bz2) bzip2 -d - ;; (*.txz|*.tar.xz) xz -d - ;; - esac | tar -xf - -C "$SRC" || rmdir "$SRC" + esac | tar -xf - -C "$src" || rmdir "$src" - find "$SRC" -mindepth 2 -maxdepth 2 -exec mv {} "$SRC" \; - rmdir "$SRC"/* 2>/dev/null || true + mv "$src"/*/* "$src" + rmdir "$src"/* 2>/dev/null || true ;; (git) - [ -d "$SRC" ] && exit 0 + [ -d "$src" ] && exit 0 IFS="" read -r url < "$PACK/$2/git" - git clone "$url" "$SRC" + git clone "$url" "$src" ;; (cvs) - [ -d "$SRC" ] && exit 0 || mkdir -p "$SRC" + [ -d "$src" ] && exit 0 || mkdir -p "$src" read -r url path < "$PACK/$2/cvs" - cd "$SRC" + cd "$src" cvs -qd "$url" checkout -P "$path" ;; (get) @@ -42,9 +44,9 @@ case "$1" in exit 1 ;; (build) - [ -d "$SRC" ] || "$0" get "$2" + [ -d "$src" ] || "$0" get "$2" - cd "$SRC" + cd "$src" mkdir -p "$PREFIX" exec "$PACK/$2/build" ;; diff --git a/pack/sbase/build b/pack/sbase/build @@ -0,0 +1 @@ +../build/make+ \ No newline at end of file diff --git a/pack/sbase/git b/pack/sbase/git @@ -0,0 +1 @@ +git://git.suckless.org/sbase