summarylogtreecommitdiffstats
path: root/suckless-rebuild
diff options
context:
space:
mode:
authoran9wer2020-05-30 23:05:44 +0800
committeran9wer2020-05-30 23:05:44 +0800
commitbd9f5dd2c28ce83ba748cf7ebecc2901cc8c43da (patch)
tree19e4dca08675b0d321d400da43a224561a71d3d9 /suckless-rebuild
parentd50a47b9fd461888a3c4e3fe70fc108313276fc6 (diff)
downloadaur-bd9f5dd2c28ce83ba748cf7ebecc2901cc8c43da.tar.gz
[0.1.1-1] Add rebuild for slstatus
Diffstat (limited to 'suckless-rebuild')
-rwxr-xr-xsuckless-rebuild29
1 files changed, 14 insertions, 15 deletions
diff --git a/suckless-rebuild b/suckless-rebuild
index 213a9a743aeb..dac11721fc77 100755
--- a/suckless-rebuild
+++ b/suckless-rebuild
@@ -4,24 +4,23 @@ DESTDIR=~/.suckless
BUILDDIR=~/.suckless-build
usage() {
- echo "Usage: suckless-rebuild st <config.h>"
+ echo "Usage: suckless-rebuild st|slstatus <config.h>"
exit 1
}
if [[ ${#@} != 2 || $1 =~ ^-h$|^--help$ || $2 =~ ^-h$|^--help$ ]]; then
- echo "Usage: suckless-rebuild st <config.h>"
- exit 1
+ usage
fi
-tool=$1
+software=$1
config=$2
-if [[ ! $tool =~ ^st$ ]]; then
- echo "Unknown suckless tool '$tool'."
+if [[ ! $software =~ ^st$|^slstatus$ ]]; then
+ echo "Unknown suckless software '$software'."
exit 1
fi
-if [[ ! -d /usr/src/$tool ]]; then
- echo "'an9wer-$tool' may not be installed."
+if [[ ! -d /usr/src/$software ]]; then
+ echo "'an9wer-$software' may not be installed."
exit 1
fi
if [[ ! -f $config ]]; then
@@ -29,20 +28,20 @@ if [[ ! -f $config ]]; then
exit 1
fi
-if [[ -e $BUILDDIR/$tool ]]; then
- temp=$(mktemp -u -d /tmp/$tool.XXXXX)
- mv "$BUILDDIR/$tool" "$temp"
+if [[ -e $BUILDDIR/$software ]]; then
+ temp=$(mktemp -u -d /tmp/$software.XXXXX)
+ mv "$BUILDDIR/$software" "$temp"
fi
mkdir -p "$BUILDDIR"
-cp -r /usr/src/st "$BUILDDIR/$tool"
-cp -f "$config" "$BUILDDIR/$tool"
+cp -r /usr/src/$software "$BUILDDIR/$software"
+cp -f "$config" "$BUILDDIR/$software"
-cd "$BUILDDIR/$tool"
+cd "$BUILDDIR/$software"
if make &> build.log && make PREFIX="$DESTDIR" install &> build.log; then
echo "Done! Recommend to add '~/.suckless/bin' to \$PATH to use new builded st."
else
- echo "Some error occurred, check '$BUILDDIR/$tool/build.log' to find more."
+ echo "Some error occurred, check '$BUILDDIR/$software/build.log' to find more."
fi
if [[ -v temp ]]; then
sed -i "1i The last built directory was moved to $temp\n" build.log