Skip to content

Commit

Permalink
added logging of errors to a file for debs installation and man pages…
Browse files Browse the repository at this point in the history
… edits
  • Loading branch information
mars4science committed Sep 25, 2023
1 parent c49c74b commit 429781a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
7 changes: 4 additions & 3 deletions apt_get.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
if [ "x${software_path_root}" = "x" ] ; then software_path_root=/media/$(id -un)/usb/LM ; fi
if [ "x${work_path}" = "x" ] ; then work_path=/media/ramdisk ; fi
default_local_debs="$software_path_root/debs"
amend_log="${work_path}/amend_errors.log"

# where to take from dpkg status file and apt sources if not supplied as argument (passed as one argument via shift)
default_local_apt_dpkg_folder="$software_path_root/apt_dpkg_state/"
Expand Down Expand Up @@ -342,9 +343,9 @@ done # reading lines of names of packages
restore_status

if [ -e $errors_apt_get ]; then
echo "===== Errors during script: ====="
1>&2 cat $errors_apt_get
echo "===== End of errors during script: ====="
echo "===== Errors during script: =====" | sudo tee --append "${amend_log}"
1>&2 cat $errors_apt_get | sudo tee --append "${amend_log}"
echo "===== End of errors during script: =====" | sudo tee --append "${amend_log}"
sudo rm $errors_apt_get
fi

Expand Down
7 changes: 5 additions & 2 deletions man_pages_edits.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ man_section="man" # changed due to: now section number included in input file li
if [ "x${software_path_root}" = "x" ] ; then software_path_root=/media/$(id -un)/usb/LM ; fi
man_pages_edits="${software_path_root}/to_root/usr/share/src/amendedliveiso/man_pages_edits.txt"

if [ "x${work_path}" = "x" ] ; then work_path=/media/ramdisk/work ; fi
amend_log="${work_path}/amend_errors.log"

echo " Processing changes to the system reference manual pages from ${man_pages_edits}"
sudo updatedb # to update database used by `locate`
IFS=''
Expand All @@ -30,12 +33,12 @@ while read -r line; do
otext="$line"
# printf "%s\n%s\n%s\n" $page $itext $otext
if [ $(locate "/${page}." "${man_section}" gz | wc -l) -ne 1 ] ; then
echo " ERROR: it seems locate cannot find unique gz archive of ${page} in ${man_section}, skipping" # after adding "/" and "." to ${page} multiples are not expected to happen, only no one found
echo " ERROR: it seems locate cannot find unique gz archive of ${page} in ${man_section}, skipping" | sudo tee --append "${amend_log}" # after adding "/" and "." to ${page} multiples are not expected to happen, only no one found
continue
fi
man_page_gzip=$(locate "/${page}." "${man_section}" gz)
if [ $(gzip --list "${man_page_gzip}" | wc -l) -ne 2 ] ; then
echo " ERROR: it seems ${man_page_gzip} contains more than 1 file, skipping"
echo " ERROR: it seems ${man_page_gzip} contains more than 1 file, skipping" | sudo tee --append "${amend_log}"
continue
fi

Expand Down

0 comments on commit 429781a

Please sign in to comment.