Browse Source

mine mangling

Sincerely,
 Your slave - with nothing better to do in the free time.


git-svn-id: http://www.rocklinux.org/svn/rock-linux/trunk@1983 c5f82cb5-29bc-0310-9cd0-bff59a50e3bc
rocklinux
Rene Rebe 21 years ago
parent
commit
d166ea34e5
2 changed files with 84 additions and 2 deletions
  1. +1
    -2
      Documentation/Developers/CHANGELOG-RENE
  2. +83
    -0
      package/base/mine/var-adm-handling.patch

+ 1
- 2
Documentation/Developers/CHANGELOG-RENE

@ -1,12 +1,11 @@
*) 2003-12-14 (2.0.0-rc3 - 2.0.0-rc4)
- updated mine (0.17)
- mine mangling
*) 2003-12-13 (2.0.0-rc3 - 2.0.0-rc4)
- Mathieu Doidy: updated lftp (2.6.10) and liferea (0.4.5)
- updated mine (0.16)
- "fixed" libowfat to install the headers into $includedir/$pkg
*) 2003-12-12 (2.0.0-rc3 - 2.0.0-rc4)

+ 83
- 0
package/base/mine/var-adm-handling.patch

@ -0,0 +1,83 @@
Our ober-guru did not wanted a new mine release - so here is
my single fix.
- (Slave) Rene Rebe <rene@rocklinux.org>
Index: remove.c
===================================================================
--- remove.c (revision 17)
+++ remove.c (revision 18)
@@ -70,37 +70,47 @@
printf("%s: ", package);
printf("removing %s\n", filename);
}
- else
- if ( ! strncmp(filename, "var/adm/", 8) ) {
- if ( mode_verbose )
- printf("%s: moving %s to var/adm/backup\n",
+ else {
+ struct stat statbuf;
+
+ snprintf(realfn1, 1024, "%s/%s", root, filename);
+ if ( stat(realfn1, &statbuf) )
+ printf("WARNING: Could not stat file %s.\n",
+ realfn1);
+
+ if ( ! strncmp(filename, "var/adm/", 8) &&
+ ! (S_ISDIR(statbuf.st_mode)) ) {
+ if ( mode_verbose )
+ printf("%s: moving %s to var/adm/backup\n",
package, filename);
- snprintf(realfn1, 1024, "%s/var/adm/backup", root);
- mkdir(realfn1, 0700);
+ snprintf(realfn1, 1024, "%s/var/adm/backup",
+ root);
+ mkdir(realfn1, 0700);
- snprintf(realfn1, 1024, "%s", filename+8);
- sscanf(realfn1, "%[^/]/%[^/]", buf1, buf2);
+ snprintf(realfn1, 1024, "%s", filename+8);
+ sscanf(realfn1, "%[^/]/%[^/]", buf1, buf2);
- snprintf(realfn1, 1024, "%s/%s", root, filename);
- snprintf(realfn2, 1024, "%s/var/adm/backup/%s_%s",
- root, buf2, buf1);
+ snprintf(realfn1, 1024, "%s/%s", root, filename);
+ snprintf(realfn2, 1024, "%s/var/adm/backup/%s_%s",
+ root, buf2, buf1);
- if ( rename(realfn1, realfn2) ) {
- printf("While removing package %s: %s: %s\n",
- package, realfn1, strerror(errno));
- errors++;
+ if ( rename(realfn1, realfn2) ) {
+ printf("While removing package %s: %s: %s\n",
+ package, realfn1, strerror(errno));
+ errors++;
+ }
}
- }
- else
- {
- if ( mode_verbose )
- printf("%s: removing %s\n", package, filename);
- snprintf(realfn1, 1024, "%s/%s", root, filename);
- if ( remove(realfn1) ) {
- printf("While removing package %s: %s: %s\n",
- package, realfn1, strerror(errno));
- errors++;
+ else
+ {
+ if ( mode_verbose )
+ printf("%s: removing %s\n",
+ package, filename);
+ if ( remove(realfn1) ) {
+ printf("While removing package %s: %s: %s\n",
+ package, realfn1, strerror(errno));
+ errors++;
+ }
}
}
}

Loading…
Cancel
Save