[pacman-dev] [PATCH] makepkg: [Idea] Introduce $SRCPKGDEST
Introduce $SRCPKGDEST to define a destination dir for source packages instead of saving them in $PKGDEST with binary packages. The simple patch doesn't break old behavior. Signed-off-by: Nezmer <git@nezmer.info> --- etc/makepkg.conf.in | 2 ++ scripts/makepkg.sh.in | 7 +++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/etc/makepkg.conf.in b/etc/makepkg.conf.in index 3a3a415..b92a697 100644 --- a/etc/makepkg.conf.in +++ b/etc/makepkg.conf.in @@ -91,6 +91,8 @@ PURGE_TARGETS=(usr/{,share}/info/dir .packlist *.pod) #PKGDEST=/home/packages #-- Source cache: specify a fixed directory where source files will be cached #SRCDEST=/home/sources +#-- Source packages: specify a fixed directory where all src packages will be placed +#SRCPKGDEST=/home/srcpackages #-- Packager: name/email of the person or organization building packages #PACKAGER="John Doe <john@doe.com>" diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index 5bbd880..5bd294c 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -1108,7 +1108,7 @@ create_srcpackage() { "$SRCEXT" ;; esac - local pkg_file="$PKGDEST/${pkgbase}-${pkgver}-${pkgrel}${SRCEXT}" + local pkg_file="$SRCPKGDEST/${pkgbase}-${pkgver}-${pkgrel}${SRCEXT}" # tar it up msg2 "$(gettext "Compressing source package...")" @@ -1575,6 +1575,7 @@ done #preserve environment variables _PKGDEST=${PKGDEST} _SRCDEST=${SRCDEST} +_SRCPKGDEST=${SRCPKGDEST} # default config is makepkg.conf MAKEPKG_CONF=${MAKEPKG_CONF:-$confdir/makepkg.conf} @@ -1613,6 +1614,8 @@ PKGDEST=${_PKGDEST:-$PKGDEST} PKGDEST=${PKGDEST:-$startdir} #default to $startdir if undefined SRCDEST=${_SRCDEST:-$SRCDEST} SRCDEST=${SRCDEST:-$startdir} #default to $startdir if undefined +SRCPKGDEST=${_SRCPKGDEST:-$SRCPKGDEST} +SRCPKGDEST=${SRCPKGDEST:-$PKGDEST} #default to $PKGDEST if undefined if (( HOLDVER )) && [[ -n $FORCE_VER ]]; then @@ -1838,7 +1841,7 @@ msg "$(gettext "Making package: %s")" "$pkgbase $pkgver-$pkgrel ($(date))" # if we are creating a source-only package, go no further if (( SOURCEONLY )); then - if [[ -f $PKGDEST/${pkgbase}-${pkgver}-${pkgrel}${SRCEXT} ]] \ + if [[ -f $SRCPKGDEST/${pkgbase}-${pkgver}-${pkgrel}${SRCEXT} ]] \ && (( ! FORCE )); then error "$(gettext "A source package has already been built. (use -f to overwrite)")" exit 1 -- 1.6.6
2010/1/20 Nezmer <git@nezmer.info>:
Introduce $SRCPKGDEST to define a destination dir for source packages instead of saving them in $PKGDEST with binary packages.
The simple patch doesn't break old behavior.
Signed-off-by: Nezmer <git@nezmer.info> --- etc/makepkg.conf.in | 2 ++ scripts/makepkg.sh.in | 7 +++++-- 2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/etc/makepkg.conf.in b/etc/makepkg.conf.in index 3a3a415..b92a697 100644 --- a/etc/makepkg.conf.in +++ b/etc/makepkg.conf.in @@ -91,6 +91,8 @@ PURGE_TARGETS=(usr/{,share}/info/dir .packlist *.pod) #PKGDEST=/home/packages #-- Source cache: specify a fixed directory where source files will be cached #SRCDEST=/home/sources +#-- Source packages: specify a fixed directory where all src packages will be placed +#SRCPKGDEST=/home/srcpackages #-- Packager: name/email of the person or organization building packages #PACKAGER="John Doe <john@doe.com>"
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index 5bbd880..5bd294c 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -1108,7 +1108,7 @@ create_srcpackage() { "$SRCEXT" ;; esac
- local pkg_file="$PKGDEST/${pkgbase}-${pkgver}-${pkgrel}${SRCEXT}" + local pkg_file="$SRCPKGDEST/${pkgbase}-${pkgver}-${pkgrel}${SRCEXT}"
# tar it up msg2 "$(gettext "Compressing source package...")" @@ -1575,6 +1575,7 @@ done #preserve environment variables _PKGDEST=${PKGDEST} _SRCDEST=${SRCDEST} +_SRCPKGDEST=${SRCPKGDEST}
# default config is makepkg.conf MAKEPKG_CONF=${MAKEPKG_CONF:-$confdir/makepkg.conf} @@ -1613,6 +1614,8 @@ PKGDEST=${_PKGDEST:-$PKGDEST} PKGDEST=${PKGDEST:-$startdir} #default to $startdir if undefined SRCDEST=${_SRCDEST:-$SRCDEST} SRCDEST=${SRCDEST:-$startdir} #default to $startdir if undefined +SRCPKGDEST=${_SRCPKGDEST:-$SRCPKGDEST} +SRCPKGDEST=${SRCPKGDEST:-$PKGDEST} #default to $PKGDEST if undefined
if (( HOLDVER )) && [[ -n $FORCE_VER ]]; then @@ -1838,7 +1841,7 @@ msg "$(gettext "Making package: %s")" "$pkgbase $pkgver-$pkgrel ($(date))"
# if we are creating a source-only package, go no further if (( SOURCEONLY )); then - if [[ -f $PKGDEST/${pkgbase}-${pkgver}-${pkgrel}${SRCEXT} ]] \ + if [[ -f $SRCPKGDEST/${pkgbase}-${pkgver}-${pkgrel}${SRCEXT} ]] \ && (( ! FORCE )); then error "$(gettext "A source package has already been built. (use -f to overwrite)")" exit 1 -- 1.6.6
I think this is one of the more helpful minority tweaks. It makes sense to have two different pkgdests for the two different pkg types. -- GPG/PGP ID: B42DDCAD
Nezmer wrote:
Introduce $SRCPKGDEST to define a destination dir for source packages instead of saving them in $PKGDEST with binary packages.
The simple patch doesn't break old behavior.
Signed-off-by: Nezmer <git@nezmer.info> --- etc/makepkg.conf.in | 2 ++ scripts/makepkg.sh.in | 7 +++++-- 2 files changed, 7 insertions(+), 2 deletions(-)
Without actually testing, the patch looks fine. For the record, we discussed this in http://bugs.archlinux.org/task/10559 and I think the general consensus was that if we got a patch then it would go in. Dan: opinions? Allan
On Tue, Jan 19, 2010 at 9:15 PM, Allan McRae <allan@archlinux.org> wrote:
Nezmer wrote:
Introduce $SRCPKGDEST to define a destination dir for source packages instead of saving them in $PKGDEST with binary packages.
The simple patch doesn't break old behavior.
Signed-off-by: Nezmer <git@nezmer.info> --- etc/makepkg.conf.in | 2 ++ scripts/makepkg.sh.in | 7 +++++-- 2 files changed, 7 insertions(+), 2 deletions(-)
Without actually testing, the patch looks fine.
For the record, we discussed this in http://bugs.archlinux.org/task/10559 and I think the general consensus was that if we got a patch then it would go in.
I had to make sure I didn't contradict a former answer and I found it. :) http://bugs.archlinux.org/task/10559#comment28946 So yeah, high level I'm fine with this, but haven't closely reviewed the patch yet. -Dan
On 01/19/2010 07:05 PM, Nezmer wrote:
Introduce $SRCPKGDEST to define a destination dir for source packages instead of saving them in $PKGDEST with binary packages.
The simple patch doesn't break old behavior.
Like it, but SRCPKGDEST should be mentioned in makepkg{,.conf} man pages. Maybe the patch can be based upon [1]. [1] http://projects.archlinux.org/users/allan/pacman.git/commit/?h=working&id=31f5ac58f150393b84140484e1a952021fdc5de8
On Wed, Jan 20, 2010 at 03:34:01PM +0100, Cedric Staniewski wrote:
On 01/19/2010 07:05 PM, Nezmer wrote:
Introduce $SRCPKGDEST to define a destination dir for source packages instead of saving them in $PKGDEST with binary packages.
The simple patch doesn't break old behavior.
Like it, but SRCPKGDEST should be mentioned in makepkg{,.conf} man pages. Maybe the patch can be based upon [1].
Patch on its way
participants (6)
-
Allan McRae
-
Cedric Staniewski
-
Dan McGee
-
Nezmer
-
Nezmer
-
Ray Rashif