mirror of
https://github.com/awalsh128/cache-apt-pkgs-action.git
synced 2024-12-22 18:55:30 +00:00
Update installation to consider symlinks as well.
Addresses problem raised in #25
This commit is contained in:
parent
c58b29a1aa
commit
a85a2de3b3
|
@ -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
|
||||
|
|
|
@ -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
9
lib.sh
|
@ -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."
|
||||
}
|
Loading…
Reference in a new issue