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

Missing depends when PKGBUILD includes backup #44

Closed
repsac-by opened this issue Jan 8, 2017 · 18 comments
Closed

Missing depends when PKGBUILD includes backup #44

repsac-by opened this issue Jan 8, 2017 · 18 comments

Comments

@repsac-by
Copy link

PKGBUILD

pkgname=example
pkgver=1
pkgrel=1
pkgdesc='missing depends'
url='https://example.org'
license=('custom')
arch=('x86_64')
depends=('bash')
backup=('etc/example/conf')

package() {
	echo test > conf
	install -Dm644 -t "$pkgdir/etc/example" conf
}

file size of depends 0:

$ makepkg
...
$ repose foo
$ tar tvf foo.db example-1-1/depends
-rw-r--r-- repose/repose     0 2017-01-08 23:41 example-1-1/depends

After remove backup:

$ makepkg
...
$ repose foo
$ tar tvf foo.db example-1-1/depends
-rw-r--r-- repose/repose    16 2017-01-08 23:44 example-1-1/depends
$ tar xOf foo.db example-1-1/depends
%DEPENDS%
bash

$
$ repose --version 
repose 7
@vodik
Copy link
Owner

vodik commented Jan 9, 2017

Reproduced. Huh... great

@vodik
Copy link
Owner

vodik commented Jan 9, 2017

Ah shit, okay, I know what's up - I broke the parser.

The actual problem here is backup. The PKGBUILD looks like this:

# Generated by makepkg 5.0.1
# using fakeroot version 1.21
# Mon Jan  9 17:48:43 UTC 2017
pkgname = example
pkgver = 1-1
pkgdesc = missing depends
url = https://example.org
builddate = 1483984123
packager = Simon Gomizelj <simongmzlj@gmail.com>
size = 1024
arch = x86_64
license = custom
backup = etc/example/conf
depend = bash

And the parser halts at the backup line - without raising any sort of visible error. Great.

Well, nice catch, and should be an easy fix.

vodik added a commit that referenced this issue Jan 9, 2017
This would have made #44 way easier to catch...
@vodik vodik closed this as completed in 324d750 Jan 9, 2017
@vodik
Copy link
Owner

vodik commented Jan 9, 2017

Can you check that this works on master, and if so, I'll tag a new stable release.

@repsac-by
Copy link
Author

repsac-by commented Jan 9, 2017

$ repose --version 
repose 7-12-geffbedf

backup is now handled correctly.

But found that now throws an error if the package is missing field url. Unfortunately, repose doesn't say which package with error was detected. I had to go through all the packages until I found the package and figured out what the error is.

repose: failed to parse PKGINFO

Perhaps it's worth opening a new issue.

@vodik
Copy link
Owner

vodik commented Jan 9, 2017

Nah, I suspect its along the same lines.

Okay, I'm not going to have time to dig into it until this evening, but I'll spend some time making that error message a little better. Then, once you know which package it is, I can fix it.

@vodik vodik reopened this Jan 9, 2017
@repsac-by
Copy link
Author

@vodik This is my private package, it is just missing the url field. There are no more differences from the usual package.

@repsac-by
Copy link
Author

PKGBUILD

pkgname=example
pkgver=1
pkgrel=1
pkgdesc='error on missing url'
license=('custom')
arch=('x86_64')
depends=('bash')
backup=('etc/example/conf')

package() {
	echo test > conf
	install -Dm644 -t "$pkgdir/etc/example" conf
}
$ makepkg
...
$ repose foo   
repose: failed to parse PKGINFO

@repsac-by
Copy link
Author

repsac-by commented Jan 10, 2017

Here is another packages from AUR which does not pass https://aur.archlinux.org/pkgbase/gtksourceview-pkgbuild/
https://aur.archlinux.org/packages/neovim-symlinks/

$ repose foo                                 
repose: failed to parse PKGINFO
$ strace repose foo
...
openat(3, "mime-pkgbuild-3-2-any.pkg.tar.xz", O_RDONLY) = 5
fstat(5, {st_mode=S_IFREG|0644, st_size=7816, ...}) = 0
fstat(5, {st_mode=S_IFREG|0644, st_size=7816, ...}) = 0
read(5, "\3757zXZ\0\0\4\346\326\264F\4\300\307<\200\300\2!\1\26\0\0\0\0\0\0004\306\207\36"..., 8192) = 7816
mmap(NULL, 8392704, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f410f0ce000
read(5, "", 8192)                       = 0
write(2, "repose: ", 8repose: )                 = 8
write(2, "failed to parse PKGINFO", 23failed to parse PKGINFO) = 23
write(2, "\n", 1
)                       = 1
exit_group(1)                           = ?
+++ exited with 1 +++

.PKGINFO

# Generated by makepkg 5.0.1
# using fakeroot version 1.21
# Tue Jan 10 06:43:15 UTC 2017
pkgname = mime-pkgbuild
pkgbase = gtksourceview-pkgbuild
pkgver = 3-2
pkgdesc = MIME types for PKGBUILD files
url = 
builddate = 1484030595
packager = Unknown Packager
size = 1024
arch = any
license = free
depend = shared-mime-info

@vodik
Copy link
Owner

vodik commented Jan 10, 2017

Yeah, you're making me wonder if I just can't handle empty fields...

vodik added a commit that referenced this issue Jan 10, 2017
@vodik vodik closed this as completed in 92ee037 Jan 10, 2017
@vodik
Copy link
Owner

vodik commented Jan 10, 2017

Awesome, thank you very much.

If you don't happen to find any new problems, I'll release 7.1. Yikes, all this mess just to shave a few seconds off parsing...

@vodik
Copy link
Owner

vodik commented Jan 10, 2017

Alright, released 7.1 and flagged the maintainer that the package is out of date (didn't realise its now in community, cool).

@Celti
Copy link
Contributor

Celti commented Jan 18, 2017

I haven't had cause to update my repo or I'd have reported this sooner, but 7.1 (out of the Arch repos) is now failing with "failed to parse PKGINFO" on dozens of packages for me. strace is here, but I'm not sure where to start looking.

@repsac-by
Copy link
Author

@Celti strace is not needed anymore, as repose on error reports the name of the package

post here the output of command:
tar xOf /path/to/ttf-ms-win10-sea-10.0.10586-1-any.pkg.tar.xz .PKGINFO

@kyrias
Copy link
Contributor

kyrias commented Jan 18, 2017

For the record, I got lots of those errors for packages built in 2015 or so that still worked just fine to install. I was sort of in a hurry at the time though, so just deleted them and rebuilt from scratch.

@Celti
Copy link
Contributor

Celti commented Jan 18, 2017

Sorry for the delay, here:

# Generated by makepkg 4.2.1
# using fakeroot version 1.20.2
# Mon Jan  4 21:39:20 UTC 2016
pkgname = ttf-ms-win10-sea
pkgbase = ttf-ms-win10
pkgver = 10.0.10586-1
pkgdesc = Microsoft Windows 10 Southeast Asian TrueType fonts
url = http://www.microsoft.com/typography/fonts/product.aspx?PID=164
builddate = 1451943560
packager = Patrick Burroughs (Celti) <celti@celti.name>
size = 6653952
arch = any
license = custom
conflict = ttf-vista-fonts
conflict = ttf-ms-win8-sea
conflict = ttf-win7-fonts-sea
provides = ttf-font
depend = fontconfig
depend = xorg-fonts-encodings
depend = xorg-mkfontscale
depend = xorg-mkfontdir
makepkgopt = strip
makepkgopt = docs
makepkgopt = !libtool
makepkgopt = !staticlibs
makepkgopt = emptydirs
makepkgopt = zipman
makepkgopt = purge
makepkgopt = !upx
makepkgopt = !debug

@vodik
Copy link
Owner

vodik commented Jan 20, 2017

Looking into this - sorry, been sick with a bad cold

@vodik vodik reopened this Jan 20, 2017
vodik added a commit that referenced this issue Jan 20, 2017
@vodik vodik closed this as completed in ce14e43 Jan 20, 2017
@vodik
Copy link
Owner

vodik commented Jan 20, 2017

Okay, so I just haven't had the free time just yet, but something that's pretty clear is the new parser, while faster, is just too strict.

This is a quick fix, I'll hack on something to downgrade these parser failures into warning, then release a 7.2

@vodik
Copy link
Owner

vodik commented Jan 20, 2017

Thanks again everyone, and thanks for putting up with this. Phewf

This was referenced Jan 24, 2017
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

4 participants