Date: Mon, 22 Oct 2012 09:18:13 +0200 From: Baptiste Daroussin <bapt@FreeBSD.org> To: Eitan Adler <eadler@FreeBSD.org> Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r241830 - in head/usr.sbin/pkg_install: add create delete info lib updating version Message-ID: <20121022071813.GA38813@ithaqua.etoilebsd.net> In-Reply-To: <201210220212.q9M2CKKP008069@svn.freebsd.org> References: <201210220212.q9M2CKKP008069@svn.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--3V7upXqbjpZ4EhLz Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable hi, pkg_install are under portmgr maintainership, and we never received this pa= tch to review and validate. The patch looks ok but should have been validated by portmgr and is missing= the needed bump of the version number. Last I totally disagree on a 3 days MFC time, but would rather go for at le= ast one month or even more, so that we can really get feedback from people actu= ally using this before MFCing regards, Bapt On Mon, Oct 22, 2012 at 02:12:20AM +0000, Eitan Adler wrote: > Author: eadler > Date: Mon Oct 22 02:12:20 2012 > New Revision: 241830 > URL: http://svn.freebsd.org/changeset/base/241830 >=20 > Log: > Warn users when using pkg tools if it looks like they > be be pkgng users. > =20 > Reviewed by: bapt (earlier version) > Reviewed by: kwm > Approved by: cperciva > MFC after: 3 days >=20 > Added: > head/usr.sbin/pkg_install/lib/pkgng.c (contents, props changed) > Modified: > head/usr.sbin/pkg_install/add/main.c > head/usr.sbin/pkg_install/create/main.c > head/usr.sbin/pkg_install/delete/main.c > head/usr.sbin/pkg_install/info/main.c > head/usr.sbin/pkg_install/lib/Makefile > head/usr.sbin/pkg_install/lib/lib.h > head/usr.sbin/pkg_install/updating/main.c > head/usr.sbin/pkg_install/version/main.c >=20 > Modified: head/usr.sbin/pkg_install/add/main.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/usr.sbin/pkg_install/add/main.c Mon Oct 22 02:12:15 2012 (r24182= 9) > +++ head/usr.sbin/pkg_install/add/main.c Mon Oct 22 02:12:20 2012 (r24183= 0) > @@ -135,6 +135,7 @@ main(int argc, char **argv) > static char temppackageroot[MAXPATHLEN]; > static char pkgaddpath[MAXPATHLEN]; > =20 > + warnpkgng(); > if (*argv[0] !=3D '/' && strchr(argv[0], '/') !=3D NULL) > PkgAddCmd =3D realpath(argv[0], pkgaddpath); > else >=20 > Modified: head/usr.sbin/pkg_install/create/main.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/usr.sbin/pkg_install/create/main.c Mon Oct 22 02:12:15 2012 (r24= 1829) > +++ head/usr.sbin/pkg_install/create/main.c Mon Oct 22 02:12:20 2012 (r24= 1830) > @@ -72,6 +72,7 @@ main(int argc, char **argv) > int ch; > char **pkgs, **start, *tmp; > =20 > + warnpkgng(); > pkgs =3D start =3D argv; > while ((ch =3D getopt_long(argc, argv, opts, longopts, NULL)) !=3D -= 1) > switch(ch) { >=20 > Modified: head/usr.sbin/pkg_install/delete/main.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/usr.sbin/pkg_install/delete/main.c Mon Oct 22 02:12:15 2012 (r24= 1829) > +++ head/usr.sbin/pkg_install/delete/main.c Mon Oct 22 02:12:20 2012 (r24= 1830) > @@ -67,6 +67,7 @@ main(int argc, char **argv) > const char *tmp; > struct stat stat_s; > =20 > + warnpkgng(); > pkgs =3D start =3D argv; > while ((ch =3D getopt_long(argc, argv, opts, longopts, NULL)) !=3D -= 1) > switch(ch) { >=20 > Modified: head/usr.sbin/pkg_install/info/main.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/usr.sbin/pkg_install/info/main.c Mon Oct 22 02:12:15 2012 (r2418= 29) > +++ head/usr.sbin/pkg_install/info/main.c Mon Oct 22 02:12:20 2012 (r2418= 30) > @@ -68,6 +68,7 @@ main(int argc, char **argv) > char **pkgs, **start; > char *pkgs_split; > =20 > + warnpkgng(); > whead =3D malloc(sizeof(struct which_head)); > if (whead =3D=3D NULL) > err(2, NULL); >=20 > Modified: head/usr.sbin/pkg_install/lib/Makefile > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/usr.sbin/pkg_install/lib/Makefile Mon Oct 22 02:12:15 2012 (r241= 829) > +++ head/usr.sbin/pkg_install/lib/Makefile Mon Oct 22 02:12:20 2012 (r241= 830) > @@ -3,7 +3,7 @@ > LIB=3D install > INTERNALLIB=3D > SRCS=3D file.c msg.c plist.c str.c exec.c global.c pen.c match.c \ > - deps.c version.c pkgwrap.c url.c > + deps.c version.c pkgwrap.c url.c pkgng.c > =20 > WARNS?=3D 3 > WFORMAT?=3D 1 >=20 > Modified: head/usr.sbin/pkg_install/lib/lib.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/usr.sbin/pkg_install/lib/lib.h Mon Oct 22 02:12:15 2012 (r241829) > +++ head/usr.sbin/pkg_install/lib/lib.h Mon Oct 22 02:12:20 2012 (r241830) > @@ -157,6 +157,7 @@ const char *make_playpen(char *, off_t); > char *where_playpen(void); > int leave_playpen(void); > off_t min_free(const char *); > +void warnpkgng(void); > =20 > /* String */ > char *get_dash_string(char **); >=20 > Added: head/usr.sbin/pkg_install/lib/pkgng.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/usr.sbin/pkg_install/lib/pkgng.c Mon Oct 22 02:12:20 2012 (r2418= 30) > @@ -0,0 +1,38 @@ > +/* > + * FreeBSD install - a package for the installation and maintenance > + * of non-core utilities. > + * > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions > + * are met: > + * 1. Redistributions of source code must retain the above copyright > + * notice, this list of conditions and the following disclaimer. > + * 2. Redistributions in binary form must reproduce the above copyright > + * notice, this list of conditions and the following disclaimer in the > + * documentation and/or other materials provided with the distributio= n. > + * > + * Eitan Adler > + * > + * detect pkgng's existence and warn > + * > + */ > + > +#include <sys/cdefs.h> > +__FBSDID("$FreeBSD$"); > + > +#include "lib.h" > +#include <err.h> > + > +void warnpkgng(void) { > + char pkgngpath[MAXPATHLEN]; > + char *pkgngdir; > + > + pkgngdir =3D getenv("PKG_DBDIR"); > + if (pkgngdir =3D=3D NULL) > + pkgngdir =3D "/var/db/pkg"; > + strcpy(pkgngpath, pkgngdir); > + strcat(pkgngpath, "/local.sqlite"); > + > + if (access(pkgngpath, F_OK) =3D=3D 0) > + warnx("Don't use the pkg_ tools if you are using pkgng"); > +} >=20 > Modified: head/usr.sbin/pkg_install/updating/main.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/usr.sbin/pkg_install/updating/main.c Mon Oct 22 02:12:15 2012 (r= 241829) > +++ head/usr.sbin/pkg_install/updating/main.c Mon Oct 22 02:12:20 2012 (r= 241830) > @@ -87,6 +87,7 @@ main(int argc, char *argv[]) > DIR *dir; > FILE *fd; > =20 > + warnpkgng(); > while ((ch =3D getopt_long(argc, argv, opts, longopts, NULL)) !=3D -1) { > switch (ch) { > case 'd': >=20 > Modified: head/usr.sbin/pkg_install/version/main.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/usr.sbin/pkg_install/version/main.c Mon Oct 22 02:12:15 2012 (r2= 41829) > +++ head/usr.sbin/pkg_install/version/main.c Mon Oct 22 02:12:20 2012 (r2= 41830) > @@ -58,6 +58,7 @@ main(int argc, char **argv) > { > int ch, cmp =3D 0; > =20 > + warnpkgng(); > if (argc =3D=3D 4 && !strcmp(argv[1], "-t")) { > cmp =3D version_cmp(argv[2], argv[3]); > printf(cmp > 0 ? ">\n" : (cmp < 0 ? "<\n" : "=3D\n")); > _______________________________________________ > svn-src-all@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" --3V7upXqbjpZ4EhLz Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlCE8zUACgkQ8kTtMUmk6EypsQCgqNcC+pnjSc63ZaTZfVIavmfE BNsAnjMrimhz4pJ/IKg9xjoImp1qIFo8 =ArH2 -----END PGP SIGNATURE----- --3V7upXqbjpZ4EhLz--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20121022071813.GA38813>