Deleted Added
full compact
perform.c (131280) perform.c (131285)
1/*
2 * FreeBSD install - a package for the installation and maintainance
3 * of non-core utilities.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 5 unchanged lines hidden (view full) ---

14 * Jeremy D. Lea.
15 * 11 May 2002
16 *
17 * This is the version module. Based on pkg_version.pl by Bruce A. Mah.
18 *
19 */
20
21#include <sys/cdefs.h>
1/*
2 * FreeBSD install - a package for the installation and maintainance
3 * of non-core utilities.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 5 unchanged lines hidden (view full) ---

14 * Jeremy D. Lea.
15 * 11 May 2002
16 *
17 * This is the version module. Based on pkg_version.pl by Bruce A. Mah.
18 *
19 */
20
21#include <sys/cdefs.h>
22__FBSDID("$FreeBSD: head/usr.sbin/pkg_install/version/perform.c 131280 2004-06-29 18:59:19Z eik $");
22__FBSDID("$FreeBSD: head/usr.sbin/pkg_install/version/perform.c 131285 2004-06-29 19:06:42Z eik $");
23
24#include "lib.h"
25#include "version.h"
26#include <err.h>
27#include <fetch.h>
28#include <signal.h>
29
30FILE *IndexFile;

--- 16 unchanged lines hidden (view full) ---

47 char tmp[PATH_MAX], **pkgs, *pat[2], **patterns;
48 struct index_entry *ie;
49 int i, err_cnt = 0;
50 int MatchType;
51
52 /*
53 * Try to find and open the INDEX. We only check IndexFile != NULL
54 * later, if we actually need the INDEX.
23
24#include "lib.h"
25#include "version.h"
26#include <err.h>
27#include <fetch.h>
28#include <signal.h>
29
30FILE *IndexFile;

--- 16 unchanged lines hidden (view full) ---

47 char tmp[PATH_MAX], **pkgs, *pat[2], **patterns;
48 struct index_entry *ie;
49 int i, err_cnt = 0;
50 int MatchType;
51
52 /*
53 * Try to find and open the INDEX. We only check IndexFile != NULL
54 * later, if we actually need the INDEX.
55 * XXX This should not be hard-coded to INDEX-5.
56 */
57 if (*indexarg == NULL)
55 */
56 if (*indexarg == NULL)
58 snprintf(tmp, PATH_MAX, "%s/INDEX-5", PORTS_DIR);
57 snprintf(tmp, PATH_MAX, "%s/%s", PORTS_DIR, INDEX_FNAME);
59 else
60 strlcpy(tmp, *indexarg, PATH_MAX);
61 if (isURL(tmp))
62 IndexFile = fetchGetURL(tmp, "");
63 else
64 IndexFile = fopen(tmp, "r");
65
66 /* Get either a list of matching or all packages */

--- 79 unchanged lines hidden (view full) ---

146 * First we check if the installed package has an origin, and try
147 * looking for it's Makefile. If we find the Makefile we get the
148 * latest version from there. If we fail, we start looking in the
149 * INDEX, first matching the origin and then the package name.
150 */
151 if (plist.origin != NULL) {
152 snprintf(tmp, PATH_MAX, "%s/%s", PORTS_DIR, plist.origin);
153 if (isdir(tmp) && chdir(tmp) != FAIL && isfile("Makefile")) {
58 else
59 strlcpy(tmp, *indexarg, PATH_MAX);
60 if (isURL(tmp))
61 IndexFile = fetchGetURL(tmp, "");
62 else
63 IndexFile = fopen(tmp, "r");
64
65 /* Get either a list of matching or all packages */

--- 79 unchanged lines hidden (view full) ---

145 * First we check if the installed package has an origin, and try
146 * looking for it's Makefile. If we find the Makefile we get the
147 * latest version from there. If we fail, we start looking in the
148 * INDEX, first matching the origin and then the package name.
149 */
150 if (plist.origin != NULL) {
151 snprintf(tmp, PATH_MAX, "%s/%s", PORTS_DIR, plist.origin);
152 if (isdir(tmp) && chdir(tmp) != FAIL && isfile("Makefile")) {
154 if ((latest = vpipe("make -V PKGNAME", tmp)) == NULL)
153 if ((latest = vpipe("/usr/bin/make -V PKGNAME", tmp)) == NULL)
155 warnx("Failed to get PKGNAME from %s/Makefile!", tmp);
156 else
157 show_version(plist.name, latest, "port");
158 }
159 }
160 if (latest == NULL) {
161 /* We only pull in the INDEX once, if needed. */
162 if (SLIST_EMPTY(&Index)) {

--- 229 unchanged lines hidden ---
154 warnx("Failed to get PKGNAME from %s/Makefile!", tmp);
155 else
156 show_version(plist.name, latest, "port");
157 }
158 }
159 if (latest == NULL) {
160 /* We only pull in the INDEX once, if needed. */
161 if (SLIST_EMPTY(&Index)) {

--- 229 unchanged lines hidden ---