#!/bin/sh
## a quickie to update the Depends: for official Opera .debs to reflect
## the current situation where Sid depends on libqt3-mt, not libqt3c102

DEB=$1
USAGE="Usage: $0 <filename.deb>"

if [ -z ${DEB} ]; then
	echo $USAGE
	exit
fi

#extract control.tar.gz from the appropriate .deb
ar x $DEB control.tar.gz  || exit

#uncompress it
gzip -d control.tar.gz || exit

#extract control from control.tar
tar -xf control.tar ./control || exit

#edit control changing the depends line for "libqt3c102-mt" to "libqt3-mt"
sed -i 's/libqt3c102-mt/libqt3-mt/' control 

#update control.tar with the changed file
tar -uf control.tar ./control

#gzip it
gzip control.tar

#replace the modified config.tar.gz into the deb
ar r $DEB control.tar.gz

#cleanup
rm control control.tar.gz