1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-08-13 17:03:46 -04:00

* integrity check looping - support multiple algorithms at once

This commit is contained in:
Aaron Griffin 2006-11-15 17:18:31 +00:00
parent 83f6d8de8c
commit 95358f7c5b

View File

@ -42,7 +42,7 @@ INSTALL=0
DOWNLOAD="" DOWNLOAD=""
KEEPDOCS=0 KEEPDOCS=0
NOBUILD=0 NOBUILD=0
NOCCACHE=0 USE_CCACHE=0
NODEPS=0 NODEPS=0
NOEXTRACT=0 NOEXTRACT=0
NOSTRIP=0 NOSTRIP=0
@ -309,7 +309,7 @@ while [ "$#" -ne "0" ]; do
--syncdeps) DEP_BIN=1 ;; --syncdeps) DEP_BIN=1 ;;
--sudosync) DEP_SUDO=1 ;; --sudosync) DEP_SUDO=1 ;;
--builddeps) DEP_SRC=1 ;; --builddeps) DEP_SRC=1 ;;
--noccache) NOCCACHE=1 ;; --noccache) USE_CCACHE=0 ;;
--nodeps) NODEPS=1 ;; --nodeps) NODEPS=1 ;;
--noextract) NOEXTRACT=1 ;; --noextract) NOEXTRACT=1 ;;
--install) INSTALL=1 ;; --install) INSTALL=1 ;;
@ -332,7 +332,7 @@ while [ "$#" -ne "0" ]; do
while getopts "bBcCdefghij:Lmnop:rsSw:-" opt; do while getopts "bBcCdefghij:Lmnop:rsSw:-" opt; do
case $opt in case $opt in
b) DEP_SRC=1 ;; b) DEP_SRC=1 ;;
B) NOCCACHE=1 ;; B) USE_CCACHE=0 ;;
c) CLEANUP=1 ;; c) CLEANUP=1 ;;
C) CLEANCACHE=1 ;; C) CLEANCACHE=1 ;;
d) NODEPS=1 ;; d) NODEPS=1 ;;
@ -568,10 +568,14 @@ if [ "$NOEXTRACT" = "1" ]; then
warning "Skipping source extraction -- using existing src/ tree" warning "Skipping source extraction -- using existing src/ tree"
warning "Skipping source integrity checks -- using existing src/ tree" warning "Skipping source integrity checks -- using existing src/ tree"
else else
integ="$(echo $INTEGRITY_CHECK | tr A-Z a-z)" for integ in ${INTEGRITY_CHECK[@]}; do
integ="$(echo $integ | tr A-Z a-z)"
case "$integ" in case "$integ" in
md5) integrity_name="md5sum" ;; md5) integrity_name="md5sum" ;;
sha1) integrity_name="sha1sum" ;; sha1) integrity_name="sha1sum" ;;
sha256) integrity_name="sha256sum" ;;
sha384) integrity_name="sha384sum" ;;
sha512) integrity_name="sha512sum" ;;
*) error "Invalid integrity algorithm '$integ' specified"; exit 1;; *) error "Invalid integrity algorithm '$integ' specified"; exit 1;;
esac esac
if [ ! $(type -p $integrity_name) ]; then if [ ! $(type -p $integrity_name) ]; then
@ -630,6 +634,8 @@ else
else else
warning "Integrity checks ($INTEGRITY_CHECK) are missing or incomplete." warning "Integrity checks ($INTEGRITY_CHECK) are missing or incomplete."
fi fi
fi
done
msg "Extracting Sources..." msg "Extracting Sources..."
for netfile in "${source[@]}"; do for netfile in "${source[@]}"; do
@ -668,7 +674,6 @@ else
fi fi
fi fi
done done
fi
fi fi
if [ "`id -u`" = "0" ]; then if [ "`id -u`" = "0" ]; then
@ -694,7 +699,7 @@ if [ "$DISTCC" = "y" ]; then
fi fi
# use ccache if it's available # use ccache if it's available
if [ "$NOCCACHE" = "0" ]; then if [ "$USE_CCACHE" = "1" ]; then
[ -d /usr/lib/ccache/bin ] && export PATH=/usr/lib/ccache/bin:$PATH [ -d /usr/lib/ccache/bin ] && export PATH=/usr/lib/ccache/bin:$PATH
fi fi