Improve sed regex to cover all cases that exists at once. Current solution was broken in Noble

This commit is contained in:
Igor Pecovnik 2024-01-05 13:25:24 +01:00
parent 02ef17a3a0
commit 32fecdd9cc
No known key found for this signature in database
GPG Key ID: 93D6889F9F0E78D5

View File

@ -141,8 +141,9 @@ function compile_armbian-base-files() {
sed -i '/\/etc\/dpkg\/origins\/debian/a \/etc\/dpkg\/origins\/armbian' "${destination}"/DEBIAN/conffiles
# Fix symlinking in postinst for Debian and Ubuntu. They have to point towards Armbian, Armbian parent is Debian or Ubuntu -> Debian
sed -i "s|ln -sf ubuntu /etc/dpkg/origins/default|ln -sf armbian /etc/dpkg/origins/default|g" "${destination}"/DEBIAN/postinst
sed -i "s|ln -sf debian \"\$DPKG_ROOT/etc/dpkg/origins/default\"|ln -sf armbian \"\$DPKG_ROOT/etc/dpkg/origins/default\"|g" "${destination}"/DEBIAN/postinst
sed -i -E -e "s/\origins\/ubuntu|debian/origins\/armbian/g" "${destination}"/DEBIAN/postinst
sed -i -E -e "s/ln -sf ubuntu|debian/ln -sf armbian/g" "${destination}"/DEBIAN/postinst
# Create preinst file if not exists (Debian)
if [[ ! -e "${destination}"/DEBIAN/preinst ]]; then
cat <<- EOD >> "${destination}"/DEBIAN/preinst