local-repo icon indicating copy to clipboard operation
local-repo copied to clipboard

Don't build a package if won't add it

Open rffontenelle opened this issue 12 years ago • 4 comments

If local-repo is told to add a package from its source tarball, it will build then add. However, the package is already in the database, the addition will only be denied after the compilation. Can't it be told to the user before the compilation is done?

Example:

$ LC_ALL=C lr -s gngeo

Loading repo: /var/cache/rafaelrepo gngeo 0.8-3

$ LC_ALL=C lr -a https://aur.archlinux.org/packages/gn/gngeo/gngeo.tar.gz

Loading repo: /var/cache/rafaelrepo Forging a new package: https://aur.archlinux.org/packages/gn/gngeo/gngeo.tar.gz

[=========================] 100% ==> Making package: gngeo 0.8-4 (Sun Apr 22 00:36:09 BRT 2012) (... hiden build stuff ...) ==> Tidying install... -> Purging unwanted files... -> Compressing man and info pages... -> Stripping unneeded symbols from binaries and libraries... ==> Creating package... -> Generating .PKGINFO file... -> Adding install file... -> Compressing package... ==> Leaving fakeroot environment. ==> Finished making: gngeo 0.8-4 (Sun Apr 22 00:37:25 BRT 2012)

Adding package to the repo: gngeo Package is already in the repo: gngeo

rffontenelle avatar Apr 22 '12 03:04 rffontenelle

@josephgbr yepp, thats a little bit annoying, the problem is, that i can't be 100% sure about the package name, before the package is built. will think about that.

EDIT: --aur-add tests this before building the package.

ushis avatar Apr 22 '12 03:04 ushis

@ushis Is it possible to download source tarball, extract, source the variables and then read the value of pkgname ? Except for split packages, which is not supported anyway, this would tell for sure the package name, as makepkg rely on variable 'pkgname' to create the package filename.

rffontenelle avatar Apr 22 '12 03:04 rffontenelle

Yeah, i know that shouldn't be a problem, but the current "PackageBuilder" has no access to the repo instance. So either i give the PackageBuilder access, which is not very nice with the current design, or i make the Repo class Singleton (i think about that for a while).

ushis avatar Apr 22 '12 03:04 ushis

Well, I'm out of ideas at the moment. Good luck. :)

rffontenelle avatar Apr 22 '12 04:04 rffontenelle