Skip to content

Instantly share code, notes, and snippets.

@jirib
Last active February 5, 2020 16:08
Show Gist options
  • Select an option

  • Save jirib/6d06acb1db3fb07ea01d0bbae2a97f8a to your computer and use it in GitHub Desktop.

Select an option

Save jirib/6d06acb1db3fb07ea01d0bbae2a97f8a to your computer and use it in GitHub Desktop.
yadm_gtar_diff
diff --git a/test/test_encryption.py b/test/test_encryption.py
index ec3b330..e3f1d81 100644
--- a/test/test_encryption.py
+++ b/test/test_encryption.py
@@ -146,7 +146,7 @@ def decrypt_targets(tmpdir_factory, runner, gnupg):
env = os.environ.copy()
env['GNUPGHOME'] = gnupg.home
run = runner(
- ['tar', 'cvf', '-'] +
+ ['gtar', 'cvf', '-'] +
expected +
['|', 'gpg', '--batch', '--yes', '-c'] +
['--output', pipes.quote(str(symmetric))],
@@ -158,7 +158,7 @@ def decrypt_targets(tmpdir_factory, runner, gnupg):
gnupg.pw('')
add_asymmetric_key(runner, gnupg)
run = runner(
- ['tar', 'cvf', '-'] +
+ ['gtar', 'cvf', '-'] +
expected +
['|', 'gpg', '--batch', '--yes', '-e'] +
['-r', pipes.quote(KEY_NAME)] +
@@ -449,7 +449,7 @@ def encrypted_data_valid(runner, gnupg, encrypted, expected):
'gpg',
'-d', pipes.quote(str(encrypted)),
'2>/dev/null',
- '|', 'tar', 't'], env=env, shell=True, report=False)
+ '|', 'gtar', 't'], env=env, shell=True, report=False)
file_count = 0
for filename in run.out.splitlines():
if filename.endswith('/'):
diff --git a/yadm b/yadm
index b8f42fd..40af9af 100755
--- a/yadm
+++ b/yadm
@@ -850,7 +850,7 @@ function decrypt() {
fi
# decrypt the archive
- if ($GPG_PROGRAM -d "$YADM_ARCHIVE" || echo 1) | tar v${tar_option}f - -C "$YADM_WORK"; then
+ if ($GPG_PROGRAM -d "$YADM_ARCHIVE" || echo 1) | gtar v${tar_option}f - -C "$YADM_WORK"; then
[ ! "$DO_LIST" = "YES" ] && echo "All files decrypted."
else
error_out "Unable to extract encrypted files."
@@ -885,7 +885,7 @@ function encrypt() {
echo
# encrypt all files which match the globs
- if tar -f - -c "${ENCRYPT_INCLUDE_FILES[@]}" | $GPG_PROGRAM --yes "${GPG_OPTS[@]}" --output "$YADM_ARCHIVE"; then
+ if gtar -f - -c "${ENCRYPT_INCLUDE_FILES[@]}" | $GPG_PROGRAM --yes "${GPG_OPTS[@]}" --output "$YADM_ARCHIVE"; then
echo "Wrote new file: $YADM_ARCHIVE"
else
error_out "Unable to write $YADM_ARCHIVE"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment