Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 15 Dec 2012 10:45:44 -0800
From:      Garrett Cooper <yanegomi@gmail.com>
To:        "Poul-Henning Kamp" <phk@phk.freebsd.dk>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r244269 - head/tools/tools/sysbuild
Message-ID:  <72791331-4C62-4ACD-ADB1-94A109647032@gmail.com>
In-Reply-To: <39007.1355595870@critter.freebsd.dk>
References:  <201212151754.qBFHsT5D008579@svn.freebsd.org> <7855873A-AC30-4511-AA9B-F9B0E380FF92@gmail.com> <39007.1355595870@critter.freebsd.dk>

next in thread | previous in thread | raw e-mail | index | archive | help
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:
>=20
>> 	If you have a ports tree, setting the appropriate variables and=20=

>> then running make check-already-installed is both forwards and =
backwards=20
>> compatible.
>=20
> 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 =3D $?); done
=3D=3D=3D>  Checking if shells/bash already installed
=3D=3D=3D>   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 =3D 1
=3D=3D=3D>  Checking if shells/zsh already installed
ec =3D 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 =3D=3D instead of a =3D -- 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.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?72791331-4C62-4ACD-ADB1-94A109647032>