You are not logged in.

#1 2013-04-24 01:30:11

fr0z3d
Member
From: Venezuela
Registered: 2013-04-13
Posts: 8

[Solved] pkgver() function

Howdy,

I've tried everything and I can't get the pkgver() function to work. This is what I'm using (got it from the wiki):

pkgver() {
  cd "$SRCDEST/lcsgame"
  svnversion | tr -d [A-z]
}

Here's the PKGBUILD

pkgname=lcs-svn
pkgver() {
  cd "$SRCDEST/lcsgame"
  svnversion | tr -d [A-z]
}
pkgrel=1
pkgdesc="A satirical console-based political role-playing/strategy game in which you recruit a team of Elite Liberal radicals and try to save the United States from a descent into Arch-Conservatism."
arch=('i686' 'x86_64')
url="http://sourceforge.net/projects/lcsgame/"
license=('GPL2')
depends=('ncurses')
makedepends=('autoconf' 'subversion')
provides=('lcs')
conflicts=('lcs')
replaces=('lcs')
options=('!strip' '!buildflags' '!makeflags')
source=('lcsgame::svn+http://svn.code.sf.net/p/lcsgame/code/trunk')
md5sums=('SKIP')

build() {
  cd "${srcdir}/lcsgame"
  ./bootstrap
  ./configure --prefix=/usr
  make
}

package() {
  cd "${srcdir}/lcsgame"
  make install DESTDIR="${pkgdir}"
}

Edit: Here's the namcap report, which I forgot lol

Error: error: invalid package file

Error: PKGBUILD is not a valid PKGBUILD

Last edited by fr0z3d (2013-04-24 01:35:43)

Offline

#2 2013-04-24 01:33:13

Scimmia
Bug Wrangler
Registered: 2012-09-01
Posts: 5,084

Re: [Solved] pkgver() function

the pkgver() function updates the pkgver= variable. You don't have that variable.

Offline

#3 2013-04-24 01:33:59

jasonwryan
Forum & Wiki Admin
From: .nz
Registered: 2009-05-09
Posts: 19,076
Website

Re: [Solved] pkgver() function

For the initial declaration of the variable, just use:

pkgver=0

And then include the function before build() {


Arch + dwm   •   Mercurial repos  •   Github

Registered Linux User #482438

Online

#4 2013-04-24 01:34:47

Trilby
Forum Moderator
From: Massachusetts, USA
Registered: 2011-11-29
Posts: 14,032
Website

Re: [Solved] pkgver() function

Don't use $SRCDEST.  Just "cd lcsgame"


InterrobangSlider
• How's my coding? See this page.
• How's my moderating? Feel free to email any concerns, complaints, or objections.

Offline

#5 2013-04-24 01:34:51

fr0z3d
Member
From: Venezuela
Registered: 2013-04-13
Posts: 8

Re: [Solved] pkgver() function

Scimmia wrote:

the pkgver() function updates the pkgver= variable. You don't have that variable.

Oops, I knew it'd be something like this! lol.

Thank you!

Offline

#6 2013-04-24 01:36:25

Scimmia
Bug Wrangler
Registered: 2012-09-01
Posts: 5,084

Re: [Solved] pkgver() function

Trilby wrote:

Don't use $SRCDEST.  Just "cd lcsgame"

I disagree with that. IMO, it's always better to cd to an absolute path at the beginning of a function so you know for sure where you are.

Offline

#7 2013-04-24 02:19:56

Allan
Developer
From: Brisbane, AU
Registered: 2007-06-09
Posts: 10,416
Website

Re: [Solved] pkgver() function

Scimmia wrote:
Trilby wrote:

Don't use $SRCDEST.  Just "cd lcsgame"

I disagree with that. IMO, it's always better to cd to an absolute path at the beginning of a function so you know for sure where you are.

I like using the full path too...


Edit: but $SRCDEST is wrong in pkgver()...

Offline

#8 2013-04-24 02:22:18

Snowman
Developer/Forum Fellow
From: Montreal, Canada
Registered: 2004-08-20
Posts: 5,212

Re: [Solved] pkgver() function

Scimmia wrote:
Trilby wrote:

Don't use $SRCDEST.  Just "cd lcsgame"

I disagree with that. IMO, it's always better to cd to an absolute path at the beginning of a function so you know for sure where you are.

In that case, he should use $srcdir instead of $SRCDEST

Offline

#9 2013-04-24 02:32:17

Scimmia
Bug Wrangler
Registered: 2012-09-01
Posts: 5,084

Re: [Solved] pkgver() function

Snowman wrote:
Scimmia wrote:
Trilby wrote:

Don't use $SRCDEST.  Just "cd lcsgame"

I disagree with that. IMO, it's always better to cd to an absolute path at the beginning of a function so you know for sure where you are.

In that case, he should use $srcdir instead of $SRCDEST

That won't work until pacman 4.1.1. Right now, the source in $srcdir is an svn export, so it has no version control info.

Offline

Board footer

Powered by FluxBB