You are not logged in.
A quick `pacman -Si ghc` yields the following in its `Provides` field.
Provides : haskell-array=0.4.0.0 haskell-base=4.5.0.0
haskell-binary=0.5.1.0 haskell-bin-package-db=0.0.0.0
haskell-bytestring=0.9.2.1 haskell-containers=0.4.2.1
haskell-deepseq=1.3.0.0 haskell-directory=1.1.0.2
haskell-extensible-exceptions=0.1.1.4
haskell-filepath=1.3.0.0 haskell-ghc-prim=0.2.0.0
haskell-haskell2010=1.1.0.1 haskell-haskell98=2.0.0.1
haskell-hoopl=3.8.7.3 haskell-hpc=0.5.1.1
haskell-integer-gmp=0.4.0.0 haskell-old-locale=1.0.0.4
haskell-old-time=1.1.0.0 haskell-pretty=1.1.1.0
haskell-process=1.1.0.1 haskell-template-haskell=2.7.0.0
haskell-time=1.4 haskell-unix=2.5.1.0 haskell-cabal=1.14.0
Now, all those have version numbers but _are not_ packages in themselves. Typing something like `pacman -Si haskell-array` gives nothing. Yet, running makepkg on a PKGBUILD that has (make)depends which include entries like those above _will be version checked_... even though they are not packages. My question is, how does makepkg do this? As far as I have checked, there are no pacman options that tell you whether or not something you input is `provided` by a true package.
I would really like such an option, as that functionality is necessary (or would just be extremely useful) for a program that I'm writing. I just hope that the answer isn't buried somewhere in libalpm, as my program is not written in C.
Thanks for any answers you can give.
Author of Aura
Offline
pacman -T pkg1 pkg2 ...
Anything that is printed out is not installed or provided by a package that is installed.
Offline
Pacman -Ss haskell-array tells you that haskell-array is provided by ghc.
Pacman -Si haskell-array tells you that haskell-array is not it's own package.
Or more generally: pacman -Ss X gives Y. If X==Y, the input is a 'true' package. If X!=Y & Y!=NULL, the X is not a "true" package, but is provided by Y. If Y==NULL, X is not available in the official repos.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
It's esoteric AUR package PKGBUILD makedepends, etc, that I'm worried about. As an example, let's say that a PKGBUILD demands a certain version (or range of versions) of `haskell-array` for building. I want to be able to take that dependency and compare it with what's installed. Makepkg already does this, but it does it in a way that doesn't just tell you what dependencies need to upgraded. It just goes ahead and does all the downloading and upgrading for you. I'd like to be able to stop before the downloading stage and just get the data.
edit: @Trilby: Alright, I think I could hack something out of that. If I determined that it is provided by another package, I could call another -Si on that package, do some regexing and figure out the version number if provides.
Last edited by fosskers (2012-05-30 13:30:46)
Author of Aura
Offline
I suspect you're making an aur helper?
Either way, some AUR helpers do just what you want - if I'm understanding correctly. You could take a look at their code and see how they accomplish it. Then take what works best, and improve on what works worst.
Yaourt, for example, has this behavior.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
My post did point out exactly how makepkg gets the info...
Offline