PERFORCE change 175885 for review

Garrett Cooper gcooper at FreeBSD.org
Sun Mar 21 01:37:34 UTC 2010


http://p4web.freebsd.org/chv.cgi?CH=175885

Change 175885 by gcooper at gcooper-bayonetta on 2010/03/21 01:36:55

	Remove partially downloaded file on fetch failure. See bin/144919 for more details.

Affected files ...

.. //depot/projects/soc2007/gcooper-pkg_install-enhancements-simplified/usr.sbin/pkg_install/lib/url.c#2 edit

Differences ...

==== //depot/projects/soc2007/gcooper-pkg_install-enhancements-simplified/usr.sbin/pkg_install/lib/url.c#2 (text+ko) ====

@@ -108,6 +108,10 @@
     if ((ftp = fetchGetURL(fname, Verbose ? "v" : NULL)) == NULL) {
 	printf("Error: Unable to get %s: %s\n",
 	       fname, fetchLastErrString);
+	/* If the fetch fails, yank the package. */
+	if (keep_package && unlink(pkg) < 0 && Verbose) {
+	    warnx("failed to remove partially fetched package: %s", pkg);
+	}
 	return NULL;
     }
 


More information about the p4-projects mailing list