- allow spaces in group names
- fix bug in memory allocation of special doc stuff
- Jeff Johnson's mode/dev fixes
+ - clean up buildroot
2.4.101 -> 2.4.102:
- fixed spelling of "instchangelog" in lib-rpmrc.in
if (installSpecialDoc) {
doScript(spec, RPMBUILD_STRINGBUF, "%doc", pkg->specialDoc, 0);
}
+
/* fl.current now takes on "ownership" of the specialDocAttrRec */
/* allocated string data. */
fl.current = specialDocAttrRec;
{
char fileName[BUFSIZ];
char diskName[BUFSIZ];
- char *copyTo, *copyFrom, copied;
char *prefixTest, *prefixPtr;
struct stat statbuf;
int_16 fileMode;
int fileUid, fileGid;
char *fileUname, *fileGname;
- /* Copy to fileName, eliminate duplicate "/" and trailing "/" */
- copyTo = fileName;
- copied = '\0';
- copyFrom = name;
- while (*copyFrom) {
- if (*copyFrom != '/' || copied != '/') {
- *copyTo++ = copied = *copyFrom;
- }
- copyFrom++;
- }
- *copyTo = '\0';
- copyTo--;
- if ((copyTo != fileName) && (*copyTo == '/')) {
- *copyTo = '\0';
- }
+ strcpy(fileName, cleanFileName(name));
if (fl->inFtw) {
/* Any buildRoot is already prepended */
return readBuff;
}
+
+char *cleanFileName(char *name)
+{
+ static char res[BUFSIZ];
+ char *copyTo, *copyFrom, copied;
+
+ /* Copy to fileName, eliminate duplicate "/" and trailing "/" */
+ copyTo = res;
+ copied = '\0';
+ copyFrom = name;
+ while (*copyFrom) {
+ if (*copyFrom != '/' || copied != '/') {
+ *copyTo++ = copied = *copyFrom;
+ }
+ copyFrom++;
+ }
+ *copyTo = '\0';
+ copyTo--;
+ if ((copyTo != res) && (*copyTo == '/')) {
+ *copyTo = '\0';
+ }
+
+ return res;
+}
StringBuf getOutputFrom(char *dir, char *argv[],
char *writePtr, int writeBytesLeft,
int failNonZero);
+char *cleanFileName(char *name);
#endif
SINGLE_TOKEN_ONLY;
if (! spec->buildRoot) {
if (rpmGetVar(RPMVAR_BUILDROOT)) {
- spec->buildRoot = strdup(rpmGetVar(RPMVAR_BUILDROOT));
+ spec->buildRoot = rpmGetVar(RPMVAR_BUILDROOT);
} else {
- spec->buildRoot = strdup(field);
+ spec->buildRoot = field;
}
+ spec->buildRoot = strdup(cleanFileName(spec->buildRoot));
}
if (!strcmp(spec->buildRoot, "/")) {
rpmError(RPMERR_BADSPEC,