version 1.14, 2004/01/04 01:49:38 |
version 1.15, 2004/01/14 23:55:29 |
Line 288 pkg_do(const char *pkg) |
|
Line 288 pkg_do(const char *pkg) |
|
goto bomb; |
goto bomb; |
} |
} |
|
|
if (uname(&host_uname) == 0) { |
if (uname(&host_uname) < 0) { |
|
warnx("uname() failed."); |
|
if (!Force) { |
|
warnx("aborting."); |
|
goto bomb; |
|
} |
|
} else { |
int osbad = 0; |
int osbad = 0; |
|
|
/* handle Darwin's uname(3) on powerpc writing |
|
* "Power Macintosh" in struct uname.machine. |
|
*/ |
|
if (strcmp(host_uname.machine, "Power Macintosh") == 0) |
|
strcpy(host_uname.machine, "powerpc"); /* it fits */ |
|
|
|
/* If either the OS or arch are different, bomb */ |
/* If either the OS or arch are different, bomb */ |
if (strcmp(host_uname.sysname, buildinfo[BI_OPSYS]) != 0 || |
if (strcmp(OPSYS_NAME, buildinfo[BI_OPSYS]) != 0 || |
strcmp(host_uname.machine, buildinfo[BI_MACHINE_ARCH]) != 0) |
strcmp(MACHINE_ARCH, buildinfo[BI_MACHINE_ARCH]) != 0) |
osbad = 2; |
osbad = 2; |
|
|
/* If OS and arch are the same, warn if version differs */ |
/* If OS and arch are the same, warn if version differs */ |
if (strcmp(host_uname.sysname, buildinfo[BI_OPSYS]) == 0 && |
if (strcmp(OPSYS_NAME, buildinfo[BI_OPSYS]) == 0 && |
strcmp(host_uname.machine, buildinfo[BI_MACHINE_ARCH]) == 0) { |
strcmp(MACHINE_ARCH, buildinfo[BI_MACHINE_ARCH]) == 0) { |
if (strcmp(host_uname.release, buildinfo[BI_OS_VERSION]) != 0) |
if (strcmp(host_uname.release, buildinfo[BI_OS_VERSION]) != 0) |
osbad = 1; |
osbad = 1; |
} else |
} else |
Line 316 pkg_do(const char *pkg) |
|
Line 316 pkg_do(const char *pkg) |
|
buildinfo[BI_OPSYS], |
buildinfo[BI_OPSYS], |
buildinfo[BI_MACHINE_ARCH], |
buildinfo[BI_MACHINE_ARCH], |
buildinfo[BI_OS_VERSION], |
buildinfo[BI_OS_VERSION], |
host_uname.sysname, |
OPSYS_NAME, |
host_uname.machine, |
MACHINE_ARCH, |
host_uname.release); |
host_uname.release); |
} |
} |
if (!Force && (osbad >= 2)) { |
if (!Force && (osbad >= 2)) { |
warnx("aborting."); |
warnx("aborting."); |
goto bomb; |
goto bomb; |
} |
} |
} else { |
|
warnx("uname() failed."); |
|
if (!Force) { |
|
warnx("aborting."); |
|
goto bomb; |
|
} |
|
} |
} |
|
|
/* |
/* |
Line 516 ignore_replace_depends_check: |
|
Line 510 ignore_replace_depends_check: |
|
installed); |
installed); |
} |
} |
fexec(BINDIR "/pkg_delete", "-K", dbdir, installed, NULL); |
fexec(BINDIR "/pkg_delete", "-K", dbdir, installed, NULL); |
} else { |
} else if (!is_depoted_pkg) { |
warnx("other version '%s' already installed", installed); |
warnx("other version '%s' already installed", installed); |
|
|
errc = 1; |
errc = 1; |