oshazard / apacman

ArchLinux User Repository (AUR) helper and pacman wrapper
https://aur.archlinux.org/packages/apacman/
GNU General Public License v3.0
70 stars 11 forks source link

bug or feature? #40

Closed suedi closed 7 years ago

suedi commented 8 years ago

When custom repo database not synced with pacman -Sy apacman refuses to build pkg from AUR allthough all dependencies satisfied by repos availible

warning: database file for 'obarun' does not exist

Aur Targets    (1): gnome-mpv-git
Pacman Targets (1): autoconf-archive

:: Proceed with building? [Y/n] 
error: failed to prepare transaction (could not find database)
warning: database file for 'obarun' does not exist
error: failed to prepare transaction (could not find database)
Installation failed.

To fix for sure I can just do pacman -Sy but what if that custom repo disappears then a novice user could probably not fix the problem by commenting out in pacman.conf

I leave it to you to decide if it is worth fixing

justin8 commented 8 years ago

That would be expected. You can't update someone's package list. Doing an -Sy without -Syu is dangerous and can lead to installing packages that have newer dependencies than you have on your system and is strongly not recommended by Arch.

See the first big red warning box on the pacman archwiki page: https://wiki.archlinux.org/index.php/Pacman

Also: https://wiki.archlinux.org/index.php/System_maintenance#Partial_upgrades_are_unsupported https://bbs.archlinux.org/viewtopic.php?id=89328

suedi commented 8 years ago

dangerous is rather a strong word

and no suport so what else is new

I still believe I should be able to builld a package when a custom repo of no concern lacks database

suedi commented 8 years ago

damn not-so-smart phone, was not my intention to close this issue

A warning would be good an error to much

justin8 commented 8 years ago

Just add a pacman -Sy; as an alias at the start of your call of apacman or whatever utilities. But it is a bad idea for people to do that, let alone for a tool to do it automatically for them when the people maintaining the distro strongly recommend against it.

oshazard commented 8 years ago

Sorry @suedi and @justin8, I finally have time to work on these bug reports. I'm going to look through and merge the pull requests from @justin8. Afterwards I will try to close as many of the 25 open issues as I can XD. Thank you for your patience.

suedi commented 8 years ago

No problem mate, You are doing good work.

oshazard commented 7 years ago

Hmmm, so I'm not sure how to solve this one.

The error is a bug/feature of pacman $ echo "[foobar]" | sudo tee -a /etc/pacman.conf $ cat /etc/pacman.conf | grep "^\[" | grep -v "options" $ sudo pacman -S which

warning: database file for 'foobar' does not exist warning: which-2.21-2 is up to date -- reinstalling error: failed to prepare transaction (could not find database)

oshazard commented 7 years ago

However, this works... $ filename=$(ls /var/cache/pacman/pkg/which* | tail -n 1); $ sudo pacman -U $filename

warning: database file for 'foobar' does not exist loading packages... warning: which-2.21-2 is up to date -- reinstalling resolving dependencies... looking for conflicting packages... Package (1) Old Version New Version Net Change which 2.21-2 2.21-2 0.00 MiB Total Installed Size: 0.03 MiB Net Upgrade Size: 0.00 MiB :: Proceed with installation? [Y/n] y

Likewise, in the absence of installing any non-AUR packages $ apacman -S apacman --skipcache

warning: database file for 'foobar' does not exist warning: database file for 'foobar' does not exist warning: database file for 'foobar' does not exist warning: database file for 'foobar' does not exist warning: apacman-2.9-1 is up to date -- reinstalling Aur Targets (1): apacman :: Proceed with installation? [Y/n] y Edit apacman PKGBUILD with $editor? [Y/n] n Edit apacman.install with $editor? [Y/n] n

It builds and installs without issue (except all the warnings)