wok-6.x rev 9657

busybox: ensure $stuff is set. tazwok bug ?
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Apr 30 16:37:24 2011 +0200 (2011-04-30)
parents 40deda5cd878
children 5fbf13b1df6d
files busybox/receipt get-opera/stuff/get-opera
line diff
     1.1 --- a/busybox/receipt	Fri Apr 29 22:13:36 2011 +0200
     1.2 +++ b/busybox/receipt	Sat Apr 30 16:37:24 2011 +0200
     1.3 @@ -15,6 +15,7 @@
     1.4  apply_bb_patchs()
     1.5  {
     1.6      cd $src
     1.7 +    stuff=${stuff:-stuff}
     1.8      while read file; do
     1.9      	[ -f done.$file ] && continue
    1.10      	echo "Apply $file..."
     2.1 --- a/get-opera/stuff/get-opera	Fri Apr 29 22:13:36 2011 +0200
     2.2 +++ b/get-opera/stuff/get-opera	Sat Apr 30 16:37:24 2011 +0200
     2.3 @@ -1,7 +1,9 @@
     2.4  #!/bin/sh -e
     2.5  
     2.6 +PACKAGE="opera"
     2.7  URL=http://mirrors.dedipower.com/opera/linux/
     2.8  ROOT="$1"
     2.9 +[ -d "$ROOT" ] || ROOT=""
    2.10  
    2.11  if test $(id -u) != 0 ; then
    2.12          echo -e "\nYou must be root to run `basename $0`."
    2.13 @@ -9,35 +11,33 @@
    2.14          exit 0
    2.15  fi
    2.16  
    2.17 -if [ -d $ROOT/var/lib/tazpkg/installed/opera ]; then
    2.18 -  [ -n "$ROOT" ] && exit 1
    2.19 -  tazpkg remove opera
    2.20 -  [ -d /var/lib/tazpkg/installed/opera ] && exit 1
    2.21 +if [ -d $ROOT/var/lib/tazpkg/installed/$PACKAGE ]; then
    2.22 +	[ -n "$ROOT" ] && exit 1
    2.23 +	tazpkg remove $PACKAGE
    2.24 +	[ -d /var/lib/tazpkg/installed/$PACKAGE ] && exit 1
    2.25  fi
    2.26  
    2.27 -TMP_DIR=/tmp/get-opera-$$-$RANDOM
    2.28 +TMP_DIR=/tmp/get-$PACKAGE-$$-$RANDOM
    2.29  CUR_DIR=$(pwd)
    2.30  mkdir -p $TMP_DIR && cd $TMP_DIR
    2.31  
    2.32  get_releases()
    2.33  {
    2.34 -	wget -O - "$URL?C=M;O=D" 2>/dev/null | awk '/folder/ { print $5 }' | \
    2.35 -	sed -e 's/href="\(.*\)">.*/\1/' -e 's|/||'
    2.36 +	wget -qO- "$URL?C=M;O=D" | sed 's|.*[Ff]="\([^"/]*\).*|\1|;/[^0-9b]/d'
    2.37  }
    2.38  
    2.39  # Download deb
    2.40 -for RELEASE in $(get_releases); do
    2.41 -  [ -n "$RELEASE" ] || continue
    2.42 -  FILE=$(wget -O - "$URL$RELEASE/" 2> /dev/null | grep i386.deb | sed 's/.*href="\(.*\)">.*/\1/' | head -n 1)
    2.43 -  [ -n "$FILE" ] || continue
    2.44 -  wget $URL$RELEASE/$FILE
    2.45 -  [ -s $FILE ] && break
    2.46 +for RELEASE in $@ $(get_releases); do
    2.47 +	FILE=$(wget -O- "$URL$RELEASE/" 2>/dev/null | sed 's|.*[Ff]="\(.*\)".*|\1|;/6.d/!d;q')
    2.48 +	[ -n "$FILE" ] || continue
    2.49 +	wget $URL$RELEASE/$FILE
    2.50 +	[ -s $FILE ] && break
    2.51  done
    2.52  
    2.53  if [ ! -f $FILE ]; then
    2.54  	cd $CUR_DIR
    2.55  	rm -rf $TMP_DIR
    2.56 -	echo "Could not download $FILE. Exiting."
    2.57 +	echo "Could not download $FILE from $URL. Exiting."
    2.58  	exit 1
    2.59  fi
    2.60  
    2.61 @@ -95,7 +95,7 @@
    2.62  cd ../..
    2.63  
    2.64  cat > opera-$VERSION/receipt <<EOT
    2.65 -PACKAGE="opera"
    2.66 +PACKAGE="$PACKAGE"
    2.67  VERSION="$VERSION"
    2.68  CATEGORY="non-free"
    2.69  SHORT_DESC="Opera Web browser."
    2.70 @@ -107,17 +107,11 @@
    2.71  mv opera-$VERSION/fs/usr/share/opera/locale opera-$VERSION/fs/usr/share/opera/locale-full
    2.72  mkdir -p opera-$VERSION/fs/usr/share/opera/locale 
    2.73  . /etc/locale.conf
    2.74 -for i in $LANG $(echo $LANG | sed 's/_/-/') ${LANG:0:2} ; do
    2.75 +for i in $LANG ${LANG/_/-} ${LANG:0:2} fr pt de zh-cn ; do
    2.76  	[ -d opera-$VERSION/fs/usr/share/opera/locale-full/$i ] &&
    2.77  	cp -a opera-$VERSION/fs/usr/share/opera/locale-full/$i \
    2.78  		opera-$VERSION/fs/usr/share/opera/locale
    2.79  done
    2.80 -cp -a opera-$VERSION/fs/usr/share/opera/locale-full/en \
    2.81 -	  opera-$VERSION/fs/usr/share/opera/locale-full/fr \
    2.82 -	  opera-$VERSION/fs/usr/share/opera/locale-full/pt \
    2.83 -	  opera-$VERSION/fs/usr/share/opera/locale-full/de \
    2.84 -	  opera-$VERSION/fs/usr/share/opera/locale-full/zh-cn \
    2.85 -	  opera-$VERSION/fs/usr/share/opera/locale
    2.86  rm -rf opera-$VERSION/fs/usr/share/opera/locale-full
    2.87  rm -rf opera-$VERSION/fs/usr/share/pixmaps
    2.88  
    2.89 @@ -130,6 +124,9 @@
    2.90  
    2.91  # Install pseudo package
    2.92  tazpkg install opera-$VERSION.tazpkg --root=$ROOT
    2.93 +case " $@ " in
    2.94 +*\ --k*) mv opera-$VERSION.tazpkg $CUR_DIR ;;
    2.95 +esac
    2.96  
    2.97  # Clean
    2.98  cd $CUR_DIR