[SCM] live-boot branch, tmp-persistent-custom, updated. debian/3.0_a25-1-54-g57bedcf
Tails developers
amnesia at boum.org
Fri Mar 23 12:09:08 UTC 2012
The following commit has been merged in the tmp-persistent-custom branch:
commit 57bedcf2d0f896dd21b7fa9bfd38083c39c5791c
Author: Tails developers <amnesia at boum.org>
Date: Fri Mar 23 12:54:17 2012 +0100
Delete existing files in the destination's path when creating it.
diff --git a/scripts/live-helpers b/scripts/live-helpers
index 13a8cec..e6da3aa 100644
--- a/scripts/live-helpers
+++ b/scripts/live-helpers
@@ -1394,33 +1394,29 @@ activate_custom_mounts ()
continue
fi
- # FIXME: we don't handle already existing
- # non-directory files in the paths of both $source and
- # $dest.
-
if [ ! -d "${dest}" ]
then
- # if ${dest} is in /home/$user, try fixing
- # proper ownership
- # FIXME: this should really be handled by
- # live-config since we don't know for sure
- # which uid a certain user has until then
- if trim_path ${dest} | grep -qe "^${rootmnt}/*home/[^/]\+"
- then
- path="/"
- for dir in $(echo ${dest} | sed -e 's|/\+| |g')
- do
- path=${path}/${dir}
- if [ ! -e ${path} ]
+ # create the destination and delete existing files in
+ # its path that are in the way
+ path="/"
+ for dir in $(echo ${dest} | sed -e 's|/\+| |g')
+ do
+ path=trim_path ${path}/${dir}
+ if [ -f ${path} ]
+ then
+ rm -f ${path}
+ fi
+ if [ ! -e ${path} ]
+ then
+ mkdir -p ${path}
+ if echo ${path} | grep -qe "^${rootmnt}/*home/[^/]\+"
then
- mkdir -p ${path}
- # assume that the intended user is the first, which is usually the case
+ # if ${dest} is in /home try fixing proper ownership by assuming that the intended user is the first, which is usually the case
+ # FIXME: this should really be handled by live-config since we don't know for sure which uid a certain user has until then
chown 1000:1000 ${path}
fi
- done
- else
- mkdir -p ${dest}
- fi
+ fi
+ done
fi
# if ${source} doesn't exist on our persistent media
--
live-boot
More information about the debian-live-changes
mailing list