Update installation to consider symlinks as well.

Addresses problem raised in #25
This commit is contained in:
Andrew Walsh 2022-07-14 21:23:42 -07:00 committed by awalsh128
parent c58b29a1aa
commit a85a2de3b3
3 changed files with 13 additions and 14 deletions

View file

@ -57,6 +57,7 @@ runs:
/ \
"${{ steps.load-cache.outputs.cache-hit }}" \
${{ inputs.packages }}
echo "::set-output name=package-version-list::$(cat ~/cache-apt-pkgs/manifest_main.log)"
echo "::set-output name=all-package-version-list::$(cat ~/cache-apt-pkgs/manifest_all.log)"
function create_list { local list=$(cat ~/cache-apt-pkgs/manifest_${1}.log | tr '\n' ','); echo ${list:0:-1}; };
echo "::set-output name=package-version-list::$(create_list main)"
echo "::set-output name=all-package-version-list::$(create_list all)"
shell: bash

View file

@ -75,14 +75,5 @@ for package in ${normalized_packages}; do
done
log "done."
manifest_all_filepath="${cache_dir}/manifest_all.log"
log "Writing all packages manifest to ${manifest_all_filepath}..."
# Remove trailing comma and write to manifest_all file.
echo "${manifest_all:0:-1}" > "${manifest_all_filepath}"
log "done."
manifest_main_filepath="${cache_dir}/manifest_main.log"
log "Writing main requested packages manifest to ${manifest_main_filepath}..."
# Remove trailing comma and write to manifest_main file.
echo "${manifest_main:0:-1}" > "${manifest_main_filepath}"
log "done."
write_manifest "all" "${manifest_all}" "${cache_dir}/manifest_all.log"
write_manifest "main" "${manifest_main}" "${cache_dir}/manifest_main.log"

9
lib.sh
View file

@ -27,4 +27,11 @@ function get_package_name_ver {
echo "${name}" "${ver}"
}
function log { echo "$(date +%H:%M:%S)" "${@}"; }
function log { echo "$(date +%H:%M:%S)" "${@}"; }
function write_manifest {
log "Writing ${1} packages manifest to ${3}..."
# 0:-1 to remove trailing comma, delimit by newline and sort
echo "${2:0:-1}" | tr ',' '\n' | sort > ${3}
log "done."
}