Merge branch 'c2sfix' into 'main'

cowpacman2srm fix - check if directory exists before searching unit files

See merge request systemrescue/systemrescue-sources!254
This commit is contained in:
Gerd v. Egidy 2022-12-15 20:06:36 +00:00
commit c466c954c0

View file

@ -143,18 +143,20 @@ function prepare()
# we want to copy these too
# read all systemd symlinks in the cow-dir
for SYMLINK in `find "${UPPERDIR}/etc/systemd/system/" -type l -printf "%P\n"`; do
TARGET=$(readlink "${UPPERDIR}/etc/systemd/system/${SYMLINK}")
if [ -d "${UPPERDIR}/etc/systemd/system/" ]; then
for SYMLINK in `find "${UPPERDIR}/etc/systemd/system/" -type l -printf "%P\n"`; do
TARGET=$(readlink "${UPPERDIR}/etc/systemd/system/${SYMLINK}")
# targets the symlink something that is in our packages?
if grep -q "${TARGET}" $PKG_FILELIST; then
echo "Copying systemd link /etc/systemd/system/${SYMLINK}"
# copy the symlink to our target dir
LINKDIR=$(dirname "${TMP_TARGET}/etc/systemd/system/${SYMLINK}")
mkdir -p "${LINKDIR}"
cp --no-dereference "${UPPERDIR}/etc/systemd/system/${SYMLINK}" "${TMP_TARGET}/etc/systemd/system/${SYMLINK}"
fi
done
# targets the symlink something that is in our packages?
if grep -q "${TARGET}" $PKG_FILELIST; then
echo "Copying systemd link /etc/systemd/system/${SYMLINK}"
# copy the symlink to our target dir
LINKDIR=$(dirname "${TMP_TARGET}/etc/systemd/system/${SYMLINK}")
mkdir -p "${LINKDIR}"
cp --no-dereference "${UPPERDIR}/etc/systemd/system/${SYMLINK}" "${TMP_TARGET}/etc/systemd/system/${SYMLINK}"
fi
done
fi
# restore line separator
IFS=$IFS_SAVE