1 --- rpm-4.0.2/build/files.c Sun May 26 13:40:43 2002
2 +++ rpm-4.0.2-filon/build/files.c Sun May 26 13:39:44 2002
5 static int generateDepends(Spec spec, Package pkg,
6 struct cpioFileMapping *cpioList, int cpioCount,
8 + int multiLib, StringBuf fileList, int *fileListLen)
15 writeBytes += strlen(cpioList->fsPath) + 1;
16 + *fileListLen += strlen(cpioList->fsPath) + 1;
17 appendLineStringBuf(writeBuf, cpioList->fsPath);
18 + appendLineStringBuf(fileList, cpioList->fsPath);
21 for (dm = depMsgs; dm->msg != NULL; dm++) {
22 @@ -2190,10 +2192,54 @@
26 +int checkFiles(StringBuf fileList, int fileListLen)
28 + StringBuf readBuf = NULL;
29 + char* myargv[3] = {NULL, NULL, NULL};
33 + myargv[0] = rpmExpand("%{__check_files}", NULL);
34 + if (!(myargv[0] && *myargv[0] != '%')) {
38 + myargv[1] = rpmExpand("%{buildroot}", NULL);
39 + if (!(myargv[1] && *myargv[1] != '%')) {
44 + rpmMessage(RPMMESS_NORMAL, _("Searching for omited files: (using %s)...\n"),
47 + readBuf = getOutputFrom(NULL, myargv, getStringBuf(fileList), fileListLen, 0);
50 + buf = getStringBuf(readBuf);
51 + if ((*buf != '\0') && (*buf != '\n'))
52 + rpmMessage(RPMMESS_WARNING, \
53 + _("found installed files not placed in any package:\n---\n%s---\n"),
59 + freeStringBuf(readBuf);
66 int processBinaryFiles(Spec spec, int installSpecialDoc, int test)
71 + int fileListLen = 0;
73 + fileList = newStringBuf();
75 for (pkg = spec->packages; pkg != NULL; pkg = pkg->next) {
76 const char *n, *v, *r;
77 @@ -2213,13 +2260,23 @@
78 * XXX existence (rather than value) that will need to change as well.
80 if (headerGetEntry(pkg->header, RPMTAG_MULTILIBS, NULL, NULL, NULL)) {
81 - generateDepends(spec, pkg, pkg->cpioList, pkg->cpioCount, 1);
82 - generateDepends(spec, pkg, pkg->cpioList, pkg->cpioCount, 2);
83 + generateDepends(spec, pkg, pkg->cpioList, pkg->cpioCount, 1, fileList, &fileListLen);
84 + generateDepends(spec, pkg, pkg->cpioList, pkg->cpioCount, 2, fileList, &fileListLen);
86 - generateDepends(spec, pkg, pkg->cpioList, pkg->cpioCount, 0);
87 + generateDepends(spec, pkg, pkg->cpioList, pkg->cpioCount, 0, fileList, &fileListLen);
88 printDeps(pkg->header);
92 + /* Now we have in fileList list of files from all packages.
93 + * We pass it to a script which do the work of finding missing
94 + * and duplicated files.
98 + checkFiles(fileList, fileListLen);
100 + freeStringBuf(fileList);
104 --- rpm-4.0.2/platform.in Sun May 26 13:40:43 2002
105 +++ rpm-4.0.2-filon/platform.in Sun May 26 12:11:26 2002
107 # Expanded at end of %install
110 +# Gets file list on input and buildroot as first parameter
111 +# and returns list of files not found in any package
112 +%__check_files @prefix@/lib/rpm/check-files
114 %__arch_install_post @ARCH_INSTALL_POST@