1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-12-23 00:08:50 -05:00

While trying to change the number of missing deps output by makepkg, I noticed

some needless complication in a few of these functions (checkdeps required
stderr output due to the way it was called/used) so that's all cleaned up now.
Also, makepkg no longer outputs a single dep when they are missing, it lists all
at once, including makedeps
This commit is contained in:
Aaron Griffin 2007-02-14 05:52:49 +00:00
parent 98db5dcc23
commit 7e9fdfd44e

View File

@ -182,32 +182,15 @@ checkdeps() {
[ $# -gt 0 ] || return [ $# -gt 0 ] || return
missdep=$(pacman $PACMAN_OPTS -T $*) pmout=$(pacman $PACMAN_OPTS -T $*)
ret=$? ret=$?
if [ "$ret" != "0" ]; then if [ $ret -eq 127 ]; then #unresolved deps
if [ "$ret" = "127" ]; then #strip out the pacman prefix from "requires: xyz"
msg "Missing Dependencies:" echo $pmout | sed 's|requires:||g'
msg "" elif [ $ret -ne 0 ]; then
nl=0 error "pacman returned a fatal error ($ret): $pmout"
for dep in $missdep; do
echo -ne "$dep " >&2
if [ "$nl" = "1" ]; then
nl=0
echo -ne "\n" >&2
# add this dep to the list
depname=$(echo $dep | sed 's|=.*$||' | sed 's|>.*$||' | sed 's|<.*$||')
deplist="$deplist $depname"
continue
fi
nl=1
done
msg ""
else
error "pacman returned a fatal error."
exit 1 exit 1
fi fi
fi
echo $deplist
} }
handledeps() { handledeps() {
@ -302,6 +285,30 @@ handledeps() {
return $missingdeps return $missingdeps
} }
resolvedeps() {
deplist=$(checkdeps $*)
if [ -n "${deplist}" ]; then
handledeps $deplist
if [ $? -eq 0 ]; then
# check deps again to make sure they were resolved
deplist=$(checkdeps ${depends[@]})
if [ -n "${deplist}" ]; then
error "Failed to install missing dependencies."
fi
fi
fi
if [ -n "${deplist}" ]; then
msg "Missing Dependencies:"
for dep in ${deplist}; do
msg2 "${dep}"
done
return 1
else
return 0
fi
}
# fix flyspray bug #5923 # fix flyspray bug #5923
removedeps() { removedeps() {
if [ "$RMDEPS" = "1" -a "$SUDO" = "1" -a \( ! -z "$deplist" -o ! -z "$makedeplist" \) ]; then if [ "$RMDEPS" = "1" -a "$SUDO" = "1" -a \( ! -z "$deplist" -o ! -z "$makedeplist" \) ]; then
@ -591,22 +598,22 @@ if [ "$NODEPS" = "1" -o "$GENINTEG" = "1" -o "$NOBUILD" = "1" -o "$REPKG" = "1"
fi fi
# skip printing a warning message for the others: geninteg, nobuild, repkg # skip printing a warning message for the others: geninteg, nobuild, repkg
elif [ $(type -p pacman) ]; then elif [ $(type -p pacman) ]; then
deperr=0
msg "Checking Runtime Dependencies..." msg "Checking Runtime Dependencies..."
deplist=$(checkdeps ${depends[@]}) resolvedeps ${depends[@]}
handledeps $deplist if [ $? -ne 0 ]; then
if [ $? -gt 0 ]; then deperr=1
exit 1
fi
# check deps again to make sure they were resolved
deplist=$(checkdeps ${depends[@]})
if [ ! -z "$deplist" ]; then
error "Failed to install missing dependencies."
exit 1
fi fi
msg "Checking Buildtime Dependencies..." msg "Checking Buildtime Dependencies..."
makedeplist=$(checkdeps ${makedepends[@]}) resolvedeps ${makedepends[@]}
handledeps $makedeplist if [ $? -ne 0 ]; then
if [ $? -gt 0 ]; then deperr=1
fi
if [ $deperr -eq 1 ]; then
error "could not resolve all dependencies."
exit 1 exit 1
fi fi
else else