Date: Thu, 05 Sep 2002 12:53:17 -0700 From: Wes Peters <wes@softweyr.com> To: Maxim Sobolev <sobomax@FreeBSD.ORG> Cc: Will Andrews <will@csociety.org>, Simon 'corecode' Schubert <corecode@corecode.ath.cx>, ports@FreeBSD.ORG, arch@FreeBSD.ORG Subject: Re: package tools into ports/ (was: Re: Bzipped?) Message-ID: <3D77B62D.B8414858@softweyr.com> 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> <20020903130237.GB8010@vega.vega.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Maxim Sobolev wrote: > > 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. A very interesting approach. My thinking was simply to plop pkg_add or pkg_add on the install CD-ROM and have it install the mandatory pkg_tools package from the CD-ROM every time. The answer to the chicken and egg problem is to have a pre-existing system which can build this version of pkg_add. This would go for the 'mfs root' floppy for network installations as well. -- "Where am I, and what am I doing in this handbasket?" Wes Peters Softweyr LLC wes@softweyr.com http://softweyr.com/ 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?3D77B62D.B8414858>