[MPlayer-dev-eng] [PATCH] sync TOOLS/binary_codecs.sh with debian

Diego Biurrun diego at biurrun.de
Thu Apr 23 09:47:39 CEST 2009


On Wed, Apr 22, 2009 at 10:56:14PM +0200, Reinhard Tartler wrote:
> Diego Biurrun <diego at biurrun.de> writes:
> 
> > This contains a lot of whitespace changes.  Could you commit those and
> > then resend the patch without them?
> 
> Whitespace changes committed. Remaining changes:
> 
> --- binary_codecs.sh	(revision 29220)
> +++ binary_codecs.sh	(working copy)
> @@ -1,5 +1,6 @@
>  #!/bin/sh
>  set -e
> +umask 0022

Why?  To avoid insecure tempfile creation?  Probably OK...

> @@ -24,21 +25,22 @@
>  
>    #if [ ! -r mirrors ] || find mirrors -mtime +20 ; then
>      echo Downloading mirrors list..
> -    wget -nv -c -N $MYSITE/mirrors || true
> +    wget -nv -N $MYSITE/mirrors || true

Why?

>    if [ ! -r bestsites ] || [ mirrors -nt bestsites ] || \
> -    find bestsites -mtime +20 > /dev/null ; then
> -    if which netselect > /dev/null  ; then
> -      echo  Choosing best mirrors using netselect....
> -      netselect  -s 5  $( cat mirrors ) | awk '{print $2}' > bestsites
> +    find bestsites -mtime +20 | grep -q bestsites ; then
> +    if which netselect > /dev/null ; then
> +      echo Choosing best mirrors using netselect....
> +      netselect -s 5 -t 5 $( cat mirrors ) | awk '{print $2}' > bestsites

whitespace cosmetics

> -      sleep 5
> +      sleep 3

OK

> @@ -60,7 +62,7 @@
>        echo Downloading $filename from $mainsite ...
> -      wget -v -c -N $mainsite/$dir/$filename || true
> +      wget -c -N $mainsite/$dir/$filename || true
>        if [ -r "$filename" ] ; then
> @@ -68,7 +70,7 @@
>    else
> -    wget -v -c -N $url/$dir/$filename || true
> +    wget -c -N $url/$dir/$filename || true
>      if [ -r "$filename" ] ; then

OK

> @@ -83,28 +85,41 @@
>  UNPACK ()
>  {
>    filename="$1"
> -  if [ ! -r $filename.bak ] || ! cmp $filename.bak $filename ; then
> -    echo Installing $filename  ...
> -    if [ -r $filename.list  ] ; then
> -      tr '\n' '\000' < $filename.list | xargs -r0 rm  || true
> +  if [ -r $filename.bak ] && cmp $filename.bak $filename && [ -r  $filename.list ] ; then
> +    echo It appears that $filename was already succesfully installed
> +    [ -r $filename.bak ] && rm $filename.bak
> +  else
> +    if grep -q " $filename$" $PREFDIR/MD5SUMS ; then
> +      echo Checking MD5 for $filename
> +      grep " $filename$" $PREFDIR/MD5SUMS | md5sum -c -
> +    else
> +      echo Warning: no MD5 for $filename were found. Hit enter to continue.
> +      read dummy
> +    fi
> +    echo Installing $filename ...
> +    if [ -r $filename.list ] ; then
> +      tr '\n' '\000' < $filename.list | xargs -r0 rm || true

more whitespace cosmetics ..

> +    tarfail () { echo FAILED $filename ; rm $filename.list ; exit 1 ; }
> +
>      case "$filename" in
>        *.tar.gz)
> -        tar xvzf $filename > $filename.list
> +        tar xvzf $filename > $filename.list || tarfail
>          #rm $filename
>          ;;
>        *.tgz)
> -        tar xvzf $filename > $filename.list
> +        tar xvzf $filename > $filename.list || tarfail
>          #rm $filename
>          ;;
>        *.tar.bz2)
> -        tar  --bzip2 -xvf $filename > $filename.list
> +        tar --bzip2 -xvf $filename > $filename.list || tarfail

OK

> @@ -135,22 +150,51 @@
>  
>  case "$1" in
>    install)
> +    if  test -x /bin/bzip2 || test -x /usr/bin/bzip2 ; then : ; else
> +      echo You need to install bzip2

.

>      cd $PREFDIR
> -    #if [ ! -r codecs_list ] || find  codecs_list -mtime +20  ; then
> -      echo 'Getting  codecs list ...'
> -      wget -nv -c -N $MYSITE/codecs_list || true
> +    #if [ ! -r codecs_list ] || find codecs_list -mtime +20 ; then
> +      echo 'Getting codecs list ...'
> +      wget -nv -N $MYSITE/codecs_list || true

cosmetics

Diego



More information about the MPlayer-dev-eng mailing list