From owner-freebsd-ports@FreeBSD.ORG Wed Sep 3 21:32:38 2014 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mandree.no-ip.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E2554691 for ; Wed, 3 Sep 2014 21:32:37 +0000 (UTC) Received: from [IPv6:::1] (localhost6.localdomain6 [IPv6:::1]) by apollo.emma.line.org (Postfix) with ESMTP id 51C6F23CE71 for ; Wed, 3 Sep 2014 23:32:36 +0200 (CEST) Message-ID: <540788F4.30903@FreeBSD.org> Date: Wed, 03 Sep 2014 23:32:36 +0200 From: Matthias Andree User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: freebsd-ports@freebsd.org Subject: Re: [BRAINSTORMING] simplifying maintainer's life References: <20140903082538.GE63085@ivaldir.etoilebsd.net> In-Reply-To: <20140903082538.GE63085@ivaldir.etoilebsd.net> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Sep 2014 21:32:38 -0000 Am 03.09.2014 um 10:25 schrieb Baptiste Daroussin: > Hi all, > > On of the most borring thing IMHO in the plist maintainance is all the > directories. > > I have been working on some evolutions I want to share and discuss before making > them official. > > First you have to know that since pkg 1.3 @dirrm and @dirrmtry are equivalent. > > Evolutions: > 1/ stop prepending directories in plist with @dir*: let pkg discover the path > correspond to a directory and handle it as such (easy) > > 2/ make pkg automatically remove directories under PREFIX without the need of > adding them in plist, such as only empty directories and directories not under > PREFIX will have to be listed. Of course pkg will not try to remove directories > owned by another package. > > To achieve the point 2 that will mean we will stop using the mtree inside > packages and create a "hier" package that will have the default hierarchy and > every package but pkg will depend on this hier package (except if PREFIX != > LOCALBASE) > > 2 bonus of this approach: > - it will speed up pkg operation by avoiding to have to extract the mtree for > each package installation > - it will simplify a lot check-plist > > Any opinion here? Note that plist errors are rather rare compared to other error classes, so we might be optimizing prematurely here. I object to 1. I support 2 under the proviso that we tread carefully. I object to globbing in pkg-plist because that totally spoils matching actual build/stage result to expectation. We might have missing files without the builders ever noticing. * I am assuming that directories that pkg installs files into are automatically created and registered, and removed on deinstall. * do not introduce misnomers. @dirrm is not suitable to list empty directories in pkg-plist. It may technically work, but confuses the casual porter -- especially since you know that our documentation is always worse than it could be because people always prefer hacking on software to hacking away on documentation. Something like @dir or @emptydir would work. * make sure that directories remain listed with explicit markup, such as trailing slashes, leading "@dir", "@emptydir" or however. This is to ease maintenance of pkg-plist and that there is no ambiguity. Else an entry of etc/PORTNAME might be a directory, or a file - the pkg-plist should tell me that. I do not want to have to build a port to see if a line describes a directory or a file. * it was mentioned in IRC that in such cases we might need to list links specially as well, but I don't think we need to. It is important if the installed item behaves like a directory and I can tack on pathnames, or if it behaves like a file and represents its contents, or if the installed item is only a placeholder for special behaviour, like socket, named pipe, character/block special, or directory. I know some of these types would be rejected by pkg, but * if you want to auto-remove directories, you may need to implement reference counting in the pkg database so you know when a directory should be empty after deinstalls (as opposed to upgrades). Note that pkg may be unable to distinguish a deinstall from an upgrade, for instance, with portmaster. * On a related note, since it was mentioned on IRC (don't go hunting, this is my conclusion), we may want to introduce a @file escape so as to list files explicitly if their name starts the same as one of our pkg-plist macros.