Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating pkgfiledb symbolic link causes apacman to have exit status 1 #72

Closed
jeroenrnl opened this issue Oct 7, 2016 · 4 comments
Closed

Comments

@jeroenrnl
Copy link

This line (660)

runasroot ln -s ${database}/raw/pkgfile.tar.gz "$pkgfiledb" 2>/dev/null

causes apacman to exit with status 1 - which causes my script to fail.
Initially it failed because /var/cache/pkgfile did not exist. I modified my script to create it - which made it run correctly with the first run, but then on the second run, it failed again, now because /var/cache/pkgfile/aur.files already exists.
The 2>/dev/null made this very hard to troubleshoot.
In all above cases the packages in question were installed without a problem - it just exited with status 1, in my opinion it should not exit with another status than 0 on success.
For now, my script deletes /var/cache/pkgfile/aur.files before running - which makes it work, but does defy the purpose of a cache 😄

@oshazard
Copy link
Owner

oshazard commented Oct 7, 2016

In the meantime, instead of deleting that DB, you should be able to apacman run with the --nodatabase option or uncomment nodatabase='1' in apacman.conf

But yeah I'll take a look at it later today.

@oshazard
Copy link
Owner

@jeroenrnl I cannot seem to reproduce this issue on a fresh install of ArchLinux.

Can you provide more information?
Also for debugging, try bash -x /usr/bin/apacman -S <pkg>; echo $?

@jeroenrnl
Copy link
Author

I probably should have added that this was on the first run, where apacman installs itself by running
bash /tmp/apacman --gendb --skipcache --quiet --noconfirm -S apacman

@oshazard
Copy link
Owner

@jeroenrnl
Okay, yeah pkgfile is an optional dependency, so apacman now checks if it is installed (also checks if /var/cache/pkgfile directory exists), otherwise it skips updating the local DB.

However, unless you add --nodatabase (or nodatabase='1' in the config), it will still grab the packages.gz file from AUR which is used for regex matching (soon to be replaced with glob syntax).

Additionally, to improve debugging, I've modified the exit codes to follow this (see man 8 apacman)

# Exit Code Meaning
0 Success
1 Miscellaneous errors
2 Invalid parameters
3 Fatal errors, not warnings
4 No package matches found
5 Package does not exist
6 No internet connection
7 ---
8 One or more package(s) failed to build, keep going
9 One package failed to build, do not continue
10 Permission problem -- fakeroot
11 Permission problem -- root user
12 Permission problem -- sudo
13 Permission problem -- su

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants