You are not logged in.

#1 2021-09-26 22:01:57

starfry
Member
From: Surrey, UK
Registered: 2010-08-18
Posts: 230

Pacman args via makepkg

Is there a way to pass arguments to pacman when running makepkg?

I am aware of the $PACMAN environment variable but it only takes the executable path; you can't append arguments to it.

I was debugging something today and wanted to run "pacman --verbose --debug". The only way I could manage it was to copy the makepkg script and edit it.

I did look through it, couldn't see any parameterised way of adding to its PACMAN_OPTS array.

Just asking in case I missed something.... being able to pass arguments through to pacman is surely a useful thing?

Offline

#2 2021-09-26 22:26:17

Daerandin
Member
From: Norway
Registered: 2013-05-07
Posts: 258
Website

Re: Pacman args via makepkg

makepkg only runs pacman if you pass certain options to it, at the moment the only ones that come to mind are -i and -s and -r. You could avoid using those options for your debugging purpose since they are strictly not required in any case.

Offline

#3 2021-09-26 22:47:55

mpan
Member
Registered: 2012-08-01
Posts: 1,188
Website

Re: Pacman args via makepkg

starfry:
As Daerandin has mentioned, makepkg only uses pacman for very few, specific actions. Those are pretty straightforward and all of them are just shortcuts to what may be executed from outside of makepkg. None of them must be called while makepkg itself is running. So you may simply call pacman directly with any options you want.

What is the actual problem you are experiencing?

Last edited by mpan (2021-09-26 22:48:29)


Sometimes I seem a bit harsh — don’t get offended too easily!

Offline

#4 2021-09-27 07:53:59

starfry
Member
From: Surrey, UK
Registered: 2010-08-18
Posts: 230

Re: Pacman args via makepkg

Hi the problem I had was in a Gitlab pipeline that uses makepkg to build a load of packages, there was something not quite right in the some runners' environment that was preventing some pacakge dependencies from being installed. Sometimes. I've fixed the problem, it was network related.
I was just looking for some quick way to add debug to the pacman calls made by "makepkg -s" so I could quickly get some additional troubleshooting feedback without having to rebuild images.

So this is just a generic ask  for a way to pass parameters to pacman via makepkg (or, at a minimum, pass the verbose and/or debug switches). You can specify the path to the pacman executable via a variable but you can't add arguments to that.

Offline

#5 2021-09-27 08:16:06

Raynman
Member
Registered: 2011-10-22
Posts: 1,539

Re: Pacman args via makepkg

The pacman executable could be a simple wrapper script that adds those arguments.

Offline

#6 2021-09-27 12:00:45

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,365
Website

Re: Pacman args via makepkg

Raynman wrote:

The pacman executable could be a simple wrapper script that adds those arguments.

Not even a wrapper needed - man "makepkg" and look at "ENVIRONMENT VARIABLES".

Offline

#7 2021-09-27 12:40:38

starfry
Member
From: Surrey, UK
Registered: 2010-08-18
Posts: 230

Re: Pacman args via makepkg

Allan wrote:

man "makepkg" and look at "ENVIRONMENT VARIABLES".

I already did that. Are you referring me to the  `PACMAN` variable? That does not allow you to specify arguments.  - the first thing I tried was to set PACMAN = 'pacman --debug --verbose'.

If I'm missing something else there that's applicable then I am at a loss...

ENVIRONMENT VARIABLES
       PACMAN
           The command that will be used to check for missing dependencies and to install and remove packages. Pacman’s -Qq, -Rns, -S, -T, and -U operations must be supported by this
           command. If the variable is not set or empty, makepkg will fall back to ‘pacman’.

       MAKEPKG_CONF="/path/to/file"
           Use an alternate config file instead of the /etc/makepkg.conf default.

       PKGDEST="/path/to/directory"
           Directory where the resulting packages will be stored. Overrides the corresponding value defined in makepkg.conf(5).

       SRCDEST="/path/to/directory"
           Directory where the downloaded sources will be stored. Overrides the corresponding value defined in makepkg.conf(5).

       SRCPKGDEST="/path/to/directory"
           Directory where source package files will be stored. Overrides the corresponding value defined in makepkg.conf(5).

       LOGDEST="/path/to/directory"
           Directory where generated log files will be stored. Overrides the corresponding value defined in makepkg.conf(5).

       PACKAGER="John Doe <john@doe.com>"
           String to identify the creator of the resulting package. Overrides the corresponding value defined in makepkg.conf(5).

       BUILDDIR="/path/to/directory"
           Directory where the package will be built. Overrides the corresponding value defined in makepkg.conf(5).

       CARCH="(i686|x86_64)"
           Force build for a specific architecture. Useful for cross-compiling. Overrides the corresponding value defined in makepkg.conf(5).

       PKGEXT=".pkg.tar.gz", SRCEXT=".src.tar.gz"
           Sets the compression used when making compiled or source packages. Overrides the corresponding value defined in makepkg.conf(5).

       GNUPGHOME="/path/to/directory"
           Directory where the gpg keyring for signing the built package is stored.

       GPGKEY="keyid"
           Specify a key to use when signing packages, overriding the GPGKEY setting in makepkg.conf(5)

       SOURCE_DATE_EPOCH="<date>"
           Used for Reproducible Builds.

Offline

#8 2021-09-27 13:30:30

Raynman
Member
Registered: 2011-10-22
Posts: 1,539

Re: Pacman args via makepkg

Offline

#9 2021-09-28 08:10:34

a821
Member
Registered: 2012-10-31
Posts: 381

Re: Pacman args via makepkg

starfry wrote:

I already did that. Are you referring me to the  `PACMAN` variable? That does not allow you to specify arguments.  - the first thing I tried was to set PACMAN = 'pacman --debug --verbose'.

Yep, it does not work. The only thing that works (at least for me) is to make a wrapper script containing something like `exec pacman --debug --verbose "$@"` and run `PACMAN=/path/to/script makepkg ...`

If there's a better way, please share...

Offline

#10 2021-09-28 08:25:39

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,365
Website

Re: Pacman args via makepkg

Crap - I thought I fixed that so it now worked...

Offline

#11 2021-09-28 13:03:29

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,441
Website

Re: Pacman args via makepkg

Allan rebroke it?


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

Board footer

Powered by FluxBB