2 ##############################################################################
3 # Copyright (c) 2015 Ericsson AB and others.
4 # stefan.k.berg@ericsson.com
5 # jonas.bjurel@ericsson.com
6 # All rights reserved. This program and the accompanying materials
7 # are made available under the terms of the Apache License, Version 2.0
8 # which accompanies this distribution, and is available at
9 # http://www.apache.org/licenses/LICENSE-2.0
10 ##############################################################################
19 tmpdir=`mktemp -d /tmp/patchXXXXX`
22 pushd $tmpdir > /dev/null
27 mkdir -p repack/DEBIAN
28 dpkg -e $deb repack/DEBIAN
31 pushd repack/DEBIAN > /dev/null
33 echo "Before: `cat control | grep '^Depends:'`"
34 sed -i "s/$pkgdep (\([^ ]*\) [^)]*)/$pkgdep (\1 $newrev)/" control
35 echo "After: `cat control | grep '^Depends:'`"
38 fakeroot dpkg-deb --build repack
42 cp $tmpdir/repack.deb $deb
46 # Name of package for which to check dependencies to
48 # The old revision of the package in question
50 # The new revision of the package in question
53 if [ -z "$PKGDEP" ]; then
54 echo "No package dependency name"
58 if [ -z "$OLDREV" ]; then
63 if [ -z "$NEWREV" ]; then
71 ar p $deb control.tar.gz | tar xzO ./control | grep -q "^Depends:.* ${PKGDEP} ([^ ]* ${OLDREV})"
73 name=`ar p $deb control.tar.gz | tar xzO ./control | grep "^Package:.* " | sed 's/.* //'`
74 echo "**** Changing dependencies line in $deb ($name) ****"
75 patch_package $deb $PKGDEP $NEWREV