FS#65411 - makechrootpkg doesn't work if called from bash scripts
Attached to Project:
Arch Linux
Opened by Holly (kalinda) - Friday, 07 February 2020, 16:46 GMT
Last edited by Eli Schwartz (eschwartz) - Monday, 10 February 2020, 02:12 GMT
Opened by Holly (kalinda) - Friday, 07 February 2020, 16:46 GMT
Last edited by Eli Schwartz (eschwartz) - Monday, 10 February 2020, 02:12 GMT
|
Details
Description:
I have a bash program I'm using to automate building packages in my repo and part of it is that it uses makechrootpkg, which used to work fine until a couple days ago. Now when makechrootpkg -r $CHROOT -- --clean is called from the script, it gives me an error: /usr/bin/makechrootpkg: illegal option -- - If I remove the -- --clean argument, then I get this error instead: /usr/bin/makechrootpkg: option requires an argument -- r Running the command or calling the function I have makechrootpkg directly from the terminal works fine, however. I have tried removing and completely redoing my chroot, but it still gives these errors. My chroot is ext4, not btrfs. The error doesn't happen if I use regular makepkg instead. I will try to see if I can find other workarounds for, too, and report back. Additional info: * devtools 20191227-2, util-linux 2.35.1-1, arch-install-scripts 23-1, let me know if you need to know anymore. * Running kernel 5.5.2-arch1-1 Steps to reproduce: * Write a simple bash script with the command makechrootpkg -r $CHROOT (optionally add the clean flag if you like) * Go to a folder with a PKGBUILD in it, run the script, get the error. Any help is appreciated, thanks a lot! |
This task depends upon
Closed by Eli Schwartz (eschwartz)
Monday, 10 February 2020, 02:12 GMT
Reason for closing: Not a bug
Additional comments about closing: User error.
Monday, 10 February 2020, 02:12 GMT
Reason for closing: Not a bug
Additional comments about closing: User error.
> If I remove the -- --clean argument, then I get this error instead: /usr/bin/makechrootpkg: option requires an argument -- r
The problem seems evident. The "$CHROOT" variable is not defined in your script. Try running the script with "set -x" to see what command you are actually executing, I suspect the argument list which is being invoked by the kernel is:
{"makechrootpkg", "-r", "--", "--clean"}
then later:
{"makechrootpkg", "-r"}
This will obviously not work.
Anyway sorry for wasting your guys' time!