anchor.diff:  # do_curl URL FILENAME
   do_perl() {
     echo "trying perl..."
  -  perl -e 'use LWP::Simple; getprint($ARGV[0]);' "$1" > "$2"
  -  # check for bad return status
  -  test $? -ne 0 && return 1
  -  # check for bad output or empty file
  -  # grep "The specified key does not exist." "$2" 2>&1 >/dev/null
  -  # if test $? -eq 0 || test ! -s "$2"; then
  -  #   unable_to_retrieve_package
  -  # fi
  +  perl -e 'use LWP::Simple; getprint($ARGV[0]);' "$1" > "$2" 2>/tmp/stderr
  +  rc=$?
  +  # check for 404
  +  grep "404 Not Found" /tmp/stderr 2>&1 >/dev/null
  +  if test $? -eq 0; then
  +    echo "ERROR 404"
  +    unable_to_retrieve_package
  +  fi
  +
  +  # check for bad return status or empty output
  +  if test $rc -ne 0 || test ! -s "$2"; then
  +    capture_tmp_stderr "perl"
  +    return 1
  +  fi
  +
     return 0
   }
   
   # do_curl URL FILENAME
   do_python() {
     echo "trying python..."
  -  python -c "import sys,urllib2 ; sys.stdout.write(urllib2.urlopen(sys.argv[1]).read())" "$1" > "$2"
  -  # check for bad return status
  -  test $? -ne 0 && return 1
  -  # check for bad output or empty file
  -  #grep "The specified key does not exist." "$2" 2>&1 >/dev/null
  -  #if test $? -eq 0 || test ! -s "$2"; then
  -  #  unable_to_retrieve_package
  -  #fi
  +  python -c "import sys,urllib2 ; sys.stdout.write(urllib2.urlopen(sys.argv[1]).read())" "$1" > "$2" 2>/tmp/stderr
  +  rc=$?
  +  # check for 404
  +  grep "HTTP Error 404" /tmp/stderr 2>&1 >/dev/null
  +  if test $? -eq 0; then
  +    echo "ERROR 404"
  +    unable_to_retrieve_package
  +  fi
  +
  +  # check for bad return status or empty output
  +  if test $rc -ne 0 || test ! -s "$2"; then
  +    capture_tmp_stderr "python"
  +    return 1
  +  fi
     return 0
   }
   
  
positive.code: unable_to_retrieve_package() {
    echo "Unable to retrieve a valid package!"
    report_bug
    echo "URL: $url"
    exit 1
  }
  
  # do_wget URL FILENAME
  do_wget() {
    echo "trying wget..."
    wget -O "$2" "$1" 2>/tmp/stderr
    # check for bad return status
    test $? -ne 0 && return 1
    # check for 404 or empty file
    grep "ERROR 404" /tmp/stderr 2>&1 >/dev/null
    if test $? -eq 0 || test ! -s "$2"; then
      return 1
    fi
    return 0
  }
  
  # do_curl URL FILENAME
  do_curl() {
    echo "trying curl..."
    curl -L "$1" > "$2"
    # check for bad return status
    [ $? -ne 0 ] && return 1
    # check for bad output or empty file
    grep "The specified key does not exist." "$2" 2>&1 >/dev/null
    if test $? -eq 0 || test ! -s "$2"; then
      return 1
    fi
    return 0
  }
  
  
negative.code: 
  cat "$metadata_filename"
  
  # check that all the mandatory fields in the downloaded metadata are there
  if grep '^url' $metadata_filename > /dev/null && grep '^sha256' $metadata_filename > /dev/null && grep '^md5' $metadata_filename > /dev/null; then
    echo "downloaded metadata file looks valid..."
  else
    echo "downloaded metadata file is correupted or an uncaught error was encountered in downloading the file..."
    # this generally means one of the download methods downloaded a 404 or somehing like that and then reported a successful exit code,
    # and this should be fixed in the function that was doing the download.
    report_bug
  fi
  
  download_url=`awk '$1 == "url" { print $2 }' "$metadata_filename"`
  
  if test "x$platform" = "xsolaris2"; then
  