aboutsummaryrefslogtreecommitdiffstats
path: root/sbpull.bash
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-09-25 20:44:38 +0200
committerDanilo M. <danix@danix.xyz>2026-09-25 20:44:38 +0200
commitc92bdd69fe19dca126469bb1c0bc3a598917af9d (patch)
treec1a9051bfa92b73a3068d857306d7ac00148577d /sbpull.bash
downloadslackrepo_setup-c92bdd69fe19dca126469bb1c0bc3a598917af9d.tar.gz
slackrepo_setup-c92bdd69fe19dca126469bb1c0bc3a598917af9d.zip
Initial import: SBo-danix repo setup, sbshadow, sbpull
slackrepo_setup_SBo-danix.sh rebuilds the personal SBo-danix repo from upstream plus the personal and pentesting subtree overlays. Shadowing is delegated to sbshadow, which reconciles both ways against the pristine current branch (shadow packages now carried in an overlay, restore those no longer carried) and then runs mkhint -F. sbpull.bash provides the sbpull shell function that pulls one overlay subtree and runs sbshadow. Licensed GPLv2 only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'sbpull.bash')
-rw-r--r--sbpull.bash44
1 files changed, 44 insertions, 0 deletions
diff --git a/sbpull.bash b/sbpull.bash
new file mode 100644
index 0000000..cd48864
--- /dev/null
+++ b/sbpull.bash
@@ -0,0 +1,44 @@
+# sbpull: pull one overlay subtree into SBo-danix, then reconcile shadowing.
+# Source from root's ~/.bashrc: . /path/to/sbpull.bash
+#
+# Copyright (C) 2026 Danilo M. <danix@danix.xyz>
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 as published
+# by the Free Software Foundation. See the LICENSE file for details.
+
+sbpull() {
+ local repo_dir="/var/lib/sbopkg/SBo-danix"
+ local target="$1"
+ local prefix branch remote
+
+ case "$target" in
+ personal)
+ prefix="personal"
+ remote="my-slackbuilds"
+ ;;
+ pentesting)
+ prefix="pentesting"
+ remote="my-pentesting"
+ ;;
+ *)
+ echo "sbpull: usage: sbpull {personal|pentesting}" >&2
+ return 1
+ ;;
+ esac
+
+ branch="main"
+
+ pushd "$repo_dir" > /dev/null || return 1
+
+ if git subtree pull --prefix="$prefix" "$remote" "$branch" --squash; then
+ echo "sbpull: $target subtree updated."
+ sbshadow
+ else
+ echo "sbpull: git subtree pull failed for $target, check output above." >&2
+ popd > /dev/null
+ return 1
+ fi
+
+ popd > /dev/null
+}