Date: Thu, 25 Dec 2008 16:44:01 +0000 (UTC) From: Florent Thoumie <flz@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org Subject: svn commit: r186495 - in stable/6/usr.sbin/pkg_install: . create lib Message-ID: <200812251644.mBPGi1rg018276@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: flz Date: Thu Dec 25 16:44:01 2008 New Revision: 186495 URL: http://svn.freebsd.org/changeset/base/186495 Log: Synchronize pkg_install with HEAD (20080708): r180361: actually enable '-n' for pkg_create(1) r181376: use humanize_number to report pen-sizes r186494: add package directory for 7.1-RELEASE Modified: stable/6/usr.sbin/pkg_install/ (props changed) stable/6/usr.sbin/pkg_install/Makefile.inc stable/6/usr.sbin/pkg_install/create/main.c stable/6/usr.sbin/pkg_install/lib/lib.h stable/6/usr.sbin/pkg_install/lib/pen.c Modified: stable/6/usr.sbin/pkg_install/Makefile.inc ============================================================================== --- stable/6/usr.sbin/pkg_install/Makefile.inc Thu Dec 25 15:44:10 2008 (r186494) +++ stable/6/usr.sbin/pkg_install/Makefile.inc Thu Dec 25 16:44:01 2008 (r186495) @@ -2,6 +2,9 @@ LIBINSTALL= ${.OBJDIR}/../lib/libinstall.a +DPADD+= ${LIBUTIL} +LDADD+= -lutil + .if !defined(NO_CRYPT) && !defined(NO_OPENSSL) && \ defined(LDADD) && ${LDADD:M-lfetch} != "" DPADD+= ${LIBSSL} ${LIBCRYPTO} Modified: stable/6/usr.sbin/pkg_install/create/main.c ============================================================================== --- stable/6/usr.sbin/pkg_install/create/main.c Thu Dec 25 15:44:10 2008 (r186494) +++ stable/6/usr.sbin/pkg_install/create/main.c Thu Dec 25 16:44:01 2008 (r186495) @@ -208,6 +208,10 @@ main(int argc, char **argv) Recursive = TRUE; break; + case 'n': + Regenerate = FALSE; + break; + case 0: if (Help) usage(); Modified: stable/6/usr.sbin/pkg_install/lib/lib.h ============================================================================== --- stable/6/usr.sbin/pkg_install/lib/lib.h Thu Dec 25 15:44:10 2008 (r186494) +++ stable/6/usr.sbin/pkg_install/lib/lib.h Thu Dec 25 16:44:01 2008 (r186495) @@ -105,7 +105,7 @@ * Version of the package tools - increase only when some * functionality used by bsd.port.mk is changed, added or removed */ -#define PKG_INSTALL_VERSION 20080612 +#define PKG_INSTALL_VERSION 20080708 #define PKG_WRAPCONF_FNAME "/var/db/pkg_install.conf" #define main(argc, argv) real_main(argc, argv) Modified: stable/6/usr.sbin/pkg_install/lib/pen.c ============================================================================== --- stable/6/usr.sbin/pkg_install/lib/pen.c Thu Dec 25 15:44:10 2008 (r186494) +++ stable/6/usr.sbin/pkg_install/lib/pen.c Thu Dec 25 16:44:01 2008 (r186495) @@ -23,6 +23,7 @@ __FBSDID("$FreeBSD$"); #include "lib.h" #include <err.h> +#include <libutil.h> #include <libgen.h> #include <sys/signal.h> #include <sys/param.h> @@ -44,6 +45,7 @@ find_play_pen(char *pen, off_t sz) { char *cp; struct stat sb; + char humbuf[6]; if (pen[0] && isdir(dirname(pen)) == TRUE && (min_free(dirname(pen)) >= sz)) return pen; @@ -59,10 +61,12 @@ find_play_pen(char *pen, off_t sz) strcpy(pen, "/usr/tmp/instmp.XXXXXX"); else { cleanup(0); + humanize_number(humbuf, sizeof humbuf, sz, "", HN_AUTOSCALE, + HN_NOSPACE); errx(2, "%s: can't find enough temporary space to extract the files, please set your\n" -"PKG_TMPDIR environment variable to a location with at least %ld bytes\n" -"free", __func__, (long)sz); +"PKG_TMPDIR environment variable to a location with at least %s bytes\n" +"free", __func__, humbuf); return NULL; } return pen; @@ -98,6 +102,8 @@ popPen(char *pen) char * make_playpen(char *pen, off_t sz) { + char humbuf1[6], humbuf2[6]; + if (!find_play_pen(pen, sz)) return NULL; @@ -111,8 +117,13 @@ make_playpen(char *pen, off_t sz) } if (Verbose) { - if (sz) - fprintf(stderr, "Requested space: %d bytes, free space: %lld bytes in %s\n", (int)sz, (long long)min_free(pen), pen); + if (sz) { + humanize_number(humbuf1, sizeof humbuf1, sz, "", HN_AUTOSCALE, + HN_NOSPACE); + humanize_number(humbuf2, sizeof humbuf2, min_free(pen), + "", HN_AUTOSCALE, HN_NOSPACE); + fprintf(stderr, "Requested space: %s bytes, free space: %s bytes in %s\n", humbuf1, humbuf2, pen); + } } if (min_free(pen) < sz) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200812251644.mBPGi1rg018276>