Added opsi-builder.cfg: CHECKSUM_AUTOCREATE: Every downloaded file is checked using SHA1 algorithm against a checksum file, if this file ist not available, it will be created on-the-fly, dependent on this setting.
This commit is contained in:
parent
e9754434bb
commit
2c21c221ff
@ -21,6 +21,12 @@ DEBUG_LEVEL=
|
|||||||
# release : passed the testing and go's to productive
|
# release : passed the testing and go's to productive
|
||||||
STATUS="integration"
|
STATUS="integration"
|
||||||
|
|
||||||
|
# CHECKSUM_AUTOCREATE - Every downloaded file is checked using SHA1 algorithm
|
||||||
|
# against a checksum file, if this file ist not available, it will be created
|
||||||
|
# on-the-fly, dependent on this setting.
|
||||||
|
# Valid values: true|false, Default: false
|
||||||
|
CHECKSUM_AUTOCREATE=false
|
||||||
|
|
||||||
###############################
|
###############################
|
||||||
# CREATOR
|
# CREATOR
|
||||||
###############################
|
###############################
|
||||||
|
@ -96,13 +96,10 @@ builder_retrieve() {
|
|||||||
if [ ! -z ${DIST_PRIVATE_REPOS} ]; then
|
if [ ! -z ${DIST_PRIVATE_REPOS} ]; then
|
||||||
urls="${DIST_PRIVATE_REPOS}/$basename;$urls"
|
urls="${DIST_PRIVATE_REPOS}/$basename;$urls"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# check existence of CRC file only in non devel mode
|
# check existence of CRC file only in non devel mode
|
||||||
if [ ! -z "${DEVEL}" ] ; then
|
if [ ! -e "${PRODUCT_DIR}/${basename}.sha1sum" ] && [ "$CHECKSUM_AUTOCREATE" != "true" ] ; then
|
||||||
if [ ! -e ${PRODUCT_DIR}/${basename}.sha1sum ] ; then
|
fatal_error "You need to create the checksums with: sha1sum ${DIST_CACHE_DIR}/${basename} > ${PRODUCT_DIR}/${basename}.sha1sum"
|
||||||
echo "You need to create the checksums with: sha1sum ${DIST_CACHE_DIR}/${basename} > ${PRODUCT_DIR}/${basename}.sha1sum"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Downloading $basename"
|
echo "Downloading $basename"
|
||||||
@ -110,6 +107,7 @@ builder_retrieve() {
|
|||||||
for src in `echo $urls | sed -e 's/[;,]/\n/g'` ; do
|
for src in `echo $urls | sed -e 's/[;,]/\n/g'` ; do
|
||||||
if [ $downloaded == 1 ]; then continue; fi
|
if [ $downloaded == 1 ]; then continue; fi
|
||||||
|
|
||||||
|
# Download file
|
||||||
echo " Info: Downloding from $src"
|
echo " Info: Downloding from $src"
|
||||||
local downloader=${DL_DOWNLOADER[$i]}
|
local downloader=${DL_DOWNLOADER[$i]}
|
||||||
if [ -z $downloader ]; then downloader="wget" ; fi
|
if [ -z $downloader ]; then downloader="wget" ; fi
|
||||||
@ -118,19 +116,32 @@ builder_retrieve() {
|
|||||||
DL_DIST_FILE[$i]=${DIST_CACHE_DIR}/$arch/$basename
|
DL_DIST_FILE[$i]=${DIST_CACHE_DIR}/$arch/$basename
|
||||||
retrieve_file $downloader $src ${DL_DIST_FILE[$i]}
|
retrieve_file $downloader $src ${DL_DIST_FILE[$i]}
|
||||||
|
|
||||||
if [ $? == 0 ] ; then
|
if [ $? != 0 ] ; then
|
||||||
|
echo " Warning: Failed to download file - try next URL"
|
||||||
|
continue;
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check sha1
|
||||||
|
if [ ! -e "${PRODUCT_DIR}/${basename}.sha1sum" ] && [ "$CHECKSUM_AUTOCREATE" == "true" ] ; then
|
||||||
|
sha1sum ${DL_DIST_FILE[$i]} > ${PRODUCT_DIR}/${basename}.sha1sum
|
||||||
|
downloaded=1
|
||||||
|
echo " WARNING: SHA1 checksum (${DL_DIST_FILE[$i]}.sha1sum) was created dynamically because auf CHECKSUM_AUTOCREATE=$CHECKSUM_AUTOCREATE"
|
||||||
|
else
|
||||||
# testing the checksum of the downloaded files
|
# testing the checksum of the downloaded files
|
||||||
local sha1sum_val=`cat ${PRODUCT_DIR}/${basename}.sha1sum | cut -d " " -f1`
|
local sha1sum_val=`cat ${PRODUCT_DIR}/${basename}.sha1sum | cut -d " " -f1`
|
||||||
local checksum_val=`sha1sum ${DL_DIST_FILE[$i]} | cut -d " " -f1`
|
local checksum_val=`sha1sum ${DL_DIST_FILE[$i]} | cut -d " " -f1`
|
||||||
if [ "$checksum_val" == "$sha1sum_val" ] ; then
|
if [ "$checksum_val" == "$sha1sum_val" ] ; then
|
||||||
downloaded=1
|
downloaded=1
|
||||||
echo " Info: Downloaded successfully"
|
|
||||||
else
|
|
||||||
echo " Error: The checksums do not match - try next URL"
|
|
||||||
fi
|
fi
|
||||||
else
|
|
||||||
echo " Warning: Failed to download file - try next URL"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Print result
|
||||||
|
if [ "$downloaded" == "1" ] ; then
|
||||||
|
echo " Info: Downloaded successfully"
|
||||||
|
else
|
||||||
|
echo " Error: The checksums do not match - try next URL"
|
||||||
|
fi
|
||||||
|
|
||||||
done
|
done
|
||||||
echo
|
echo
|
||||||
|
|
||||||
@ -151,7 +162,7 @@ builder_create() {
|
|||||||
# Copy files and convert text files to dos format
|
# Copy files and convert text files to dos format
|
||||||
cp -Rv ${PRODUCT_DIR}/OPSI $INST_DIR
|
cp -Rv ${PRODUCT_DIR}/OPSI $INST_DIR
|
||||||
cp -Rv ${PRODUCT_DIR}/CLIENT_DATA $INST_DIR
|
cp -Rv ${PRODUCT_DIR}/CLIENT_DATA $INST_DIR
|
||||||
find $INST_DIR/CLIENT_DATA -type f | xargs -n1 -iREP sh -c 'file -i $0 | grep "text/plain" && unix2dos $0' REP
|
find $INST_DIR/CLIENT_DATA -type f | xargs -n1 -iREP sh -c 'file -i $0 | grep "text/plain" && unix2dos $0 ' REP >/dev/null
|
||||||
|
|
||||||
# converting icon file
|
# converting icon file
|
||||||
local iconfile_src=${DL_DIST_FILE[$ICON_DL_INDEX]}
|
local iconfile_src=${DL_DIST_FILE[$ICON_DL_INDEX]}
|
||||||
|
@ -89,7 +89,7 @@ function call_entry_point() {
|
|||||||
###################
|
###################
|
||||||
fatal_error() {
|
fatal_error() {
|
||||||
echo "FATAL: $1"
|
echo "FATAL: $1"
|
||||||
exit 0
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
###################
|
###################
|
||||||
|
@ -112,7 +112,7 @@ ICON_DL_INDEX=0
|
|||||||
|
|
||||||
#########################
|
#########################
|
||||||
# Setup additional, custom WINST variables
|
# Setup additional, custom WINST variables
|
||||||
# which will be injected to the *.ins files
|
# which will be injected to the *.ins files (replaces token @@BUILDER_VARIABLES@@ )
|
||||||
#
|
#
|
||||||
# The following tokens inside the WINST_VALUE will be replaced dynamically
|
# The following tokens inside the WINST_VALUE will be replaced dynamically
|
||||||
#
|
#
|
||||||
|
Loading…
Reference in New Issue
Block a user