Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 19 Jun 2004 08:58:39 +0200
From:      Oliver Eikemeier <eikemeier@fillmore-labs.com>
To:        Thomas-Martin Seck <tmseck-lists@netcologne.de>
Cc:        freebsd-ports@freebsd.org
Subject:   Re: CONFLICTS usage question
Message-ID:  <40D3E41F.3020702@fillmore-labs.com>

next in thread | raw e-mail | index | archive | help
Thomas-Martin Seck wrote:

> * Oliver Eikemeier (eikemeier@fillmore-labs.com):
>
>> Thomas-Martin Seck wrote:
>>
>>> * Oliver Eikemeier (eikemeier@fillmore-labs.com):
>>>
>>>> Thomas-Martin Seck wrote:
>>>
>>> [port (deliberately) CONFLICTS with itself]
>>
>> ??? Of course bugs like that won't hinder a port to install.
>
> Yes, that's what I am trying to say.

Which does not mean it's not a bug.

>>>>>> No. You will break installation with FORCE_PKG_REGISTER=yes.
>>>>>
>>>>> What about "-DFORCE_PKG_REGISTER -DDISABLE_CONFLICTS"?
>>>>
>>>> This disables the checks for already installed packages *and*
>>>> for conflicting packages, which are disjoint sets. You can
>>>> use this to repair files overwritten by a conflicting port
>>>> (of course damaging the other port in the process).
>>>
>>> Maybe, but one /can/ forcibly reinstall a self-conflicting port with
>>> FORCE_PKG_REGISTER and DISABLE_CONFLICTS if one is determined to do 
>>> so.
>>
>> Yep. You won't notice when you damage other ports, (which you will
>> when you do not use DISABLE_CONFLICTS), but you can do it that way.
>
> I do not and did not say that one should disable conflicts checking by
> default. My sole argument is that it can be used as a last resort for
> the FORCE_PKG_REGISTER case (I do not think that this is a common usage,
> most people use portupgrade to update/reinstall a port I guess).

Ok, the port has a bug that can be worked around. Most people are not
affected by the bug. So what?

>> Anyway, read bsd.port.mk if you want to see other uses of
>> FORCE_PKG_REGISTER
>> and why conflicting with itself is a relly bad idea. CONFLICTS and
>> FORCE_PKG_REGISTER deal with different topics.
>
> Please elaborate, since I still fail to see the real problems with self
> conflicting and I find the hoops one has to jump through using more or
> less awkward glob expressions to avoid it not really elegant. (And no,
> the "problem" with FORCE_PKG_REGISTER does not count for me, since it
> can be worked around, if really needed. This is a strawman, IMHO.).

Besides that your `workaround' has problems (as stated above), try the
attached ports:

  cd /usr/ports/misc/conflicttest2
do
  make clean deinstall reinstall
multiple times. Then do
  make CONFLICT_WITH_SELF=yes clean deinstall reinstall

See the difference? Other examples are possible, but this is probably
the most trivial one. Furthermore, you get a different error message,
which is confusing for the novice user.

The point I'm making here is that you are deliberately breaking some
basic mechanisms of the ports system, not caring about the consequences,
because it works for you. Have you ever tried to add new features to the
ports system, only to see that 1% of the ports are failing because they
use creative solutions or are just too lazy to adhere to the standards?

And 1 percent is usually more than I can fix by hand.

>>> As an interesting side note: it is amazing how many ports install a
>>> ${PREFIX}/etc/leapsecs.dat. Where are CONFLICTS when you need them :(
>>
>> Which ports are you referring to?
>
> devel/libtai and mail/mess822.

That should be easily fixable, please send-pr a patch.

> sysutils/clockspeed installs leapsecs.dat
> to etc/clockspeed; I do not know whether this makes sense at all (i.e.
> whether sntpclock would look there for it; I did not look at the code
> though).

Does this conflict with anything? Considering the name of the directory I
wouldn't assume this.

> For the records, the CONFLICTS approach is not too bad, and instead of
> bikeshedding over self-conflictness we resp. portmgr@ should tackle the
> more subtle conflicts, e.g. the leapsecs.dat conflict or the mbox.5
> conflict between mail/mutt and news/tin (my all time favourite). Maybe
> the ports cluster could be abused to generate a database of plist files
> which could be scanned for duplicates?

I have a portconflicts tool in my development projects (in fact I
seeded a development version for testing), but hope to replace it by
something better. If more ports would play be the rules, testing would
be simpler and development faster.

-Oliver

-- 


# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	misc/conflicttest1
#	misc/conflicttest1/Makefile
#	misc/conflicttest1/pkg-descr
#	misc/conflicttest2
#	misc/conflicttest2/Makefile
#	misc/conflicttest2/pkg-descr
#
echo c - misc/conflicttest1
mkdir -p misc/conflicttest1 > /dev/null 2>&1
echo x - misc/conflicttest1/Makefile
sed 's/^X//' >misc/conflicttest1/Makefile << 'END-of-misc/conflicttest1/Makefile'
X# New ports collection makefile for:	conflicttest
X# Date created:				19 Jun 2004
X# Whom:					Oliver Eikemeier
X#
X# $FreeBSD$
X#
X
XPORTNAME=	conflicttest
XPORTVERSION=	1.0
XCATEGORIES=	misc
XMASTER_SITES=	#
XDISTFILES=
X
XMAINTAINER=	eik@FreeBSD.org
XCOMMENT=	Sample port that should not CONFLICT with anything
X
X.if defined(CONFLICT_WITH_SELF)
XCONFLICTS=	conflicttest-1.*
X.endif
X
XLATEST_LINK=	conflicttest1
X
XNO_BUILD=	yes
X
Xdo-install:
X		@${ECHO_CMD} "===>   ${PKGNAME} sucessfully installed"
X
X.include <bsd.port.mk>
END-of-misc/conflicttest1/Makefile
echo x - misc/conflicttest1/pkg-descr
sed 's/^X//' >misc/conflicttest1/pkg-descr << 'END-of-misc/conflicttest1/pkg-descr'
X
END-of-misc/conflicttest1/pkg-descr
echo c - misc/conflicttest2
mkdir -p misc/conflicttest2 > /dev/null 2>&1
echo x - misc/conflicttest2/Makefile
sed 's/^X//' >misc/conflicttest2/Makefile << 'END-of-misc/conflicttest2/Makefile'
X# New ports collection makefile for:	conflicttest
X# Date created:				19 Jun 2004
X# Whom:					Oliver Eikemeier
X#
X# $FreeBSD$
X#
X
XPORTNAME=	conflicttest
XPORTVERSION=	2.0
XCATEGORIES=	misc
XMASTER_SITES=	#
XDISTFILES=
X
XMAINTAINER=	eik@FreeBSD.org
XCOMMENT=	Sample port to test CONFLICTS
X
XBUILD_DEPENDS=	${NONEXISTENT}:${PORTSDIR}/misc/conflicttest1
X
XLATEST_LINK=	conflicttest2
X
XNO_BUILD=	yes
X
Xdo-install:
X		@${ECHO_CMD} "===>   ${PKGNAME} sucessfully installed"
X
X.include <bsd.port.mk>
END-of-misc/conflicttest2/Makefile
echo x - misc/conflicttest2/pkg-descr
sed 's/^X//' >misc/conflicttest2/pkg-descr << 'END-of-misc/conflicttest2/pkg-descr'
X
END-of-misc/conflicttest2/pkg-descr
exit



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?40D3E41F.3020702>