Fix regression in rubygem unpacking (#2040)

Externalizing the source unpack in commit
cd5d667e99 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
This commit is contained in:
Panu Matilainen 2022-04-28 10:17:16 +03:00
parent bb36aac905
commit cbcd9dd38d
1 changed files with 3 additions and 2 deletions

View File

@ -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'",