[pacman-dev] [PATCH] makepkg: add option holdver (like --holdver arg)
From: Vesa Kaihlavirta <vegai@iki.fi> Signed-off-by: Vesa Kaihlavirta <vegai@iki.fi> --- scripts/makepkg.sh.in | 15 ++++++++------- 1 files changed, 8 insertions(+), 7 deletions(-) diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index 5bbd880..78b1e22 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -44,7 +44,7 @@ startdir="$PWD" srcdir="$startdir/src" pkgdir="$startdir/pkg" -packaging_options=('strip' 'docs' 'libtool' 'emptydirs' 'zipman' 'purge') +packaging_options=('strip' 'docs' 'libtool' 'emptydirs' 'zipman' 'holdver' 'purge') other_options=('ccache' 'distcc' 'makeflags' 'force') splitpkg_overrides=('pkgver' 'pkgrel' 'pkgdesc' 'arch' 'license' 'groups' \ 'depends' 'optdepends' 'provides' 'conflicts' 'replaces' \ @@ -1269,12 +1269,13 @@ check_sanity() { devel_check() { newpkgver="" - # Do not update pkgver if --holdver is set, when building a source package, repackaging, - # reading PKGBUILD from pipe (-f), or if we cannot write to the file (-w) - if (( HOLDVER || SOURCEONLY || REPKG )) \ - || [[ ! -f $BUILDFILE || ! -w $BUILDFILE ]]; then - return - fi + # Do not update pkgver if --holdver is set, holdver option is set, when building a + # source package, when reading PKGBUILD from pipe (-f), or if we cannot write to the file (-w) + if [ "$HOLDVER" -eq 1 -o "$(check_option holdver)" = "y" \ + -o "$SOURCEONLY" -ne 0 -o ! -f "$BUILDFILE" \ + -o ! -w "$BUILDFILE" ]; then + return + fi if [[ -z $FORCE_VER ]]; then # Check if this is a svn/cvs/etc PKGBUILD; set $newpkgver if so. -- 1.6.6
Vesa Kaihlavirta wrote:
From: Vesa Kaihlavirta <vegai@iki.fi>
Signed-off-by: Vesa Kaihlavirta <vegai@iki.fi> --- scripts/makepkg.sh.in | 15 ++++++++------- 1 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index 5bbd880..78b1e22 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -44,7 +44,7 @@ startdir="$PWD" srcdir="$startdir/src" pkgdir="$startdir/pkg"
-packaging_options=('strip' 'docs' 'libtool' 'emptydirs' 'zipman' 'purge') +packaging_options=('strip' 'docs' 'libtool' 'emptydirs' 'zipman' 'holdver' 'purge') other_options=('ccache' 'distcc' 'makeflags' 'force') splitpkg_overrides=('pkgver' 'pkgrel' 'pkgdesc' 'arch' 'license' 'groups' \ 'depends' 'optdepends' 'provides' 'conflicts' 'replaces' \ @@ -1269,12 +1269,13 @@ check_sanity() { devel_check() { newpkgver=""
- # Do not update pkgver if --holdver is set, when building a source package, repackaging, - # reading PKGBUILD from pipe (-f), or if we cannot write to the file (-w) - if (( HOLDVER || SOURCEONLY || REPKG )) \ - || [[ ! -f $BUILDFILE || ! -w $BUILDFILE ]]; then - return - fi + # Do not update pkgver if --holdver is set, holdver option is set, when building a + # source package, when reading PKGBUILD from pipe (-f), or if we cannot write to the file (-w) + if [ "$HOLDVER" -eq 1 -o "$(check_option holdver)" = "y" \ + -o "$SOURCEONLY" -ne 0 -o ! -f "$BUILDFILE" \ + -o ! -w "$BUILDFILE" ]; then + return + fi
if [[ -z $FORCE_VER ]]; then # Check if this is a svn/cvs/etc PKGBUILD; set $newpkgver if so.
Why is this useful? I see that you can either you use the --holdver flag or you check out a specific revision in the PKGBUILD. Allan
Why is this useful? I see that you can either you use the --holdver flag or you check out a specific revision in the PKGBUILD.
For software that make their release versions only in svc. E.g. my go package in community. I want to have holdver every time I build this package, and it's much more convenient if it's defined in the PKGBUILD. --vk
Vesa Kaihlavirta wrote:
Why is this useful? I see that you can either you use the --holdver flag or you check out a specific revision in the PKGBUILD.
For software that make their release versions only in svc. E.g. my go package in community. I want to have holdver every time I build this package, and it's much more convenient if it's defined in the PKGBUILD.
Shouldn't you just move _hgroot and _hgrepo inside the package() function? If you have to use --holdver everytime you build a package, then that package is not really a VCS style package and should not be treated like one. As an aside, looking at holdver makes me realize just how stupid it is. It does not hold the checkout at the version specified, which I bet most people thinks it will. It just stop the pkgver being updated. e.g. I just build makepkg-git-19790101-1... Allan
On Wed, Jan 20, 2010 at 11:55 AM, Allan McRae <allan@archlinux.org> wrote:
As an aside, looking at holdver makes me realize just how stupid it is. It does not hold the checkout at the version specified, which I bet most people thinks it will. It just stop the pkgver being updated. e.g. I just build makepkg-git-19790101-1...
I know, it's completely broken. IIRC it only works with svn and cvs. That's just one of the many problems I have with this whole makepkg vcs stuff... Maybe that's the whole problem, the system might have been originally designed with cvs/svn in mind, and all the other version control were just added on top, not in an ideal way. The main complaints usually don't concern cvs/svn but all the others. Or at least the complaints that are not easily fixed. One of the last bug is actually about svn but seems like an easy fix : http://bugs.archlinux.org/task/17872 We need to have in mind the big differences between the different version control system : 1) ability to determine the last version remotely : only svn and bzr ? (I just remembered that cvs also just uses the current date) 2) ability to checkout the specified date/revision (a linear number which can be used in pkgver) : yes for cvs/svn, no for git/darcs I meant for a long time to have a closer and more precise look at the differences important for makepkg between all vcs. Just did not find the time/motivation for it. The second challenge is to have a system that is both flexible and factorize the most of code between two different PKGBUILD-vcs
On Wed, Jan 20, 2010 at 1:43 PM, Xavier Chantry <shiningxc@gmail.com> wrote:
On Wed, Jan 20, 2010 at 11:55 AM, Allan McRae <allan@archlinux.org> wrote:
As an aside, looking at holdver makes me realize just how stupid it is. It does not hold the checkout at the version specified, which I bet most people thinks it will. It just stop the pkgver being updated. e.g. I just build makepkg-git-19790101-1...
I know, it's completely broken. IIRC it only works with svn and cvs. That's just one of the many problems I have with this whole makepkg vcs stuff...
I didn't like how it smelled either, but was aiming at not breaking current patterns. Why not just remove the whole thing if it's so bad... --vk
participants (3)
-
Allan McRae
-
Vesa Kaihlavirta
-
Xavier Chantry