Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

kbuild: pacman-pkg: move common commands to a separate function

All build and package functions share the following commands:

export MAKEFLAGS="${KBUILD_MAKEFLAGS}"
cd "${objtree}"

Factor out the common code.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Acked-by:  Thomas Weißschuh <linux@weissschuh.net>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Reviewed-by: Christian Heusel <christian@heusel.eu>

+10 -7
+10 -7
scripts/package/PKGBUILD
··· 36 36 ) 37 37 options=(!debug !strip !buildflags !makeflags) 38 38 39 - build() { 39 + _prologue() { 40 40 # MAKEFLAGS from makepkg.conf override the ones inherited from kbuild. 41 41 # Bypass this override with a custom variable. 42 42 export MAKEFLAGS="${KBUILD_MAKEFLAGS}" 43 43 cd "${objtree}" 44 + } 45 + 46 + build() { 47 + _prologue 44 48 45 49 ${MAKE} KERNELRELEASE="${KERNELRELEASE}" KBUILD_BUILD_VERSION="${pkgrel}" 46 50 } ··· 52 48 _package() { 53 49 pkgdesc="The ${pkgdesc} kernel and modules" 54 50 55 - export MAKEFLAGS="${KBUILD_MAKEFLAGS}" 56 - cd "${objtree}" 57 51 local modulesdir="${pkgdir}/usr/${MODLIB}" 52 + 53 + _prologue 58 54 59 55 echo "Installing boot image..." 60 56 # systemd expects to find the kernel here to allow hibernation ··· 80 76 _package-headers() { 81 77 pkgdesc="Headers and scripts for building modules for the ${pkgdesc} kernel" 82 78 83 - export MAKEFLAGS="${KBUILD_MAKEFLAGS}" 84 - cd "${objtree}" 85 79 local builddir="${pkgdir}/usr/${MODLIB}/build" 80 + 81 + _prologue 86 82 87 83 if grep -q CONFIG_MODULES=y include/config/auto.conf; then 88 84 echo "Installing build files..." ··· 104 100 provides=(linux-api-headers) 105 101 conflicts=(linux-api-headers) 106 102 107 - export MAKEFLAGS="${KBUILD_MAKEFLAGS}" 108 - cd "${objtree}" 103 + _prologue 109 104 110 105 ${MAKE} headers_install INSTALL_HDR_PATH="${pkgdir}/usr" 111 106 }