mirror of
https://github.com/moparisthebest/pacman
synced 2024-08-13 17:03:46 -04:00
makepkg -g: use checksums defined in the pkgbuild
Signed-off-by: Xavier Chantry <shiningxc@gmail.com> [Allan: amend documentation] Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
parent
64c3255b0e
commit
79987c92cb
@ -81,10 +81,11 @@ Options
|
|||||||
|
|
||||||
*-g, \--geninteg*::
|
*-g, \--geninteg*::
|
||||||
For each source file in the source array of PKGBUILD, download the file
|
For each source file in the source array of PKGBUILD, download the file
|
||||||
if required and generate integrity checks. The integrity checks
|
if required and generate integrity checks. The integrity checks generated
|
||||||
generated are determined by the value of the INTEGRITY_CHECK array in
|
are determined by the checks present in the PKGBUILD, falling back to the
|
||||||
linkman:makepkg.conf[5]. This output can be redirected into your
|
value of the INTEGRITY_CHECK array in makepkg.conf(5) if these are absent
|
||||||
PKGBUILD for source validation using "`makepkg -g >> PKGBUILD`".
|
This output can be redirected into your PKGBUILD for source validation
|
||||||
|
using "`makepkg -g >> PKGBUILD`".
|
||||||
|
|
||||||
*--skipinteg*::
|
*--skipinteg*::
|
||||||
Do not fail when the PKGBUILD does not contain any integrity checks, just
|
Do not fail when the PKGBUILD does not contain any integrity checks, just
|
||||||
|
@ -497,6 +497,24 @@ download_sources() {
|
|||||||
popd &>/dev/null
|
popd &>/dev/null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get_integlist() {
|
||||||
|
local integ
|
||||||
|
local integlist=()
|
||||||
|
|
||||||
|
for integ in md5 sha1 sha256 sha384 sha512; do
|
||||||
|
local integrity_sums=($(eval echo "\${${integ}sums[@]}"))
|
||||||
|
if [[ -n "$integrity_sums" ]]; then
|
||||||
|
integlist=(${integlist[@]} $integ)
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
if (( ${#integlist[@]} > 0 )); then
|
||||||
|
echo ${integlist[@]}
|
||||||
|
else
|
||||||
|
echo ${INTEGRITY_CHECK[@]}
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
generate_checksums() {
|
generate_checksums() {
|
||||||
msg "$(gettext "Generating checksums for source files...")"
|
msg "$(gettext "Generating checksums for source files...")"
|
||||||
plain ""
|
plain ""
|
||||||
@ -506,8 +524,15 @@ generate_checksums() {
|
|||||||
exit 1 # $E_MISSING_PROGRAM
|
exit 1 # $E_MISSING_PROGRAM
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
local integlist
|
||||||
|
if (( $# == 0 )); then
|
||||||
|
integlist=$(get_integlist)
|
||||||
|
else
|
||||||
|
integlist=$@
|
||||||
|
fi
|
||||||
|
|
||||||
local integ
|
local integ
|
||||||
for integ in ${INTEGRITY_CHECK[@]}; do
|
for integ in ${integlist[@]}; do
|
||||||
integ="${integ,,}"
|
integ="${integ,,}"
|
||||||
case "$integ" in
|
case "$integ" in
|
||||||
md5|sha1|sha256|sha384|sha512) : ;;
|
md5|sha1|sha256|sha384|sha512) : ;;
|
||||||
|
Loading…
Reference in New Issue
Block a user