projects
/
grml-debootstrap.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
1a229d0
)
use `|| eend $?` consistently in `cleanup` function
author
Patrick Schleizer
<adrelanos@whonix.org>
Wed, 25 Oct 2023 15:20:46 +0000
(11:20 -0400)
committer
Patrick Schleizer
<adrelanos@whonix.org>
Thu, 7 Dec 2023 17:50:37 +0000
(12:50 -0500)
grml-debootstrap
patch
|
blob
|
history
diff --git
a/grml-debootstrap
b/grml-debootstrap
index
51960e4
..
b9b298f
100755
(executable)
--- a/
grml-debootstrap
+++ b/
grml-debootstrap
@@
-287,8
+287,7
@@
cleanup() {
einfo "Not unmounting $MNTPOINT as you requested me to install into a directory of your own choice."
else
einfo "Unmounting $MNTPOINT"
einfo "Not unmounting $MNTPOINT as you requested me to install into a directory of your own choice."
else
einfo "Unmounting $MNTPOINT"
- umount "$MNTPOINT"
- eend $?
+ umount "$MNTPOINT" || eend $?
fi
if [ -n "$STAGES" ] ; then
fi
if [ -n "$STAGES" ] ; then
@@
-299,21
+298,19
@@
cleanup() {
# remove directory only if we used the default with process id inside the name
if echo "$MNTPOINT" | grep -q '/mnt/debootstrap\.' ; then
einfo "Removing directory ${MNTPOINT}"
# remove directory only if we used the default with process id inside the name
if echo "$MNTPOINT" | grep -q '/mnt/debootstrap\.' ; then
einfo "Removing directory ${MNTPOINT}"
- rmdir "$MNTPOINT"
- eend $?
+ rmdir "$MNTPOINT" || eend $?
fi
fi
fi
if [ -n "${ORIG_TARGET}" ] ; then
einfo "Removing loopback mount of file ${ORIG_TARGET}."
fi
fi
fi
if [ -n "${ORIG_TARGET}" ] ; then
einfo "Removing loopback mount of file ${ORIG_TARGET}."
- kpartx -d "${ORIG_TARGET}"
+ kpartx -d "${ORIG_TARGET}"
|| eend $?
# Workaround for a bug in kpartx which doesn't clean up properly,
# see Debian Bug #891077 and Github-PR grml/grml-debootstrap#112
if dmsetup ls | grep -q "^${LOOP_PART} "; then
# Workaround for a bug in kpartx which doesn't clean up properly,
# see Debian Bug #891077 and Github-PR grml/grml-debootstrap#112
if dmsetup ls | grep -q "^${LOOP_PART} "; then
- kpartx -d "/dev/${LOOP_DISK}" >/dev/null
+ kpartx -d "/dev/${LOOP_DISK}" >/dev/null
|| eend $?
fi
fi
- eend $?
fi
}
fi
}