You are not logged in.

#1 2005-06-09 08:45:21

xerverius
Member
From: ~
Registered: 2004-11-02
Posts: 230
Website

[SOLVED] Store SVN revision number in pkgver

I'd like to set the pkgver to the latest revision number, so i tried the following:

.... beginning of pkgbuild.....

cd $startdir/src/
echo "Downloading latest revision from SVN server..."
svn co http://...../trunk $pkgname -q
#get the text "Latest revision number is xxxxx."
textver=$(svn co http://....../trunk $pkgname)
pkgver=${textver:20:6} #strip the text from the string and save the number in pkgver.
echo "Revision number is $pkgver..." #runs fine, the number xxxxx is shown :)

....continue compiling and stuff.....

So everything runs fine and the package is compiled, but after creating the .FILELIST the package is compressed with the following error:

tar: .... Cannot stat: No such file or directory a package is created with the name $pkgname but without extension of revision number.

So... is it possible to get the rivision number from the server (is local also possible, from the directory after downloading?) and create a proper number, so the package is compressed without errors and the package name will be $pkgname-$pkgver-1.tar.gz?

Thanks in advance, Xerverius

Offline

#2 2005-06-09 08:58:50

IceRAM
Member
From: Bucharest, Romania
Registered: 2004-03-04
Posts: 772
Website

Re: [SOLVED] Store SVN revision number in pkgver

Are you sure the output (from compiling & stuff) is put in $startdir/pkg?

Offline

#3 2005-06-09 09:05:01

xerverius
Member
From: ~
Registered: 2004-11-02
Posts: 230
Website

Re: [SOLVED] Store SVN revision number in pkgver

IceRAM wrote:

Are you sure the output (from compiling & stuff) is put in $startdir/pkg?

Yes, there is a package create in the directory (and the size is ok) but the name wrong, for example if you want to create the following package:

pkgname=xfdesktop
pkgver=15904 <==from the get revision number row, when i enter this by hand, nothing is going wrong!
pkgrel=1

i get the error: tar: 15904-1.tar.gz Cannot stat: No such file or directory
And the script continues and creates a package, removed the src/ en pkg/ dir and is done.

Offline

#4 2005-06-09 09:05:08

cactus
Taco Eater
From: t͈̫̹ͨa͖͕͎̱͈ͨ͆ć̥̖̝o̫̫̼s͈̭̱̞͍̃!̰
Registered: 2004-05-25
Posts: 4,622
Website

Re: [SOLVED] Store SVN revision number in pkgver

I dont think creating the pkgver on the fly inside the pkgbuild is such a good idea. Instead, use the value manually set in the pkgver to check out a version from svn. Then the builder of the package can just supply the version he wants checked out, and build it.
Note: "head" is also a viable version. Then the release just gets incremented with each new build.


"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍

Offline

#5 2005-06-09 11:24:15

xerverius
Member
From: ~
Registered: 2004-11-02
Posts: 230
Website

Re: [SOLVED] Store SVN revision number in pkgver

If i use the following line everything is downloaded and converted at once:

pkgver=`LC_ALL=C svn export --force http://../$pkgname/trunk $pkgname | tail -n 1 | cut -d " " -f 3 | cut -d "." -f 1`

Offline

#6 2005-06-20 08:15:17

dtw
Forum Fellow
From: UK
Registered: 2004-08-03
Posts: 4,439
Website

Re: [SOLVED] Store SVN revision number in pkgver

You can't use gensync on PKGBUILDS that are written like this.  I use the following code to fix this:

  # Correct the pkgver in our PKGBUILD - this allows correct gensync operation
  # NOTE: pkgver variable must be declared with first 10 lines of PKGBUILD!
  cd $startdir
  old_pkgver=$pkgver
- pkgver=`date +%Y%m%d`
+ pkgver=`LC_ALL=C svn export --force http://../$pkgname/trunk $pkgname | tail -n 1 | cut -d " " -f 3 | cut -d "." -f 1`
  sed -i "1,11 s|pkgver=$old_pkgver|pkgver=$pkgver|" ./PKGBUILD

Offline

Board footer

Powered by FluxBB