Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 21 Mar 2010 01:37:33 GMT
From:      Garrett Cooper <gcooper@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 175885 for review
Message-ID:  <201003210137.o2L1bXk0031906@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/chv.cgi?CH=175885

Change 175885 by gcooper@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;
     }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201003210137.o2L1bXk0031906>