Skip to content

Commit 44c33b3

Browse files
awalsh128sn-o-w
andauthored
Pull staging changes upstream. (#113)
* Pull dev upstream to staging. (#112) * Use awk to enclose filename in single quotes tar #99 * Add null field separator so filenames don't get broken up. * Move upload logs up in the action sequence so it captures data before it gets deleted. * Fix awk (#109) --------- Co-authored-by: sn-o-w <[email protected]> * Fix awk delimiter. Pull in fix by @sn-o-w in https://github.com/sn-o-w/cache-apt-pkgs-action/commit/d0ee83b497ac30023e51cd526c62e57b07501912 mentioned in issue #99 --------- Co-authored-by: sn-o-w <[email protected]>
1 parent 6f9e6a8 commit 44c33b3

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

action.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,13 @@ runs:
8383
DEBUG: "${{ inputs.debug }}"
8484
PACKAGES: "${{ inputs.packages }}"
8585

86+
- id: upload-logs
87+
if: ${{ inputs.debug == 'true' }}
88+
uses: actions/upload-artifact@v3
89+
with:
90+
name: cache-apt-pkgs-logs_${{ env.CACHE_KEY }}
91+
path: ~/cache-apt-pkgs/*.log
92+
8693
- id: save-cache
8794
if: ${{ ! steps.load-cache.outputs.cache-hit }}
8895
uses: actions/cache/save@v3
@@ -94,10 +101,3 @@ runs:
94101
run: |
95102
rm -rf ~/cache-apt-pkgs
96103
shell: bash
97-
98-
- id: upload-logs
99-
if: ${{ inputs.debug == 'true' }}
100-
uses: actions/upload-artifact@v3
101-
with:
102-
name: cache-apt-pkgs-logs_${{ env.CACHE_KEY }}
103-
path: ~/cache-apt-pkgs/*.log

install_and_cache_pkgs.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ for installed_package in ${installed_packages}; do
9292
& get_install_script_filepath "" "${package_name}" "preinst" \
9393
& get_install_script_filepath "" "${package_name}" "postinst"; } |
9494
while IFS= read -r f; do test -f "${f}" -o -L "${f}" && get_tar_relpath "${f}"; done |
95-
xargs -I {} echo \'{}\' | # Single quotes ensure literals like backslash get captured.
95+
# Single quotes ensure literals like backslash get captured. Use \0 to avoid field separation.
96+
awk -F"\0" '{print "\x27"$1"\x27"}' |
9697
sudo xargs tar -cf "${cache_filepath}" -C /
9798

9899
log " done (compressed size $(du -h "${cache_filepath}" | cut -f1))."

0 commit comments

Comments
 (0)