mirror of
https://github.com/nchevsky/systemrescue-zfs.git
synced 2026-01-26 18:34:14 +01:00
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:
commit
c466c954c0
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue