mirror of
https://gitlab.archlinux.org/archlinux/devtools.git
synced 2025-09-13 09:56:18 +02:00
Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
17e875f6b3 | ||
![]() |
a7c5010d24 | ||
![]() |
f72775feac |
20
commitpkg
20
commitpkg
@@ -5,6 +5,17 @@ abort() {
|
||||
exit 1
|
||||
}
|
||||
|
||||
getpkgfile() {
|
||||
if [[ ${#} -ne 1 ]]; then
|
||||
echo 'ERROR: No canonical package found!' >&2
|
||||
exit 1
|
||||
elif [ ! -f "${1}" ]; then
|
||||
echo "ERROR: Package ${1} not found!" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo ${1}
|
||||
}
|
||||
|
||||
# Source makepkg.conf; fail if it is not found
|
||||
if [ -r '/etc/makepkg.conf' ]; then
|
||||
@@ -74,11 +85,12 @@ echo 'done'
|
||||
|
||||
for _arch in ${arch[@]}; do
|
||||
for _pkgname in ${pkgname[@]}; do
|
||||
pkgfile=$_pkgname-$pkgver-$pkgrel-${_arch}$PKGEXT
|
||||
pkgfile=$(getpkgfile "$_pkgname-$pkgver-$pkgrel-${_arch}".pkg.tar.* 2>/dev/null)
|
||||
pkgdestfile=$(getpkgfile "$PKGDEST/$_pkgname-$pkgver-$pkgrel-${_arch}".pkg.tar.* 2>/dev/null)
|
||||
|
||||
if [ ! -f $pkgfile -a -f "$PKGDEST/$pkgfile" ]; then
|
||||
pkgfile="$PKGDEST/$pkgfile"
|
||||
elif [ ! -f $pkgfile ]; then
|
||||
if [ ! -f "$pkgfile" -a -f "$pkgdestfile" ]; then
|
||||
pkgfile="$pkgdestfile"
|
||||
elif [ ! -f "$pkgfile" ]; then
|
||||
echo "skipping ${_arch}"
|
||||
continue 2
|
||||
fi
|
||||
|
@@ -196,14 +196,14 @@ cd /build
|
||||
export HOME=/build
|
||||
sudo -u nobody makepkg $MAKEPKG_ARGS || touch BUILD_FAILED
|
||||
[ -f BUILD_FAILED ] && exit 1
|
||||
which namcap &>/dev/null && namcap /build/PKGBUILD /pkgdest/*${PKGEXT} > /pkgdest/namcap.log
|
||||
which namcap &>/dev/null && namcap /build/PKGBUILD /pkgdest/*.pkg.tar.* > /pkgdest/namcap.log
|
||||
exit 0
|
||||
EOF
|
||||
) > "$copydir/chrootbuild"
|
||||
chmod +x "$copydir/chrootbuild"
|
||||
|
||||
if mkarchroot -r "/chrootbuild" "$copydir"; then
|
||||
for pkgfile in "${copydir}"/pkgdest/*${PKGEXT}; do
|
||||
for pkgfile in "${copydir}"/pkgdest/*.pkg.tar.*; do
|
||||
[ -e "$pkgfile" ] || continue
|
||||
_pkgname=$(basename "$pkgfile")
|
||||
if [ "$add_to_db" -eq "1" ]; then
|
||||
@@ -221,15 +221,6 @@ if mkarchroot -r "/chrootbuild" "$copydir"; then
|
||||
fi
|
||||
done
|
||||
|
||||
for f in "${copydir}"/srcdest/*; do
|
||||
[ -e "$f" ] || continue
|
||||
if [ -d "$SRCDEST" ]; then
|
||||
mv "$f" "${SRCDEST}"
|
||||
else
|
||||
mv "$f" "${WORKDIR}"
|
||||
fi
|
||||
done
|
||||
|
||||
for l in "${copydir}"/build/*-{build,package}.log; do
|
||||
[ -f "$l" ] && mv "$l" "${WORKDIR}"
|
||||
done
|
||||
@@ -238,6 +229,15 @@ else
|
||||
touch "${copydir}/build/BUILD_FAILED"
|
||||
fi
|
||||
|
||||
for f in "${copydir}"/srcdest/*; do
|
||||
[ -e "$f" ] || continue
|
||||
if [ -d "$SRCDEST" ]; then
|
||||
mv "$f" "${SRCDEST}"
|
||||
else
|
||||
mv "$f" "${WORKDIR}"
|
||||
fi
|
||||
done
|
||||
|
||||
if [ -e "${copydir}/build/BUILD_FAILED" ]; then
|
||||
echo "Build failed, check $copydir/build"
|
||||
rm "${copydir}/build/BUILD_FAILED"
|
||||
|
Reference in New Issue
Block a user