wok-4.x rev 7754

get-opera: use deb archive, save 3MB (tanks Ruari)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Dec 21 12:49:01 2010 +0100 (2010-12-21)
parents a6cc66b552c6
children 040555bd4620
files get-opera/stuff/get-opera
line diff
     1.1 --- a/get-opera/stuff/get-opera	Tue Dec 21 15:30:57 2010 +0800
     1.2 +++ b/get-opera/stuff/get-opera	Tue Dec 21 12:49:01 2010 +0100
     1.3 @@ -25,10 +25,10 @@
     1.4  	sed -e 's/href="\(.*\)">.*/\1/' -e 's|/||'
     1.5  }
     1.6  
     1.7 -# Download rpm
     1.8 +# Download deb
     1.9  for RELEASE in $(get_releases); do
    1.10    [ -n "$RELEASE" ] || continue
    1.11 -  FILE=$(wget -O - "$URL$RELEASE/" 2> /dev/null | grep i386.rpm | sed 's/.*href="\(.*\)">.*/\1/' | head -n 1)
    1.12 +  FILE=$(wget -O - "$URL$RELEASE/" 2> /dev/null | grep i386.deb | sed 's/.*href="\(.*\)">.*/\1/' | head -n 1)
    1.13    [ -n "$FILE" ] || continue
    1.14    wget $URL$RELEASE/$FILE
    1.15    [ -s $FILE ] && break
    1.16 @@ -41,17 +41,17 @@
    1.17  	exit 1
    1.18  fi
    1.19  
    1.20 -RELEASE=$(rpm -qip $FILE  | awk '/^Release/ { print $3 }')
    1.21 -VERSION=$(rpm -qip $FILE  | awk '/^Version/ { print $3 }')-$RELEASE
    1.22 +mkdir opera
    1.23 +dpkg-deb -e $FILE opera/meta
    1.24 +dpkg-deb -x $FILE opera/fs
    1.25 +# extracted pkg can be removed: Save RAM
    1.26 +rm -f $FILE
    1.27 +sed '/^Description:/,$!d;s/^Description://' \
    1.28 +	< opera/meta/control > opera/description.txt
    1.29  
    1.30 -mkdir -p opera-$VERSION/fs
    1.31 -
    1.32 -# Extract files
    1.33 +VERSION=$(grep ^Version opera/meta/control | awk '{ print $2 }')
    1.34 +mv opera opera-$VERSION
    1.35  cd opera-$VERSION/fs
    1.36 -rpm -qip ../../$FILE > description.txt
    1.37 -rpm2cpio < ../../$FILE | cpio -idm
    1.38 -# extracted pkg can be removed: Save RAM
    1.39 -rm -f ../../$FILE
    1.40  
    1.41  # Create menu
    1.42  mkdir -p usr/share/applications