Browse Source

Stefan Fiedler:

mine: directories are always unmodified
	misc/tools-source/getfiles.c: stat symlinks, not the files they point to



git-svn-id: http://www.rocklinux.org/svn/rock-linux/trunk@7573 c5f82cb5-29bc-0310-9cd0-bff59a50e3bc
rocklinux
Stefan Fiedler 19 years ago
parent
commit
b509fd0dc8
2 changed files with 6 additions and 3 deletions
  1. +1
    -1
      misc/tools-source/getfiles.c
  2. +5
    -2
      package/base/mine/special-files.patch

+ 1
- 1
misc/tools-source/getfiles.c

@ -34,7 +34,7 @@ int main(int argc, char ** argv) {
while ( fgets(buf, 512, stdin) != NULL && while ( fgets(buf, 512, stdin) != NULL &&
(fn = strchr(buf, ' ')) != NULL ) { (fn = strchr(buf, ' ')) != NULL ) {
if ( (n = strchr(++fn, '\n')) != NULL ) *n = '\0'; if ( (n = strchr(++fn, '\n')) != NULL ) *n = '\0';
if ( !stat(fn,&st) && !S_ISDIR(st.st_mode) )
if ( !lstat(fn,&st) && !S_ISDIR(st.st_mode) )
puts(fn); puts(fn);
} }
return 0; return 0;

+ 5
- 2
package/base/mine/special-files.patch

@ -71,13 +71,13 @@ diff -dur mine-0.24/md5sum.c mine-0.24-patch/md5sum.c
#include <sys/stat.h> #include <sys/stat.h>
#include <unistd.h> #include <unistd.h>
@@ -37,35 +38,39 @@
@@ -37,35 +38,42 @@
struct stat statbuf; struct stat statbuf;
snprintf(realfilename, 1024, "%s/%s", root, filename); snprintf(realfilename, 1024, "%s/%s", root, filename);
- return (stat(realfilename, &statbuf) != 0 || S_ISFIFO(statbuf.st_mode)) - return (stat(realfilename, &statbuf) != 0 || S_ISFIFO(statbuf.st_mode))
- ? "" : md5_file(realfilename); - ? "" : md5_file(realfilename);
+ if (stat(realfilename, &statbuf) != 0)
+ if (lstat(realfilename, &statbuf) != 0 || S_ISDIR(statbuf.st_mode))
+ return ""; + return "";
+ else if (!S_ISREG(statbuf.st_mode)) + else if (!S_ISREG(statbuf.st_mode))
+ return "X"; + return "X";
@ -97,6 +97,9 @@ diff -dur mine-0.24/md5sum.c mine-0.24-patch/md5sum.c
- if (md5_f == NULL || strcmp(md5_f, "") == 0) - if (md5_f == NULL || strcmp(md5_f, "") == 0)
- return 0; - return 0;
+ +
+/* printf ("md5sum_check(): md5_f: %s, md5_d: %s\n",
+ (md5_f) ? md5_f : "NULL", (md5_d) ? md5_d : "NULL");
+*/
+ if (strcmp(md5_f, "") == 0) + if (strcmp(md5_f, "") == 0)
+ return MD5SUM_CHECK_OK; + return MD5SUM_CHECK_OK;
else if (md5_d == NULL) else if (md5_d == NULL)

Loading…
Cancel
Save