Commit 38df754a authored by Loic's avatar Loic
Browse files

HBSD: improve the debug_print display



Improved display especially when the -V (Verbose output) option is used.
Signed-off-by: Loic's avatarLoic <loic.f@hardenedbsd.org>
MFC-to:		13-STABLE
MFC-to:		12-STABLE
(cherry picked from commit 18369f86)
parent 1aefb6c0
......@@ -402,7 +402,7 @@ fetch_update() {
fi
if [ ${verbose} -gt 0 ]; then
debug_print "[*] Verified hash: ${filehash} = ${pubhash}"
debug_print "[*] Verified hash: ${filehash}\n[*] ↳ Remote Hash: ${pubhash}"
fi
fi
......@@ -645,12 +645,13 @@ apply_base() {
dirs="/bin /sbin /lib /libexec /usr/bin /usr/sbin /usr/lib"
if [ ${verbose} -gt 0 ]; then
debug_print "[*] Applying base"
debug_print "\n[*] Applying base"
fi
for dir in ${dirs}; do
if [ -d ${mountpoint}/${dir} ]; then
${CHFLAGS} -R noschg ${mountpoint}/${dir}
#FIX-ME: empty: flags ("schg" is not "none"
${CHFLAGS} -R noschg ${mountpoint}/${dir} 2> /dev/null
res=${?}
if [ ${res} -gt 0 ]; then
return ${res}
......@@ -901,7 +902,7 @@ remove_obsolete() {
for file in $(cat ${tmpdir}/ObsoleteFiles.txt); do
if [ -f ${mountpoint}/${file} ]; then
if [ ${interactive} -gt 0 ]; then
read -p "Remove ${mountpoint}/${file} (Y/n)? " val
read -p "Remove ${mountpoint}${file} (Y/n)? " val
case "${val}" in
[Nn]*)
continue
......@@ -910,7 +911,7 @@ remove_obsolete() {
fi
if [ ${verbose} -gt 0 ]; then
debug_print " [+] Removing ${mountpoint}/${file}"
debug_print " [+] Removing ${mountpoint}${file}"
fi
rm -f ${mountpoint}/${file}
......@@ -922,7 +923,7 @@ remove_obsolete() {
for file in $(cat ${tmpdir}/ObsoleteDirs.txt); do
if [ -e ${mountpoint}/${file} ]; then
if [ ${verbose} -gt 0 ]; then
debug_print " [+] Removing ${mountpoint}/${file}"
debug_print " [+] Removing ${mountpoint}${file}"
fi
rm -rf ${mountpoint}/${file}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment