You are not logged in.
Pages: 1
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
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
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
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
The pacman executable could be a simple wrapper script that adds those arguments.
Offline
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
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
Offline
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
Crap - I thought I fixed that so it now worked...
Offline
Allan rebroke it?
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Offline
Pages: 1