Date: Tue, 3 Sep 2002 16:02:37 +0300 From: Maxim Sobolev <sobomax@FreeBSD.ORG> To: Will Andrews <will@csociety.org> Cc: "Simon 'corecode' Schubert" <corecode@corecode.ath.cx>, Wes Peters <wes@softweyr.com>, ports@FreeBSD.ORG, arch@FreeBSD.ORG Subject: Re: package tools into ports/ (was: Re: Bzipped?) Message-ID: <20020903130237.GB8010@vega.vega.com> In-Reply-To: <20020903121413.GN2072@procyon.firepipe.net> References: <20020901142653.A32415@capable.rogards.com> <20020901191937.GI87971@leviathan.inethouston.net> <20020902103215.36ae8e3b.corecode@corecode.ath.cx> <20020902085654.GH2072@procyon.firepipe.net> <3D7445D3.DAA2C9B9@softweyr.com> <20020903100258.068fb3ab.corecode@corecode.ath.cx> <20020903121413.GN2072@procyon.firepipe.net>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Sep 03, 2002 at 05:14:13AM -0700, Will Andrews wrote: > On Tue, Sep 03, 2002 at 10:02:58AM +0200, Simon 'corecode' Schubert wrote: > > Hitting two birds with one stone, so to speak. > > > > OK, how do you install the package tools package onto the system if it > > > doesn't come with package tools? > > > > > > Please note that I'm all for having the package tools in ports, because it > > > will make the one last feature I want to add to them ever so much easier > > > to build, but we do have to fix this chicken vs. egg probem first. > > Simple. We keep the pkg_install stuff in the src tree. That > way, everyone will always have a minimal version installed with > the system. If needed, they can then install a newer version via > the ports tree. If that newer version is installed, bsd.port.mk > will use it instead. > > Please see NetBSD for an example that they have done for 4 years. > It's such a great idea I'm not sure why nobody in FreeBSD did it. I am also thinking about something like that for a quite some time, but it is not quite straightforward to implement correctly. Yes, you can add version reporting into pkg_info and make bsd.port.mk detecting it and installing a new version from ports if it is too outdated. The problem with such approach is that if you will overwrite older versions in /usr/sbin with newer ones, it will work, but only until the next build/installworld (for example if user runs security branch and new patchlevel is available requiring full world rebuild), when the newer ones will be replaced by old ones again. Sure, executing `make something' in ports tree will put things in order again, but what if before that the user will try to delete some package or add a new one using pkg_delete/pkg_add directly? Another approach is to install pkg_tools package into /usr/local, but extend tools in the base system to check version of their counterparts in /usr/local (if installed) and turn themselves into a wrappers if ones in /usr/local are newer than ones in the /usr. This approach is better in the long run, since it allows to not worry about system upgrades, but creates 'chiken and egg' problem, since adding checking/wrapping functionality would require to change pkg_install tools. Therefore, IMO some combined approach is necessary. I have the following (very preliminary) vision of what needs to be done to solve the problem: 1. Assign some form of version number to pkg_install tools. This number should be monotonically increased each time when new functionality is added or older functionality used in bsd.port.mk is changed. Add appropriate reporting routine. 2. Add wrapping functionality into pkg_install tools: on startup of any tool check that a configuration file in some pre-defined location exsists, read it, compare versions here and there and execve() specified file if it is newer, otherwise continue running. Format of file could be very simple, say one line with two words: the first is version number and the second is installation base, i.e. /var/db/pkg_install.wrap: 123455 /usr/local/sbin 3. Create an appropriate pkg_tools port, which will install latest version of the tools and generate configuration file described above when installed FreeBSD version supports finctionality described in (1). If it doesn't, then the port whould just overwrite versions of pkg tools in /usr/sbin with newer versions and warn user about the need to reinstall the port after buildworld/installworld. 4. Add bsd.port.mk bits and pieces for installing that pkg_tools port if system version is too old. I hope that this would be useful for you. Any comments or questions are appreciated. -Maxim > > > i don't see a problem here. bsd.port.mk is always available, so we > > should be able to check for the right pkgtools version. if we need a > > newer one, just install the port. compilation works without pkgtools and > > the only one used in post-installation is pkg_create, which in turn > > should then already be installed on the system... > > Right, what I said above is a little clearer IMHO. > > regards, > -- > wca > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-ports" in the body of the message > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020903130237.GB8010>