Revision: 6279
Updated Code
at May 14, 2008 03:21 by Juanje
Updated Code
#!/bin/bash dist=ubuntu backport=toro cd $1 for pkg in *.deb do pkg_ver=${pkg##*$dist} pkg_ver="${dist}${pkg_ver%%_*.deb}" pkg_dir=${pkg%%_*} debian="${pkg_dir}/DEBIAN" (dpkg-deb -X $pkg $pkg_dir && dpkg-deb -e $pkg $debian) || \ (echo "Error en $pkg" ; continue) sed -i "/^Version/s|${pkg_ver}|${pkg_ver}~toro|g" ${debian}/control dpkg -b $pkg_dir ${pkg/${pkg_ver}/${pkg_ver}~toro} done
Revision: 6278
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at May 14, 2008 03:10 by Juanje
Initial Code
#!/bin/bash dist=ubuntu backport=toro cd $1 for pkg in *.deb do pkg_ver=${pkg##*$dist} pkg_ver="${dist}${pkg_ver%%_*.deb}" pkg_dir=${pkg%%_*} debian="${pkg_dir}/DEBIAN" (dpkg-deb -X $pkg $pkg_dir && dpkg-deb -e $pkg $debian) || \ (echo "Error en $pkg" ; continue) sed -i "/^Version/s|${pkg_ver}|${pkg_ver}~toro|g" ${debian}/control dpkg -b $pkg_dir ${pkg/${pkg_ver}/${pkg_ver}~toro} done
Initial URL
Initial Description
This script goes to the directory you pass as a parameter and change de version of all the packages found in there. It was used for an amount of packages which were building from the sources but for an lower version of Ubuntu (actually for Guadalinex v4 which codename is 'toro'. That's why in variable 'backport' says 'toro'). The code wasn't touched so we didn't change the 'debian/changelog' and the packages were generates with its normal version. The problem is the packages were compiled with lower version of libraries than the Ubuntu version the packages was saying. To avoid binary problems and mark those packages as a 'backport' we changed the packages version after the generation with dpkg-deb. It's quite nasty stuff, but was useful and maybe it could help some one on similar purposes. Also it could be a shellscripting example for more things (var expansions, for example)
Initial Title
Rename debian/ubuntu backport packages
Initial Tags
ubuntu
Initial Language
Bash