- Timestamp:
- 05/13/2006 11:26:19 AM (18 years ago)
- Branches:
- 1.0, 2.3, 2.3.x, 2.4, ablfs, ablfs-more, legacy, new_features, trunk
- Children:
- 7d9a82d
- Parents:
- 046d5c3
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
common/common-functions
r046d5c3 r8a43b5b 660 660 cd $BUILDDIR/sources 661 661 [[ -f MD5SUMS ]] && rm MD5SUMS 662 [[ -f MD5SUMS-$VERSION ]] && rm MD5SUMS-$VERSION663 662 [[ -f MISSING_FILES.DMP ]] && rm MISSING_FILES.DMP 664 663 [[ -f urls.lst ]] && rm urls.lst 665 666 # Download a fresh MD5SUMS file667 wget $SERVER/pub/lfs/conglomeration/MD5SUMS668 664 669 665 # Generate URLs file … … 690 686 BOOKMD5=`echo $line | cut -d" " -f3` # MD5 book value 691 687 692 if [[ x"$BOOKMD5" != "x" ]]; then 693 HAVEMD5=1 694 MD5="$BOOKMD5 $FILE" 695 else 696 # Find the md5 sum for this package in the server MD5SUMS file. 697 set +e 698 HAVEMD5=1 # Always assume we have a MD5SUM 699 MD5=`grep " $FILE" MD5SUMS` 700 if [ $? -ne 0 ]; then 701 set -e 702 gs_wrt_message "$FILE not found in MD5SUMS" 703 # IMPORTANT:: There is no MD5SUM for this file. 704 HAVEMD5=0 705 fi 706 fi 688 # Validation pair 689 MD5="$BOOKMD5 $FILE" 690 HAVEMD5=1 707 691 708 692 set -e … … 718 702 echo "${BOLD}${YELLOW}$FILE: not found in ${SRC_ARCHIVE}${OFF}" 719 703 fromARCHIVE=0 720 # If the file does not exist in /sources download a fresh one704 # If the file does not exist yet in /sources download a fresh one 721 705 if [ ! -f $FILE ] ; then 722 706 if ! wget $URL1 && ! wget $URL2 ; then … … 727 711 fi 728 712 729 # Is there a MD5SUM to validate the file against. 730 if [[ "$HAVEMD5" = "1" ]] ; then 731 # IF the md5sum does not match the existing files 732 if ! echo "$MD5" | md5sum -c - >/dev/null ; then 733 [[ $fromARCHIVE = "1" ]] && echo "${BOLD}${YELLOW}MD5SUM did not match SRC_ARCHIVE copy${OFF}" 734 [[ $fromARCHIVE = "0" ]] && echo "${BOLD}${YELLOW}MD5SUM did not match REMOTE copy${OFF}" 735 # Remove the old file and download a new one 736 rm -fv $FILE 737 # Force generation of MD5SUM and storage in SRC_ARCHIVE 738 fromARCHIVE=0; 739 # Try and retrieve the file. Servers in reverse order. 740 if ! wget $URL2 && ! wget $URL1 ; then 741 gs_wrt_message "$FILE not found on the servers.. SKIPPING" 742 continue 743 fi 713 # IF the md5sum does not match the existing files 714 if ! echo "$MD5" | md5sum -c - >/dev/null ; then 715 [[ $fromARCHIVE = "1" ]] && echo "${BOLD}${YELLOW}MD5SUM did not match SRC_ARCHIVE copy${OFF}" 716 [[ $fromARCHIVE = "0" ]] && echo "${BOLD}${YELLOW}MD5SUM did not match REMOTE copy${OFF}" 717 # Remove the old file and download a new one 718 rm -fv $FILE 719 # Force storage in SRC_ARCHIVE 720 fromARCHIVE=0; 721 # Try to retrieve again the file. Servers in reverse order. 722 if ! wget $URL2 && ! wget $URL1 ; then 723 gs_wrt_message "$FILE not found on the servers.. SKIPPING" 724 continue 744 725 fi 745 726 fi 746 727 747 728 # Validate the MD5SUM one last time 748 if [[ "$HAVEMD5" = "1" ]] &&! echo "$MD5" | md5sum -c - >/dev/null ; then729 if ! echo "$MD5" | md5sum -c - >/dev/null ; then 749 730 gs_wrt_message "$FILE does not match MD5SUMS value" 750 731 # Force generation of MD5SUM … … 755 736 if [[ "$HAVEMD5" = "0" ]] ; then 756 737 echo "${BOLD}${YELLOW}Generating a new MD5SUM for ${OFF}$FILE" 757 echo "NEW MD5SUM $(md5sum $FILE)" >> MISSING_FILES.DMP738 echo "NEW MD5SUM: $(md5sum $FILE)" >> MISSING_FILES.DMP 758 739 fi 759 740 760 741 # Good or bad we write the original md5sum to a file 761 echo "$MD5" >> MD5SUMS -$VERSION742 echo "$MD5" >> MD5SUMS 762 743 763 744 # Copy the freshly downloaded file
Note:
See TracChangeset
for help on using the changeset viewer.