2016-03-21 16:49:56 +01:00
|
|
|
# vim: set ts=4 sw=4 et:
|
|
|
|
|
|
|
|
consistency_check_existing () {
|
|
|
|
while IFS=" " read -r dep origname deplabel; do
|
|
|
|
[ -f "$XBPS_SRCPKGDIR/$dep/template" ] && continue
|
|
|
|
case "$deplabel" in
|
2017-02-23 22:03:31 +01:00
|
|
|
makedepends|hostmakedepends|checkdepends)
|
2016-03-21 16:49:56 +01:00
|
|
|
msg_warn "unsatisfied $deplabel in $origname: $dep does not exist\n";
|
|
|
|
;;
|
|
|
|
*) printf "%s %s %s\n" "$dep" "$origname" "$deplabel" ;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
consistency_convert_pkgname () {
|
|
|
|
local origname= pkgname version= revision=
|
|
|
|
while IFS=" " read -r dep origname deplabel; do
|
|
|
|
case "$deplabel" in
|
2017-02-23 22:03:31 +01:00
|
|
|
makedepends|hostmakedepends|checkdepends)
|
2016-03-21 16:49:56 +01:00
|
|
|
printf "%s %s %s\n" "$dep" "$origname" "$deplabel"
|
|
|
|
continue
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
case "$dep" in
|
2023-01-30 15:34:51 +01:00
|
|
|
*\<*|*\>*|*=*)
|
2016-03-21 16:49:56 +01:00
|
|
|
printf "%s %s %s\n" "$dep" "$origname" "$deplabel"
|
|
|
|
continue
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
if pkgname=$(xbps-uhelper getpkgname "$dep" 2> /dev/null) && \
|
|
|
|
version=$(xbps-uhelper getpkgversion "$dep" 2> /dev/null) && \
|
|
|
|
revision=$(xbps-uhelper getpkgrevision "$dep" 2> /dev/null); then
|
|
|
|
printf "%s %s %s\n" "${pkgname}>=${version}_${revision}" "$origname" "$deplabel"
|
|
|
|
else
|
|
|
|
printf "%s %s %s\n" "$dep>=0" "$origname" "$deplabel"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
consistency_check_smart () {
|
|
|
|
local pkgname= depdef= dep=
|
|
|
|
while IFS=" " read -r depdef origname deplabel; do
|
|
|
|
case "$deplabel" in
|
2017-02-23 22:03:31 +01:00
|
|
|
makedepends|hostmakedepends|checkdepends)
|
2016-03-21 16:49:56 +01:00
|
|
|
printf "%s %s %s\n" "$depdef" "$origname" "$deplabel"
|
|
|
|
continue
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
dep=$(xbps-uhelper getpkgdepname "$depdef")
|
|
|
|
|
|
|
|
if [ ! -f "$XBPS_SRCPKGDIR/$dep/template" ]; then
|
|
|
|
msg_warn "unsatisfied $deplabel in $origname: $dep does not exist\n";
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
(
|
|
|
|
XBPS_TARGET_PKG=$dep
|
|
|
|
read_pkg
|
2019-01-18 18:08:51 +01:00
|
|
|
xbps-uhelper pkgmatch "$depdef" "${pkgname}-${version}_${revision}" && return
|
2016-03-21 16:49:56 +01:00
|
|
|
msg_red "unsatisfied $deplabel in $origname: $dep is $version, but required is $depdef\n";
|
|
|
|
)
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
consistency_check() {
|
|
|
|
local pkg= pkgname=
|
|
|
|
for pkg in "$XBPS_SRCPKGDIR"/*/template; do
|
2019-04-14 14:31:37 +02:00
|
|
|
pkg=${pkg%/*}
|
2019-04-13 22:45:35 +02:00
|
|
|
XBPS_TARGET_PKG=${pkg##*/}
|
2016-03-21 16:49:56 +01:00
|
|
|
(
|
|
|
|
read_pkg
|
|
|
|
[ "$depends" ] && printf "%s $pkgname depends\n" $depends
|
|
|
|
[ "$conflicts" ] && printf "%s $pkgname conflicts\n" $conflicts
|
2019-01-18 18:08:51 +01:00
|
|
|
[ -L "$XBPS_SRCPKGDIR/$XBPS_TARGET_PKG" ] && return
|
2016-03-21 16:49:56 +01:00
|
|
|
[ "$makedepends" ] && printf "%s $pkgname makedepends\n" $makedepends
|
|
|
|
[ "$hostmakedepends" ] && printf "%s $pkgname hostmakedepends\n" $hostmakedepends
|
2017-02-23 22:03:31 +01:00
|
|
|
[ "$checkdepends" ] && printf "%s $pkgname checkdepends\n" $checkdepends
|
2016-03-21 16:49:56 +01:00
|
|
|
)
|
|
|
|
done | grep -v "^virtual?" | sed "s/^[^ ]*?//" | consistency_check_existing | \
|
|
|
|
consistency_convert_pkgname | consistency_check_smart
|
|
|
|
}
|