[darwinbuild-changes] [211] trunk/darwinxref/plugins/register.c
source_changes at macosforge.org
source_changes at macosforge.org
Wed Oct 4 01:58:40 PDT 2006
Revision: 211
http://trac.macosforge.org/projects/darwinbuild/changeset/211
Author: kevin
Date: 2006-10-04 01:58:40 -0700 (Wed, 04 Oct 2006)
Log Message:
-----------
- fall back to simple checksum on systems without redo_prebinding -u
Modified Paths:
--------------
trunk/darwinxref/plugins/register.c
Modified: trunk/darwinxref/plugins/register.c
===================================================================
--- trunk/darwinxref/plugins/register.c 2005-08-30 19:02:44 UTC (rev 210)
+++ trunk/darwinxref/plugins/register.c 2006-10-04 08:58:40 UTC (rev 211)
@@ -160,12 +160,25 @@
return format_digest(digstr);
}
-static int have_redo_prebinding() {
+static char* calculate_unprebound_digest(const char* filename);
+
+static int have_undo_prebinding() {
static int result = -2;
if (result == -2) {
struct stat sb;
result = stat("/usr/bin/redo_prebinding", &sb);
}
+
+ // Not all versions of redo_prebinding support -u
+ if (result == 0) {
+ char* digest = calculate_unprebound_digest("/bin/sh");
+ if (digest) {
+ if (strcmp(digest, "ERROR") == 0) {
+ result = -1;
+ }
+ free(digest);
+ }
+ }
return result;
}
@@ -404,7 +417,7 @@
int isMachO;
res = register_libraries(fd, build, project, &isMachO);
lseek(fd, (off_t)0, SEEK_SET);
- if (isMachO && have_redo_prebinding() == 0) {
+ if (isMachO && have_undo_prebinding() == 0) {
checksum = calculate_unprebound_digest(ent->fts_accpath);
} else {
checksum = calculate_digest(fd);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/darwinbuild-changes/attachments/20061004/ee2e72d8/attachment-0001.html
More information about the darwinbuild-changes
mailing list