You are not logged in.

#1 2013-09-17 18:46:21

Gradient
Member
Registered: 2013-05-19
Posts: 87

[Solved] PKGBUILDS's 'provides' entries duplicated in 'conflicts'

I came across a package in the AUR with the same entries in its PKGBUILDS's 'provides' and 'conflicts' array. Isn't it implicit that installing a package which provides 'foo' should uninstall any previous 'foo' package?

Last edited by Gradient (2013-09-17 20:48:20)

Offline

#2 2013-09-17 18:54:13

karol
Archivist
Registered: 2009-05-06
Posts: 25,428

Re: [Solved] PKGBUILDS's 'provides' entries duplicated in 'conflicts'

It's done with packages from the repos too, so I guess it's not implicit https://projects.archlinux.org/svntogit … s/mplayer2

Offline

#3 2013-09-17 19:04:35

Trilby
Forum Moderator
From: Massachusetts, USA
Registered: 2011-11-29
Posts: 13,843
Website

Re: [Solved] PKGBUILDS's 'provides' entries duplicated in 'conflicts'

There is no reason that conflicts and provides should imply each other.

If pkg 1 contains binaries (or libs, or whatever) A B and C, and pkg 2 contains A B  and D, then they conflict, but neither one provides the other.  If pkg 2 contained A B C and D, then they'd conflict, and 2 could provide 1 (but 1 couldn't provide 2).  Packages can also provide things that aren't even packages, like common-lisp: there is no common-lisp package in the repos, but there are a couple packages that provide common-lisp.


InterrobangSlider
• How's my coding? See this page.
• How's my moderating? Feel free to email any concerns, complaints, or objections.

Offline

#4 2013-09-17 19:19:17

Gradient
Member
Registered: 2013-05-19
Posts: 87

Re: [Solved] PKGBUILDS's 'provides' entries duplicated in 'conflicts'

Still, I don't understand. If pkg1 provides A, then necessarily it conflicts with pkg2 that also provides A? Which means that 'provides' implies 'conflicts'.

Let's take this simple PKGBUILDS as an example. Why the need for duplicates entries?

Last edited by Gradient (2013-09-17 19:29:12)

Offline

#5 2013-09-17 19:29:46

karol
Archivist
Registered: 2009-05-06
Posts: 25,428

Re: [Solved] PKGBUILDS's 'provides' entries duplicated in 'conflicts'

Both cronie and fcron provide cron and thus they conflict with each other.
https://projects.archlinux.org/svntogit … ges/cronie
https://projects.archlinux.org/svntogit … ages/fcron

$ pacman -S fcron
resolving dependencies...
looking for inter-conflicts...
:: fcron and cronie are in conflict (cron). Remove cronie? [y/N] 
$ pacman -S cronie
resolving dependencies...
looking for inter-conflicts...
:: cronie and fcron are in conflict (cron). Remove fcron? [y/N] 

Offline

#6 2013-09-17 19:39:26

Gradient
Member
Registered: 2013-05-19
Posts: 87

Re: [Solved] PKGBUILDS's 'provides' entries duplicated in 'conflicts'

You are both giving examples confirming my point, not refuting it. smile

karol wrote:

Both cronie and fcron provide cron and thus they conflict with each other.
https://projects.archlinux.org/svntogit … ges/cronie
https://projects.archlinux.org/svntogit … ages/fcron

That is a good example. Why cronie's PGKBUILDS has 'cron' in both 'provides' and 'conflicts' while fcron's PKGBUILDS only has 'cron' in 'provides'.

My point is that if you have 'foo' in 'provides', it is not necessary to have it in 'conflicts' too.

Last edited by Gradient (2013-09-17 19:43:17)

Offline

#7 2013-09-17 19:45:11

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 5,278

Re: [Solved] PKGBUILDS's 'provides' entries duplicated in 'conflicts'

Similarly, packages can conflict with each other, but don't actually provide one and other.

I can't think of any packages off the top of my head, but imagine that package A has /usr/bin/do-a-thing, and package B also has /usr/bin/do-a-thing, each package's do-a-thing does something different, so they don't provide the functionality of the other package, nevertheless, they still conflict with one another.

If the packages both conflicted with one another and also provided the same functionality, it should be sufficient to just declare a common "provides" for the two packages, it's doesn't hurt to keep track of the other package's name in the conflicts array too.


Sakura:-
Mobo: ASUS P8Z77-V PRO // Processor: Intel Core i7-3770K 3.4GHz // GFX: nVidia GeForce GTX 970 Ti // RAM: 32GB (4x 8GB) Corsair DDR3 (@ 2133MHz) // Storage: 1x 3TB Seagate SATAII 5x 1TB Samsung SATAII, 2x 120GB Corsair SSD

