]> git.pld-linux.org Git - packages/rpm.git/commitdiff
- check for files not placed in any package
authorfilon <filon@sokrates.mimuw.edu.pl>
Sun, 26 May 2002 12:58:57 +0000 (12:58 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    rpm-check_files.patch -> 1.1

rpm-check_files.patch [new file with mode: 0644]

diff --git a/rpm-check_files.patch b/rpm-check_files.patch
new file mode 100644 (file)
index 0000000..d959299
--- /dev/null
@@ -0,0 +1,119 @@
+--- rpm-4.0.2/build/files.c    Sun May 26 13:40:43 2002
++++ rpm-4.0.2-filon/build/files.c      Sun May 26 13:39:44 2002
+@@ -1987,7 +1987,7 @@
+  */
+ static int generateDepends(Spec spec, Package pkg,
+                          struct cpioFileMapping *cpioList, int cpioCount,
+-                         int multiLib)
++                         int multiLib, StringBuf fileList, int *fileListLen)
+ {
+     StringBuf writeBuf;
+     int writeBytes;
+@@ -2013,7 +2013,9 @@
+       }
+       writeBytes += strlen(cpioList->fsPath) + 1;
++      *fileListLen += strlen(cpioList->fsPath) + 1;
+       appendLineStringBuf(writeBuf, cpioList->fsPath);
++      appendLineStringBuf(fileList, cpioList->fsPath);
+     }
+     for (dm = depMsgs; dm->msg != NULL; dm++) {
+@@ -2190,10 +2192,58 @@
+     FREE(versions);
+ }
++int checkFiles(StringBuf fileList, int fileListLen)
++{
++    StringBuf readBuf = NULL;
++    char* myargv[3];
++    int bufLen;
++    int rc = 0;
++    char *buf;
++    
++    myargv[0] = rpmExpand("%{__check_files}", NULL);
++    if (!(myargv[0] && *myargv[0] != '%')) {
++        rc = -1;
++        goto exit;
++    }    
++    myargv[1] = rpmExpand("%{buildroot}", NULL);
++    if (!(myargv[1] && *myargv[1] != '%')) {
++        rc = -1;
++        goto exit;
++    }
++    myargv[2] = NULL;
++    
++    rpmMessage(RPMMESS_NORMAL, _("Searching for omited files: (using %s)...\n"),
++               myargv[0]);
++                  
++    /* bufLen =  (fileList->tail - fileList->buf) + 1; */
++    bufLen = fileListLen;
++    readBuf = getOutputFrom(NULL, myargv, getStringBuf(fileList), bufLen, 0);
++    
++    if (readBuf) {
++        buf = getStringBuf(readBuf);
++        if ((*buf != '\0') & (*buf != '\n'))
++            rpmMessage(RPMMESS_WARNING, \
++                      _("found installed files not placed in any package:\n---\n%s---\n"),
++                       getStringBuf(readBuf));
++    }
++    
++exit:
++    
++    freeStringBuf(readBuf);
++    FREE(myargv[0]);
++    FREE(myargv[1]);
++
++    return rc;
++}
++
+ int processBinaryFiles(Spec spec, int installSpecialDoc, int test)
+ {
+     Package pkg;
+     int res = 0;
++    StringBuf fileList;
++    int fileListLen;
++    
++    fileList = newStringBuf();
+     
+     for (pkg = spec->packages; pkg != NULL; pkg = pkg->next) {
+       const char *n, *v, *r;
+@@ -2213,13 +2260,22 @@
+      * XXX existence (rather than value) that will need to change as well.
+      */
+       if (headerGetEntry(pkg->header, RPMTAG_MULTILIBS, NULL, NULL, NULL)) {
+-          generateDepends(spec, pkg, pkg->cpioList, pkg->cpioCount, 1);
+-          generateDepends(spec, pkg, pkg->cpioList, pkg->cpioCount, 2);
++          generateDepends(spec, pkg, pkg->cpioList, pkg->cpioCount, 1, fileList, &fileListLen);
++          generateDepends(spec, pkg, pkg->cpioList, pkg->cpioCount, 2, fileList, &fileListLen);
+       } else
+-          generateDepends(spec, pkg, pkg->cpioList, pkg->cpioCount, 0);
++          generateDepends(spec, pkg, pkg->cpioList, pkg->cpioCount, 0, fileList, &fileListLen);
+       printDeps(pkg->header);
+       
+     }
++    /* Now we have in fileList lits of files from all packages.
++     * We pass it to a script which do the work of finding missing
++     * and duplicated files.
++     */
++    
++    checkFiles(fileList, fileListLen);
++    
++    freeStringBuf(fileList);
++    
+     return res;
+ }
+--- rpm-4.0.2/platform.in      Sun May 26 13:40:43 2002
++++ rpm-4.0.2-filon/platform.in        Sun May 26 12:11:26 2002
+@@ -38,6 +38,10 @@
+ #     Expanded at end of %install
+ #
++# Gets file list on input and buildroot as first parameter
++# and returns list of files not found in any package
++%__check_files                @prefix@/lib/rpm/check-files
++
+ %__arch_install_post   @ARCH_INSTALL_POST@
+ %__os_install_post    \
This page took 0.147847 seconds and 4 git commands to generate.