Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix "Remove tmp prefix from tar path" #244

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

turuslan
Copy link
Contributor

@turuslan turuslan commented Mar 15, 2022

Fixes #158 and reverts #176.

I introduced bug by using unnecessary wildcard.
Fixed by removing it.

-    tar -czf $__tarball_output_path -C $__tmp_dir filcrypto/*
+    tar -czf $__tarball_output_path -C $__tmp_dir filcrypto

However code before #158 also had unnecessary wildcard.

-    tar -czf $__tarball_output_path $__tmp_dir/*
+    tar -czf $__tarball_output_path $__tmp_dir

There are two options for tar file structure:

  1. One line change to just remove tmp prefix (sufficient)
-    tar -czf $__tarball_output_path $__tmp_dir/*
+    tar -czf $__tarball_output_path -C $__tmp_dir .
  1. Remove tmp prefix and put files in a directory.
    This is just for conveniece - it's annoying when archive is unpacked in wrong directory, and it creates lots of files there, and it's not easy to write all the filenames for rm or mv - tar file can have single root directory.
+    mkdir $__tmp_dir/filcrypto
-    find -L . -type f -name filcrypto.h -exec cp -- "{}" $__tmp_dir/ \;
+    find -L . -type f -name filcrypto.h -exec cp -- "{}" $__tmp_dir/filcrypto \;
-    find -L . -type f -name libfilcrypto.a -exec cp -- "{}" $__tmp_dir/ \;
+    find -L . -type f -name libfilcrypto.a -exec cp -- "{}" $__tmp_dir/filcrypto \;
-    find -L . -type f -name filcrypto.pc -exec cp -- "{}" $__tmp_dir/ \;
+    find -L . -type f -name filcrypto.pc -exec cp -- "{}" $__tmp_dir/filcrypto \;

-    tar -czf $__tarball_output_path $__tmp_dir/*
+    tar -czf $__tarball_output_path -C $__tmp_dir filcrypto

Please comment, and I will revert second option, and reduce PR to first option one-line


CI complains about GITHUB_TOKEN, which is not related to this PR

@Stebalien Stebalien requested a review from magik6k March 21, 2022 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant