makepkg: repackage rework with package functions
When using the optional package() function or split packages, the entire packaging step is rerun instead of just final package creation step. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
parent
5bc23bc05d
commit
fba5771fa4
1 changed files with 28 additions and 20 deletions
|
@ -67,6 +67,7 @@ LOGGING=0
|
||||||
SOURCEONLY=0
|
SOURCEONLY=0
|
||||||
IGNOREARCH=0
|
IGNOREARCH=0
|
||||||
HOLDVER=0
|
HOLDVER=0
|
||||||
|
PKGFUNC=0
|
||||||
SPLITPKG=0
|
SPLITPKG=0
|
||||||
|
|
||||||
# Forces the pkgver of the current PKGBUILD. Used by the fakeroot call
|
# Forces the pkgver of the current PKGBUILD. Used by the fakeroot call
|
||||||
|
@ -1526,8 +1527,8 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# check for sudo if we will need it during makepkg execution
|
# check for sudo if we will need it during makepkg execution
|
||||||
if [ "$ASROOT" = "0" -a \( "$DEP_BIN" = "1" \
|
if [ "$ASROOT" = "0" \
|
||||||
-o "$RMDEPS" = "1" -o "$INSTALL" = "1" \) ]; then
|
-a \( "$DEP_BIN" = "1" -o "$RMDEPS" = "1" -o "$INSTALL" = "1" \) ]; then
|
||||||
if [ ! "$(type -p sudo)" ]; then
|
if [ ! "$(type -p sudo)" ]; then
|
||||||
error "$(gettext "Cannot find the sudo binary! Is sudo installed?")"
|
error "$(gettext "Cannot find the sudo binary! Is sudo installed?")"
|
||||||
plain "$(gettext "Missing dependencies cannot be installed or removed as a normal user")"
|
plain "$(gettext "Missing dependencies cannot be installed or removed as a normal user")"
|
||||||
|
@ -1566,6 +1567,10 @@ if [ "$GENINTEG" = "1" ]; then
|
||||||
exit 0 # $E_OK
|
exit 0 # $E_OK
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ "$(type -t package)" == "function" ]; then
|
||||||
|
PKGFUNC=1
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "${#pkgname[@]}" -gt "1" ]; then
|
if [ "${#pkgname[@]}" -gt "1" ]; then
|
||||||
SPLITPKG=1
|
SPLITPKG=1
|
||||||
fi
|
fi
|
||||||
|
@ -1659,12 +1664,12 @@ fi
|
||||||
# Run the bare minimum in fakeroot
|
# Run the bare minimum in fakeroot
|
||||||
if [ "$INFAKEROOT" = "1" ]; then
|
if [ "$INFAKEROOT" = "1" ]; then
|
||||||
if [ "$SPLITPKG" = "0" ]; then
|
if [ "$SPLITPKG" = "0" ]; then
|
||||||
if [ "$REPKG" = "0" ]; then
|
if [ "$PKGFUNC" = "0" ]; then
|
||||||
if [ "$(type -t package)" != "function" ]; then
|
if [ "$REPKG" = "0" ]; then
|
||||||
run_build
|
run_build
|
||||||
else
|
|
||||||
run_package
|
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
run_package
|
||||||
tidy_install
|
tidy_install
|
||||||
fi
|
fi
|
||||||
create_package
|
create_package
|
||||||
|
@ -1740,10 +1745,13 @@ if [ "$NOEXTRACT" = "1" ]; then
|
||||||
plain "$(gettext "Aborting...")"
|
plain "$(gettext "Aborting...")"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
elif [ "$REPKG" = "1" -a \( ! -d "$pkgdir" -o "$(ls "$pkgdir" 2>/dev/null)" = "" \) ]; then
|
elif [ "$REPKG" = "1" ]; then
|
||||||
error "$(gettext "The package directory is empty, there is nothing to repackage!")"
|
if [ "$PKGFUNC" = "0" -a "$SPLITPKG" = "0" \
|
||||||
plain "$(gettext "Aborting...")"
|
-a \( ! -d "$pkgdir" -o "$(ls "$pkgdir" 2>/dev/null)" = "" \) ]; then
|
||||||
exit 1
|
error "$(gettext "The package directory is empty, there is nothing to repackage!")"
|
||||||
|
plain "$(gettext "Aborting...")"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
download_sources
|
download_sources
|
||||||
check_checksums
|
check_checksums
|
||||||
|
@ -1755,7 +1763,7 @@ if [ "$NOBUILD" = "1" ]; then
|
||||||
exit 0 #E_OK
|
exit 0 #E_OK
|
||||||
else
|
else
|
||||||
# check for existing pkg directory; don't remove if we are repackaging
|
# check for existing pkg directory; don't remove if we are repackaging
|
||||||
if [ -d "$pkgdir" -a "$REPKG" = "0" ]; then
|
if [ -d "$pkgdir" -a \( "$REPKG" = "0" -o "$PKGFUNC" = "1" -o "$SPLITPKG" = "1" \) ]; then
|
||||||
msg "$(gettext "Removing existing pkg/ directory...")"
|
msg "$(gettext "Removing existing pkg/ directory...")"
|
||||||
rm -rf "$pkgdir"
|
rm -rf "$pkgdir"
|
||||||
fi
|
fi
|
||||||
|
@ -1764,19 +1772,19 @@ else
|
||||||
|
|
||||||
# if we are root or if fakeroot is not enabled, then we don't use it
|
# if we are root or if fakeroot is not enabled, then we don't use it
|
||||||
if [ "$(check_buildenv fakeroot)" != "y" -o $EUID -eq 0 ]; then
|
if [ "$(check_buildenv fakeroot)" != "y" -o $EUID -eq 0 ]; then
|
||||||
|
if [ "$REPKG" = "0" ]; then
|
||||||
|
devel_update
|
||||||
|
run_build
|
||||||
|
fi
|
||||||
if [ "$SPLITPKG" = "0" ]; then
|
if [ "$SPLITPKG" = "0" ]; then
|
||||||
if [ "$REPKG" = "0" ]; then
|
if [ "$PKGFUNC" = "1" ]; then
|
||||||
devel_update
|
run_package
|
||||||
run_build
|
tidy_install
|
||||||
if [ "$(type -t package)" == "function" ]; then
|
elif [ "$REPKG" = "0" ]; then
|
||||||
run_package
|
|
||||||
fi
|
|
||||||
tidy_install
|
tidy_install
|
||||||
fi
|
fi
|
||||||
create_package
|
create_package
|
||||||
else
|
else
|
||||||
devel_update
|
|
||||||
run_build
|
|
||||||
for pkg in ${pkgname[@]}; do
|
for pkg in ${pkgname[@]}; do
|
||||||
pkgdir="$pkgdir/$pkg"
|
pkgdir="$pkgdir/$pkg"
|
||||||
mkdir -p "$pkgdir"
|
mkdir -p "$pkgdir"
|
||||||
|
@ -1789,7 +1797,7 @@ else
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
if [ "$(type -t package)" == "function" -o "$SPLITPKG" = "1" ]; then
|
if [ "$REPKG" = "0" -a \( "$PKGFUNC" == "1" -o "$SPLITPKG" = "1" \) ]; then
|
||||||
devel_update
|
devel_update
|
||||||
run_build
|
run_build
|
||||||
cd "$startdir"
|
cd "$startdir"
|
||||||
|
|
Loading…
Add table
Reference in a new issue