diff --git a/dist2src/core.py b/dist2src/core.py index 08242964..294fe134 100644 --- a/dist2src/core.py +++ b/dist2src/core.py @@ -283,7 +283,9 @@ def _enforce_autosetup(self): `%autosetup -a -a` doesn't work https://bugzilla.redhat.com/show_bug.cgi?id=1881840 b) %setup + pushd/cd - we cannot recreate those patches correctly since they are not applied from root #92 - c) no bullshit, just plain %setup and %patch -- in any case, we turn + c) %setup -T - do not unpack SOURCE0: in this case we don't want %autosetup b/c + it would be empty, we need to rely on %patch + d) no bullshit, just plain %setup and %patch -- in any case, we turn %setup into %autosetup -N to be sure the .git repo is created correctly unless `-a -a` is used """ @@ -294,6 +296,8 @@ def _enforce_autosetup(self): return a_a_regex = re.compile(r"-a") + # -T means to not unpack, it can actually be set e.g. like "-cT" + cap_t_regex = re.compile(r"-[a-zA-Z]*T") for i, line in enumerate(prep_lines): if line.startswith(("%autosetup", "%autopatch")): logger.info("This package uses %autosetup or %autopatch.") @@ -305,6 +309,11 @@ def _enforce_autosetup(self): "`%setup -aN -aM` detected, we cannot turn it to %autosetup" ) continue + if cap_t_regex.findall(line): + logger.info( + "`%setup -T` detected - no %autosetup, we need to rely on %patch" + ) + continue # %setup -> %autosetup -N prep_lines[i] = line.replace("%setup", "%autosetup -N") # %autosetup does not accept -q, remove it diff --git a/tests/conftest.py b/tests/conftest.py index 2ecfa782..8d9f3362 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -49,6 +49,7 @@ "unbound", "c8", ), # again, another level of directories and patches applied in a subdir + ("hyperv-daemons", "c8"), # no archive, source files are %SOURCEXXX ] # these packages only have a single commit in the respective dist-git branch