[elbe-devel] [PATCH v3 15/15] Remove "dbpkg.py" from ELBE
dion at linutronix.de
dion at linutronix.de
Wed Jun 26 10:40:19 CEST 2019
From: Olivier Dion <dion at linutronix.de>
Signed-off-by: Olivier Dion <dion at linutronix.de>
---
debian/python-elbe-buildenv.install | 1 -
debian/python3-elbe-buildenv.install | 1 -
elbepack/debpkg.py | 89 ------------------------------------
3 files changed, 91 deletions(-)
delete mode 100644 elbepack/debpkg.py
diff --git a/debian/python-elbe-buildenv.install b/debian/python-elbe-buildenv.install
index 995aaf3d..27d6a435 100644
--- a/debian/python-elbe-buildenv.install
+++ b/debian/python-elbe-buildenv.install
@@ -23,7 +23,6 @@
./usr/lib/python2.*/*-packages/elbepack/asciidoclog.py
./usr/lib/python2.*/*-packages/elbepack/cdroms.py
./usr/lib/python2.*/*-packages/elbepack/debianreleases.py
-./usr/lib/python2.*/*-packages/elbepack/debpkg.py
./usr/lib/python2.*/*-packages/elbepack/efilesystem.py
./usr/lib/python2.*/*-packages/elbepack/fstab.py
./usr/lib/python2.*/*-packages/elbepack/rpcaptcache.py
diff --git a/debian/python3-elbe-buildenv.install b/debian/python3-elbe-buildenv.install
index be0fd497..f935a9a0 100644
--- a/debian/python3-elbe-buildenv.install
+++ b/debian/python3-elbe-buildenv.install
@@ -23,7 +23,6 @@
./usr/lib/python3.*/*-packages/elbepack/asciidoclog.py
./usr/lib/python3.*/*-packages/elbepack/cdroms.py
./usr/lib/python3.*/*-packages/elbepack/debianreleases.py
-./usr/lib/python3.*/*-packages/elbepack/debpkg.py
./usr/lib/python3.*/*-packages/elbepack/efilesystem.py
./usr/lib/python3.*/*-packages/elbepack/fstab.py
./usr/lib/python3.*/*-packages/elbepack/rpcaptcache.py
diff --git a/elbepack/debpkg.py b/elbepack/debpkg.py
deleted file mode 100644
index ede724cc..00000000
--- a/elbepack/debpkg.py
+++ /dev/null
@@ -1,89 +0,0 @@
-# ELBE - Debian Based Embedded Rootfilesystem Builder
-# Copyright (c) 2014 Torben Hohn <torbenh at linutronix.de>
-# Copyright (c) 2017 Manuel Traut <manut at linutronix.de>
-#
-# SPDX-License-Identifier: GPL-3.0-or-later
-
-import os
-import string
-
-from tempfile import mkdtemp
-
-control_template_string = """Package: ${name}
-Version: ${version}
-Section: main
-Priority: optional
-Architecture: ${arch}
-Maintainer: elbe-devel at linutronix.de
-Description: ${description}
-Depends: ${deps}
-Multi-Arch: same
-"""
-
-control_template = string.Template(control_template_string)
-
-
-def gen_controlfile(name, version, arch, description, deps):
- d = dict(
- name=name,
- version=version,
- arch=arch,
- description=description,
- deps=deps)
- return control_template.substitute(d)
-
-
-def write_file(fname, mode, cont):
- f = file(fname, "w")
- f.write(cont)
- f.close()
- os.chmod(fname, mode)
-
-
-def build_binary_deb(
- name,
- arch,
- version,
- description,
- files,
- deps,
- target_dir):
-
- # pylint: disable=too-many-arguments
-
- tmpdir = mkdtemp()
- pkgfname = "%s_%s_%s" % (name, version, arch)
- pkgdir = os.path.join(tmpdir, pkgfname)
-
- os.system('mkdir -p "%s"' % os.path.join(pkgdir, "DEBIAN"))
- write_file(
- os.path.join(
- pkgdir,
- "DEBIAN",
- "control"),
- 0o644,
- gen_controlfile(
- name,
- version,
- arch,
- description,
- deps))
-
- for (fname, instpath) in files:
- full_instpath = os.path.join(pkgdir, instpath)
- os.system('mkdir -p "%s"' % full_instpath)
- os.system('cp -a "%s" "%s"' % (fname, full_instpath))
-
- os.system('dpkg-deb --build "%s"' % pkgdir)
-
- os.system(
- 'cp -v "%s" "%s"' %
- (os.path.join(
- tmpdir,
- pkgfname +
- ".deb"),
- target_dir))
-
- os.system('rm -r "%s"' % tmpdir)
-
- return pkgfname + ".deb"
--
2.11.0
More information about the elbe-devel
mailing list