Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 15 Oct 2002 03:33:13 +0000
From:      "Clark C. Evans" <cce@clarkevans.com>
To:        ports@freebsd.org
Subject:   why is .install_done needed?  It seems redundant.
Message-ID:  <20021015033313.GA37677@doublegemini.com>
In-Reply-To: <200210142352.g9ENqI3a044262@aaz.links.ru>
References:  <20021014211418.GC36236@doublegemini.com> <200210142352.g9ENqI3a044262@aaz.links.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Oct 15, 2002 at 03:52:18AM +0400, "."@babolo.ru wrote:
| >   2) Where are these ports storing the flag that says
| >      they are already installed?  Any good way to 
| >      reset this flag or have this flag be in the 
| >      /var partition (which is different for each install?)
|
| ${WRKDIR}/.STAGE_done.NAME-VERSION
| usually ${WRKDIR} is ./work

Thanks.   Is there a way to tell "make install" to use
pkg_info to deterimine if a port is installed rather 
than keying from the .install_done.NAME-VERSION file?

Logic I'd like to see for "make install" ---

  grab the port name
  check to see if it appears in pkg_info list
  if so, check the version
     if the versions match, do nothing
     if the versions mis-match, complain loudly
     check-dependencies using the same method
  if not,
     then install

I don't see why "make install" should be using
.install_done at all, as installation is a
property of the system installed upon (/var)
and not a property of the package or its
current state of preparation.

In short, I think the .install_done.NAME-VERSION is
not only useless, but perhaps even harmful?  As a work-around
for this behavior, I've created to fill in the required
.install_done files from pkg_info...

import os
def syncports(root='',prn=0):
    pkg = {}
    if root: lst = os.popen("chroot %s pkg_info" % root, "r")
    else:    lst = os.popen("pkg_info","r")
    while lst:
        ln = lst.readline()
        if not ln: break
        ln = ln.split(" ")[0]
        pkg[ln] = None
    idx = open("%s/usr/ports/INDEX" % root )
    for port in idx.readlines():
        port = port.split("|")
        name = port[0]
        path = port[1]
        file = "%s%s/work/.install_done.%s" % (root,path,name)
        try:
            if pkg.has_key(name):
                fh = open(file,"w")
                fh.write("")
                fh.close()
                if prn: print "==> ", name
            else:
                os.remove(file)
        except: pass
if '__main__' == __name__: syncports(prn=1)

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?20021015033313.GA37677>