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,58 @@
26 +int checkFiles(StringBuf fileList, int fileListLen)
28 + StringBuf readBuf = NULL;
34 + myargv[0] = rpmExpand("%{__check_files}", NULL);
35 + if (!(myargv[0] && *myargv[0] != '%')) {
39 + myargv[1] = rpmExpand("%{buildroot}", NULL);
40 + if (!(myargv[1] && *myargv[1] != '%')) {
46 + rpmMessage(RPMMESS_NORMAL, _("Searching for omited files: (using %s)...\n"),
49 + /* bufLen = (fileList->tail - fileList->buf) + 1; */
50 + bufLen = fileListLen;
51 + readBuf = getOutputFrom(NULL, myargv, getStringBuf(fileList), bufLen, 0);
54 + buf = getStringBuf(readBuf);
55 + if ((*buf != '\0') & (*buf != '\n'))
56 + rpmMessage(RPMMESS_WARNING, \
57 + _("found installed files not placed in any package:\n---\n%s---\n"),
58 + getStringBuf(readBuf));
63 + freeStringBuf(readBuf);
70 int processBinaryFiles(Spec spec, int installSpecialDoc, int test)
75 + int fileListLen = 0;
77 + fileList = newStringBuf();
79 for (pkg = spec->packages; pkg != NULL; pkg = pkg->next) {
80 const char *n, *v, *r;
81 @@ -2213,13 +2260,23 @@
82 * XXX existence (rather than value) that will need to change as well.
84 if (headerGetEntry(pkg->header, RPMTAG_MULTILIBS, NULL, NULL, NULL)) {
85 - generateDepends(spec, pkg, pkg->cpioList, pkg->cpioCount, 1);
86 - generateDepends(spec, pkg, pkg->cpioList, pkg->cpioCount, 2);
87 + generateDepends(spec, pkg, pkg->cpioList, pkg->cpioCount, 1, fileList, &fileListLen);
88 + generateDepends(spec, pkg, pkg->cpioList, pkg->cpioCount, 2, fileList, &fileListLen);
90 - generateDepends(spec, pkg, pkg->cpioList, pkg->cpioCount, 0);
91 + generateDepends(spec, pkg, pkg->cpioList, pkg->cpioCount, 0, fileList, &fileListLen);
92 printDeps(pkg->header);
96 + /* Now we have in fileList lits of files from all packages.
97 + * We pass it to a script which do the work of finding missing
98 + * and duplicated files.
102 + checkFiles(fileList, fileListLen);
104 + freeStringBuf(fileList);
108 --- rpm-4.0.2/platform.in Sun May 26 13:40:43 2002
109 +++ rpm-4.0.2-filon/platform.in Sun May 26 12:11:26 2002
111 # Expanded at end of %install
114 +# Gets file list on input and buildroot as first parameter
115 +# and returns list of files not found in any package
116 +%__check_files @prefix@/lib/rpm/check-files
118 %__arch_install_post @ARCH_INSTALL_POST@