[pacman-dev] CVS update of pacman-lib (4 files)
Date: Friday, February 23, 2007 @ 14:51:25 Author: dan Path: /home/cvs-pacman/pacman-lib Modified: doc/PKGBUILD.5 (1.8 -> 1.9) doc/makepkg.8 (1.7 -> 1.8) doc/makepkg.conf.5 (1.3 -> 1.4) scripts/makepkg (1.50 -> 1.51) Implementing feature request: <http://bugs.archlinux.org/task/4706> * Added these three possible options (or !options, more likely), to the PKGBUILD possibilities: - ccache - distcc - makeflags * Removed the --noccache and -j flags from makepkg as their functionality is better used by adding the above options to a PKGBUILD- keep the functionality where it is needed. Testing would be appreciated, I didn't do much of that yet. --------------------+ doc/PKGBUILD.5 | 20 +++++++++++++++++--- doc/makepkg.8 | 8 -------- doc/makepkg.conf.5 | 3 +-- scripts/makepkg | 34 +++++++++++++++++++--------------- 4 files changed, 37 insertions(+), 28 deletions(-) Index: pacman-lib/doc/PKGBUILD.5 diff -u pacman-lib/doc/PKGBUILD.5:1.8 pacman-lib/doc/PKGBUILD.5:1.9 --- pacman-lib/doc/PKGBUILD.5:1.8 Thu Feb 22 22:23:07 2007 +++ pacman-lib/doc/PKGBUILD.5 Fri Feb 23 14:51:24 2007 @@ -59,7 +59,7 @@ Specifies a special install script that is to be included in the package. This file should reside in the same directory as the \fB\*(PB\fP, and will be copied into the package by \fBmakepkg\fP. It does not need to be included in the -\fIsource\fP array. (e.g. \fBinstall=pkgname.install\fP) +\fIsource\fP array (e.g. \fBinstall=pkgname.install\fP). .TP .B source \fI(array)\fP @@ -99,8 +99,8 @@ .TP .B arch \fI(array)\fP -Defines on which architectures the given package is available. (e.g. -\fBarch=('i686' 'x86_64')\fP) +Defines on which architectures the given package is available (e.g. +\fBarch=('i686' 'x86_64')\fP). .TP .B backup \fI(array)\fP @@ -166,6 +166,20 @@ .B emptydirs Leave empty directories in packages. .TP +.B ccache +Allow the use of \fBccache\fP during build. More useful in its negative form +"!ccache" with select packages that have problems building with \fBccache\fP. +.TP +.B distcc +Allow the use of \fBdistcc\fP during build. More useful in its negative form +"!distcc" with select packages that have problems building with \fBdistcc\fP. +.TP +.B makeflags +Allow the use of user-specific makeflags during build as specified in +\fBmakepkg.conf\fP. More useful in its negative form "!makeflags" with select +packages that have problems building with custom makeflags such as "-j2" (or +higher). +.TP .B force Force the package to be upgraded by a \fBpacman\fP system upgrade operation, even if the version number would normally not trigger such an upgrade. This is Index: pacman-lib/doc/makepkg.8 diff -u pacman-lib/doc/makepkg.8:1.7 pacman-lib/doc/makepkg.8:1.8 --- pacman-lib/doc/makepkg.8:1.7 Thu Feb 22 22:23:07 2007 +++ pacman-lib/doc/makepkg.8 Fri Feb 23 14:51:24 2007 @@ -32,10 +32,6 @@ them it will call \fBmakepkg\fP to build and install the missing dependencies. The child calls will be made with the \fB-b\fP and \fB-i\fP options. .TP -.B \-B, --noccache -Disable the use of \fBccache\fP during build (useful for select packages that -have problems with \fBccache\fP). -.TP .B \-c, --clean Clean up leftover work files and directories after a successful build. .TP @@ -72,10 +68,6 @@ .B \-i, --install Install or upgrade the package after a successful build using \fBpacman\fP. .TP -.B \-j \fIjobs\fP -Sets MAKEFLAGS="-j\fIjobs\fP" before building the package. This is useful for -overriding the \fIMAKEFLAGS\fP setting in \fBmakepkg.conf\fP. -.TP .B \-m, --nocolor Disable color in output messages. .TP Index: pacman-lib/doc/makepkg.conf.5 diff -u pacman-lib/doc/makepkg.conf.5:1.3 pacman-lib/doc/makepkg.conf.5:1.4 --- pacman-lib/doc/makepkg.conf.5:1.3 Thu Feb 22 22:23:07 2007 +++ pacman-lib/doc/makepkg.conf.5 Fri Feb 23 14:51:24 2007 @@ -68,8 +68,7 @@ .B ccache Use ccache to cache compilation by default. This allows for faster compiles if you are continuously recompiling the same packages. It can be disabled for -individual packages by passing the \fB-B\fP or \fB--noccache\fP flag to -\fBmakepkg\fP. +individual packages by placing \fB!ccache\fP in the \fB\*(PB\fP options array. .RE .TP .B DISTCC_HOSTS="\fIhost1 ...\fP" Index: pacman-lib/scripts/makepkg diff -u pacman-lib/scripts/makepkg:1.50 pacman-lib/scripts/makepkg:1.51 --- pacman-lib/scripts/makepkg:1.50 Wed Feb 14 00:52:49 2007 +++ pacman-lib/scripts/makepkg Fri Feb 23 14:51:25 2007 @@ -356,7 +356,6 @@ echo echo "Options:" echo " -b, --builddeps Build missing dependencies from source" - echo " -B, --noccache Do not use ccache during build" echo " -c, --clean Clean up work files after build" echo " -C, --cleancache Clean up source files from the cache" echo " -d, --nodeps Skip all dependency checks" @@ -365,7 +364,6 @@ echo " -g, --geninteg Generate integrity checks for source files" echo " -h, --help This help" echo " -i, --install Install package after successful build" - echo " -j <jobs> Set MAKEFLAGS to \"-j<jobs>\" before building" echo " -L, --log Log package build process" echo " -m, --nocolor Disable colorized output messages" echo " -o, --nobuild Download and extract files only" @@ -421,7 +419,6 @@ --syncdeps) DEP_BIN=1 ;; --usesudo) SUDO=1 ;; --builddeps) DEP_SRC=1 ;; - --noccache) USE_CCACHE="n" ;; --nodeps) NODEPS=1 ;; --noextract) NOEXTRACT=1 ;; --install) INSTALL=1 ;; @@ -441,10 +438,9 @@ exit 1 ;; -*) - while getopts "bBcCdefghij:Lmop:rRsS-" opt; do + while getopts "bcCdefghiLmop:rRsS-" opt; do case $opt in b) DEP_SRC=1 ;; - B) USE_CCACHE="n" ;; c) CLEANUP=1 ;; C) CLEANCACHE=1 ;; d) NODEPS=1 ;; @@ -456,7 +452,6 @@ exit 0 ;; i) INSTALL=1 ;; - j) export MAKEFLAGS="-j$OPTARG" ;; L) LOGGING=1 ;; m) USE_COLOR="n" ;; o) NOBUILD=1 ;; @@ -524,7 +519,7 @@ source $BUILDSCRIPT -# check for no-no's +# check for no-no's in the build script if [ -z "$pkgver" ]; then error "pkgver is not allowed to be empty." exit 1 @@ -553,7 +548,8 @@ exit 1 fi -if [ -f $PKGDEST/${pkgname}-${pkgver}-${pkgrel}-${CARCH}.${PKGEXT} -a "$FORCE" = "0" -a "$GENINTEG" = "0" ]; then +if [ -f $PKGDEST/${pkgname}-${pkgver}-${pkgrel}-${CARCH}.${PKGEXT} + -a "$FORCE" = "0" -a "$GENINTEG" = "0" ]; then if [ "$INSTALL" = "1" ]; then warning "a package has already been built, installing existing package." installpackage @@ -564,8 +560,9 @@ fi fi -# Enter the fakeroot environment if necessary. This will call the makepkg script again -# as the fake root user. We detect this by passing a sentinel option (-F) to makepkg +# Enter the fakeroot environment if necessary. This will call the makepkg +# script again as the fake root user. We detect this by passing a sentinel +# option (-F) to makepkg. if [ "$EUID" != "0" ]; then if [ "$(check_buildenv fakeroot)" = "y" ]; then if [ $(type -p fakeroot) ]; then @@ -819,17 +816,24 @@ fi mkdir -p $startdir/pkg - # use distcc if requested - if [ "$(check_buildenv distcc)" = "y" ]; then + # use distcc if it is requested (check buildenv and PKGBUILD opts) + if [ "$(check_buildenv distcc)" = "y" -a "$(check_option distcc)" != "n" ]; then [ -d /usr/lib/distcc/bin ] && export PATH=/usr/lib/distcc/bin:$PATH + else if [ "$(check_option distcc)" = "n" ]; then + # if it is not wanted, clear the makeflags too + export MAKEFLAGS="" fi - # use ccache if it's available - # USE_CCACHE still here because it is a command line option - if [ ! "$USE_CCACHE" = "n" -a "$(check_buildenv ccache)" = "y" ]; then + # use ccache if it is requested (check buildenv and PKGBUILD opts) + if [ "$(check_buildenv ccache)" = "y" -a "$(check_option ccache)" != "n" ]; then [ -d /usr/lib/ccache/bin ] && export PATH=/usr/lib/ccache/bin:$PATH fi + # clear user-specified makeflags if requested + if [ "$(check_option makeflags)" = "n" ]; then + export MAKEFLAGS="" + fi + # build msg "Starting build()..."
participants (1)
-
Dan McGee