Kaydet (Commit) f3823f56 authored tarafından Hans-Joachim Lankenau's avatar Hans-Joachim Lankenau

ause119: #i111075# usability, stability and macosx fixes

üst 35170adf
...@@ -3,14 +3,10 @@ ...@@ -3,14 +3,10 @@
# #
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# Copyright 2008 by Sun Microsystems, Inc. # Copyright 2000, 2010 Oracle and/or its affiliates.
# #
# OpenOffice.org - a multi-platform office productivity suite # OpenOffice.org - a multi-platform office productivity suite
# #
# $RCSfile: makefile.mk,v $
#
# $Revision: 1.8 $
#
# This file is part of OpenOffice.org. # This file is part of OpenOffice.org.
# #
# OpenOffice.org is free software: you can redistribute it and/or modify # OpenOffice.org is free software: you can redistribute it and/or modify
...@@ -65,25 +61,31 @@ for i in wget /usr/bin/wget /usr/local/bin/wget /usr/sfw/bin/wget /opt/sfw/bin/w ...@@ -65,25 +61,31 @@ for i in wget /usr/bin/wget /usr/local/bin/wget /usr/sfw/bin/wget /opt/sfw/bin/w
fi fi
done done
for i in curl /usr/bin/curl /usr/local/bin/curl /usr/sfw/bin/curl /opt/sfw/bin/curl /opt/local/bin/curl; do if [ -z "$wget" ]; then
# mac curl returns "2" on --version for i in curl /usr/bin/curl /usr/local/bin/curl /usr/sfw/bin/curl /opt/sfw/bin/curl /opt/local/bin/curl; do
# eval "$i --version" > /dev/null 2>&1 # mac curl returns "2" on --version
# ret=$? # eval "$i --version" > /dev/null 2>&1
# if [ $ret -eq 0 ]; then # ret=$?
# if [ $ret -eq 0 ]; then
if [ -x $i ]; then if [ -x $i ]; then
curl=$i curl=$i
echo found curl: $curl echo found curl: $curl
break 2 break 2
fi fi
done done
fi
if [ -z "$wget" -a -z "$curl" ]; then if [ -z "$wget" -a -z "$curl" ]; then
echo "ERROR: neither wget nor curl found!" echo "ERROR: neither wget nor curl found!"
exit exit
fi fi
for i in md5sum /usr/local/bin/md5sum gmd5sum /usr/sfw/bin/md5sum /opt/sfw/bin/gmd5sum /opt/local/bin/md5sum; do for i in md5 md5sum /usr/local/bin/md5sum gmd5sum /usr/sfw/bin/md5sum /opt/sfw/bin/gmd5sum /opt/local/bin/md5sum; do
if [ "$i" = "md5" ]; then
eval "$i -x" > /dev/null 2>&1
else
eval "$i --version" > /dev/null 2>&1 eval "$i --version" > /dev/null 2>&1
fi
ret=$? ret=$?
if [ $ret -eq 0 ]; then if [ $ret -eq 0 ]; then
md5sum=$i md5sum=$i
...@@ -92,13 +94,22 @@ for i in md5sum /usr/local/bin/md5sum gmd5sum /usr/sfw/bin/md5sum /opt/sfw/bin/g ...@@ -92,13 +94,22 @@ for i in md5sum /usr/local/bin/md5sum gmd5sum /usr/sfw/bin/md5sum /opt/sfw/bin/g
fi fi
done done
if [ "$md5sum" = "md5" ]; then
md5special=-r
fi
if [ -z "$md5sum" ]; then if [ -z "$md5sum" ]; then
echo "Warning: no md5sum: found!" echo "Warning: no md5sum: found!"
fi fi
start_dir=`pwd` start_dir=`pwd`
logfile=$TARFILE_LOCATION/fetch.log
date >> $logfile
filelist=`cat $1` filelist=`cat $1`
cd $TARFILE_LOCATION mkdir -p $TARFILE_LOCATION/tmp
cd $TARFILE_LOCATION/tmp
echo $$ > fetch-running
for i in $filelist ; do for i in $filelist ; do
# echo $i # echo $i
if [ "$i" != `echo $i | sed "s/^http:\///"` ]; then if [ "$i" != `echo $i | sed "s/^http:\///"` ]; then
...@@ -106,30 +117,38 @@ for i in $filelist ; do ...@@ -106,30 +117,38 @@ for i in $filelist ; do
# TODO: check for comment # TODO: check for comment
else else
if [ "$tarurl" != "" ]; then if [ "$tarurl" != "" ]; then
if [ ! -f "$i" ]; then if [ ! -f "../$i" ]; then
echo $i
if [ ! -z "$wget" ]; then if [ ! -z "$wget" ]; then
$wget -nv -N $tarurl/$i $wget -nv -N $tarurl/$i 2>&1 | tee -a $logfile
else else
echo fetching $i echo fetching $i
$curl $file_date_check -O $tarurl/$i $curl $file_date_check -O $tarurl/$i 2>&1 | tee -a $logfile
fi fi
wret=$? wret=$?
if [ $wret -ne 0 ]; then if [ $wret -ne 0 ]; then
mv $i ${i}_broken
failed="$failed $i" failed="$failed $i"
wret=0 wret=0
fi fi
if [ -f $i -a -n "$md5sum" ]; then if [ -f $i -a -n "$md5sum" ]; then
sum=`$md5sum $i | sed "s/ [ *].*//"` sum=`$md5sum $md5special $i | sed "s/ .*//"`
sum2=`echo $i | sed "s/-.*//"` sum2=`echo $i | sed "s/-.*//"`
if [ "$sum" != "$sum2" ]; then if [ "$sum" != "$sum2" ]; then
echo checksum failure for $i echo checksum failure for $i 2>&1 | tee -a $logfile
failed="$failed $i" failed="$failed $i"
mv $i ${i}_broken
else
mv $i ..
fi fi
else
mv $i ..
fi fi
fi fi
fi fi
fi fi
done done
rm $TARFILE_LOCATION/tmp/*-*
cd $start_dir cd $start_dir
if [ ! -z "$failed" ]; then if [ ! -z "$failed" ]; then
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment