mirror of
https://github.com/moparisthebest/pacman
synced 2025-01-08 12:28:00 -05:00
makepkg: add functions for backup and restore of package fields
Adds functions for the backup and restoration of package variables that can be over-ridden during package splitting. Variables which can be overridden are given in the splitpkg_overrides variable. Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
08034ceb17
commit
9804911c5f
@ -42,9 +42,12 @@ BUILDSCRIPT='@BUILDSCRIPT@'
|
|||||||
startdir="$PWD"
|
startdir="$PWD"
|
||||||
srcdir="$startdir/src"
|
srcdir="$startdir/src"
|
||||||
pkgdir="$startdir/pkg"
|
pkgdir="$startdir/pkg"
|
||||||
|
|
||||||
packaging_options=('strip' 'docs' 'libtool' 'emptydirs' 'zipman' 'purge')
|
packaging_options=('strip' 'docs' 'libtool' 'emptydirs' 'zipman' 'purge')
|
||||||
other_options=('ccache' 'distcc' 'makeflags' 'force')
|
other_options=('ccache' 'distcc' 'makeflags' 'force')
|
||||||
readonly -a packaging_options other_options
|
splitpkg_overrides=('pkgdesc' 'license' 'groups' 'depends' 'optdepends' 'provides' \
|
||||||
|
'conflicts' 'replaces' 'backup' 'options' 'install')
|
||||||
|
readonly -a packaging_options other_options splitpkg_overrides
|
||||||
|
|
||||||
# Options
|
# Options
|
||||||
ASROOT=0
|
ASROOT=0
|
||||||
@ -1179,6 +1182,24 @@ devel_update() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
backup_package_variables() {
|
||||||
|
for var in ${splitpkg_overrides[@]}; do
|
||||||
|
indirect="${var}_backup"
|
||||||
|
eval "${indirect}=\"${!var}\""
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
restore_package_variables() {
|
||||||
|
for var in ${splitpkg_overrides[@]}; do
|
||||||
|
indirect="${var}_backup"
|
||||||
|
if [ -n "${!indirect}" ]; then
|
||||||
|
eval "${var}=\"${!indirect}\""
|
||||||
|
else
|
||||||
|
unset ${var}
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
# getopt like parser
|
# getopt like parser
|
||||||
parse_options() {
|
parse_options() {
|
||||||
local short_options=$1; shift;
|
local short_options=$1; shift;
|
||||||
|
Loading…
Reference in New Issue
Block a user