[jhbuild/desrt/master: 9/9] scripts: add a debian-mkequivs script
- From: Ryan Lortie <desrt src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [jhbuild/desrt/master: 9/9] scripts: add a debian-mkequivs script
- Date: Fri, 2 Jan 2015 23:32:12 +0000 (UTC)
commit 308954e9ae7cff6da4d4ec712ad7d4d50a230b50
Author: Ryan Lortie <desrt desrt ca>
Date: Fri Jan 2 15:27:27 2015 -0500
scripts: add a debian-mkequivs script
Add a neat hack to generate a .deb file that depends on sysdeps of
jhbuild.
This has at least two uses:
- generating a package that people can download and install with gdebi
in order to get all build dependencies satisfied
- generating a package that can be marked as a keeper in debfoster to
keep a large number of jhbuild-required dependencies installed
without too much additional noise
scripts/debian-mkequivs.py | 46 ++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 46 insertions(+), 0 deletions(-)
---
diff --git a/scripts/debian-mkequivs.py b/scripts/debian-mkequivs.py
new file mode 100755
index 0000000..fcba573
--- /dev/null
+++ b/scripts/debian-mkequivs.py
@@ -0,0 +1,46 @@
+#!/usr/bin/env python2
+
+from jhbuild.utils import debian_data
+from jhbuild.utils import sysid
+from email.utils import formataddr
+import email.generator
+import email.message
+import subprocess
+import sys
+
+if len(sys.argv) != 2:
+ print "error: must give a Debian package name to create (like 'jhbuild-builddeps')"
+ sys.exit(1)
+
+myid = sysid.get_id()
+
+if not myid in debian_data.package_lists:
+ print "error: don't know about a release called '{}'".format(myid)
+ sys.exit(1)
+
+package_list = dict(debian_data.package_lists[myid])
+package_list.update(debian_data.package_lists['common'])
+depends = []
+
+for line in sys.stdin:
+ dep = line.strip()
+
+ if dep in package_list:
+ depends.append(' | '.join (pkg.split('/')[-1] for pkg in package_list[dep]))
+ else:
+ print "warning: don't know how to satisfy '{}'".format(dep)
+
+
+control = email.message.Message()
+control['Package'] = sys.argv[1]
+control['Depends'] = ', '.join (depends)
+try:
+ control['Maintainer'] = formataddr((subprocess.check_output(['git', 'config', 'user.name']).strip(),
+ subprocess.check_output(['git', 'config', 'user.email']).strip()))
+except: pass
+control['Description'] = 'jhbuild dependencies meta-package\nSee https://wiki.gnome.org/HowDoI/Jhbuild for
more info'
+control['Readme'] = '/dev/null'
+equivs = subprocess.Popen(['equivs-build', '-'], stdin = subprocess.PIPE)
+email.generator.Generator(equivs.stdin).flatten(control)
+equivs.stdin.close()
+equivs.wait()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]