mirror of
https://github.com/moparisthebest/pacman
synced 2024-08-13 17:03:46 -04:00
makepkg: detect incorrect usage of provides array
Using > or < in the provides array is wrong so make it cause an error. Fixes FS#12540. Also, use bash substitution rather than spawning new processes where possible in the error checking. Move split package detection to a better position. Signed-off-by: Allan McRae <allan@archlinux.org> [Dan: backport to maint] Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
parent
f4651c49af
commit
2f59996c54
@ -160,7 +160,9 @@ name. The syntax is: `$$source=('filename::url')$$`
|
|||||||
depend on 'cron' rather than 'dcron OR fcron'.
|
depend on 'cron' rather than 'dcron OR fcron'.
|
||||||
Versioned provisions are also possible, in the 'name=version' format.
|
Versioned provisions are also possible, in the 'name=version' format.
|
||||||
For example, dcron can provide 'cron=2.0' to satisfy the 'cron>=2.0'
|
For example, dcron can provide 'cron=2.0' to satisfy the 'cron>=2.0'
|
||||||
dependency of other packages.
|
dependency of other packages. Provisions involving the '>' and '<'
|
||||||
|
operators are invalid as only specifc versions of a package may be
|
||||||
|
provided.
|
||||||
|
|
||||||
*replaces (array)*::
|
*replaces (array)*::
|
||||||
An array of packages that this package should replace, and can be used
|
An array of packages that this package should replace, and can be used
|
||||||
|
@ -1439,11 +1439,11 @@ if [ -z "$pkgrel" ]; then
|
|||||||
error "$(gettext "%s is not allowed to be empty.")" "pkgrel"
|
error "$(gettext "%s is not allowed to be empty.")" "pkgrel"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
if [ $(echo "$pkgver" | grep '-') ]; then
|
if [ "$pkgver" != "${pkgver//-/}" ]; then
|
||||||
error "$(gettext "%s is not allowed to contain hyphens.")" "pkgver"
|
error "$(gettext "%s is not allowed to contain hyphens.")" "pkgver"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
if [ $(echo "$pkgrel" | grep '-') ]; then
|
if [ "$pkgrel" != "${pkgrel//-/}" ]; then
|
||||||
error "$(gettext "%s is not allowed to contain hyphens.")" "pkgrel"
|
error "$(gettext "%s is not allowed to contain hyphens.")" "pkgrel"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@ -1465,6 +1465,14 @@ if ! in_array $CARCH ${arch[@]}; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
for provide in ${provides[@]}; do
|
||||||
|
if [ $provide != ${provide//</} -o $provide != ${provide//>/} ]; then
|
||||||
|
error "$(gettext "Provides array cannot contain comparison (< or >) operators.")"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
unset provide
|
||||||
|
|
||||||
if [ "$install" -a ! -f "$install" ]; then
|
if [ "$install" -a ! -f "$install" ]; then
|
||||||
error "$(gettext "Install scriptlet (%s) does not exist.")" "$install"
|
error "$(gettext "Install scriptlet (%s) does not exist.")" "$install"
|
||||||
exit 1
|
exit 1
|
||||||
|
Loading…
Reference in New Issue
Block a user