Remove sudo usage
All checks were successful
Publish Master Push Event / Publish master push (push) Successful in 1s
All checks were successful
Publish Master Push Event / Publish master push (push) Successful in 1s
This commit is contained in:
parent
f2fc6d1af4
commit
3ad3201073
3 changed files with 5 additions and 5 deletions
|
@ -29,7 +29,7 @@ fi
|
|||
|
||||
log "Updating APT package list..."
|
||||
if [[ -z "$(find -H /var/lib/apt/lists -maxdepth 0 -mmin -5)" ]]; then
|
||||
sudo apt-fast update > /dev/null
|
||||
apt-fast update > /dev/null
|
||||
log "done"
|
||||
else
|
||||
log "skipped (fresh within at least 5 minutes)"
|
||||
|
@ -62,7 +62,7 @@ install_log_filepath="${cache_dir}/install.log"
|
|||
|
||||
log "Clean installing ${package_count} packages..."
|
||||
# Zero interaction while installing or upgrading the system via apt.
|
||||
sudo DEBIAN_FRONTEND=noninteractive apt-fast --yes install ${packages} > "${install_log_filepath}"
|
||||
DEBIAN_FRONTEND=noninteractive apt-fast --yes install ${packages} > "${install_log_filepath}"
|
||||
log "done"
|
||||
log "Installation log written to ${install_log_filepath}"
|
||||
|
||||
|
@ -94,7 +94,7 @@ for installed_package in ${installed_packages}; do
|
|||
while IFS= read -r f; do test -f "${f}" -o -L "${f}" && get_tar_relpath "${f}"; done |
|
||||
# Single quotes ensure literals like backslash get captured. Use \0 to avoid field separation.
|
||||
awk -F"\0" '{print "\x27"$1"\x27"}' |
|
||||
sudo xargs tar -cf "${cache_filepath}" -C /
|
||||
xargs tar -cf "${cache_filepath}" -C /
|
||||
|
||||
log " done (compressed size $(du -h "${cache_filepath}" | cut -f1))."
|
||||
fi
|
||||
|
|
2
lib.sh
2
lib.sh
|
@ -24,7 +24,7 @@ function execute_install_script {
|
|||
log "- Executing ${install_script_filepath}..."
|
||||
# Don't abort on errors; dpkg-trigger will error normally since it is
|
||||
# outside its run environment.
|
||||
sudo sh -x ${install_script_filepath} ${4} || true
|
||||
sh -x ${install_script_filepath} ${4} || true
|
||||
log " done"
|
||||
fi
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@ log "Restoring ${cached_filecount} packages from cache..."
|
|||
for cached_filepath in ${cached_filepaths}; do
|
||||
|
||||
log "- $(basename "${cached_filepath}") restoring..."
|
||||
sudo tar -xf "${cached_filepath}" -C "${cache_restore_root}" > /dev/null
|
||||
|
||||
log " done"
|
||||
|
||||
# Execute install scripts if available.
|
||||
|
|
Loading…
Reference in a new issue