You are not logged in.

#1 2014-06-30 16:48:10

bitsdd
Member
Registered: 2014-06-26
Posts: 34

Is there a programatical way of getting package dependencies...

actually i'm building something for which i need the list of package dependencies for particular package to be installed, but unfortunately i'm not able to find anything as i tried:

sqlite3 core.db

but eventually get:

Error: file is encrypted or is not a database

and at this moment i don't what to do, if anyone can suggest??


Is there any cookies because i'm all about arch arch arch....

Offline

#2 2014-06-30 17:02:51

clfarron4
Member
From: London, UK
Registered: 2013-06-28
Posts: 2,164
Website

Re: Is there a programatical way of getting package dependencies...

Have you tried:

pacman -Si package

For example, I don't have gnome-shell installed and I can find out the listed dependencies with:

claire ~ % pacman -Si gnome-shell
Repository     : extra
Name           : gnome-shell
Version        : 3.12.2-1
Description    : The next generation GNOME Shell
Architecture   : x86_64
URL            : http://live.gnome.org/GnomeShell
Licences       : GPL2
Groups         : gnome
Provides       : None
Depends On     : accountsservice  caribou  gcr  gjs  gnome-bluetooth
                 gnome-menus  upower  gnome-session  gnome-settings-daemon
                 gnome-themes-standard  gsettings-desktop-schemas
                 libcanberra-pulse  libcroco  libgdm  libsecret  mutter
                 mutter-wayland  network-manager-applet  telepathy-logger
                 telepathy-mission-control  unzip  gstreamer
Optional Deps  : gnome-control-center: System settings
                 evolution-data-server: Evolution calendar integration
Conflicts With : None
Replaces       : None
Download Size  : 1137.62 KiB
Installed Size : 10810.00 KiB
Packager       : Jan de Groot <jgc@archlinux.org>
Build Date     : Thu 15 May 2014 21:28:18 BST
Validated By   : MD5 Sum  SHA256 Sum  Signature

EDIT: sudo command removed, as suggested by @jjacky below.

Last edited by clfarron4 (2014-06-30 17:50:08)


Claire is fine.
Problems? I have dysgraphia, so clear and concise please.
My public GPG key for package signing
My x86_64 package repository

Offline

#3 2014-06-30 17:10:41

bitsdd
Member
Registered: 2014-06-26
Posts: 34

Re: Is there a programatical way of getting package dependencies...

I know, but i don't wanna do it through pacman(may be that's absurd)...
can't i use like core.db to extract such (package info) directly without the need of pacman.


Is there any cookies because i'm all about arch arch arch....

Offline

#4 2014-06-30 17:11:46

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

Re: Is there a programatical way of getting package dependencies...

Try expac.

Offline

#5 2014-06-30 17:12:45

Cloudef
Member
Registered: 2010-10-12
Posts: 636

Re: Is there a programatical way of getting package dependencies...

Use libalpm (public header)

Last edited by Cloudef (2014-06-30 17:15:21)

Offline

#6 2014-06-30 17:26:24

jjacky
Member
Registered: 2011-11-09
Posts: 347
Website

Re: Is there a programatical way of getting package dependencies...

clfarron4: why the use of sudo in your example?

you could use pacman, e.g.

pacman -Sp --print-format '%n %v' foobar

or, as Cloudef said, use libalpm if you don't wanna parse pacman's output.

Also database files aren't sqlite db, but tar.gz files:

tar tf core.db

Offline

#7 2014-06-30 17:46:45

clfarron4
Member
From: London, UK
Registered: 2013-06-28
Posts: 2,164
Website

Re: Is there a programatical way of getting package dependencies...

jjacky wrote:

clfarron4: why the use of sudo in your example?

I automatically type sudo before pacman (habit).

I see your suggestion only lists dependencies left to install, rather than all dependencies.

Last edited by clfarron4 (2014-06-30 17:49:10)


Claire is fine.
Problems? I have dysgraphia, so clear and concise please.
My public GPG key for package signing
My x86_64 package repository

Offline

#8 2014-06-30 17:55:49

bitsdd
Member
Registered: 2014-06-26
Posts: 34

Re: Is there a programatical way of getting package dependencies...

jjacky wrote:

Also database files aren't sqlite db, but tar.gz files:

tar tf core.db

Thanks, actually that's close to what i want smile

thanks to all for there suggestions smile


Is there any cookies because i'm all about arch arch arch....

Offline

#9 2014-06-30 18:10:55

jjacky
Member
Registered: 2011-11-09
Posts: 347
Website

Re: Is there a programatical way of getting package dependencies...

clfarron4 wrote:

I see your suggestion only lists dependencies left to install, rather than all dependencies.

oh right, it simply prints what would otherwise be installed, so any dependency already met won't be listed, indeed. (On the other hand, it is recursive, unlike the listing in -Si)

Offline

Board footer

Powered by FluxBB