diff options
| author | David E. O'Brien <obrien@FreeBSD.org> | 1999-06-14 21:58:59 +0000 |
|---|---|---|
| committer | David E. O'Brien <obrien@FreeBSD.org> | 1999-06-14 21:58:59 +0000 |
| commit | ba83352b78b29ee8c624e8717a847567a899b5c3 (patch) | |
| tree | 1f407184f1e8b4e65e5e953dff782c566e7c59ec /usr.sbin/pkg_install | |
| parent | 501bebb5be365806e07297d1e08213cd23c639d4 (diff) | |
Notes
Diffstat (limited to 'usr.sbin/pkg_install')
| -rw-r--r-- | usr.sbin/pkg_install/add/main.c | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/usr.sbin/pkg_install/add/main.c b/usr.sbin/pkg_install/add/main.c index 002222fbada3..ee002c4fdc9b 100644 --- a/usr.sbin/pkg_install/add/main.c +++ b/usr.sbin/pkg_install/add/main.c @@ -1,6 +1,6 @@ #ifndef lint static const char rcsid[] = - "$Id: main.c,v 1.22 1999/01/26 22:31:23 billf Exp $"; + "$Id: main.c,v 1.23 1999/01/28 20:17:32 billf Exp $"; #endif /* @@ -26,6 +26,7 @@ static const char rcsid[] = #include <err.h> #include <sys/param.h> +#include <sys/utsname.h> #include <objformat.h> #include "lib.h" #include "add.h" @@ -187,18 +188,25 @@ static char * getpackagesite(char binform[1024]) { int reldate; + static char sitepath[MAXPATHLEN]; + struct utsname u; reldate = getosreldate(); + uname(&u); + strcpy(sitepath, u.machine); + if (reldate == 300005) - return "i386/packages-3.0/"; - else if (300004 > reldate && reldate >= 300000) - return "i386/packages-3.0-aout/Latest/" ; - else if (300004 < reldate) - return !strcmp(binform, "elf") ? "i386/packages-3-stable/Latest/" : - "i386/packages-3.0-aout/Latest/"; + strcat(sitepath, "/packages-3.0/"); + else if (300000 < reldate && reldate <= 300004) + strcat(sitepath, "/packages-3.0-aout/Latest/"); + else if (300004 < reldate && reldate < 400000) + strcat(sitepath, !strcmp(binform, "elf") ? "/packages-3-stable/Latest/" : + "/packages-3.0-aout/Latest/"); + else + strcat(sitepath, "/packages-current/Latest/"); - return(""); + return sitepath; } |
