[elbe-devel] [PATCH 3/8] elbepack: commands: drop internal genlicence command
Thomas Weißschuh
thomas.weissschuh at linutronix.de
Mon Jul 8 11:23:56 CEST 2024
The genlicence 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-genlicence.rst | 61 -----------------------------------
docs/elbe.rst | 4 ---
elbepack/commands/genlicence.py | 53 ------------------------------
newsfragments/+genlicence.removal.rst | 1 +
5 files changed, 1 insertion(+), 119 deletions(-)
diff --git a/debian/python3-elbe-buildenv.install b/debian/python3-elbe-buildenv.install
index a0acffe537d6..06c17e4d4863 100644
--- a/debian/python3-elbe-buildenv.install
+++ b/debian/python3-elbe-buildenv.install
@@ -4,7 +4,6 @@ usr/lib/python3.*/*-packages/elbepack/commands/buildsdk.py
usr/lib/python3.*/*-packages/elbepack/commands/chroot.py
usr/lib/python3.*/*-packages/elbepack/commands/db.py
usr/lib/python3.*/*-packages/elbepack/commands/fetch_initvm_pkgs.py
-usr/lib/python3.*/*-packages/elbepack/commands/genlicence.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
diff --git a/docs/elbe-genlicence.rst b/docs/elbe-genlicence.rst
deleted file mode 100644
index 376513cbece6..000000000000
--- a/docs/elbe-genlicence.rst
+++ /dev/null
@@ -1,61 +0,0 @@
-************************
-elbe-genlicence
-************************
-
-NAME
-====
-
-elbe-genlicence - Generate a file containing the licences of the
-packages included in a project.
-
-SYNOPSIS
-========
-
- ::
-
- elbe genlicence \
- [ --output <filename> ] \
- [ --xml <xmlfilename> ] \
- <project-dir>
-
-DESCRIPTION
-===========
-
-*elbe-genlicence* creates a file which will contain the licences of the
-packages included in a project, generated from the *copyright* files in
-the */usr/share/doc/\** directories of the root filesystem.
-
-This command has to be run **inside the Elbe build VM**.
-
-OPTIONS
-=======
-
---output <filename>
- Write the result to <filename> instead of *licence.txt*.
-
---xml <xmlfilename>
- Write an xml file with all the licenses to <xmlfilename>.
-
---buildtype <buildtype>
- Override the buildtype.
-
---skip-validation
- Skip xml schema validation.
-
-<project>
- The build directory of the project to process.
-
-EXAMPLES
-========
-
-- Generate a licence file for the project in */var/cache/elbe/<uuid>*
- and name the result *myproject-licences.txt*.
-
- ::
-
- # elbe genlicence --output myproject-licences.txt /var/cache/elbe/<uuid>
-
-ELBE
-====
-
-Part of the ``elbe(1)`` suite
diff --git a/docs/elbe.rst b/docs/elbe.rst
index 3ded45773952..56067b32e72e 100644
--- a/docs/elbe.rst
+++ b/docs/elbe.rst
@@ -50,10 +50,6 @@ Elbe COMMANDS
``elbe-gen_update(1)``
generate an update archive for elbe-updated.
-``elbe-genlicence(1)``
- generate a file containing the licences of all packages included in a
- project.
-
``elbe-get_archive(1)``
extract a config archive (.tbz) from a XML file.
diff --git a/elbepack/commands/genlicence.py b/elbepack/commands/genlicence.py
deleted file mode 100644
index 7c5898fd52a2..000000000000
--- a/elbepack/commands/genlicence.py
+++ /dev/null
@@ -1,53 +0,0 @@
-# ELBE - Debian Based Embedded Rootfilesystem Builder
-# SPDX-License-Identifier: GPL-3.0-or-later
-# SPDX-FileCopyrightText: 2014, 2016 Linutronix GmbH
-
-import io
-import logging
-import sys
-from optparse import OptionParser
-
-from elbepack.elbeproject import ElbeProject
-from elbepack.elbexml import ValidationError, ValidationMode
-from elbepack.log import elbe_logging
-
-
-def run_command(argv):
- oparser = OptionParser(usage='usage: %prog genlicence [options] <project>')
- oparser.add_option('--output', dest='output',
- help='outputfilename')
- oparser.add_option('--xml', dest='xml', default=None,
- help='xml outputfilename')
- oparser.add_option('--buildtype', dest='buildtype',
- help='Override the buildtype')
- oparser.add_option('--skip-validation', action='store_true',
- dest='skip_validation', default=False,
- help='Skip xml schema validation')
-
- (opt, args) = oparser.parse_args(argv)
-
- if len(args) != 1:
- print('wrong number of arguments')
- oparser.print_help()
- sys.exit(70)
-
- with elbe_logging({'streams': sys.stdout}):
- try:
- project = ElbeProject(args[0],
- override_buildtype=opt.buildtype,
- skip_validate=opt.skip_validation,
- url_validation=ValidationMode.NO_CHECK)
- except ValidationError:
- logging.exception('XML validation failed. Bailing out')
- sys.exit(71)
-
- if opt.output:
- f = io.open(opt.output, 'w+', encoding='utf-8')
- else:
- f = io.open('licence.txt', 'w+', encoding='utf-8')
-
- pkglist = project.get_rpcaptcache().get_installed_pkgs()
- pkgnames = [p.name for p in pkglist]
-
- project.buildenv.rfs.write_licenses(f, pkgnames, opt.xml)
- f.close()
diff --git a/newsfragments/+genlicence.removal.rst b/newsfragments/+genlicence.removal.rst
new file mode 100644
index 000000000000..38c127196f35
--- /dev/null
+++ b/newsfragments/+genlicence.removal.rst
@@ -0,0 +1 @@
+The *internal* command `elbe genlicence`.
--
2.45.2
More information about the elbe-devel
mailing list