Offline

#8 2013-09-17 19:46:03

Trilby
Forum Moderator
From: Massachusetts, USA
Registered: 2011-11-29
Posts: 13,843
Website

Re: [Solved] PKGBUILDS's 'provides' entries duplicated in 'conflicts'

Neither one (cronie, fcron) is in the other's conflicts array, they conflict because they both have cron in the provides and conflicts array.

Conflicts should definitely not imply provides, but I suppose in most cases provides could imply conflicts - but not always.

A case where provides might not imply a conflict is with libraries or interpreters.  While it doesn't currently exist, there could - in principle - be a package-name for a general python interpreter for scripts that can run equally well on python2 or python3.  Each python2 and python3 could provide the "python-basic" package, but they need not conflict.  I don't know if such rare cases actually exist, but I think the flexible mechanism to allow for such cases is good.

Last edited by Trilby (2013-09-17 19:47:28)


InterrobangSlider
• How's my coding? See this page.
• How's my moderating? Feel free to email any concerns, complaints, or objections.

Offline

#9 2013-09-17 19:54:19

Gradient
Member
Registered: 2013-05-19
Posts: 87

Re: [Solved] PKGBUILDS's 'provides' entries duplicated in 'conflicts'

Trilby wrote:

While it doesn't currently exist, there could - in principle - be a package-name for a general python interpreter for scripts that can run equally well on python2 or python3.  Each python2 and python3 could provide the "python-basic" package, but they need not conflict.  I don't know if such rare cases actually exist, but I think the flexible mechanism to allow for such cases is good.

If 'python2' and 'python3' both have 'python-basic' in their 'provides' array, isn't pacman going to shoot an error if I try to install both?

Offline

#10 2013-09-17 19:57:53

karol
Archivist
Registered: 2009-05-06
Posts: 25,428

Re: [Solved] PKGBUILDS's 'provides' entries duplicated in 'conflicts'

Gradient wrote:

You are both giving examples confirming my point, not refuting it. smile

karol wrote:

Both cronie and fcron provide cron and thus they conflict with each other.
https://projects.archlinux.org/svntogit … ges/cronie
https://projects.archlinux.org/svntogit … ages/fcron

That is a good example. Why cronie's PGKBUILDS has 'cron' in both 'provides' and 'conflicts' while fcron's PKGBUILDS only has 'cron' in 'provides'.

I don't know the answer to your question, so I searched around and came up with some examples.
mplayer2 has 'mplayer' in both 'provides' and 'conflicts', but cronie & fcron approch it differently, indeed confirming your point :-)

Offline

#11 2013-09-17 20:11:43

Trilby
Forum Moderator
From: Massachusetts, USA
Registered: 2011-11-29
Posts: 13,843
Website

Re: [Solved] PKGBUILDS's 'provides' entries duplicated in 'conflicts'

I'm confused.  If two packages provide the same faux-package, but *don't* list it in the conflicts array, then does pacman remove the other?  I hope not.

Edit: I just tested, this works as I expected: if two packages each provide the same name "faux-package" they can both be installed.

I just made pkgbuilds for packages called "crap" and "crap2".  They both had "crap-package" in the provides array, but nothing in the conflicts array.  They each made a directory in /opt/ but not the same directory so there were no actual file conflicts.  Pacman installed both without issue.  `pacman -Qs crap-package` returns both installed packages.

Last edited by Trilby (2013-09-17 20:21:10)


InterrobangSlider
• How's my coding? See this page.
• How's my moderating? Feel free to email any concerns, complaints, or objections.

Offline

#12 2013-09-17 20:13:00

karol
Archivist
Registered: 2009-05-06
Posts: 25,428

Re: [Solved] PKGBUILDS's 'provides' entries duplicated in 'conflicts'

Trilby wrote:

I'm confused.  If two packages provide the same faux-package, but *don't* list it in the conflicts array, then does pacman remove the other?  I hope not.

See for yourself https://bbs.archlinux.org/viewtopic.php … 4#p1325794

Offline

#13 2013-09-17 20:22:19

Trilby
Forum Moderator
From: Massachusetts, USA
Registered: 2011-11-29
Posts: 13,843
Website

Re: [Solved] PKGBUILDS's 'provides' entries duplicated in 'conflicts'

That's not what I was talking about.  There they explicitly list cron in the conflicts array.  See my test for the real answer.


InterrobangSlider
• How's my coding? See this page.
• How's my moderating? Feel free to email any concerns, complaints, or objections.

Offline

#14 2013-09-17 20:23:31

karol
Archivist
Registered: 2009-05-06
Posts: 25,428

