[elbe-devel] [PATCH 4/8] elbepack: commands: drop internal toolchainextract command

Thomas Weißschuh thomas.weissschuh at linutronix.de
Mon Jul 8 11:23:57 CEST 2024


The toolchainextract command is a remnant from the time before the SOAP
service managing all buildenv interaction.
Nowadays it is only a maintenance burden, remove it.

Signed-off-by: Thomas Weißschuh <thomas.weissschuh at linutronix.de>
---
 debian/python3-elbe-buildenv.install        |  1 -
 docs/elbe-toolchainextract.rst              | 92 -----------------------------
 elbepack/commands/toolchainextract.py       | 79 -------------------------
 newsfragments/+toolchainextract.removal.rst |  1 +
 4 files changed, 1 insertion(+), 172 deletions(-)

diff --git a/debian/python3-elbe-buildenv.install b/debian/python3-elbe-buildenv.install
index 06c17e4d4863..8462aadfc117 100644
--- a/debian/python3-elbe-buildenv.install
+++ b/debian/python3-elbe-buildenv.install
@@ -6,7 +6,6 @@ usr/lib/python3.*/*-packages/elbepack/commands/db.py
 usr/lib/python3.*/*-packages/elbepack/commands/fetch_initvm_pkgs.py
 usr/lib/python3.*/*-packages/elbepack/commands/gen_update.py
 usr/lib/python3.*/*-packages/elbepack/commands/mkcdrom.py
-usr/lib/python3.*/*-packages/elbepack/commands/toolchainextract.py
 usr/lib/python3.*/*-packages/elbepack/makofiles/environment-setup-elbe.mako
 usr/lib/python3.*/*-packages/elbepack/makofiles/toolchain-shar-extract.sh.mako
 usr/lib/python3.*/*-packages/elbepack/db.py
