You are not logged in.

#1 2008-08-28 08:09:18

adamruss
Member
Registered: 2008-01-17
Posts: 143

help - is there a way to "decrease" a version number in the pkgbuild?

i made a cvs pkgbuild, which recivies today's date as the version, but the daily tar.gz is a day before.
so if today is the 28/8/2008 the version will be 20080828 but the avalible src file will be pkg-20080827.tar.gz.

is there a way to make a variable like this?:
pkgver=20080828
_truepkgver=$pkgver - 1

thanks

Offline

#2 2008-08-28 08:37:35

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,405
Website

Re: help - is there a way to "decrease" a version number in the pkgbuild?

Why don't you make the pkgver=20080827?  Also, cvs package but using a tarball... huh?

Offline

#3 2008-08-28 08:39:22

dyscoria
Member
Registered: 2008-01-10
Posts: 1,007

Re: help - is there a way to "decrease" a version number in the pkgbuild?

Since pkgver is actually just an integer, you could do:

_truepkgver=$((pkgver-1))


flack 2.0.6: menu-driven BASH script to easily tag FLAC files (AUR)
knock-once 1.2: BASH script to easily create/send one-time sequences for knockd (forum/AUR)

Offline

#4 2008-08-28 08:42:55

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: help - is there a way to "decrease" a version number in the pkgbuild?

To expand on Allan's "huh?"... tongue

A CVS PKGBUILD checks out the latest source from the project's CVS repo and builds from that - no tarball supplied or required. If the project provides daily tarballs, that means that they are doing the checkout themselves and tarring it up. In that case, you do not need to create a CVS PKGBUILD - you can create a typical tarball-based PKGBUILD, and put whatever date you want in as $pkgver.

Offline

#5 2008-08-28 08:42:55

byte
Member
From: Düsseldorf (DE)
Registered: 2006-05-01
Posts: 2,046

Re: help - is there a way to "decrease" a version number in the pkgbuild?

pkgver=$(($(date +%Y%m%d)-1))

Edit: eh, wut?! When I was reading up on the bash and date manpages there had been no answers, and now this. Maniacs! tongue

Last edited by byte (2008-08-28 08:44:31)


1000

Offline

#6 2008-08-28 08:47:21

adamruss
Member
Registered: 2008-01-17
Posts: 143

Re: help - is there a way to "decrease" a version number in the pkgbuild?

i know i can make a regular pkgbuild. but then every update i will have to manually change the pkgver - not cool sad
the whole point of the cvs pkg is to type "makepkg" and have the latest src.

and yes - it's a cvs with daily tar.gz builds.


pkgver=$(($(date +%Y%m%d)-1))

this is great, will this work on the 1st of the month as well? or should i add an "if it's the first - return 1"

thanks for the replies.

Last edited by adamruss (2008-08-28 08:53:46)

Offline

#7 2008-08-28 08:52:03

byte
Member
From: Düsseldorf (DE)
Registered: 2006-05-01
Posts: 2,046

Re: help - is there a way to "decrease" a version number in the pkgbuild?

No, it won't, forget about that.

Use a proper CVS PKGBUILD instead. There's no need to edit anything afterwards, as long as you follow /usr/share/pacman/PKGBUILD-cvs.proto.


1000

Offline

#8 2008-08-28 08:53:35

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: help - is there a way to "decrease" a version number in the pkgbuild?

I think this is still the rule of thumb, these + versionpkg:
http://wiki.archlinux.org/index.php/Arc … S_PKGBUILD

Offline

#9 2008-08-28 08:58:14

byte
Member
From: Düsseldorf (DE)
Registered: 2006-05-01
Posts: 2,046

Re: help - is there a way to "decrease" a version number in the pkgbuild?

Erm, versionpkg is deprecated for quite a while. Normal makepkg should have incorporated all of it.


1000

Offline

#10 2008-08-28 09:01:19

adamruss
Member
Registered: 2008-01-17
Posts: 143

Re: help - is there a way to "decrease" a version number in the pkgbuild?

i understand why you all say to use a proper cvs pkgbuild - but there is no cvs repository, only daily builds, and i would like the pkgbuild to update the pkgver it self.
this is a pkgbuild for my own use (not posting on AUR) so i can do what ever right? smile
thanks for all the reply's

Offline

#11 2008-08-28 10:52:10

Profjim
Member
From: NYC
Registered: 2008-03-24
Posts: 658

Re: help - is there a way to "decrease" a version number in the pkgbuild?

For the date arithmetic, use:
date --date=yesterday +FORMAT

I've never seen it documented that the --date parameter takes today,yesterday,.. but it does. Found it by trial & error.

Offline

#12 2008-08-28 18:59:01

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: help - is there a way to "decrease" a version number in the pkgbuild?

Documented in a general non-specific way in the man page, and in an exhaustive, nitty-gritty way in the info page.

Offline

#13 2008-08-29 07:49:03

Profjim
Member
From: NYC
Registered: 2008-03-24
Posts: 658

Re: help - is there a way to "decrease" a version number in the pkgbuild?

tomk, thanks for that site

Offline

Board footer

Powered by FluxBB