重命名debian/ubuntu backport包
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了重命名debian/ubuntu backport包相关的知识,希望对你有一定的参考价值。
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)
#!/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
以上是关于重命名debian/ubuntu backport包的主要内容,如果未能解决你的问题,请参考以下文章
ImportError:没有名为“backports”的模块
Python 请求 - 如何使用系统 ca 证书(debian/ubuntu)?
Android 上的 ThreeTen-Backport 错误 - ZoneRulesException:未注册时区数据文件