Commit 516d0047 authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm repack: add mark_config_noreplace(), use for claude-code env.conf

parent 8ea3b80a
......@@ -23,6 +23,7 @@ CLAUDE_CODE_DISABLE_AUTO_UPDATE=1
DISABLE_AUTOUPDATER=1
CLAUDE_NO_DIAGNOSTICS=1
EOF
mark_config_noreplace $CONFIGDIR/env.conf
cat <<EOF | create_exec_file /usr/bin/$PRODUCT
#!/bin/sh
......
......@@ -217,6 +217,16 @@ pack_file()
subst "s|%files|%files\n$file|" $SPEC
}
# Mark file as %config(noreplace) in spec so user changes survive package update
# Usage: mark_config_noreplace <path>
mark_config_noreplace()
{
local file="$1"
[ -n "$file" ] || return
subst "s|\"$file\"|%config(noreplace) \"$file\"|" $SPEC
subst "s|^$file$|%config(noreplace) $file|" $SPEC
}
# Add dir (only dir) to spec (if missed)
# Usage: pack_dir <path_to_dir>
pack_dir()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment