You are not logged in.

#1 2015-08-03 18:59:14

will.price94
Member
From: UK
Registered: 2011-11-09
Posts: 63
Website

[SOLVED] [ERROR] Pushing a -git package with dynamic `pkgver`

# Maintainer: Will Price <will.price94+aur@gmail.com>
pkgname=pug-git
pkgver() {
  cd "${pkgname%%-git}"
  git describe --long | sed -r 's/-([0-9,a-g,A-G]{7}.*)//' | sed 's/-/./'
}
pkgrel=1
epoch=
pkgdesc="Quickly update local projects and their dependencies with a
single command"
arch=('any')
url="https://github.com/ashur/pug"
license=('github')
groups=()
depends=('php')
makedepends=()
checkdepends=()
optdepends=('git' 'subversion' 'composer')
provides=()
conflicts=()
replaces=()
backup=()
options=()
install=
changelog=
md5sums=('SKIP')
source=("${pkgname%%-git}::git+https://github.com/ashur/pug.git")
prepare() {
	cd "$srcdir/${pkgname%%-git}"
    git submodule init
    git submodule update
}

package() {
	cd "$srcdir/${pkgname%%-git}"
    mkdir -p "$pkgdir"/usr/{bin,share/pear}
    cp -r "$srcdir/${pkgname%%-git}" "$pkgdir/usr/share/pear/"
    ln -s /usr/share/pear/pug/pug "$pkgdir/usr/bin"
}
pkgbase = pug-git
	pkgdesc = Quickly update local projects and their dependencies with a single command
	pkgrel = 1
	url = https://github.com/ashur/pug
	arch = any
	license = github
	depends = php
	optdepends = git
	optdepends = subversion
	optdepends = composer
	source = pug::git+https://github.com/ashur/pug.git
	md5sums = SKIP

pkgname = pug-git
$ git push -u origin master
Counting objects: 4, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 953 bytes | 0 bytes/s, done.
Total 4 (delta 0), reused 0 (delta 0)
remote: error: The following error occurred when parsing commit
remote: error: 582a4c8fbdc90bb4de9eeec11e15cac1236f9bba:
remote: error: missing mandatory field: pkgver
remote: error: hook declined to update refs/heads/master
To ssh://aur@aur4.archlinux.org/pug-git.git
 ! [remote rejected] master -> master (hook declined)
error: failed to push some refs to 'ssh://aur@aur4.archlinux.org/pug-git.git'

Any ideas, this is my first commit/push of this package.

Last edited by will.price94 (2015-08-03 21:03:53)

Offline

#2 2015-08-03 19:12:18

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: [SOLVED] [ERROR] Pushing a -git package with dynamic `pkgver`

You have the function, but not the field...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2015-08-03 19:15:13

will.price94
Member
From: UK
Registered: 2011-11-09
Posts: 63
Website

Re: [SOLVED] [ERROR] Pushing a -git package with dynamic `pkgver`

I should have a field in the PKGBUILD in addition to the function? Why? I thought they were mutually exclusive?

Offline

#4 2015-08-03 20:02:33

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,729

Re: [SOLVED] [ERROR] Pushing a -git package with dynamic `pkgver`

They are not. You need both the variable and the function.

The function updates the variable.

Last edited by Scimmia (2015-08-03 20:02:47)

Offline

#5 2015-08-03 20:04:25

will.price94
Member
From: UK
Registered: 2011-11-09
Posts: 63
Website

Re: [SOLVED] [ERROR] Pushing a -git package with dynamic `pkgver`

Interesting, even though I have now added a `pkgver=0` to my PKGBUILD and rerun `mksrcinfo` and committed the two files, I'm still getting the same error. I wonder if it's due to having an unbuildable commit in my history.

Offline

#6 2015-08-03 20:55:43

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,729

Re: [SOLVED] [ERROR] Pushing a -git package with dynamic `pkgver`

Why pkgver=0? Just run makepkg -o and upload it like that

It should tell you what commit is the problem. It does validate every commit, so you probably have to start over.

Offline

#7 2015-08-03 21:00:12

will.price94
Member
From: UK
Registered: 2011-11-09
Posts: 63
Website

Re: [SOLVED] [ERROR] Pushing a -git package with dynamic `pkgver`

Ah, that was my problem, no running `makepkg`!

Thanks for all the help.

Offline

Board footer

Powered by FluxBB