mirror of
https://github.com/awalsh128/cache-apt-pkgs-action.git
synced 2025-09-20 10:07:08 +00:00
Add error suppression on file testing.
This commit is contained in:
parent
f076e88841
commit
aa86a37b2d
8
lib.sh
8
lib.sh
|
@ -16,8 +16,8 @@ function execute_install_script {
|
||||||
get_install_filepath "${1}" "${package_name}" "${3}")
|
get_install_filepath "${1}" "${package_name}" "${3}")
|
||||||
if test ! -z "${install_script_filepath}"; then
|
if test ! -z "${install_script_filepath}"; then
|
||||||
log "- Executing ${install_script_filepath}..."
|
log "- Executing ${install_script_filepath}..."
|
||||||
# Don't abort on errors; dpkg-trigger will error normally since it is outside
|
# Don't abort on errors; dpkg-trigger will error normally since it is
|
||||||
# its run environment.
|
# outside its run environment.
|
||||||
sudo sh -x ${install_script_filepath} ${4} || true
|
sudo sh -x ${install_script_filepath} ${4} || true
|
||||||
log " done"
|
log " done"
|
||||||
fi
|
fi
|
||||||
|
@ -90,8 +90,8 @@ function get_package_name_from_cached_filepath {
|
||||||
function get_install_filepath {
|
function get_install_filepath {
|
||||||
# Filename includes arch (e.g. amd64).
|
# Filename includes arch (e.g. amd64).
|
||||||
local filepath="$(\
|
local filepath="$(\
|
||||||
ls -1 ${1}var/lib/dpkg/info/${2}*.${3} \
|
ls -1 ${1}var/lib/dpkg/info/${2}*.${3} 2> /dev/null \
|
||||||
| grep -E ${2}'(:.*)?.'${3} | head -1)"
|
| grep -E ${2}'(:.*)?.'${3} | head -1 || true)"
|
||||||
test "${filepath}" && echo "${filepath}"
|
test "${filepath}" && echo "${filepath}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/bin/bash -x
|
#!/bin/bash
|
||||||
|
|
||||||
# Fail on any error.
|
# Fail on any error.
|
||||||
set -e
|
set -e
|
||||||
|
|
Loading…
Reference in a new issue