# -*- shell-script -*-
-# Copyright (C) 2007 - 2014 Steve Youngs <steve@sxemacs.org>
+# Copyright (C) 2007 - 2021 Steve Youngs <steve@sxemacs.org>
# What lies here is a collection of handy bash shell functions and
# aliases that make life a little easier for pkgusr.
grep --colour=always '^\*\*\*' ${HOME}/install.${arg}|less
}
+chkg()
+{
+ local arg=$1
+ if [ -z "$arg" ]; then
+ arg=err
+ fi
+ grep --colour=always '^\*\*\*' ${HOME}/check.${arg}|less
+}
+
+makeg()
+{
+ local arg=$1
+ if [ -z "$arg" ]; then
+ arg=err
+ fi
+ grep --colour=always '^\*\*\*' ${HOME}/make.${arg}|less
+}
+
dlog()
{
for log in configure make check install upd verupd; do
grep --colour Version:.*$ ${HOME}/.project
}
-showinst()
+ipkg()
{
local top=$(grep -n "^Install Notes:$" ${HOME}/.project|cut -d: -f1)
local bot=$(grep -n "^General Notes:$" ${HOME}/.project|cut -d: -f1)
sed -n ${top},${bot}p ${HOME}/.project|less
}
-showgen()
+gpkg()
{
local top=$(grep -n "^General Notes:$" ${HOME}/.project|cut -d: -f1)
local bot=$(grep -n "^CONTENTS:$" ${HOME}/.project|cut -d: -f1)
fi
}
+## Convenience to allow existing pkgusrs to update their git
+# config
+prep_git()
+{
+ install -vdm755 ${HOME}/.config/git &&
+ ln -svf /etc/pkgusr/gitconfig ${HOME}/.config/git/config &&
+ # Nuke the old ~/.gitconfig
+ rm -v ${HOME}/.gitconfig 2>/dev/null || true
+}
+
## Aliases
# Repos/Websites
alias srepo='grep --colour Repo_Location:.*$ ${HOME}/.project'
alias lerr='ls -l ${HOME}/*.err'
alias llog='ls -l ${HOME}/*.log'
# Util
-alias ebld='nano -w ${HOME}/build'
-alias epro='nano -w ${HOME}/.project'
-alias ebp='nano -w ${HOME}/{build,.project}'
+## As of 2021-01-18 nano (v5.5) seems FUBAR'd
+alias ebld='vi ${HOME}/build'
+alias epro='vi ${HOME}/.project'
+alias ebp='vi -a ${HOME}/{build,.project}'
+# alias ebld='nano -w ${HOME}/build'
+# alias epro='nano -w ${HOME}/.project'
+# alias ebp='nano -w ${HOME}/{build,.project}'
alias deps='grep --colour "Deps: " ${HOME}/.project'
-alias ipkg=showinst
-alias gpkg=showgen
alias listp='pinky -l $(whoami)|less'
H-pkg()
dlog Removes all build logs
instg {err|log} Greps install.err (default) or install.log for
pkgusr notifications ("*** some message")
+ chkg {err|log} Greps check.err (default) or check.log for
+ pkgusr notifications ("*** some message")
+ makeg {err|log} Greps make.err (default) or make.log for
+ pkgusr notifications ("*** some message")
Package Notes/Content:
- showinst Displays the \`Install Notes'. (alias: ipkg)
- showgen Displays the \`General Notes'. (alias: gpkg)
+ ipkg Displays the \`Install Notes'. (alias: ipkg)
+ gpkg Displays the \`General Notes'. (alias: gpkg)
listp Displays the entire package info (piped through less(1))
srepo Display the package's source repo location.
rawrepo Output just the repo URL (to use with lynx, curl, etc)
updver [NEWVER] Updates the version in the .project. It MUST be
quoted to protect it from shell expansion.
+Miscellaneous Bobs & Bits:
+
+ prep_git Sets up ~/.config/git/config
+ In the normal course of events you shouldn't need to
+ use this as it happens during login if it is needed.
+
EOF
}