2012-05-18 05:02:54 +04:00
|
|
|
--- rpm-5.4.9/build/files.c.buildroot_dups~ 2012-04-15 17:04:14.000000000 +0200
|
|
|
|
+++ rpm-5.4.9/build/files.c 2012-05-15 02:11:03.734983519 +0200
|
|
|
|
@@ -2917,7 +2917,7 @@ exit:
|
2012-02-01 18:08:07 +04:00
|
|
|
|
|
|
|
/* auxiliary function for checkDuplicateFiles() */
|
|
|
|
/* XXX need to pass Header because fi->h is NULL */
|
|
|
|
-static int fiIntersect(/*@null@*/ rpmfi fi1, /*@null@*/ rpmfi fi2)
|
|
|
|
+static int fiIntersect(/*@null@*/ rpmfi fi1, /*@null@*/ rpmfi fi2, size_t buildrootL)
|
|
|
|
/*@globals internalState @*/
|
|
|
|
/*@modifies fi1, fi2, internalState @*/
|
|
|
|
{
|
2012-05-18 05:02:54 +04:00
|
|
|
@@ -2941,7 +2941,7 @@ static int fiIntersect(/*@null@*/ rpmfi
|
2012-02-01 18:08:07 +04:00
|
|
|
if (!dups)
|
|
|
|
dups = rpmiobNew(0);
|
|
|
|
dups = rpmiobAppend(dups, "\t", 0);
|
|
|
|
- dups = rpmiobAppend(dups, fn1, 1);
|
|
|
|
+ dups = rpmiobAppend(dups, fn1+buildrootL, 1);
|
|
|
|
n++;
|
|
|
|
}
|
|
|
|
}
|
2012-05-18 05:02:54 +04:00
|
|
|
@@ -2972,7 +2972,7 @@ static int fiIntersect(/*@null@*/ rpmfi
|
2012-02-01 18:08:07 +04:00
|
|
|
* @param spec spec file control structure
|
|
|
|
* @return number of duplicate files
|
|
|
|
*/
|
|
|
|
-static int checkDuplicateFiles(Spec spec)
|
|
|
|
+static int checkDuplicateFiles(Spec spec, size_t buildrootL)
|
|
|
|
/*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
|
|
|
|
/*@modifies *spec->packages,
|
|
|
|
rpmGlobalMacroContext, fileSystem, internalState @*/
|
2012-05-18 05:02:54 +04:00
|
|
|
@@ -2997,7 +2997,7 @@ static int checkDuplicateFiles(Spec spec
|
2012-02-01 18:08:07 +04:00
|
|
|
#endif
|
|
|
|
if (fi2 == NULL) continue;
|
|
|
|
(void) rpmfiSetHeader(fi2, pkg2->header);
|
|
|
|
- n += fiIntersect(fi1, fi2);
|
|
|
|
+ n += fiIntersect(fi1, fi2, buildrootL);
|
|
|
|
(void) rpmfiSetHeader(fi2, NULL);
|
|
|
|
fi2 = rpmfiFree(fi2);
|
|
|
|
}
|
2012-05-18 05:02:54 +04:00
|
|
|
@@ -3023,7 +3023,7 @@ static inline int packagedDir(Package pk
|
2012-02-01 18:08:07 +04:00
|
|
|
* /A/B/C/D
|
|
|
|
* Now directories "/A/B" and "/A/B/C" should also be packaged.
|
|
|
|
*/
|
|
|
|
-static int pkgUnpackagedSubdirs(Package pkg)
|
|
|
|
+static int pkgUnpackagedSubdirs(Package pkg, size_t buildrootL)
|
|
|
|
/*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
|
|
|
|
/*@modifies pkg->header,
|
|
|
|
rpmGlobalMacroContext, fileSystem, internalState @*/
|
2012-05-18 05:02:54 +04:00
|
|
|
@@ -3096,7 +3096,7 @@ static int pkgUnpackagedSubdirs(Package
|
2012-02-01 18:08:07 +04:00
|
|
|
|
|
|
|
for (i = 0; i < n; i++) {
|
|
|
|
list = rpmiobAppend(list, "\t", 0);
|
|
|
|
- list = rpmiobAppend(list, unpackaged[i], 1);
|
|
|
|
+ list = rpmiobAppend(list, unpackaged[i]+buildrootL, 1);
|
|
|
|
unpackaged[i] = _free(unpackaged[i]);
|
|
|
|
}
|
|
|
|
unpackaged = _free(unpackaged);
|
2012-05-18 05:02:54 +04:00
|
|
|
@@ -3117,7 +3117,7 @@ static int pkgUnpackagedSubdirs(Package
|
2012-02-01 18:08:07 +04:00
|
|
|
* @param spec spec file control structure
|
|
|
|
* @return number of unpackaged subdirectories
|
|
|
|
*/
|
|
|
|
-static int checkUnpackagedSubdirs(Spec spec)
|
|
|
|
+static int checkUnpackagedSubdirs(Spec spec, size_t buildrootL)
|
|
|
|
/*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
|
|
|
|
/*@modifies *spec->packages,
|
|
|
|
rpmGlobalMacroContext, fileSystem, internalState @*/
|
2012-05-18 05:02:54 +04:00
|
|
|
@@ -3126,7 +3126,7 @@ static int checkUnpackagedSubdirs(Spec s
|
2012-02-01 18:08:07 +04:00
|
|
|
Package pkg;
|
|
|
|
|
|
|
|
for (pkg = spec->packages; pkg; pkg = pkg->next)
|
|
|
|
- n += pkgUnpackagedSubdirs(pkg);
|
|
|
|
+ n += pkgUnpackagedSubdirs(pkg, buildrootL);
|
|
|
|
return n;
|
|
|
|
}
|
|
|
|
|
2012-05-18 05:02:54 +04:00
|
|
|
@@ -3137,6 +3137,11 @@ rpmRC processBinaryFiles(Spec spec, int
|
2012-02-01 18:08:07 +04:00
|
|
|
Package pkg;
|
|
|
|
rpmRC res = RPMRC_OK;
|
2012-05-18 05:02:54 +04:00
|
|
|
|
2012-02-01 18:08:07 +04:00
|
|
|
+ char *buildroot = rpmExpand("%{?buildroot}", NULL);
|
|
|
|
+ size_t buildrootL = strlen(buildroot);
|
|
|
|
+
|
|
|
|
+ buildroot = _free(buildroot);
|
|
|
|
+
|
|
|
|
for (pkg = spec->packages; pkg != NULL; pkg = pkg->next) {
|
|
|
|
int rc;
|
|
|
|
|
2012-05-18 05:02:54 +04:00
|
|
|
@@ -3178,8 +3183,8 @@ rpmRC processBinaryFiles(Spec spec, int
|
2012-02-01 18:08:07 +04:00
|
|
|
if (res == RPMRC_OK) {
|
|
|
|
if (checkUnpackagedFiles(spec) > 0)
|
|
|
|
res = RPMRC_FAIL;
|
|
|
|
- (void) checkDuplicateFiles(spec);
|
|
|
|
- (void) checkUnpackagedSubdirs(spec);
|
|
|
|
+ (void) checkDuplicateFiles(spec, buildrootL);
|
|
|
|
+ (void) checkUnpackagedSubdirs(spec, buildrootL);
|
|
|
|
}
|
|
|
|
|
|
|
|
return res;
|