Verified Commit b862bca8 authored by Eli Schwartz's avatar Eli Schwartz Committed by Morten Linderud
Browse files

wip: add support for debug packages

parent 998155b1
......@@ -249,6 +249,14 @@ getpkgarch() {
echo "$_ver"
}
is_debug_package() {
local pkgfile=${1}
local pkgbase="$(getpkgbase "${pkgfile}")"
local pkgname="$(getpkgname "${pkgfile}")"
[[ ${pkgbase}-debug = ${pkgname} ]]
}
check_packager() {
local _packager
......@@ -325,7 +333,7 @@ check_pkgvcs() {
read -ra vcsnames <<<"${vcsnames}"
[[ "${vcsver}" = "${_pkgver}" ]] || return 1
in_array "${_pkgname}" "${vcsnames[@]}" || return 1
in_array "${_pkgname}" "${vcsnames[@]}" "${_pkgbase}-debug" || return 1
return 0
}
......@@ -349,6 +357,7 @@ check_splitpkgs() {
# not a split package
(( ${#vcsnames[@]} > 1 )) || continue
[[ ${_pkgbase}-debug = ${_pkgname} ]] && continue
mkdir -p "${repo}/${_pkgarch}/${_pkgbase}"
echo "${_pkgname}" >> "${repo}/${_pkgarch}/${_pkgbase}/staging"
......
......@@ -82,28 +82,45 @@ for repo in "${repos[@]}"; do
any_pkgs=($(getpkgfiles "${STAGING}/${repo}/"*-any${PKGEXTS} 2>/dev/null))
for pkgarch in "${ARCHES[@]}"; do
add_pkgs=()
debug_pkgs=()
arch_pkgs=($(getpkgfiles "${STAGING}/${repo}/"*"-${pkgarch}"${PKGEXTS} 2>/dev/null))
for pkg in "${arch_pkgs[@]}" "${any_pkgs[@]}"; do
pkgfile="${pkg##*/}"
if is_debug_package "${pkg}"; then
debug_pkgs+=("${pkgfile}")
currentpool=${PKGPOOL}-debug
currentrepo=${repo}-debug
else
add_pkgs+=("${pkgfile}")
currentpool=${PKGPOOL}
currentrepo=${repo}
fi
msg2 '%s (%s)' "$pkgfile" "$pkgarch"
# any packages might have been moved by the previous run
if [[ -f ${pkg} ]]; then
mv "${pkg}" "$FTP_BASE/${PKGPOOL}"
mv "${pkg}" "$FTP_BASE/${currentpool}"
fi
ln -s "../../../${PKGPOOL}/${pkgfile}" "$FTP_BASE/$repo/os/${pkgarch}"
ln -s "../../../${currentpool}/${pkgfile}" "$FTP_BASE/${currentrepo}/os/${pkgarch}"
# also move signatures
if [[ -f ${pkg}.sig ]]; then
mv "${pkg}.sig" "$FTP_BASE/${PKGPOOL}"
mv "${pkg}.sig" "$FTP_BASE/${currentpool}"
fi
"$(dirname "$(readlink -e "${BASH_SOURCE[0]}")")/db-archive" "${FTP_BASE}/${PKGPOOL}/${pkg##*/}"
if [[ -f $FTP_BASE/${PKGPOOL}/${pkgfile}.sig ]]; then
ln -s "../../../${PKGPOOL}/${pkgfile}.sig" "$FTP_BASE/$repo/os/${pkgarch}"
if [[ ${PKGPOOL} = ${currentpool} ]]; then
# do not archive debug info, this is not of historic interest
"$(dirname "$(readlink -e "${BASH_SOURCE[0]}")")/db-archive" "${FTP_BASE}/${PKGPOOL}/${pkg##*/}"
fi
if [[ -f $FTP_BASE/${currentpool}/${pkgfile}.sig ]]; then
ln -s "../../../${currentpool}/${pkgfile}.sig" "$FTP_BASE/${currentrepo}/os/${pkgarch}"
fi
add_pkgs+=("${pkgfile}")
done
if (( ${#add_pkgs[@]} >= 1 )); then
arch_repo_modify add "${repo}" "${pkgarch}" "${add_pkgs[@]}"
fi
if (( ${#debug_pkgs[@]} >= 1 )); then
arch_repo_modify add "${repo}-debug" "${pkgarch}" ${debug_pkgs[@]}
fi
done
done
......
......@@ -121,9 +121,9 @@ eot
mkdir -p "${TMP}/"{ftp,tmp,staging,{package,source}-cleanup,svn-packages-{copy,repo}}
for r in ${PKGREPOS[@]}; do
mkdir -p "${TMP}/staging/${r}"
mkdir -p "${TMP}"/staging/${r}{,-debug}
for a in ${ARCHES[@]}; do
mkdir -p "${TMP}/ftp/${r}/os/${a}"
mkdir -p "${TMP}"/ftp/${r}{,-debug}/os/${a}
done
done
mkdir -p "${TMP}/ftp/${PKGPOOL}"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment