mirror of
https://github.com/processone/ejabberd.git
synced 2024-09-25 14:24:55 +02:00
make-installers: Override code on upgrade
Use tar's --skip-old-files option for the data directory (/opt/ejabberd) only. Files in the code directory (/opt/ejabberd-$version) should be overridden on upgrade.
This commit is contained in:
parent
6d93d49c6c
commit
c54fe5b29e
@ -97,7 +97,6 @@ create_help_file()
|
|||||||
create_setup_script()
|
create_setup_script()
|
||||||
{
|
{
|
||||||
local dir="$1"
|
local dir="$1"
|
||||||
local tarball="$2"
|
|
||||||
|
|
||||||
cat >"$dir/setup" <<-EOF
|
cat >"$dir/setup" <<-EOF
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
@ -176,7 +175,9 @@ create_setup_script()
|
|||||||
then host='localhost'
|
then host='localhost'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
tar --skip-old-files -C "\$(dirname '$code_path')" -xf '$tarball'
|
(tar -cf - '$rel_name' | tar --skip-old-files -C "\$(dirname '$code_path')" -xpf -)
|
||||||
|
(tar -cf - '$rel_name-$rel_vsn' | tar -C "\$(dirname '$code_path')" -xpf -)
|
||||||
|
|
||||||
chown -R -h 'root:root' '$code_path'
|
chown -R -h 'root:root' '$code_path'
|
||||||
chown 'root:$rel_name' '$code_path/lib/epam-'*'/priv/bin/epam'
|
chown 'root:$rel_name' '$code_path/lib/epam-'*'/priv/bin/epam'
|
||||||
chmod '4750' '$code_path/lib/epam-'*'/priv/bin/epam'
|
chmod '4750' '$code_path/lib/epam-'*'/priv/bin/epam'
|
||||||
@ -247,15 +248,14 @@ create_setup_script()
|
|||||||
|
|
||||||
for arch in $architectures
|
for arch in $architectures
|
||||||
do
|
do
|
||||||
tar_name="$rel_name-$rel_vsn-linux-$arch.tar"
|
tar_name="$rel_name-$rel_vsn-linux-$arch.tar.gz"
|
||||||
tgz_name="$tar_name.gz"
|
|
||||||
installer_name="$rel_name-$rel_vsn-$iteration-linux-$arch.run"
|
installer_name="$rel_name-$rel_vsn-$iteration-linux-$arch.run"
|
||||||
|
|
||||||
test -e "$tgz_name" || tools/make-binaries
|
test -e "$tar_name" || tools/make-binaries
|
||||||
echo "$myself: Putting together installer for $arch ..."
|
echo "$myself: Putting together installer for $arch ..."
|
||||||
gzip -c -d <"$tgz_name" >"$tmp_dir/$tar_name"
|
tar -xzpf "$tar_name"
|
||||||
create_help_file "$tmp_dir/help.txt"
|
create_help_file "$tmp_dir/help.txt"
|
||||||
create_setup_script "$tmp_dir" "$tar_name"
|
create_setup_script "$tmp_dir"
|
||||||
"$makeself" --help-header "$tmp_dir/help.txt" \
|
"$makeself" --help-header "$tmp_dir/help.txt" \
|
||||||
"$tmp_dir" "$installer_name" "$rel_name $rel_vsn" './setup'
|
"$tmp_dir" "$installer_name" "$rel_name $rel_vsn" './setup'
|
||||||
find "$tmp_dir" -mindepth 1 -delete
|
find "$tmp_dir" -mindepth 1 -delete
|
||||||
|
Loading…
Reference in New Issue
Block a user