2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-30 01:26:38 +00:00

Merge pull request #4662 from neo954/genesis

Fix clean install problem of xcat-genesis-base
This commit is contained in:
zet809 2018-01-22 13:38:33 +08:00 committed by GitHub
commit b871df219e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -17,6 +17,8 @@ set -x
[ -n "${RPM_PACKAGE}" ] || exit 1
[ -f "${RPM_PACKAGE}" ] || exit 1
umask 0022
EXTRACT_DIR="${RPM_PACKAGE##*/}"
EXTRACT_DIR="${EXTRACT_DIR%%-snap*}"
@ -39,7 +41,7 @@ fi
sed -i -e "/^Description:/i Breaks: xcat-genesis-scripts-${PACKAGE_ARCH//x86_64/amd64} (<< 2.13.10)" "${EXTRACT_DIR}/debian/control"
cat >"${EXTRACT_DIR}/debian/preinst" <<-EOF
cat >"${EXTRACT_DIR}/debian/preinst" <<EOF
#!/bin/bash
[ -d /opt/xcat/share/xcat/netboot/genesis/${PACKAGE_ARCH}/fs/bin ] &&
@ -52,6 +54,10 @@ cat >"${EXTRACT_DIR}/debian/preinst" <<-EOF
rm -rf /opt/xcat/share/xcat/netboot/genesis/${PACKAGE_ARCH}/fs/lib64
[ -d /opt/xcat/share/xcat/netboot/genesis/${PACKAGE_ARCH}/fs/var/run ] &&
rm -rf /opt/xcat/share/xcat/netboot/genesis/${PACKAGE_ARCH}/fs/var/run
exit 0
EOF
chmod 0755 "${EXTRACT_DIR}/debian/preinst"
( cd "${EXTRACT_DIR}" && debian/rules binary )