summaryrefslogtreecommitdiff
path: root/tools/rpmuncompress.c
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2022-04-28 10:17:16 +0300
committerPanu Matilainen <pmatilai@redhat.com>2022-04-28 10:23:40 +0300
commitcbcd9dd38dd1d0379e5d25ed3c1b1e96353e4014 (patch)
tree8f6b8f0571699f6c1def91c54eb46b6f252622e7 /tools/rpmuncompress.c
parentbb36aac905cf8eb470f085574641d92c8d8ca20f (diff)
downloadrpm-cbcd9dd38dd1d0379e5d25ed3c1b1e96353e4014.tar.gz
Fix regression in rubygem unpacking (#2040)
Externalizing the source unpack in commit cd5d667e99f931504a512b591fcde7ed92cee344 required changing the way rubygems are unpacked, and now the .gemspec file gets unpacked into different place. Oops. Reported and initial patch by Vit Ondruch. Fixes: #2040
Diffstat (limited to 'tools/rpmuncompress.c')
-rw-r--r--tools/rpmuncompress.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/rpmuncompress.c b/tools/rpmuncompress.c
index 609fb0f53..55aac4c44 100644
--- a/tools/rpmuncompress.c
+++ b/tools/rpmuncompress.c
@@ -97,12 +97,13 @@ static char *doUntar(const char *fn)
if (needtar) {
rasprintf(&buf, "%s '%s' | %s %s -", zipper, fn, tar, taropts);
} else if (at->compressed == COMPRESSED_GEM) {
- size_t nvlen = strlen(fn) - 3;
+ const char *bn = basename(fn);
+ size_t nvlen = strlen(bn) - 3;
char *gem = rpmGetPath("%{__gem}", NULL);
char *gemspec = NULL;
char gemnameversion[nvlen];
- rstrlcpy(gemnameversion, fn, nvlen);
+ rstrlcpy(gemnameversion, bn, nvlen);
gemspec = rpmGetPath("", gemnameversion, ".gemspec", NULL);
rasprintf(&buf, "%s '%s' && %s spec '%s' --ruby > '%s'",