dot

packages and services management
Log | Files | Refs | README

commit 080acfee848e290336eccbd59072976f2d88755e
parent fa2e37f55640089be00bf2420813548a7fb0851c
Author: Josuah Demangeon <josuah.demangeon@gandi.net>
Date:   Tue, 15 Aug 2017 16:26:31 +0200

using ROOT as only configuration variable

Diffstat:
Mbuild | 4++--
Mcalendar/bin/calendar-update | 2+-
Mdma/build | 6+++---
Denchive/.config/enchive/key.pub | 2--
Mgit/git-index.1 | 8++++----
Mgit/run | 2+-
Mii/run | 6+++---
Miomenu/bin/io | 2+-
Miomenu/bin/io-cache | 20+++++++++-----------
Diomenu/bin/io-setfont | 3---
Miomenu/bin/io-unicode | 3+--
Mlibbearssl/bin/bot | 4++--
Mmini_httpd/run | 2+-
Dminihttpd/build | 4----
Dminihttpd/run | 1-
Dminihttpd/tar | 1-
Amonitor/.cron.swp | 0
Mmonitor/bin/monitor | 11+++++------
Mmonitor/bin/monitor-plot | 2+-
Mmonitor/cron | 1+
Mmpop/build | 2+-
Angircd/.crash.swp | 0
Angircd/crash | 1+
Mngircd/run | 2+-
Mopentracker/run | 4++--
Apkg/bin/.pkg-tar.swp | 0
Mpkg/bin/pkg-build | 6+++---
Mpkg/bin/pkg-configure | 26++++++++++++--------------
Mpkg/bin/pkg-git | 6+++---
Mpkg/bin/pkg-install | 6+++---
Mpkg/bin/pkg-remove | 4+++-
Mpkg/bin/pkg-service | 46++++++++++++++++++++++++++--------------------
Mpkg/bin/pkg-tar | 15++++++++-------
Apkg/cron | 1+
Mquark/configure | 2+-
Mratox/config.mk | 12++++++------
Mratox/run | 2+-
Mrc | 12++----------
Mscron/run | 2+-
Mshell/bin/fig | 2+-
Mshell/bin/uri | 4++--
Mshell/profile | 2+-
Mst/build | 2+-
Mxdg/profile | 20++++++++++----------
44 files changed, 125 insertions(+), 138 deletions(-)

diff --git a/build b/build @@ -1,4 +1,4 @@ -find "$PKG/${PWD##*/}" -name '*.diff' -exec patch -N -p 1 -i {} ';' -find "$PKG/${PWD##*/}" -name 'config.*' -exec cp -f {} . ';' +find "$ROOT/pkg/${PWD##*/}" -name '*.diff' -exec patch -N -p 1 -i {} ';' +find "$ROOT/pkg/${PWD##*/}" -name 'config.*' -exec cp -f {} . ';' [ -f ./configure ] && ./configure --prefix="$PREFIX" make && make prefix="$PREFIX" PREFIX="$PREFIX" install clean diff --git a/calendar/bin/calendar-update b/calendar/bin/calendar-update @@ -1,4 +1,4 @@ # pull calendar data from various sources wget -qO- 'http://planning.univ-rennes1.fr/jsp/custom/modules/plannings/cal.jsp?data=8241fc3873200214d3ba247351a161f5bd72d825015315fe5d6496b849150f14ec7f554d6ed7ba1bbad7b9bdf5b7bdb27fbb53e06bf966cea3b3f4c7cc4cd75b8af069ff1fd12df97e86aed5fc16ce3b8edd3cda7b61e593' | -calendar-import | sed 's/ (Exp.*//' > "$VAR/cal/university" +calendar-import | sed 's/ (Exp.*//' > "$ROOT/var/cal/university" diff --git a/dma/build b/dma/build @@ -1,10 +1,10 @@ -mkdir -p "$PREFIX/bin" "$PREFIX/share/man/man8" "$VAR/spool/dma" +mkdir -p "$PREFIX/bin" "$PREFIX/share/man/man8" "$ROOT/var/spool/dma" case "$(uname)" in (*BSD ) cd bsd ;; esac make PREFIX="$PREFIX" \ - CONFDIR="$PKG/dma" \ - VAR="$VAR" \ + CONFDIR="$ROOT/pkg/dma" \ + VAR="$ROOT/var" \ CFLAGS+="-I$ROOT/include" \ LDFLAGS+="-L$ROOT/lib" diff --git a/enchive/.config/enchive/key.pub b/enchive/.config/enchive/key.pub @@ -1 +0,0 @@ -/mnt/ssh/enchive/key.pub- \ No newline at end of file diff --git a/git/git-index.1 b/git/git-index.1 @@ -1,11 +1,11 @@ .Dd mar 23, 2017 -.Dt WWW-GIT +.Dt GIT-INDEX .Os . . .Sh NAME . -.Nm www-git +.Nm git-index .Nd generate static website with the git command . . @@ -67,10 +67,10 @@ A script generating an index of multiple repositories might look like this: printf '<!doctype html>\\n<html>\\n<body>\\n<ul>\\n' > ./index.html printf '<li><a href="">%s</a></li>\n' git/repo1 repo1 >> index.html -www-git /path/to/repo1 +git-index /path/to/repo1 printf '<li><a href="">%s</a></li>\n' git/repo2 repo2 >> index.html -www-git /path/to/repo2 +git-index /path/to/repo2 printf '</ul>\\n</body>\\n</html>\\n' >> index.html .Ed diff --git a/git/run b/git/run @@ -1 +1 @@ -git daemon --base-path="$GIT" --export-all & PID=$! +git daemon --base-path="$ROOT/git" --export-all & PID=$! diff --git a/ii/run b/ii/run @@ -1,12 +1,12 @@ -mkdir -p "$VAR/irc/$1" +mkdir -p "$ROOT/var/irc/$1" ii \ -s "$1" \ - -i "$VAR/irc" \ + -i "$ROOT/var/irc" \ -p "${2:-6667}" \ -n "$NICK" \ -k PASS \ -f "$NAME" \ - > "$VAR/irc/$1/log" & + > "$ROOT/var/irc/$1/log" & PID=$! diff --git a/iomenu/bin/io b/iomenu/bin/io @@ -22,7 +22,7 @@ then else selection=$({ cut -d ' ' -f 3- "$HOME/.abduco/names" - cat "$VAR/cache/io" + cat "$ROOT/var/cache/io" } | iomenu -p io -s -h | sed 's/# //') command=$(printf %s "$selection" | cut -d ' ' -f 1) diff --git a/iomenu/bin/io-cache b/iomenu/bin/io-cache @@ -1,9 +1,7 @@ +mkdir -p "$ROOT/var/cache" +touch "$ROOT/var/cache/io" - -mkdir -p "$VAR/cache" -touch "$VAR/cache/io" - -find "$HOME" \ +find "$ROOT" \ -path "*/.git/*" -prune -o \ -path "*/.hg/*" -prune -o \ -path "${MAIL%/*}/*/*" -prune -o \ @@ -12,7 +10,7 @@ find "$HOME" \ awk -v MAIL="${MAIL%/*}" ' - $0 ~ ENVIRON["VAR"] "/irc/.*/$" { + $0 ~ ENVIRON["ROOT/var"] "/irc/.*/$" { ircv[ircc++] = $0 } @@ -28,7 +26,7 @@ awk -v MAIL="${MAIL%/*}" ' searchv[searchc++] = $0 } - $0 ~ VAR "/music" { + $0 ~ ROOT/var "/music" { musicv[musicc++] = $0 } @@ -59,10 +57,10 @@ awk -v MAIL="${MAIL%/*}" ' print "# " ENVIRON["EDITOR"] for (i = 0; i < filesc; i++) print(filesv[i] ) } -' > "$VAR/cache/io" +' > "$ROOT/var/cache/io" { printf '# uri\n' - cat "$HOME/lib/url"/* "$PKG/lib/url" - cut -d ' ' -f 1 "$HOME/.ssh/known_hosts" | sed -r 's|^|ssh://root@|' -} >> "$VAR/cache/io" + cat "$ROOT/lib/url"/* "$ROOT/pkg/lib/url" + cut -d ' ' -f 1 "$ROOT/.ssh/known_hosts" | sed -r 's|^|ssh://root@|' +} >> "$ROOT/var/cache/io" diff --git a/iomenu/bin/io-setfont b/iomenu/bin/io-setfont @@ -1,3 +0,0 @@ -# set tty font using iomenu -l 255 -p setfont - -find "$PKG/consolefonts" -type f | sort | iomenu -l 255 -p setfont | xargs setfont diff --git a/iomenu/bin/io-unicode b/iomenu/bin/io-unicode @@ -1,9 +1,8 @@ # prompt for an unicode character mkdir -p "$CACHE" -CACHE="$HOME/.cache/io" -[ -f "$CACHE/unicode" ] || +[ -f "$ROOT/var/cache/unicode" ] || wget -O- http://www.unicode.org/Public/UNIDATA/UnicodeData.txt | cut -d ';' -f diff --git a/libbearssl/bin/bot b/libbearssl/bin/bot @@ -4,8 +4,8 @@ CHAN=#commits NICK=${0##*/} PASS=$PASS -mkdir -p "$VAR/irc/$HOST" -cd "$VAR/irc/$HOST" || exit +mkdir -p "$ROOT/var/irc/$HOST" +cd "$ROOT/var/irc/$HOST" || exit case "$1" in (git) diff --git a/mini_httpd/run b/mini_httpd/run @@ -1 +1 @@ -mini_httpd -D -v -d "$VAR/www" -dd "$VAR/www" & PID=$! +mini_httpd -D -v -d "$ROOT/var/www" -dd "$ROOT/var/www" & PID=$! diff --git a/minihttpd/build b/minihttpd/build @@ -1,4 +0,0 @@ -# sed 's///' mini_httpd.c > mini_httpd.c.sed && -# mv mini_httpd.c.sed mini_httpd.c - -make diff --git a/minihttpd/run b/minihttpd/run @@ -1 +0,0 @@ -mini_httpd -Dd "$VAR/www" & PID=$! diff --git a/minihttpd/tar b/minihttpd/tar @@ -1 +0,0 @@ -http://www.acme.com/software/mini_httpd/mini_httpd-1.27.tar.gz diff --git a/monitor/.cron.swp b/monitor/.cron.swp Binary files differ. diff --git a/monitor/bin/monitor b/monitor/bin/monitor @@ -1,13 +1,12 @@ -# script monitoring performances and recording data to $VAR/stat +# script monitoring performances and recording data to $ROOT/var/stat -VAR=${VAR:-$HOME/var} STEP="${1:-900}" -mkdir -p "$VAR/stat" +mkdir -p "$ROOT/var/stat" while true do - monitor-step "$STEP" >> "$VAR/stat/data" - tail -n 100 "$VAR/stat/data" | - monitor-plot "$STEP" > "$VAR/stat/graph" + monitor-step "$STEP" >> "$ROOT/var/stat/data" + tail -n 100 "$ROOT/var/stat/data" | + monitor-plot "$STEP" > "$ROOT/var/stat/graph" done diff --git a/monitor/bin/monitor-plot b/monitor/bin/monitor-plot @@ -1,4 +1,4 @@ -# read the data from "$VAR/stat/data" and fills missing entries with "?" +# read the data from stdin and fills missing entries with "?" awk -v STEP="${1:?argument missing} step}" ' diff --git a/monitor/cron b/monitor/cron @@ -0,0 +1 @@ +*/15 * * * * monitor-step diff --git a/mpop/build b/mpop/build @@ -8,6 +8,6 @@ export libssl_LIBS=-L$ROOT/lib make \ CFLAGS="$libssl_CFLAGS" \ LDFLAGS="-L$ROOT/lib -lssl -lcrypto" \ - RPATH="$OPT/libopenssl/lib" + RPATH="$ROOT/opt/libopenssl/lib" make PREFIX="$PREFIX" install diff --git a/ngircd/.crash.swp b/ngircd/.crash.swp Binary files differ. diff --git a/ngircd/crash b/ngircd/crash @@ -0,0 +1 @@ +pkg-service start ngircd diff --git a/ngircd/run b/ngircd/run @@ -1 +1 @@ -ngircd -f "$PKG/ngircd/ngircd.conf" -n & PID=$! +ngircd -f "$ROOT/pkg/ngircd/ngircd.conf" -n & PID=$! diff --git a/opentracker/run b/opentracker/run @@ -1,2 +1,2 @@ -mkdir -p "$VAR/torrent" -opentracker -d "$VAR/torrent" & PID="$!" +mkdir -p "$ROOT/var/torrent" +opentracker -d "$ROOT/var/torrent" & PID="$!" diff --git a/pkg/bin/.pkg-tar.swp b/pkg/bin/.pkg-tar.swp Binary files differ. diff --git a/pkg/bin/pkg-build b/pkg/bin/pkg-build @@ -1,11 +1,11 @@ -mkdir -p "$OPT/$1" && cd "$OPT/$1" || exit 1 +mkdir -p "$ROOT/opt/$1" && cd "$ROOT/opt/$1" || exit 1 export PREFIX="$PWD" mkdir -p bin etc include lib share/man ln -s bin sbin -cd "$SRC/$1" || exit 1 +cd "$ROOT/src/$1" || exit 1 -[ -f "$PKG/$1/build" ] && sh "$PKG/$1/build" || sh "$PKG/build" +[ -f "$ROOT/pkg/$1/build" ] && sh "$ROOT/pkg/$1/build" || sh "$ROOT/pkg/build" rm "$PREFIX/sbin" rmdir "$PREFIX/share/man" "$PREFIX"/* 2> /dev/null || true diff --git a/pkg/bin/pkg-configure b/pkg/bin/pkg-configure @@ -1,14 +1,12 @@ -ROOT="${ROOT:-$HOME}" -ETC="${ETC:-$ETC}" -PKG="${PKG:-$PKG}" +ROOT=${ROOT:-$HOME} # --- dotfiles ----------------------------------------------------------------- -find "$PKG/${1:-}" -path "$ROOT/pkg/*/.*" | while IFS='' read -r path +find "$ROOT/pkg/${1:-}" -path "$ROOT/pkg/*/.*" | while IFS='' read -r path do - [ -d "$path" ] && mkdir -p "$HOME/${path#$PKG/*/}" - [ -f "$path" ] && ln -sf "$path" "$HOME/${path#$PKG/*/}" + [ -d "$path" ] && mkdir -p "$HOME/${path#$ROOT/pkg/*/}" + [ -f "$path" ] && ln -sf "$path" "$HOME/${path#$ROOT/pkg/*/}" done find -L "$ROOT" -type l -exec rm {} + 2> /dev/null @@ -16,24 +14,24 @@ find -L "$ROOT" -type l -exec rm {} + 2> /dev/null # --- crontab ------------------------------------------------------------------ -[ -f "$PKG/$1/cron" ] && cat "$ROOT/pkg/$1/cron" >> "$ETC/crontab" -sort -u "$ETC/crontab +[ -f "$ROOT/pkg/$1/cron" ] && tee -a "$ROOT/etc/crontab" < "$ROOT/pkg/$1/cron" +sort -u "$ROOT/etc/crontab" -o "$ROOT/etc/crontab" # --- configure ---------------------------------------------------------------- -if [ ! -f "$PKG/$1/configure" ] -then printf 'no configuration needed for %s\n' "$1" +if [ ! -f "$ROOT/pkg/$1/configure" ] +then true elif [ "$(whoami)" = root ] -then sh "$PKG/$1/configure" +then sh "$ROOT/pkg/$1/configure" elif command -v doas -then doas sh "$PKG/$1/configure" +then doas sh "$ROOT/pkg/$1/configure" elif command -v sudo -then sudo sh "$PKG/$1/configure" +then sudo sh "$ROOT/pkg/$1/configure" elif command -v su -then su -c 'sh "$1"' "$PKG/$1/configure" +then su -c 'sh "$1"' "$ROOT/pkg/$1/configure" fi diff --git a/pkg/bin/pkg-git b/pkg/bin/pkg-git @@ -1,3 +1,3 @@ -IFS='' read -r git < "$PKG/$1/git" -mkdir -p "$SRC" -git clone "$git" "$SRC/$1" +IFS='' read -r git < "$ROOT/pkg/$1/git" +mkdir -p "$HOMR/src" +git clone "$git" "$ROOT/src/$1" diff --git a/pkg/bin/pkg-install b/pkg/bin/pkg-install @@ -1,9 +1,9 @@ exit=0 -find "$OPT/$1" | tee /dev/stderr | while IFS='' read -r path +find "$HOME/opt/$1" | tee /dev/stderr | while IFS='' read -r path do - [ -d "$path" ] && mkdir -p "$ROOT/${path#$OPT/$1}" || exit=1 - [ -f "$path" ] && ln -sf "$path" "$ROOT/${path#$OPT/$1}" || exit=1 + [ -d "$path" ] && mkdir -p "$ROOT/${path#$HOME/opt/$1}" || exit=1 + [ -f "$path" ] && ln -sf "$path" "$ROOT/${path#$HOME/opt/$1}" || exit=1 done exit "$exit" diff --git a/pkg/bin/pkg-remove b/pkg/bin/pkg-remove @@ -1,2 +1,4 @@ -rm -rf "${OPT:?}/${1:?}" "${SRC:?}/${1:?}" +: ${1:?} + +rm -rf "$ROOT/opt/$1" "$ROOT/src/$1" find -L "$ROOT" -type l -exec rm {} + diff --git a/pkg/bin/pkg-service b/pkg/bin/pkg-service @@ -1,43 +1,47 @@ -cmd=$1 srv=${2%/} error=0 running=0 acted=0 +cmd=$1 srv=${2%/} error=0 running=0 acted=0 killed=0 +mkdir -p "$ROOT/run/pid" case "$cmd" in (start | stop | status) shift 2 ;; +(update) + shift 1 + ;; (restart) - "$0" stop && "$0" start || exit 1 + "$0" stop "$@" && "$0" start "$@" || exit 1 ;; ('') - cd "$PKG" || exit 1 + cd "$ROOT/pkg" || exit 1 for service in */run do "$0" status "${service%/run}" done exit 0 ;; (*) - printf '%s (start | stop | restart | status) <pkg>\n' "${0##*/}" + printf '%s (start | stop | restart | status | update) <pkg>\n' "${0##*/}" + exit 1 ;; esac -mkdir -p "$RUN/pid" - # --- stop / status ------------------------------------------------------------ -[ -d "$RUN/pid/$srv" ] && for pid in $(ls "$RUN/pid/$srv") +[ "$srv" ] && [ -d "$ROOT/run/pid/$srv" ] && +for pid in $(ls "$ROOT/run/pid/$srv") do for arg in "$@" - do grep -qF "$arg" "$RUN/pid/$srv/$pid" || continue 2 + do grep -qF "$arg" "$ROOT/run/pid/$srv/$pid" || continue 2 done - if cmp "$RUN/pid/$srv/$pid" "/proc/$pid/cmdline" &> /dev/null + if cmp "$ROOT/run/pid/$srv/$pid" "/proc/$pid/cmdline" &> /dev/null then - acted=1 cmdline="$(tr '\0' ' ' < "$RUN/pid/$srv/$pid")" + acted=1 cmdline="$(tr '\0' ' ' < "$ROOT/run/pid/$srv/$pid")" - if [ "$cmd" = stop ] + if [ "$cmd" = stop ] && kill "$pid" then - kill "$pid" && printf '%-15s [x] %s\n' "$srv" "$cmdline" + rm -f "$ROOT/run/pid/$srv/$pid" else running=1 printf '%-15s [r] %s\n' "$srv" "$cmdline" @@ -45,7 +49,7 @@ do fi done -if [ "$acted""$cmd" = '0''status' ] || [ "$acted""$cmd" = '0''stop' ] +if [ "$acted""$cmd" = '0''status' ] || [ "$acted""$cmd" = '0''stop' ] then printf '%-15s [ ]\n' "$srv" fi @@ -54,29 +58,31 @@ fi if [ "$running" = 0 ] && [ "$cmd" = start ] then - mkdir -p "$RUN/pid/$srv" - . "$PKG/$srv/run" "$@" >> "$VAR/log/$srv" 2>&1 <&- + mkdir -p "$ROOT/run/pid/$srv" + . "$ROOT/pkg/$srv/run" "$@" >> "$ROOT/var/log/$srv" 2>&1 <&- - if cp "/proc/$PID/cmdline" "$RUN/pid/$srv/$PID" 2> /dev/null + if cp "/proc/$PID/cmdline" "$ROOT/run/pid/$srv/$PID" 2> /dev/null then - cmdline=$(tr '\0' ' ' < "$RUN/pid/$srv/$PID") + cmdline=$(tr '\0' ' ' < "$ROOT/run/pid/$srv/$PID") printf '%-15s [+] %s\n' "$srv" "$cmdline" else - touch "$RUN/pid/$srv/$PID" + touch "$ROOT/run/pid/$srv/$PID" fi fi # --- check -------------------------------------------------------------------- -find "$RUN/pid" -type f | while IFS='' read path +find "$ROOT/run/pid" -type f | while IFS='' read path do if ! cmp "$path" "/proc/${path##*/}/cmdline" 2> /dev/null then srv=${path%/*} srv=${srv##*/} printf '%-15s [!] %s\n' "$srv" "$(tr '\0' ' ' < "$path")" rm -f "$path" + + [ -f "$ROOT/pkg/$srv/crash" ] && sh "$ROOT/pkg/$srv/crash" fi done -find "$RUN/pid" -depth -type d -exec rmdir {} + 2> /dev/null || true +rmdir "$ROOT/run/pid"/* 2> /dev/null || true diff --git a/pkg/bin/pkg-tar b/pkg/bin/pkg-tar @@ -1,8 +1,8 @@ -read tar < "$PKG/$1/tar" || exit 1 +read tar < "$ROOT/pkg/$1/tar" || exit 1 -[ -e "$SRC/$1" ] && exit 1 +[ -e "$ROOT/pkg/$1" ] && exit 1 -mkdir -p "$SRC/$1" && cd "$SRC/$1" +mkdir -p "$ROOT/pkg/$1" && cd "$ROOT/pkg/$1" wget -O - "$tar" | case "$tar" in (*.tar.bz2 | *.tbz2) bunzip2 -d ;; @@ -11,9 +11,10 @@ wget -O - "$tar" | case "$tar" in (*.tar ) tee ;; esac | tar -xf - -if [ $(ls "$SRC/$1" | wc -l) = 1 ] +if [ $(ls "$ROOT/pkg/$1" | wc -l) = 1 ] then - dir=$(ls "$SRC/$1") - find "$SRC/$1" -mindepth 2 -maxdepth 2 -exec mv {} "$SRC/$1" ';' - rmdir "$SRC/$1/$dir" + dir=$(ls "$ROOT/pkg/$1") + find "$ROOT/pkg/$1" -mindepth 2 -maxdepth 2 \ + -exec mv {} "$ROOT/pkg/$1" ';' + rmdir "$ROOT/pkg/$1/$dir" fi diff --git a/pkg/cron b/pkg/cron @@ -0,0 +1 @@ +*/1 * * * * pkg-service update diff --git a/quark/configure b/quark/configure @@ -1 +1 @@ -setcap 'CAP_NET_BIND_SERVICE+ep' "$OPT/bin/quark" +setcap 'CAP_NET_BIND_SERVICE+ep' "$ROOT/opt/bin/quark" diff --git a/ratox/config.mk b/ratox/config.mk @@ -14,15 +14,15 @@ CPPFLAGS = \ CFLAGS = \ -I/usr/local/include \ - -I$(OPT)/libtox/include \ - -I$(OPT)/libvpx/include \ - -I$(OPT)/libopus/include \ + -I$(ROOT)/opt/libtox/include \ + -I$(ROOT)/opt/libvpx/include \ + -I$(ROOT)/opt/libopus/include \ -Wall -Wunused $(CPPFLAGS) LDFLAGS = \ -L/usr/local/lib \ - -L$(OPT)/libtox/lib \ - -L$(OPT)/libvpx/lib \ - -L$(OPT)/libopus/lib + -L$(ROOT)/opt/libtox/lib \ + -L$(ROOT)/opt/libvpx/lib \ + -L$(ROOT)/opt/libopus/lib LDLIBS = -ltoxcore -ltoxav -ltoxencryptsave -lopus -lvpx -lm -lpthread diff --git a/ratox/run b/ratox/run @@ -1,2 +1,2 @@ -mkdir -p "$VAR/tox" && cd "$VAR/tox" || exit 1 +mkdir -p "$ROOT/var/tox" && cd "$ROOT/var/tox" || exit 1 ratox & PID=$! diff --git a/rc b/rc @@ -1,23 +1,15 @@ export ROOT="$HOME" -export PKG="$ROOT/pkg" -export OPT="$ROOT/opt" -export SRC="$ROOT/src" -export GIT="$ROOT/git" -export VAR="$ROOT/var" -export RUN="$ROOT/run" -export SRV="$ROOT/srv" - export PATH="$ROOT/bin:$PATH" export MANPATH="$ROOT/man:$MANPATH" export C_INCLUDE_PATH="$ROOT/include" export LIBRARY_PATH="$ROOT/.local/lib" export LD_LIBRARY_PATH="$ROOT/lib:$LD_LIBRARY_PATH" -for bin in "$PKG"/*/bin +for bin in "$ROOT/pkg"/*/bin do [ -d "$bin" ] && export PATH="$bin:$PATH" done -for profile in "$PKG"/*/profile +for profile in "$ROOT/pkg"/*/profile do [ -f "$profile" ] && . "$profile" done diff --git a/scron/run b/scron/run @@ -1 +1 @@ -crond -n -f "$ETC/crontab" & PID=$! +crond -n -f "$ROOT/etc/crontab" & PID=$! diff --git a/shell/bin/fig b/shell/bin/fig @@ -13,7 +13,7 @@ do [ "$print" = 1 ] && [ "$line" = '' ] && break [ "$print" = 1 ] && printf '%s\n' "$line" [ "$line" = "$character" ] && print=1 - done < "$PKG/fig/${FONT:-1}" | sed 's/;$//' + done < "$ROOT/pkg/fig/${FONT:-1}" | sed 's/;$//' ) l1="$l1$1 " diff --git a/shell/bin/uri b/shell/bin/uri @@ -22,8 +22,8 @@ case "$1" in exec $EDITOR "${1#*://}" ;; ( git://* ) - mkdir -p "$GIT" - cd "$GIT" || exit 1 + mkdir -p "$ROOT/git" + cd "$ROOT/git" || exit 1 git clone "$1" ;; ( wiki://* ) diff --git a/shell/profile b/shell/profile @@ -13,7 +13,7 @@ export TERMCAP="$TERM_CAP" export NAME='Josuah Demangeon' export TZ='Europe/Paris' export NICK='josuah' -export MAIL="$HOME/var/mail/INBOX" +export MAIL="$ROOT/var/mail/INBOX" export EMAIL='mail@josuah.net' export EDITOR=vim VISUAL=$EDITOR diff --git a/st/build b/st/build @@ -1,4 +1,4 @@ -find "$PKG/st" -name '*.diff' -exec patch -N -p 1 -i {} ';' +find "$ROOT/pkg/st" -name '*.diff' -exec patch -N -p 1 -i {} ';' sed 's/gray90/#eeeeee/; s/black/#000000/; s/white/#ffffff/' config.def.h > config.h diff --git a/xdg/profile b/xdg/profile @@ -1,16 +1,16 @@ -export XDG_DATA_HOME="$HOME/share" -export XDG_DATA_DIRS="$HOME/share" +export XDG_DATA_HOME="$ROOT/share" +export XDG_DATA_DIRS="$ROOT/share" -export XDG_CONFIG_HOME="$HOME/etc" -export XDG_CONFIG_DIRS="$HOME/etc" +export XDG_CONFIG_HOME="$ROOT/etc" +export XDG_CONFIG_DIRS="$ROOT/etc" -export XDG_CACHE_HOME="$HOME/var/cache" -export XDG_DOWNLOAD_DIR="$HOME/var/tmp" +export XDG_CACHE_HOME="$ROOT/var/cache" +export XDG_DOWNLOAD_DIR="$ROOT/var/tmp" -export XDG_MUSIC_DIR="$HOME/lib/music" -export XDG_VIDEOS_DIR="$HOME/lib/videos" -export XDG_PICTURES_DIR="$HOME/lib/images" -export XDG_DOCUMENTS_DIR="$HOME/lib/documents" +export XDG_MUSIC_DIR="$ROOT/lib/music" +export XDG_VIDEOS_DIR="$ROOT/lib/videos" +export XDG_PICTURES_DIR="$ROOT/lib/images" +export XDG_DOCUMENTS_DIR="$ROOT/lib/documents" export XDG_DESKTOP_DIR="/tmp" export XDG_TEMPLATES_DIR="/tmp"