PERFORCE change 181523 for review
Julien Laffaye
jlaffaye at FreeBSD.org
Wed Jul 28 17:14:07 UTC 2010
http://p4web.freebsd.org/@@181523?ac=10
Change 181523 by jlaffaye at jlaffaye-chulak on 2010/07/28 17:13:28
Fix bugs here and there.
Affected files ...
.. //depot/projects/soc2010/pkg_complete/lib/libpkg/url.c#5 edit
.. //depot/projects/soc2010/pkg_complete/usr.sbin/pkg_install/add/extract.c#9 edit
.. //depot/projects/soc2010/pkg_complete/usr.sbin/pkg_install/add/perform.c#9 edit
Differences ...
==== //depot/projects/soc2010/pkg_complete/lib/libpkg/url.c#5 (text+ko) ====
@@ -251,7 +251,6 @@
{
struct fetch_data *data = NULL;
char *tmp;
- char fname[FILENAME_MAX];
char pkg[FILENAME_MAX];
int retcode = 0;
@@ -266,7 +265,7 @@
if (keep_package) {
tmp = getenv("PKGDIR");
strlcpy(pkg, tmp ? tmp : ".", sizeof(pkg));
- tmp = basename(fname);
+ tmp = basename(url);
strlcat(pkg, "/", sizeof(pkg));
strlcat(pkg, tmp, sizeof(pkg));
@@ -280,8 +279,8 @@
data->pkgfd = 0;
fetchDebug = (Verbose > 0);
- if ((data->ftp = fetchGetURL(fname, Verbose ? "v" : NULL)) == NULL) {
- warnx("Error: Unable to get %s: %s\n", fname, fetchLastErrString);
+ if ((data->ftp = fetchGetURL(url, Verbose ? "v" : NULL)) == NULL) {
+ warnx("Error: Unable to get %s: %s\n", url, fetchLastErrString);
/* If the fetch fails, yank the package. */
if (keep_package && unlink(pkg) < 0)
warnx("failed to remove partially fetched package: %s", pkg);
@@ -290,7 +289,7 @@
}
if (isatty(0) || Verbose) {
- printf("Fetching %s...", fname);
+ printf("Fetching %s...", url);
fflush(stdout);
}
@@ -324,7 +323,7 @@
if ((r = fread(data->buf, 1, sizeof(data->buf), data->ftp)) < 1)
if (ferror(data->ftp)) {
archive_set_error(a, 0, "error while fetching : %s",
- fetchLastErrString);
+ strerror(errno));
return (-1);
}
==== //depot/projects/soc2010/pkg_complete/usr.sbin/pkg_install/add/extract.c#9 (text+ko) ====
@@ -255,7 +255,7 @@
}
else {
char dep_url[FILENAME_MAX];
- if (find_package_url(dep_url, fname, p->name) != 1)
+ if (find_package_url(dep_url, fname, p->name) != 0)
errx(1, "Can not make an URL to get %s",
p->name);
@@ -605,7 +605,7 @@
if (rename(db_dir_tmp, db_dir) == -1)
warn("Can not rename '%s' to '%s'", db_dir_tmp, db_dir);
else {
- extract_state = 2;
+ extract_state = 0;
if (Verbose)
printf("Package %s registered in %s\n", pkg->name, db_dir);
}
==== //depot/projects/soc2010/pkg_complete/usr.sbin/pkg_install/add/perform.c#9 (text+ko) ====
More information about the p4-projects
mailing list