dot

packages and services management
Log | Files | Refs | README

commit 6f0f320c4d41da196163ec7946d32ce1ed99888e
parent 741b177683f221ec929f20a4ad88b641e38dd5cb
Author: Josuah Demangeon <mail@josuah.net>
Date:   Mon,  8 Jan 2018 14:31:55 +0100

use echo instead of printf for usage

Diffstat:
Mbin/agenda | 13+++++++------
Mbin/back | 28+++++++++++++++++++++++-----
Mbin/clip | 3++-
Mbin/pack | 3++-
Mdot/profile | 2+-
Mdot/sfeed/sfeedrc | 1-
Apack/man-c++/build | 5+++++
Apack/man-c++/tar | 1+
Mpack/man-posix/build | 4+++-
9 files changed, 44 insertions(+), 16 deletions(-)

diff --git a/bin/agenda b/bin/agenda @@ -165,7 +165,8 @@ case $1 in (show) [ $# -lt 2 ] || [ $# -gt 3 ] && exec "$0" awk -v SORT="${3:-BECLS}" "$awk_sort" "$AGENDA/$2" | - awk -v OFF="$(date +%z | cut -c 1-3)" "$awk_show" + awk -v OFF="$(date +%z | cut -c 1-3)" "$awk_show" | + less ;; (add) [ $# -ne 4 ] && exec "$0" @@ -180,11 +181,11 @@ case $1 in exec $EDITOR "$AGENDA/$2" ;; (*) - printf 'usage: agenda add name YYYY-MM-DD-HH-MM YYYY-MM-DD-HH-MM\n' - printf ' agenda edit name\n' - printf ' agenda import ics_file name [+-]HH\n' - printf ' agenda show name [BESCL]\n' - printf '\n' + echo 'usage: agenda add <name> <YYYY-MM-DD-HH-MM> <YYYY-MM-DD-HH-MM>' + echo ' agenda edit <name>' + echo ' agenda import <file.ics> <name> [+-]<HH>' + echo ' agenda show <name> [BESCL]' + echo '' ls -C "$AGENDA" ;; esac diff --git a/bin/back b/bin/back @@ -3,9 +3,9 @@ BACK="${BACK:-$HOME/back}" -mkdir -p "$BACK/ref" "$BACK/obj" +mkdir -p "$BACK/rev" "$BACK/obj" sum='b2sum -l 256' -[ -r "$BACK/log" ] && log=$BACK/ref/$(sed -n '$ s/[^ ]* // p' "$BACK/log") +[ -r "$BACK/log" ] && log=$BACK/rev/$(sed -n '$ s/[^ ]* // p' "$BACK/log") case $1 in (new) @@ -15,11 +15,29 @@ case $1 in do [ -f "$BACK/obj/$hash" ] || cp "$path" "$BACK/obj/$hash" done - ref=$($sum "$BACK/new" | sed 's/ .*//') - mv "$BACK/new" "$BACK/ref/$ref" - date +"%Y-%m-%d-%H-%M-%S $ref" >> $BACK/log + rev=$($sum "$BACK/new" | sed 's/ .*//') + mv "$BACK/new" "$BACK/rev/$rev" + date +"%Y-%m-%d-%H-%M-%S $rev" >> $BACK/log + ;; +(set) + more "$BACK/rev/$2" + 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 {} + + + while read -r hash path + do + mkdir -p "$(dirname "$path")" + cp "$BACK/obj/$hash" "$path" + done < "$BACK/rev/$2" + ;; +(log) + less "$BACK/log" ;; (*) + echo 'usage: back new' + echo ' back set <rev>' + echo ' back log' ;; esac diff --git a/bin/clip b/bin/clip @@ -14,6 +14,7 @@ case $1 in cat "$CLIP" ;; (*) - printf 'usage: clip -i [file...]\n clip -o\n' + echo 'usage: clip -i [file...]' + echo ' clip -o' ;; esac diff --git a/bin/pack b/bin/pack @@ -57,7 +57,8 @@ case "$1" in find -L "$SYSROOT" -type l -exec rm {} + ;; (*) - printf 'usage: pack tar | git | get | build | add | del package\n\n' + echo 'usage: pack tar | git | get | build | add | del <package>' + echo '' COLUMNS=80 ls -C "$HOME/etc/pack" ;; esac diff --git a/dot/profile b/dot/profile @@ -30,7 +30,7 @@ export BLIH="josuah.demangeon@epitech.eu" export CVSROOT="anoncvs@anoncvs.fr.openbsd.org:/cvs" export PKG_PATH="https://ftp.fr.openbsd.org/pub/OpenBSD/" -export ABDUCO_SOCKET_DIR="$HOME/.cache/run" +export ABDUCO_SOCKET_DIR="$HOME/.cache" export ABDUCO_CMD="dvtm-status" export MBLAZE="$HOME/.config/mblaze" export LESS="-~R" diff --git a/dot/sfeed/sfeedrc b/dot/sfeed/sfeedrc @@ -20,4 +20,3 @@ feeds() http://xkcd.com/atom.xml \ http://xkcd.com } - diff --git a/pack/man-c++/build b/pack/man-c++/build @@ -0,0 +1,5 @@ +#!/bin/sh + +mkdir -p "$OPT/share/man" + +cp -r man3 "$OPT/share/man/man3" diff --git a/pack/man-c++/tar b/pack/man-c++/tar @@ -0,0 +1 @@ +http://gcc.gnu.org/pub/gcc/libstdc++/doxygen/libstdc++-api-4.5.2.man.tar.bz2 diff --git a/pack/man-posix/build b/pack/man-posix/build @@ -1 +1,3 @@ -make DESTDIR="$OPT" install +#!/bin/sh + +make prefix="$OPT" install