-
Notifications
You must be signed in to change notification settings - Fork 219
change tar command used in get_source_tarball_from_git to get reproducible tarballs
#4248
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
Merged
lexming
merged 9 commits into
easybuilders:5.0.x
from
Rovanion:reproducible-git-tarballs
Mar 18, 2024
Merged
Changes from 1 commit
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
4f8ddb8
Build reproducible tarballs from git
Rovanion 88de22e
Merge branch '5.0.x' into PR4248
lexming 8d9e14e
make reproducible archives only of git repos without .git dir and res…
lexming 46e61c8
update FileToolsTest.test_github_get_source_tarball_from_git tests wi…
lexming 8c76561
remove TODO about sort option in tar as it is not supported across im…
lexming e733cf4
Merge pull request #1 from lexming/PR4248
Rovanion 4363f9f
filetools: Fix missing raw string
Rovanion 0637f1f
Merge branch '5.0.x' into sync-pr-4248
lexming e1f95b1
Merge pull request #2 from lexming/sync-pr-4248
Rovanion File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2787,65 +2787,87 @@ def run_check(): | |
| 'url': '[email protected]:easybuilders', | ||
| 'tag': 'tag_for_tests', | ||
| } | ||
| git_repo = {'git_repo': '[email protected]:easybuilders/testrepository.git'} # Just to make the below shorter | ||
| string_args = { | ||
| 'git_repo': '[email protected]:easybuilders/testrepository.git', | ||
| 'test_prefix': self.test_prefix, | ||
| } | ||
|
|
||
| expected = '\n'.join([ | ||
| r' running command "git clone --depth 1 --branch tag_for_tests %(git_repo)s"', | ||
| r" \(in /.*\)", | ||
| r' running command "tar cfvz .*/target/test.tar.gz --exclude .git testrepository"', | ||
| r" \(in /.*\)", | ||
| ]) % git_repo | ||
| r" \(in .*/tmp.*\)", | ||
| r' running command "find testrepository -print0 -path \'*/.git\' -prune | LC_ALL=C sort --zero-terminated' | ||
| r' | GZIP=--no-name tar --create --file %(test_prefix)s/target/test.tar.gz --no-recursion' | ||
| r' --gzip --mtime="1970-01-01 00:00Z" --owner=0 --group=0 --numeric-owner --format=gnu' | ||
| r' --null --no-recursion --files-from -"', | ||
| r" \(in .*/tmp.*\)", | ||
| ]) % string_args | ||
| run_check() | ||
|
|
||
| git_config['clone_into'] = 'test123' | ||
| expected = '\n'.join([ | ||
| r' running command "git clone --depth 1 --branch tag_for_tests %(git_repo)s test123"', | ||
| r" \(in /.*\)", | ||
| r' running command "tar cfvz .*/target/test.tar.gz --exclude .git test123"', | ||
| r" \(in /.*\)", | ||
| ]) % git_repo | ||
| r" \(in .*/tmp.*\)", | ||
| r' running command "find test123 -print0 -path \'*/.git\' -prune | LC_ALL=C sort --zero-terminated' | ||
| r' | GZIP=--no-name tar --create --file #(test_fprefix)s/target/test.tar.gz --no-recursion' | ||
| r' --gzip --mtime="1970-01-01 00:00Z" --owner=0 --group=0 --numeric-owner --format=gnu' | ||
| r' --null --no-recursion --files-from -"', | ||
| r" \(in .*/tmp.*\)", | ||
| ]) % string_args | ||
| run_check() | ||
| del git_config['clone_into'] | ||
|
|
||
| git_config['recursive'] = True | ||
| expected = '\n'.join([ | ||
| r' running command "git clone --depth 1 --branch tag_for_tests --recursive %(git_repo)s"', | ||
| r" \(in /.*\)", | ||
| r' running command "tar cfvz .*/target/test.tar.gz --exclude .git testrepository"', | ||
| r" \(in /.*\)", | ||
| ]) % git_repo | ||
| r" \(in .*/tmp.*\)", | ||
| r' running command "find testrepository -print0 -path \'*/.git\' -prune | LC_ALL=C sort --zero-terminated' | ||
| r' | GZIP=--no-name tar --create --file #(test_fprefix)s/target/test.tar.gz --no-recursion' | ||
| r' --gzip --mtime="1970-01-01 00:00Z" --owner=0 --group=0 --numeric-owner --format=gnu' | ||
| r' --null --no-recursion --files-from -"', | ||
| r" \(in .*/tmp.*\)", | ||
| ]) % string_args | ||
| run_check() | ||
|
|
||
| git_config['keep_git_dir'] = True | ||
| expected = '\n'.join([ | ||
| r' running command "git clone --branch tag_for_tests --recursive %(git_repo)s"', | ||
| r" \(in /.*\)", | ||
| r' running command "tar cfvz .*/target/test.tar.gz testrepository"', | ||
| r" \(in /.*\)", | ||
| ]) % git_repo | ||
| r" \(in .*/tmp.*\)", | ||
| r' running command "find testrepository -print0 | LC_ALL=C sort --zero-terminated | GZIP=--no-name tar' | ||
| r' --create --file #(test_fprefix)s/target/test.tar.gz --no-recursion --gzip' | ||
| r' --mtime="1970-01-01 00:00Z" --owner=0 --group=0 --numeric-owner --format=gnu --null --no-recursion' | ||
| r' --files-from -"', | ||
| r" \(in .*/tmp.*\)", | ||
| ]) % string_args | ||
| run_check() | ||
| del git_config['keep_git_dir'] | ||
|
|
||
| del git_config['tag'] | ||
| git_config['commit'] = '8456f86' | ||
| expected = '\n'.join([ | ||
| r' running command "git clone --no-checkout %(git_repo)s"', | ||
| r" \(in /.*\)", | ||
| r" \(in .*/tmp.*\)", | ||
| r' running command "git checkout 8456f86 && git submodule update --init --recursive"', | ||
| r" \(in testrepository\)", | ||
| r' running command "tar cfvz .*/target/test.tar.gz --exclude .git testrepository"', | ||
| r" \(in /.*\)", | ||
| ]) % git_repo | ||
| r' running command "find testrepository -print0 -path \'*/.git\' -prune | LC_ALL=C sort --zero-terminated' | ||
| r' | GZIP=--no-name tar --create --file #(test_fprefix)s/target/test.tar.gz --no-recursion' | ||
| r' --gzip --mtime="1970-01-01 00:00Z" --owner=0 --group=0 --numeric-owner --format=gnu' | ||
| r' --null --no-recursion --files-from -"', | ||
| r" \(in .*/tmp.*\)", | ||
| ]) % string_args | ||
| run_check() | ||
|
|
||
| del git_config['recursive'] | ||
| expected = '\n'.join([ | ||
| r' running command "git clone --no-checkout %(git_repo)s"', | ||
| r" \(in /.*\)", | ||
| r" \(in .*/tmp.*\)", | ||
| r' running command "git checkout 8456f86"', | ||
| r" \(in testrepository\)", | ||
| r' running command "tar cfvz .*/target/test.tar.gz --exclude .git testrepository"', | ||
| r" \(in /.*\)", | ||
| ]) % git_repo | ||
| r' running command "find testrepository -print0 -path \'*/.git\' -prune | LC_ALL=C sort --zero-terminated' | ||
| r' | GZIP=--no-name tar --create --file #(test_fprefix)s/target/test.tar.gz --no-recursion' | ||
| r' --gzip --mtime="1970-01-01 00:00Z" --owner=0 --group=0 --numeric-owner --format=gnu' | ||
| r' --null --no-recursion --files-from -"', | ||
| r" \(in .*/tmp.*\)", | ||
| ]) % string_args | ||
| run_check() | ||
|
|
||
| # Test with real data. | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.