Re: pkgng suggestion: renaming /usr/sbin/pkg to

看板FB_current作者時間13年前 (2012/08/27 09:32), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串46/74 (看更多)
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); _______________________________________________ freebsd-current@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"
文章代碼(AID): #1GEiuIF6 (FB_current)
討論串 (同標題文章)
文章代碼(AID): #1GEiuIF6 (FB_current)