aboutsummaryrefslogtreecommitdiffstats
path: root/dfly-update
diff options
context:
space:
mode:
authorAaron LI <aly@aaronly.me>2018-03-10 21:47:03 +0800
committerAaron LI <aly@aaronly.me>2018-03-10 21:47:03 +0800
commit3dc434d3a15d7541107ad92acc777877801de6a9 (patch)
tree7c75043964216b674c94fab5b2dfea9618bd7ead /dfly-update
parent1145b0b1659e84fba119a529e9d42656ce70b884 (diff)
downloaddfly-update-3dc434d3a15d7541107ad92acc777877801de6a9.tar.bz2
install_system(): improve progress reports
Diffstat (limited to 'dfly-update')
-rwxr-xr-xdfly-update46
1 files changed, 23 insertions, 23 deletions
diff --git a/dfly-update b/dfly-update
index 6465d45..d38e1e7 100755
--- a/dfly-update
+++ b/dfly-update
@@ -402,27 +402,27 @@ install_system() {
error ${EC_ARGS} "install_system: invalid arguments: $@"
local file file2 item
echo "Installing the new kernel and world ..."
- echo " => Stashing the files to protect from overriding ..."
+ echo " => Backing up the files to protect from overriding ..."
for file in ${FILES_IGNORE}; do
if [ -f "${file}" ]; then
file2="${file}.${BAK_SUF}"
- echo -n " * ${file} "
+ echo -n " * ${file} "
cp -af "${file}" "${file2}" # NOTE: do NOT use "mv"
- echo "(stashed)"
+ echo "<backed>"
fi
done
echo " => Creating distribution directories ..."
- mtree -deU -f ${MNT_DIR}/etc.hdd/mtree/BSD.root.dist \
- -p / || exit ${EC_MTREE}
- mtree -deU -f ${MNT_DIR}/etc.hdd/mtree/BSD.var.dist \
- -p /var || exit ${EC_MTREE}
- mtree -deU -f ${MNT_DIR}/etc.hdd/mtree/BSD.usr.dist \
- -p /usr || exit ${EC_MTREE}
- mtree -deU -f ${MNT_DIR}/etc.hdd/mtree/BSD.include.dist \
+ mtree -deUq -f ${MNT_DIR}/etc.hdd/mtree/BSD.root.dist \
+ -p / || exit ${EC_MTREE}
+ mtree -deUq -f ${MNT_DIR}/etc.hdd/mtree/BSD.var.dist \
+ -p /var || exit ${EC_MTREE}
+ mtree -deUq -f ${MNT_DIR}/etc.hdd/mtree/BSD.usr.dist \
+ -p /usr || exit ${EC_MTREE}
+ mtree -deUq -f ${MNT_DIR}/etc.hdd/mtree/BSD.include.dist \
-p /usr/include || exit ${EC_MTREE}
- mtree -deU -f ${MNT_DIR}/etc.hdd/mtree/BSD.local.dist \
- -p /usr/local || exit ${EC_MTREE}
+ mtree -deUq -f ${MNT_DIR}/etc.hdd/mtree/BSD.local.dist \
+ -p /usr/local || exit ${EC_MTREE}
echo " => Installing kernel and world ..."
for item in COPYRIGHT \
@@ -443,21 +443,21 @@ install_system() {
usr/share \
var/msgs \
var/yp; do
- echo -n " * Installing: ${item} ... "
+ echo -n " * Installing: ${item} ... "
cpdup -o -u ${MNT_DIR}/${item} /${item} || exit ${EC_CPDUP}
- echo "done!"
+ echo "ok"
done
- echo " => Recovering the stashed files ..."
+ echo " => Recovering the backed files ..."
for file in ${FILES_IGNORE}; do
file2="${file}.${BAK_SUF}"
if [ -f "${file2}" ]; then
- echo -n " * ${file} "
+ echo -n " * ${file} "
mv -f "${file2}" "${file}"
- echo "(recovered)"
+ echo "<recovered>"
fi
done
- echo " => DONE"
+ echo " => DONE!"
}
# Upgrade the system with configurations
@@ -475,16 +475,16 @@ upgrade_system() {
for file in ${FILES_IGNORE}; do
file_new="${etcdir}/${file#/etc/}"
if [ -f "${file_new}" ]; then
- echo -n " * ${file_new} "
+ echo -n " * ${file_new} "
rm -f "${file_new}"
- echo "(ignored)"
+ echo "<ignored>"
fi
done
echo " => Renaming changed files while deleting others ..."
find /etc/ -type f | while read -r file; do
file_new="${etcdir}/${file#/etc/}"
if [ -f "${file_new}" ]; then
- echo -n " * ${file_new} "
+ echo -n " * ${file_new} "
if cmp -s "${file}" "${file_new}"; then
rm -f "${file_new}"
echo "(same)"
@@ -496,8 +496,8 @@ upgrade_system() {
done
echo " => Coping new configurations over ..."
- cpdup -o -u -I ${etcdir} /etc || exit ${EC_CPDUP}
- echo " => DONE"
+ cpdup -o -u ${etcdir} /etc || exit ${EC_CPDUP}
+ echo " => DONE!"
rm -rf "${etcdir}"
echo "+---------+"
echo "| WARNING | Files with '${NEW_SUF}' suffix need manual merge!"