libmakepkg: move more functions for extracting information from PKGBIULDs
Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
15b6cecdd5
commit
23e3c48526
2 changed files with 46 additions and 46 deletions
|
@ -18,7 +18,7 @@
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#
|
#
|
||||||
|
|
||||||
[ -n "$LIBMAKEPKG_UTIL_PKGBUILD_SH" ] && return
|
[[ -n "$LIBMAKEPKG_UTIL_PKGBUILD_SH" ]] && return
|
||||||
LIBMAKEPKG_UTIL_PKGBUILD_SH=1
|
LIBMAKEPKG_UTIL_PKGBUILD_SH=1
|
||||||
|
|
||||||
|
|
||||||
|
@ -144,3 +144,48 @@ get_pkg_arch() {
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
print_all_package_names() {
|
||||||
|
local version=$(get_full_version)
|
||||||
|
local architecture pkg opts a
|
||||||
|
for pkg in ${pkgname[@]}; do
|
||||||
|
get_pkgbuild_attribute "$pkg" 'arch' 1 architecture
|
||||||
|
get_pkgbuild_attribute "$pkg" 'options' 1 opts
|
||||||
|
for a in ${architecture[@]}; do
|
||||||
|
printf "%s-%s-%s\n" "$pkg" "$version" "$a"
|
||||||
|
if in_opt_array "debug" ${opts[@]} && in_opt_array "strip" ${opts[@]}; then
|
||||||
|
printf "%s-%s-%s-%s\n" "$pkg" "@DEBUGSUFFIX@" "$version" "$a"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
get_all_sources() {
|
||||||
|
local aggregate l a
|
||||||
|
|
||||||
|
if array_build l 'source'; then
|
||||||
|
aggregate+=("${l[@]}")
|
||||||
|
fi
|
||||||
|
|
||||||
|
for a in "${arch[@]}"; do
|
||||||
|
if array_build l "source_$a"; then
|
||||||
|
aggregate+=("${l[@]}")
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
array_build "$1" "aggregate"
|
||||||
|
}
|
||||||
|
|
||||||
|
get_all_sources_for_arch() {
|
||||||
|
local aggregate l
|
||||||
|
|
||||||
|
if array_build l 'source'; then
|
||||||
|
aggregate+=("${l[@]}")
|
||||||
|
fi
|
||||||
|
|
||||||
|
if array_build l "source_$CARCH"; then
|
||||||
|
aggregate+=("${l[@]}")
|
||||||
|
fi
|
||||||
|
|
||||||
|
array_build "$1" "aggregate"
|
||||||
|
}
|
||||||
|
|
|
@ -739,36 +739,6 @@ extract_svn() {
|
||||||
cp -au "$dir" "$srcdir"
|
cp -au "$dir" "$srcdir"
|
||||||
}
|
}
|
||||||
|
|
||||||
get_all_sources() {
|
|
||||||
local aggregate l a
|
|
||||||
|
|
||||||
if array_build l 'source'; then
|
|
||||||
aggregate+=("${l[@]}")
|
|
||||||
fi
|
|
||||||
|
|
||||||
for a in "${arch[@]}"; do
|
|
||||||
if array_build l "source_$a"; then
|
|
||||||
aggregate+=("${l[@]}")
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
array_build "$1" "aggregate"
|
|
||||||
}
|
|
||||||
|
|
||||||
get_all_sources_for_arch() {
|
|
||||||
local aggregate l
|
|
||||||
|
|
||||||
if array_build l 'source'; then
|
|
||||||
aggregate+=("${l[@]}")
|
|
||||||
fi
|
|
||||||
|
|
||||||
if array_build l "source_$CARCH"; then
|
|
||||||
aggregate+=("${l[@]}")
|
|
||||||
fi
|
|
||||||
|
|
||||||
array_build "$1" "aggregate"
|
|
||||||
}
|
|
||||||
|
|
||||||
download_sources() {
|
download_sources() {
|
||||||
local netfile all_sources
|
local netfile all_sources
|
||||||
local get_source_fn=get_all_sources_for_arch get_vcs=1
|
local get_source_fn=get_all_sources_for_arch get_vcs=1
|
||||||
|
@ -2357,21 +2327,6 @@ run_split_packaging() {
|
||||||
pkgname=${pkgname_backup[@]}
|
pkgname=${pkgname_backup[@]}
|
||||||
}
|
}
|
||||||
|
|
||||||
print_all_package_names() {
|
|
||||||
local version=$(get_full_version)
|
|
||||||
local architecture pkg opts a
|
|
||||||
for pkg in ${pkgname[@]}; do
|
|
||||||
get_pkgbuild_attribute "$pkg" 'arch' 1 architecture
|
|
||||||
get_pkgbuild_attribute "$pkg" 'options' 1 opts
|
|
||||||
for a in ${architecture[@]}; do
|
|
||||||
printf "%s-%s-%s\n" "$pkg" "$version" "$a"
|
|
||||||
if in_opt_array "debug" ${opts[@]} && in_opt_array "strip" ${opts[@]}; then
|
|
||||||
printf "%s-%s-%s-%s\n" "$pkg" "@DEBUGSUFFIX@" "$version" "$a"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
m4_include(library/parseopts.sh)
|
m4_include(library/parseopts.sh)
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue