aboutsummaryrefslogtreecommitdiffstats
path: root/llama.cpp-vulkan/doinst.sh
diff options
context:
space:
mode:
authorDanilo Macrì <danix@danix.xyz>2026-04-03 12:20:05 -0400
committerGitHub <noreply@github.com>2026-04-03 12:20:05 -0400
commita7976bfe662097273e91471e2609df2d30120656 (patch)
treec54b2a6d28a89333b771bdee05e6baa45fe0c94f /llama.cpp-vulkan/doinst.sh
parent1045963959ddfb697898fa90476f837aae4e2881 (diff)
parentebb26eac2948e02def3c7ac1ac23c4ecd345a5a7 (diff)
downloadmy-slackbuilds-a7976bfe662097273e91471e2609df2d30120656.tar.gz
my-slackbuilds-a7976bfe662097273e91471e2609df2d30120656.zip
Merge pull request #5 from danixland/restructure-flat-layout
repo: flatten layout — move packages to root, extras to .extras/
Diffstat (limited to 'llama.cpp-vulkan/doinst.sh')
-rw-r--r--llama.cpp-vulkan/doinst.sh27
1 files changed, 27 insertions, 0 deletions
diff --git a/llama.cpp-vulkan/doinst.sh b/llama.cpp-vulkan/doinst.sh
new file mode 100644
index 0000000..0b91476
--- /dev/null
+++ b/llama.cpp-vulkan/doinst.sh
@@ -0,0 +1,27 @@
+config() {
+ NEW="$1"
+ OLD="$(dirname $NEW)/$(basename $NEW .new)"
+ # If there's no config file by that name, mv it over:
+ if [ ! -r $OLD ]; then
+ mv $NEW $OLD
+ elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then
+ # toss the redundant copy
+ rm $NEW
+ fi
+ # Otherwise, we leave the .new copy for the admin to consider...
+}
+
+preserve_perms() {
+ NEW="$1"
+ OLD="$(dirname $NEW)/$(basename $NEW .new)"
+ if [ -e $OLD ]; then
+ cp -a $OLD ${NEW}.incoming
+ cat $NEW > ${NEW}.incoming
+ mv ${NEW}.incoming $NEW
+ fi
+ config $NEW
+}
+
+preserve_perms etc/rc.d/rc.llama.cpp.new
+config etc/rc.d/rc.llama.cpp.new
+