Skip to content

Commit 0c573b6

Browse files
committed
Fix setup line for packages without a prefix folder
Previously in a cleanup commit 74c0833 the support for packages that didn't have a prefix folder was unintentionally removed. This change updates the setup call for non-R packages to add the support back. Signed-off-by: William Douglas <[email protected]>
1 parent 356da62 commit 0c573b6

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

autospec/specfiles.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -483,12 +483,16 @@ def write_prep(self):
483483
self._write_strip(f"gpg --homedir .gnupg --status-fd 1 --verify {self.config.signature_macro} %{{SOURCE0}} > gpg.status")
484484
self._write_strip(f"grep -E '^\\[GNUPG:\\] (GOODSIG|EXPKEYSIG) {self.keyid}' gpg.status")
485485
self.write_prep_prepend()
486-
prefix = self.content.prefixes[self.url]
487486
if self.config.default_pattern == 'R':
488487
prefix = self.content.tarball_prefix
489488
self._write_strip("%setup -q -n " + prefix)
490489
else:
491-
self._write_strip("%setup -q -n " + prefix)
490+
prefix = self.content.prefixes[self.url]
491+
if not prefix:
492+
prefix = os.path.splitext(os.path.basename(self.url))[0]
493+
self._write_strip("%setup -q -c -n " + prefix)
494+
else:
495+
self._write_strip("%setup -q -n " + prefix)
492496
for archive in self.config.sources["archive"]:
493497
# Handle various archive types
494498
extract_cmd = 'tar xf {}'

0 commit comments

Comments
 (0)