Date: Sun, 26 Aug 2012 16:09:34 -0700 (PDT) From: Garrett Cooper <yanegomi@gmail.com> To: Doug Barton <dougb@freebsd.org> Cc: Warren Block <wblock@wonkity.com>, Ian Lepore <freebsd@damnhippie.dyndns.org>, Baptiste Daroussin <bapt@freebsd.org>, current@freebsd.org, Tjoelker <jilles@stack.nl>, Steve Wills <swills@freebsd.org>, CyberLeo Kitsana <cyberleo@cyberleo.net>, Jilles@freebsd.org, ports@freebsd.org Subject: Re: pkgng suggestion: renaming /usr/sbin/pkg to /usr/sbin/pkg-bootstrap Message-ID: <alpine.BSF.2.00.1208261557470.83780@toaster.local> In-Reply-To: <503A8C17.8050006@FreeBSD.org> References: <97612B57-1255-4BB3-A6D3-FC74324C6D67@FreeBSD.org> <20120824081543.GB2998@ithaqua.etoilebsd.net> <50380269.6020003@FreeBSD.org> <20120825000148.GF37867@ithaqua.etoilebsd.net> <50396113.3080607@cyberleo.net> <20120826122649.GA8995@stack.nl> <20120826125846.GD37534@ithaqua.etoilebsd.net> <503A6D4B.9070606@FreeBSD.org> <20120826185810.GB42842@ithaqua.etoilebsd.net> <1346008112.1140.76.camel@revolution.hippie.lan> <alpine.BSF.2.00.1208261429320.38978@wonkity.com> <503A8C17.8050006@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 26 Aug 2012, Doug Barton wrote: ... > There really is no need to be so clever here. The bootstrapping issue is > going to be a minor annoyance that affects a small percentage of our users. I think Doug's correct in this case about it being a "one-time problem" as installing via bsdinstall, etc should take care of this (I disagree with the "small percentage of our users" part though). There's still a chicken and egg problem with installing packaging via bsdinstall, etc though, as ports requires pkg* in order to function; I really hope that some of the naysayers have considered this "minor" issue as this would be a stop-gap to removing pkg(8) from base. Rather than providing a solution for that problem because that's a bigger architectural issue (and not my job to solve), I offer this patch I quickly hacked up instead as my 2 cents for the discussion on how to make users aware that pkg_install is dying/dead, as this is one case that needs to be better handled. Thanks, -Garrett PS It's really sad that no one really has been updating UPDATING in either ports or src, as I think this would help alleviate the need for unnecessary obfuscation. Index: UPDATING =================================================================== --- UPDATING (revision 239716) +++ UPDATING (working copy) @@ -24,6 +24,10 @@ disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +2014XXXX: + pkg_install has been replaced with pkgng; please see webpage + XXX/install port YYY for more details. + 20120727: The sparc64 ZFS loader has been changed to no longer try to auto- detect ZFS providers based on diskN aliases but now requires these Index: usr.sbin/pkg_install/version/main.c =================================================================== --- usr.sbin/pkg_install/version/main.c (revision 239290) +++ usr.sbin/pkg_install/version/main.c (working copy) @@ -123,6 +123,8 @@ argc -= optind; argv += optind; + PKG_PORTS_MSG(); + return pkg_perform(argv); } Index: usr.sbin/pkg_install/add/main.c =================================================================== --- usr.sbin/pkg_install/add/main.c (revision 239290) +++ usr.sbin/pkg_install/add/main.c (working copy) @@ -215,6 +215,8 @@ argc -= optind; argv += optind; + PKG_PORTS_MSG(); + if (AddMode != SLAVE) { pkgs = (char **)malloc((argc+1) * sizeof(char *)); for (ch = 0; ch <= argc; pkgs[ch++] = NULL) ; Index: usr.sbin/pkg_install/info/main.c =================================================================== --- usr.sbin/pkg_install/info/main.c (revision 239290) +++ usr.sbin/pkg_install/info/main.c (working copy) @@ -238,6 +238,8 @@ argc -= optind; argv += optind; + PKG_PORTS_MSG(); + if (Flags & SHOW_PTREV) { if (!Quiet) printf("Package tools revision: "); Index: usr.sbin/pkg_install/delete/main.c =================================================================== --- usr.sbin/pkg_install/delete/main.c (revision 239290) +++ usr.sbin/pkg_install/delete/main.c (working copy) @@ -128,6 +128,8 @@ argc -= optind; argv += optind; + PKG_PORTS_MSG(); + /* Get all the remaining package names, if any */ while (*argv) { /* Don't try to apply heuristics if arguments are regexs */ Index: usr.sbin/pkg_install/create/main.c =================================================================== --- usr.sbin/pkg_install/create/main.c (revision 239290) +++ usr.sbin/pkg_install/create/main.c (working copy) @@ -229,6 +229,8 @@ argc -= optind; argv += optind; + PKG_PORTS_MSG(); + /* Get all the remaining package names, if any */ while (*argv) *pkgs++ = *argv++; Index: usr.sbin/pkg_install/lib/lib.h =================================================================== --- usr.sbin/pkg_install/lib/lib.h (revision 239290) +++ usr.sbin/pkg_install/lib/lib.h (working copy) @@ -31,6 +31,7 @@ #include <sys/utsname.h> #include <ctype.h> #include <dirent.h> +#include <err.h> #include <stdarg.h> #include <stdio.h> #include <stdlib.h> @@ -239,4 +240,33 @@ extern int AutoAnswer; extern int Verbose; +#define EOL_VERSION 11000000 + +#define PKG_INSTALL_DEPRECATION_MSG \ + "pkg_install has been deprecated in favor of pkgng; please see UPDATING for more details" + +#if __FreeBSD_version > EOL_VERSION + +#define PKG_PORTS_MSG() \ +do { \ + if (Quiet) { \ + exit(1); \ + } else { \ + warnx(PKG_INSTALL_DEPECATION_MSG); \ + } \ +} while (0) + +#else + +#define PKG_PORTS_MSG() \ +do { \ + if (Quiet) { \ + exit(1); \ + } else { \ + errx(1, PKG_INSTALL_DEPRECATION_MSG); \ + } \ +} while (0) + +#endif /* __FreeBSD_version > EOL_VERSION */ + #endif /* _INST_LIB_LIB_H_ */ Index: usr.sbin/pkg_install/updating/main.c =================================================================== --- usr.sbin/pkg_install/updating/main.c (revision 239290) +++ usr.sbin/pkg_install/updating/main.c (working copy) @@ -104,6 +104,8 @@ argc -= optind; argv += optind; + PKG_PORTS_MSG(); + /* Check if passed date has a correct format. */ if (dflag == 1) { linelength = strlen(date);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?alpine.BSF.2.00.1208261557470.83780>