debug: Update cmd and test for Windows (#45309)

* debug: Update cmd and test for Windows

* Add comment tar options not supported by Win tar
This commit is contained in:
Nicole C. 2024-08-12 15:50:51 -04:00 committed by GitHub
parent 78810e95ed
commit 27557a133b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View File

@ -6,6 +6,7 @@
import os
import platform
import re
import sys
from datetime import datetime
from glob import glob
@ -62,9 +63,10 @@ def create_db_tarball(args):
base = os.path.basename(str(spack.store.STORE.root))
transform_args = []
# Currently --transform and -s are not supported by Windows native tar
if "GNU" in tar("--version", output=str):
transform_args = ["--transform", "s/^%s/%s/" % (base, tarball_name)]
else:
elif sys.platform != "win32":
transform_args = ["-s", "/^%s/%s/" % (base, tarball_name)]
wd = os.path.dirname(str(spack.store.STORE.root))

View File

@ -16,8 +16,6 @@
debug = SpackCommand("debug")
pytestmark = pytest.mark.not_on_windows("does not run on windows")
@pytest.mark.db
def test_create_db_tarball(tmpdir, database):