Re: [Solved] PKGBUILDS's 'provides' entries duplicated in 'conflicts'

Trilby wrote:

There they explicitly list cron in the conflicts array.

Only cronie does, fcron conflicts with dcron, not with cron.
https://projects.archlinux.org/svntogit … ages/fcron

Offline

#15 2013-09-17 20:24:49

Trilby
Forum Moderator
From: Massachusetts, USA
Registered: 2011-11-29
Posts: 13,843
Website

Re: [Solved] PKGBUILDS's 'provides' entries duplicated in 'conflicts'

Yes, but just the same, an explicit conflict is listed in one of the two packages, so they cannot be installed at the same time.  The question was if "provides" implies "conflicts" and it does not: two packages with the same "Provides" name can both be installed as long as an explicit "Conflicts" isn't specified.  The fact that one can explicitly define the two to be the same is not evidence that the latter is implied by the former.

Last edited by Trilby (2013-09-17 20:26:13)


InterrobangSlider
• How's my coding? See this page.
• How's my moderating? Feel free to email any concerns, complaints, or objections.

Offline

#16 2013-09-17 20:39:01

karol
Archivist
Registered: 2009-05-06
Posts: 25,428

Re: [Solved] PKGBUILDS's 'provides' entries duplicated in 'conflicts'

Trilby wrote:

Yes, but just the same, an explicit conflict is listed in one of the two packages, so they cannot be installed at the same time.

Hm, you're right.
I find these pseudo-reverse conflicts a bit unintuitive but I guess they're simple and get the job done.

Offline

#17 2013-09-17 20:47:45

Gradient
Member
Registered: 2013-05-19
Posts: 87

Re: [Solved] PKGBUILDS's 'provides' entries duplicated in 'conflicts'

Triby is right. I also did some tests. Marked as solved.

Offline

#18 2013-09-17 20:58:29

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 5,278

Re: [Solved] PKGBUILDS's 'provides' entries duplicated in 'conflicts'

Hm, interesting! Thanks for clearing that up, Triby.

This topic encouraged me to read the PKGBUILD man page, which provides similar information:

       conflicts (array)
           An array of packages that will conflict with this package (i.e. they cannot both be
           installed at the same time). This directive follows the same format as depends.
           Versioned conflicts are supported using the operators as described in depends.

       provides (array)
           An array of “virtual provisions” this package provides. This allows a package to
           provide dependencies other than its own package name. For example, the dcron package
           can provide cron, which allows packages to depend on cron rather than dcron OR fcron.

           Versioned provisions are also possible, in the name=version format. For example, dcron
           can provide cron=2.0 to satisfy the cron>=2.0 dependency of other packages. Provisions
           involving the > and < operators are invalid as only specific versions of a package may
           be provided.

           If the provision name appears to be a library (ends with .so), makepkg will try to
           find the library in the built package and append the correct version. Appending the
           version yourself disables auto detection.

Sakura:-
Mobo: ASUS P8Z77-V PRO // Processor: Intel Core i7-3770K 3.4GHz // GFX: nVidia GeForce GTX 970 Ti // RAM: 32GB (4x 8GB) Corsair DDR3 (@ 2133MHz) // Storage: 1x 3TB Seagate SATAII 5x 1TB Samsung SATAII, 2x 120GB Corsair SSD

Offline

#19 2013-09-17 21:28:55

Gradient
Member
Registered: 2013-05-19
Posts: 87

Re: [Solved] PKGBUILDS's 'provides' entries duplicated in 'conflicts'

When I add the 'libre' repository of Parabola GNU/Linux before all others in 'pacman.conf', pacman asks me to replace linux by linux-libre. I understand that pacman installs the first 'linux' packages it finds. Is pacman looking at the 'provides' array in this case (the two packages' names are different here)?

Offline

#20 2013-09-17 21:35:49

Trilby
Forum Moderator
From: Massachusetts, USA
Registered: 2011-11-29
Posts: 13,843
Website

Re: [Solved] PKGBUILDS's 'provides' entries duplicated in 'conflicts'

No, it's looking at the conflicts array (edit: or perhaps the "replaces")

One can have several kernels installed (I have two) just fine.  And while in my case their provides name is different, I also have the linux-ck-headers installed which "provide" linux-headers.  I just tested this too for a more realistic example than those above: I can install linux-headers just fine and then I have two packages that "provide" linux-headers, but they do not conflict:

$ pacman -Qs linux-headers
local/linux-ck-core2-headers 3.11.1-2 (ck-core2)
    Header files and scripts to build modules for linux-ck. Intel Core2/Newer
    Xeon optimized.
local/linux-headers 3.11.1-1
    Header files and scripts for building modules for Linux kernel

In the case of the libre repo, I'm assuming it lists the default kernel as a conflict.  This would be easily checked with `pacman -Qi linux-libre`.

Last edited by Trilby (2013-09-17 21:39:25)


InterrobangSlider
• How's my coding? See this page.
• How's my moderating? Feel free to email any concerns, complaints, or objections.

Offline

#21 2013-09-17 21:46:20

Gradient
Member
Registered: 2013-05-19
Posts: 87

Re: [Solved] PKGBUILDS's 'provides' entries duplicated in 'conflicts'

I don't understand what is happening when I run 'pacman -Syu'. Let's take a simpler example. When I run 'pacman -Syu', pacman asks me if I want to replace 'firefox' with 'iceweasel-libre'.

Here is what I found in the PKGBUILDS of iceweasel :

replaces = ('firefox')
conflicts = ('firefox')
provides = ('firefox')

What is pacman really doing when I run 'pacman -Syu'? Perhaps it looks in the repos for the packages which 'provides' those that I currently have installed, then because of the 'replaces' array, it asks me if I want to replace it by iceweasel-libre? But those are just speculations...

Last edited by Gradient (2013-09-17 21:50:54)

Offline

#22 2013-09-17 21:49:47

Trilby
Forum Moderator
From: Massachusetts, USA
Registered: 2011-11-29
Posts: 13,843
Website

Re: [Solved] PKGBUILDS's 'provides' entries duplicated in 'conflicts'

The conflicts and replaces bits are the ones relevant to your question as I indicated above.  Provides is not relevant for this.

As Xyne pointed out in the other thread on this same issue, if the libre repo is before core/extra/community, then pacman will prioritize the libre repo.  So it checks for updates to any currently installed package (including firefox) in listed repos starting with libre (if you put it first) and it finds a "new" package that claims to replace firefox, so pacman does as it is told.


InterrobangSlider
• How's my coding? See this page.
• How's my moderating? Feel free to email any concerns, complaints, or objections.

Offline

#23 2013-09-17 21:53:18

karol
Archivist
Registered: 2009-05-06
Posts: 25,428

Re: [Solved] PKGBUILDS's 'provides' entries duplicated in 'conflicts'

Gradient wrote:

What is pacman really doing when I run 'pacman -Syu'?

pacman reads what packages you have installed and checks if there are newer packages available. If so, downloads and install them along with their dependencies.
Try running

pacman -S firefox

Do you get something like

$ pacman -S cron
:: There are 2 providers available for cron:
:: Repository core
   1) cronie
:: Repository community
   2) fcron

Enter a number (default=1):

or is iceweasel-libre installed?

Offline

#24 2013-09-17 22:23:04

Gradient
Member
Registered: 2013-05-19
Posts: 87

Re: [Solved] PKGBUILDS's 'provides' entries duplicated in 'conflicts'

All 4 packages (iceweasel-libre, firefox, cronie, dcron) are not installed and I ran 'pacman -Syy'.

I get this :

$ sudo pacman -S cron   
:: There are 2 providers available for cron:
:: Repository core
   1) cronie
:: Repository community
   2) fcron

Enter a number (default=1):

and

$ sudo pacman -S firefox
resolving dependencies...
looking for inter-conflicts...

Packages (2): mozilla-searchplugins-1.4-2  iceweasel-libre-1:23.0.1.deb1-2

Total Download Size:    21.84 MiB
Total Installed Size:   55.73 MiB

:: Proceed with installation? [Y/n]

Pacman is suggesting 'cronie' and 'fcron' when trying to install 'cron'. I understand this. But now, if I try to install 'firefox', it tries to install 'iceweasel-libre' without mentioning firefox. What is happening?

EDIT : My mistake... I installed pacman-mirrorlist-libre and arch servers are not listed

Last edited by Gradient (2013-09-17 22:29:32)

Offline

#25 2013-09-17 22:29:51

Trilby
Forum Moderator
From: Massachusetts, USA
Registered: 2011-11-29
Posts: 13,843
Website

Re: [Solved] PKGBUILDS's 'provides' entries duplicated in 'conflicts'

Neither cronie nor fcron replaces the other one.  If cronie had fcron under "replaces" you'd get similar results as you do with firefox.

It's still the same: pacman is doing what it is told.  The package information for iceweasel-libre explicitly says that it replaces firefox.  Pacman is *told* to replace firefox.  You could request that parabola change how they set these parameters, but as that repo is made to be aggressively Libre-only, then there is no suprise that it is configured to aggresively replace any non-libre software.


InterrobangSlider
• How's my coding? See this page.
• How's my moderating? Feel free to email any concerns, complaints, or objections.

Offline

Board footer

Powered by FluxBB