diff --git a/docs/elbe-toolchainextract.rst b/docs/elbe-toolchainextract.rst
deleted file mode 100644
index 18f1f77cf9a6..000000000000
--- a/docs/elbe-toolchainextract.rst
+++ /dev/null
@@ -1,92 +0,0 @@
-************************
-elbe-toolchainextract
-************************
-
-NAME
-====
-
-elbe-toolchainextract - extract libraries from a cross-toolchain
-
-SYNOPSIS
-========
-
-   ::
-
-      elbe toolchainextract \
-              [ --path <path to toolchain> ] \
-              [ --output <output repository path> ]
-              [ --codename <distro codename for repository> ]
-              [ --buildtype <shortname for the toolchain type> ]
-
-DESCRIPTION
-===========
-
-*elbe toolchainextract* builds a debian repository containing debian
-packages that have been generated from a given cross-toolchain.
-
-This command has to be run as root **inside the Elbe build VM**.
-
-OPTIONS
-=======
-
---path <path to toolchain>
-   basepath to the toolchain that is used to extract the debian
-   packages.
-
---output <output repository path>
-   path were the debian repo will be generated.
-
---codename <distro codename for repository>
-   codename of the debian suite for which the repo should be built for.
-
---buildtype <shortname of the toolchain type>
-   currently armhf-linaro48 or armel-linaro48 can be used.
-
-EXAMPLES
-========
-
--  Build a repo containing the lib packages from a Linaro armhf
-   toolchain.
-
-   ::
-
-      # elbe initvm attach
-
-      login: root  # (password root)
-
-      # elbe toolchainextract \
-          -p /opt/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux \
-          -o /opt/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_repo \
-          -c stretch \
-          -b armhf-linaro48
-
-      # ls /opt/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_repo/pool/main/*/*
-
-      /opt/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_repo/pool/main/liba/libasan0:
-      libasan0_4.8.3_armhf.deb
-
-      /opt/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_repo/pool/main/liba/libatomic1:
-      libatomic1_4.8.3_armhf.deb
-
-      /opt/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_repo/pool/main/libg/libgcc1:
-      libgcc1_4.8.3_armhf.deb
-
-      /opt/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_repo/pool/main/libg/libgfortran3:
-      libgfortran3_4.8.3_armhf.deb
-
-      /opt/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_repo/pool/main/libg/libgomp1:
-      libgomp1_4.8.3_armhf.deb
-
-      /opt/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_repo/pool/main/libm/libmudflap0:
-      libmudflap0_4.8.3_armhf.deb
-
-      /opt/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_repo/pool/main/libs/libssp0:
-      libssp0_4.8.3_armhf.deb
-
-      /opt/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_repo/pool/main/libs/libstdc++6:
-      libstdc++6_4.8.3_armhf.deb
-
-ELBE
-====
-
-Part of the ``elbe(1)`` suite
diff --git a/elbepack/commands/toolchainextract.py b/elbepack/commands/toolchainextract.py
deleted file mode 100644
index be113a65ce23..000000000000
--- a/elbepack/commands/toolchainextract.py
+++ /dev/null
@@ -1,79 +0,0 @@
-# ELBE - Debian Based Embedded Rootfilesystem Builder
-# SPDX-License-Identifier: GPL-3.0-or-later
-# SPDX-FileCopyrightText: 2014-2017 Linutronix GmbH
-
-import os
-import sys
-import tempfile
-from optparse import OptionParser
-
-from elbepack.debpkg import build_binary_deb
-from elbepack.log import elbe_logging
-from elbepack.repomanager import ToolchainRepo
-from elbepack.toolchain import get_toolchain
-from elbepack.xmldefaults import ElbeDefaults
-
-
-def run_command(argv):
-    oparser = OptionParser(usage='usage: %prog toolchainextract [options]')
-    oparser.add_option('-p', '--path', dest='path',
-                       help='path to toolchain')
-    oparser.add_option('-o', '--output', dest='output',
-                       help='output repository path')
-    oparser.add_option('-c', '--codename', dest='codename',
-                       help='distro codename for repository')
-    oparser.add_option('-b', '--buildtype', dest='buildtype',
-                       help='Override the buildtype')
-    (opt, _) = oparser.parse_args(argv)
-
-    if not opt.path:
-        oparser.print_help()
-        return 0
-    if not opt.output:
-        oparser.print_help()
-        return 0
-    if not opt.codename:
-        oparser.print_help()
-        return 0
-    if not opt.buildtype:
-        oparser.print_help()
-        return 0
-
-    defaults = ElbeDefaults(opt.buildtype)
-
-    toolchain = get_toolchain(
-        defaults['toolchaintype'],
-        opt.path,
-        defaults['arch'])
-
-    with tempfile.TemporaryDirectory() as tmpdir:
-        for lib in toolchain.pkg_libs:
-            files = toolchain.get_files_for_pkg(lib)
-
-            pkglibpath = os.path.join('usr/lib', defaults['triplet'])
-            fmap = [(f, pkglibpath) for f in files]
-
-            build_binary_deb(
-                lib,
-                defaults['arch'],
-                defaults['toolchainver'],
-                lib +
-                ' extracted from toolchain',
-                fmap,
-                toolchain.pkg_deps[lib],
-                tmpdir)
-
-        pkgs = os.listdir(tmpdir)
-
-        with elbe_logging({'streams': sys.stdout}):
-
-            repo = ToolchainRepo(defaults['arch'],
-                                 opt.codename,
-                                 opt.output)
-
-            for p in pkgs:
-                repo.includedeb(os.path.join(tmpdir, p))
-
-            repo.finalize()
-
-    return 0
diff --git a/newsfragments/+toolchainextract.removal.rst b/newsfragments/+toolchainextract.removal.rst
new file mode 100644
index 000000000000..3f47f3713b8b
--- /dev/null
+++ b/newsfragments/+toolchainextract.removal.rst
@@ -0,0 +1 @@
+The *internal* command `elbe toolchainextract`.

-- 
2.45.2



More information about the elbe-devel mailing list