Re: svn commit: r244269 - head/tools/tools/sysbuild

看板FB_svn作者時間12年前 (2013/04/27 13:33), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串4/4 (看更多)
On Dec 15, 2012, at 10:24 AM, Poul-Henning Kamp wrote: > -------- > In message <7855873A-AC30-4511-AA9B-F9B0E380FF92@gmail.com>, Garrett Cooper wri > tes: > >> If you have a ports tree, setting the appropriate variables and >> then running make check-already-installed is both forwards and backwards >> compatible. > > Uhm, I'm not sure I understand how this would apply to sysbuild, which > constructs an disk-image from scratch... You're checking whether or not the package has been installed on the running system via `pkg info`. I discovered (after poking around bsd.port.mk a bit for other things) that `make check-already-installed` in the ports directory is an equivalent backwards compatible way of doing this (again, setting PORTSDIR, PKGDBDIR, etc to the right values). Example: # for i in shells/bash shells/zsh; do (cd /usr/ports/$i; make check-already-installed; echo ec = $?); done ===> Checking if shells/bash already installed ===> bash-4.2.37 is already installed You may wish to ``make deinstall'' and install this port again by ``make reinstall'' to upgrade it properly. If you really wish to overwrite the old port of shells/bash without deleting it first, set the variable "FORCE_PKG_REGISTER" in your environment or the "make install" command line. *** Error code 1 Stop. make: stopped in /usr/ports/shells/bash ec = 1 ===> Checking if shells/zsh already installed ec = 0 All you have to do is test for the exit code being non-zero (already installed) or zero (not installed). It's unfortunate that things are flip-flopped, but I understand the reason for it being that way in the make rules. Also, your last commit snuck in a == instead of a = -- this breaks on older copies of /bin/sh . HTH, -Garrett PS Just trying to help make sure things are backwards compatible because there are random people who have reported breakage issues in the past with various tools like nanobsd, picobsd, etc that aren't tied to a particular release. _______________________________________________ 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"
文章代碼(AID): #1HUsCYG7 (FB_svn)
文章代碼(AID): #1HUsCYG7 (FB_svn)