[elbe-devel] [PATCH 07/37] Replace exit static exit codes with ascending numbers.

Benedikt Spranger b.spranger at linutronix.de
Wed Feb 7 15:28:34 CET 2024


From: Hartmut Eilers <eilers at linutronix.de>

E.L.B.E. exits with error codes in different error
cases. The used error codes where 0,1,5,10,20 and 30.
Therfor it was hard to find the appropriate location
in the code where the error occurred. In order to
ease the debugging LX decided to spit out unique
error codes. After this change every sys.exit()
spits out a unique error code, which makes it easy
to identify the location where the error occurred.

Signed-off-by: Hartmut Eilers <eilers at linutronix.de>
Signed-off-by: Benedikt Spranger <b.spranger at linutronix.de>
---
 elbepack/commands/add.py               |  8 +--
 elbepack/commands/adjustpkgs.py        |  2 +-
 elbepack/commands/buildchroot.py       | 10 ++--
 elbepack/commands/buildsdk.py          |  4 +-
 elbepack/commands/buildsysroot.py      |  4 +-
 elbepack/commands/check-build.py       |  4 +-
 elbepack/commands/check_updates.py     |  4 +-
 elbepack/commands/chg_archive.py       |  8 +--
 elbepack/commands/chroot.py            |  4 +-
 elbepack/commands/control.py           | 14 +++---
 elbepack/commands/diff.py              |  2 +-
 elbepack/commands/fetch_initvm_pkgs.py |  4 +-
 elbepack/commands/gen_update.py        | 16 +++---
 elbepack/commands/genlicence.py        |  4 +-
 elbepack/commands/get_archive.py       | 10 ++--
 elbepack/commands/hdimg.py             | 10 ++--
 elbepack/commands/init.py              | 16 +++---
 elbepack/commands/initvm.py            |  6 +--
 elbepack/commands/mkcdrom.py           |  4 +-
 elbepack/commands/parselicence.py      |  4 +-
 elbepack/commands/pbuilder.py          |  4 +-
 elbepack/commands/pin_versions.py      | 10 ++--
 elbepack/commands/pkgdiff.py           |  2 +-
 elbepack/commands/preprocess.py        |  6 +--
 elbepack/commands/prjrepo.py           |  8 +--
 elbepack/commands/repodir.py           |  6 +--
 elbepack/commands/setsel.py            |  2 +-
 elbepack/commands/show.py              | 10 ++--
 elbepack/commands/test.py              |  4 +-
 elbepack/commands/validate.py          |  8 +--
 elbepack/commands/xsdtoasciidoc.py     |  4 +-
 elbepack/debinstaller.py               |  2 +-
 elbepack/elbeproject.py                |  4 +-
 elbepack/initvmaction.py               | 68 +++++++++++++-------------
 elbepack/pbuilderaction.py             | 36 +++++++-------
 elbepack/soapclient.py                 | 68 +++++++++++++-------------
 elbepack/virtapt.py                    |  2 +-
 37 files changed, 191 insertions(+), 191 deletions(-)

diff --git a/elbepack/commands/add.py b/elbepack/commands/add.py
index 721bd8b2..562e9c23 100644
--- a/elbepack/commands/add.py
+++ b/elbepack/commands/add.py
@@ -17,7 +17,7 @@ def run_command(argv):
     if len(args) < 2:
         print("Wrong number of arguments")
         oparser.print_help()
-        sys.exit(20)
+        sys.exit(86)
 
     xmlfile = args[0]
     pkg_lst = args[1:]
@@ -26,14 +26,14 @@ def run_command(argv):
         xml = ElbeXML(xmlfile)
     except ValidationError as E:
         print(f"Error while reading xml file {xmlfile}: {E}")
-        sys.exit(20)
+        sys.exit(87)
 
     for pkg in pkg_lst:
         try:
             xml.add_target_package(pkg)
         except ValueError as E:
             print(f"Error while adding package {pkg} to {xmlfile}: {E}")
-            sys.exit(20)
+            sys.exit(88)
 
     try:
         xml.xml.write(xmlfile)
@@ -41,4 +41,4 @@ def run_command(argv):
     except PermissionError as E:
         print(f"Unable to truncate file {xmlfile}: {E}")
 
-    sys.exit(20)
+    sys.exit(89)
diff --git a/elbepack/commands/adjustpkgs.py b/elbepack/commands/adjustpkgs.py
index f1137ffd..a1f8b477 100644
--- a/elbepack/commands/adjustpkgs.py
+++ b/elbepack/commands/adjustpkgs.py
@@ -78,7 +78,7 @@ def run_command(argv):
     if len(args) != 1:
         print("Wrong number of arguments")
         oparser.print_help()
-        sys.exit(20)
+        sys.exit(62)
 
     if not opt.output:
         return 0
diff --git a/elbepack/commands/buildchroot.py b/elbepack/commands/buildchroot.py
index c36ec2ff..e7ad440e 100644
--- a/elbepack/commands/buildchroot.py
+++ b/elbepack/commands/buildchroot.py
@@ -72,11 +72,11 @@ def run_command(argv):
     if len(args) != 1:
         print("wrong number of arguments")
         oparser.print_help()
-        sys.exit(20)
+        sys.exit(26)
 
     if not opt.target:
         print("No target specified")
-        sys.exit(20)
+        sys.exit(27)
 
     if opt.skip_cdrom:
         print("WARNING: Skip CDROMS is now the default, "
@@ -88,7 +88,7 @@ def run_command(argv):
                                   opt.buildtype, opt.skip_validation)
         except ValidationError:
             logging.exception("XML validation failed.  Bailing out")
-            sys.exit(20)
+            sys.exit(28)
 
         try:
             project.build(
@@ -99,11 +99,11 @@ def run_command(argv):
                 opt.skip_pbuild)
         except CommandError as ce:
             logging.error("Command in project build failed: %s", ce.cmd)
-            sys.exit(20)
+            sys.exit(29)
 
         try:
             db = ElbeDB()
             db.save_project(project)
         except OperationalError:
             logging.exception("Failed to save project in database")
-            sys.exit(20)
+            sys.exit(30)
diff --git a/elbepack/commands/buildsdk.py b/elbepack/commands/buildsdk.py
index 56b6a97d..ac5a015a 100644
--- a/elbepack/commands/buildsdk.py
+++ b/elbepack/commands/buildsdk.py
@@ -25,7 +25,7 @@ def run_command(argv):
     if len(args) != 1:
         print("wrong number of arguments")
         oparser.print_help()
-        sys.exit(20)
+        sys.exit(39)
 
     with elbe_logging({"streams":sys.stdout}):
         try:
@@ -33,6 +33,6 @@ def run_command(argv):
                                   skip_validate=opt.skip_validation)
         except ValidationError:
             logging.exception("xml validation failed.  Bailing out")
-            sys.exit(20)
+            sys.exit(40)
 
         project.build_sdk()
diff --git a/elbepack/commands/buildsysroot.py b/elbepack/commands/buildsysroot.py
index e7dee8c2..e11d87bf 100644
--- a/elbepack/commands/buildsysroot.py
+++ b/elbepack/commands/buildsysroot.py
@@ -25,7 +25,7 @@ def run_command(argv):
     if len(args) != 1:
         print("wrong number of arguments")
         oparser.print_help()
-        sys.exit(20)
+        sys.exit(99)
 
     with elbe_logging({"streams":sys.stdout}):
         try:
@@ -33,6 +33,6 @@ def run_command(argv):
                                   skip_validate=opt.skip_validation)
         except ValidationError:
             logging.exception("XML validation failed.  Bailing out")
-            sys.exit(20)
+            sys.exit(100)
 
         project.build_sysroot()
diff --git a/elbepack/commands/check-build.py b/elbepack/commands/check-build.py
index 684c0dda..11f37c76 100644
--- a/elbepack/commands/check-build.py
+++ b/elbepack/commands/check-build.py
@@ -28,7 +28,7 @@ def run_command(argv):
 
     if len(args) < 2:
         oparser.print_help()
-        os.sys.exit(20)
+        os.sys.exit(63)
 
     if args[0] == "all":
         tests = [CheckBase.tests[tag] for tag in CheckBase.tests]
@@ -39,7 +39,7 @@ def run_command(argv):
         print("Valid tests are:\n\tall")
         for tag in CheckBase.tests:
             print(f"\t{tag}")
-        os.sys.exit(20)
+        os.sys.exit(64)
 
     total_cnt = 0
     fail_cnt  = 0
diff --git a/elbepack/commands/check_updates.py b/elbepack/commands/check_updates.py
index bc1cea8d..0d87bb49 100644
--- a/elbepack/commands/check_updates.py
+++ b/elbepack/commands/check_updates.py
@@ -61,7 +61,7 @@ def run_command(argv):
     if len(args) != 1:
         print("Wrong number of arguments")
         oparser.print_help()
-        sys.exit(20)
+        sys.exit(51)
 
     if not opt.skip_validation:
         validation = validate_xml(args[0])
@@ -69,7 +69,7 @@ def run_command(argv):
             print("xml validation failed. Bailing out")
             for i in validation:
                 print(i)
-            sys.exit(20)
+            sys.exit(52)
 
     print(f"checking {args[0]}")
 
diff --git a/elbepack/commands/chg_archive.py b/elbepack/commands/chg_archive.py
index 538935d8..cdd02d7e 100644
--- a/elbepack/commands/chg_archive.py
+++ b/elbepack/commands/chg_archive.py
@@ -27,22 +27,22 @@ def run_command(argv):
     if len(args) != 2:
         print("Wrong number of arguments")
         oparser.print_help()
-        sys.exit(20)
+        sys.exit(42)
 
     try:
         xml = etree(args[0])
     except BaseException:
         print("Error reading xml file!")
-        sys.exit(20)
+        sys.exit(43)
 
     try:
         xml = chg_archive(xml, args[1], opt.keep_attributes)
     except BaseException:
         print("Error reading archive")
-        sys.exit(20)
+        sys.exit(44)
 
     try:
         xml.write(args[0])
     except BaseException:
         print("Unable to write new xml file")
-        sys.exit(20)
+        sys.exit(45)
diff --git a/elbepack/commands/chroot.py b/elbepack/commands/chroot.py
index 9e615505..12c72efa 100644
--- a/elbepack/commands/chroot.py
+++ b/elbepack/commands/chroot.py
@@ -30,7 +30,7 @@ def run_command(argv):
     if not args:
         print("wrong number of arguments")
         oparser.print_help()
-        sys.exit(20)
+        sys.exit(72)
 
     with elbe_logging({"streams":sys.stdout}):
         try:
@@ -40,7 +40,7 @@ def run_command(argv):
                                   url_validation=ValidationMode.NO_CHECK)
         except ValidationError:
             logging.exception("XML validation failed.  Bailing out")
-            sys.exit(20)
+            sys.exit(73)
 
         os.environ["LANG"] = "C"
         os.environ["LANGUAGE"] = "C"
diff --git a/elbepack/commands/control.py b/elbepack/commands/control.py
index 82188dfb..3b83d737 100644
--- a/elbepack/commands/control.py
+++ b/elbepack/commands/control.py
@@ -133,7 +133,7 @@ def run_command(argv):
         print("", file=sys.stderr)
         print("Check, whether the initvm is actually running.", file=sys.stderr)
         print("try 'elbe initvm start'", file=sys.stderr)
-        sys.exit(10)
+        sys.exit(13)
     except socket.error as e:
         print(
             f"Failed to connect to Soap server {opt.host}:{opt.port}\n",
@@ -143,7 +143,7 @@ def run_command(argv):
             "Check, whether the Soap Server is running inside the initvm",
             file=sys.stderr)
         print("try 'elbe initvm attach'", file=sys.stderr)
-        sys.exit(10)
+        sys.exit(14)
     except BadStatusLine as e:
         print(
             f"Failed to connect to Soap server {opt.host}:{opt.port}\n",
@@ -151,7 +151,7 @@ def run_command(argv):
         print("", file=sys.stderr)
         print("Check, whether the initvm is actually running.", file=sys.stderr)
         print("try 'elbe initvm start'", file=sys.stderr)
-        sys.exit(10)
+        sys.exit(15)
 
     try:
         v_server = control.service.get_version()
@@ -167,20 +167,20 @@ def run_command(argv):
                 "'elbe control --ignore-version-diff install_elbe_version'")
 
             if not opt.ignore_version:
-                sys.exit(20)
+                sys.exit(16)
     except AttributeError:
         print("the elbe installation inside the initvm doesn't provide a \
 get_version interface. Please create a new initvm or upgrade \
 elbe inside the existing initvm.", file=sys.stderr)
         if not opt.ignore_version:
-            sys.exit(20)
+            sys.exit(24)
 
     try:
         action = ClientAction(args[0])
     except KeyError:
         print("elbe control - unknown subcommand", file=sys.stderr)
         ClientAction.print_actions()
-        sys.exit(20)
+        sys.exit(25)
 
     try:
         action.execute(control, opt, args[1:])
@@ -191,4 +191,4 @@ elbe inside the existing initvm.", file=sys.stderr)
             print(e.fault.faultstring, file=sys.stderr)
         else:
             print(e, file=sys.stderr)
-        sys.exit(5)
+        sys.exit(6)
diff --git a/elbepack/commands/diff.py b/elbepack/commands/diff.py
index 13a48689..ff3d8233 100644
--- a/elbepack/commands/diff.py
+++ b/elbepack/commands/diff.py
@@ -107,7 +107,7 @@ def run_command(argv):
     if len(args) != 2:
         print("Wrong number of arguments")
         oparser.print_help()
-        sys.exit(20)
+        sys.exit(106)
 
     if opt.exclude is None:
         opt.exclude = []
diff --git a/elbepack/commands/fetch_initvm_pkgs.py b/elbepack/commands/fetch_initvm_pkgs.py
index 3fe7732a..01239107 100644
--- a/elbepack/commands/fetch_initvm_pkgs.py
+++ b/elbepack/commands/fetch_initvm_pkgs.py
@@ -72,14 +72,14 @@ def run_command(argv):
     if len(args) != 1:
         print("wrong number of arguments")
         oparser.print_help()
-        sys.exit(20)
+        sys.exit(46)
 
     try:
         xml = ElbeXML(args[0], skip_validate=opt.skip_validation)
     except ValidationError as e:
         print(str(e))
         print("xml validation failed. Bailing out")
-        sys.exit(20)
+        sys.exit(47)
 
     with elbe_logging({"streams":sys.stdout}):
 
diff --git a/elbepack/commands/gen_update.py b/elbepack/commands/gen_update.py
index 6c22e5ef..a3ddd733 100644
--- a/elbepack/commands/gen_update.py
+++ b/elbepack/commands/gen_update.py
@@ -53,15 +53,15 @@ def run_command(argv):
     if len(args) != 1:
         if not opt.cfg_dir and not opt.cmd_dir:
             oparser.print_help()
-            sys.exit(20)
+            sys.exit(31)
 
     if len(args) == 1 and not opt.target:
         print("No target specified")
-        sys.exit(20)
+        sys.exit(32)
 
     if not opt.output:
         print("No output file specified")
-        sys.exit(20)
+        sys.exit(33)
 
     if opt.buildtype:
         buildtype = opt.buildtype
@@ -75,18 +75,18 @@ def run_command(argv):
                                   skip_validate=opt.skip_validation)
         except ValidationError:
             logging.exception("XML validation failed.  Bailing out")
-            sys.exit(20)
+            sys.exit(34)
 
     if opt.presh_file:
         if not os.path.isfile(opt.presh_file):
             logging.error('pre.sh file does not exist')
-            sys.exit(20)
+            sys.exit(35)
         project.presh_file = opt.presh_file
 
     if opt.postsh_file:
         if not os.path.isfile(opt.postsh_file):
             logging.error('post.sh file does not exist')
-            sys.exit(20)
+            sys.exit(36)
         project.postsh_file = opt.postsh_file
 
     update_xml = None
@@ -101,7 +101,7 @@ def run_command(argv):
 
         except ValidationError:
             logging.exception("XML validation failed.  Bailing out")
-            sys.exit(20)
+            sys.exit(37)
         except MissingData:
             logging.exception("Missing Data")
-            sys.exit(20)
+            sys.exit(38)
diff --git a/elbepack/commands/genlicence.py b/elbepack/commands/genlicence.py
index 8cc34dbe..53c96d08 100644
--- a/elbepack/commands/genlicence.py
+++ b/elbepack/commands/genlicence.py
@@ -29,7 +29,7 @@ def run_command(argv):
     if len(args) != 1:
         print("wrong number of arguments")
         oparser.print_help()
-        sys.exit(20)
+        sys.exit(70)
 
     with elbe_logging({"streams": sys.stdout}):
         try:
@@ -39,7 +39,7 @@ def run_command(argv):
                                   url_validation=ValidationMode.NO_CHECK)
         except ValidationError:
             logging.exception("XML validation failed.  Bailing out")
-            sys.exit(20)
+            sys.exit(71)
 
         if opt.output:
             f = io.open(opt.output, "w+", encoding='utf-8')
diff --git a/elbepack/commands/get_archive.py b/elbepack/commands/get_archive.py
index 32ede63e..ca6cf50c 100644
--- a/elbepack/commands/get_archive.py
+++ b/elbepack/commands/get_archive.py
@@ -26,24 +26,24 @@ def run_command(argv):
     if len(args) != 2:
         print("Wrong number of arguments")
         oparser.print_help()
-        sys.exit(20)
+        sys.exit(101)
 
     if os.path.exists(args[1]):
         print("archive already exists, bailing out")
-        sys.exit(20)
+        sys.exit(102)
 
     try:
         xml = etree(args[0])
     except BaseException:
         print("Error reading xml file!")
-        sys.exit(20)
+        sys.exit(103)
 
     if xml.has("archive") and not xml.text("archive") is None:
         try:
             unbase(xml.text("archive"), args[1])
         except BaseException:
             print("Error writing archive")
-            sys.exit(20)
+            sys.exit(104)
     else:
         print("no archive in this xml file.")
-        sys.exit(20)
+        sys.exit(105)
diff --git a/elbepack/commands/hdimg.py b/elbepack/commands/hdimg.py
index acd34a3c..c7450344 100644
--- a/elbepack/commands/hdimg.py
+++ b/elbepack/commands/hdimg.py
@@ -41,17 +41,17 @@ def run_command(argv):
     if len(args) != 1:
         print("Wrong number of arguments")
         oparser.print_help()
-        sys.exit(20)
+        sys.exit(65)
 
     if not opt.target:
         print("No directory specified!")
         oparser.print_help()
-        sys.exit(20)
+        sys.exit(66)
 
     if not opt.output:
         print("No Log output")
         oparser.print_help()
-        sys.exit(20)
+        sys.exit(67)
 
     if opt.skip_grub:
         opt.grub_version = 0
@@ -59,7 +59,7 @@ def run_command(argv):
     if opt.grub_version not in [0, 97, 202]:
         print("invalid grub version")
         oparser.print_help()
-        sys.exit(20)
+        sys.exit(68)
 
     with elbe_logging({"files":opt.output}):
         try:
@@ -69,6 +69,6 @@ def run_command(argv):
                                   skip_validate=opt.skip_validation)
         except ValidationError:
             logging.exception("XML validation failed.  Bailing out")
-            sys.exit(20)
+            sys.exit(69)
 
         project.targetfs.part_target(opt.target, opt.grub_version)
diff --git a/elbepack/commands/init.py b/elbepack/commands/init.py
index d62946f9..536112fc 100644
--- a/elbepack/commands/init.py
+++ b/elbepack/commands/init.py
@@ -88,18 +88,18 @@ def run_command(argv):
     if not args:
         print("no filename specified")
         oparser.print_help()
-        sys.exit(20)
+        sys.exit(78)
     elif len(args) > 1:
         print("too many filenames specified")
         oparser.print_help()
-        sys.exit(20)
+        sys.exit(79)
 
     with elbe_logging({"files": None}):
         if opt.devel:
             if not os.path.isdir(os.path.join(elbe_dir, "elbepack")):
                 logging.error("Devel Mode only valid, "
                               "when running from elbe checkout")
-                sys.exit(20)
+                sys.exit(80)
 
         if not opt.skip_validation:
             validation = validate_xml(args[0])
@@ -107,14 +107,14 @@ def run_command(argv):
                 logging.error("xml validation failed. Bailing out")
                 for i in validation:
                     logging.error(i)
-                sys.exit(20)
+                sys.exit(81)
 
         xml = etree(args[0])
 
         if not xml.has("initvm"):
             logging.error("fatal error: "
                           "xml missing mandatory section 'initvm'")
-            sys.exit(20)
+            sys.exit(82)
 
         if opt.buildtype:
             buildtype = opt.buildtype
@@ -140,7 +140,7 @@ def run_command(argv):
             logging.error("unable to create project directory: %s (%s)",
                           opt.directory,
                           e.strerror)
-            sys.exit(30)
+            sys.exit(83)
 
         out_path = os.path.join(opt.directory, ".elbe-in")
         try:
@@ -149,7 +149,7 @@ def run_command(argv):
             logging.error("unable to create subdirectory: %s (%s)",
                           out_path,
                           e.strerror)
-            sys.exit(30)
+            sys.exit(84)
 
         initvm_http_proxy = http_proxy.replace('http://localhost:',
                                                'http://10.0.2.2:')
@@ -181,7 +181,7 @@ def run_command(argv):
                 logging.error("If you use debmirror please read "
                               "https://github.com/Linutronix/elbe/issues/188 "
                               "on how to work around the issue")
-            sys.exit(20)
+            sys.exit(85)
 
         templates = os.listdir(init_template_dir)
 
diff --git a/elbepack/commands/initvm.py b/elbepack/commands/initvm.py
index 74655a55..5321c1c2 100644
--- a/elbepack/commands/initvm.py
+++ b/elbepack/commands/initvm.py
@@ -76,7 +76,7 @@ def run_command(argv):
     if not args:
         print("elbe initvm - no subcommand given", file=sys.stderr)
         InitVMAction.print_actions()
-        sys.exit(20)
+        sys.exit(48)
 
     directory = opt.directory or os.getcwd() + '/initvm'
 
@@ -88,11 +88,11 @@ def run_command(argv):
     except KeyError:
         print("elbe initvm - unknown subcommand", file=sys.stderr)
         InitVMAction.print_actions()
-        sys.exit(20)
+        sys.exit(49)
 
     try:
         action.execute(directory, opt, args[1:])
     except InitVMError as e:
         print("InitVM Exception", file=sys.stderr)
         print(e, file=sys.stderr)
-        sys.exit(5)
+        sys.exit(50)
diff --git a/elbepack/commands/mkcdrom.py b/elbepack/commands/mkcdrom.py
index de1709a1..fcbb0eb8 100644
--- a/elbepack/commands/mkcdrom.py
+++ b/elbepack/commands/mkcdrom.py
@@ -56,7 +56,7 @@ def run_command(argv):
     if len(args) != 1:
         print("wrong number of arguments", file=sys.stderr)
         oparser.print_help()
-        sys.exit(20)
+        sys.exit(74)
 
     with elbe_logging({"files":opt.log}):
 
@@ -67,7 +67,7 @@ def run_command(argv):
                                       skip_validate=opt.skip_validation)
             except ValidationError:
                 logging.exception("XML validation failed.  Bailing out")
-                sys.exit(20)
+                sys.exit(75)
 
             builddir = project.builddir
             rfs = project.buildenv.rfs
diff --git a/elbepack/commands/parselicence.py b/elbepack/commands/parselicence.py
index b57e4c5c..25626c33 100644
--- a/elbepack/commands/parselicence.py
+++ b/elbepack/commands/parselicence.py
@@ -154,7 +154,7 @@ def run_command(argv):
     if len(args) != 1:
         print("wrong number of arguments")
         oparser.print_help()
-        sys.exit(20)
+        sys.exit(53)
 
     tree = etree(args[0])
 
@@ -166,7 +166,7 @@ def run_command(argv):
     if not opt.mapping:
         print("A mapping file is required")
         oparser.print_help()
-        sys.exit(20)
+        sys.exit(54)
 
     mapping = license_dep5_to_spdx(opt.mapping)
 
diff --git a/elbepack/commands/pbuilder.py b/elbepack/commands/pbuilder.py
index 4eb534d4..e308de4a 100644
--- a/elbepack/commands/pbuilder.py
+++ b/elbepack/commands/pbuilder.py
@@ -72,11 +72,11 @@ def run_command(argv):
     except KeyError:
         print("elbe pbuilder - unknown subcommand", file=sys.stderr)
         PBuilderAction.print_actions()
-        sys.exit(20)
+        sys.exit(92)
 
     try:
         action.execute(opt, args[1:])
     except PBuilderError as e:
         print("PBuilder Exception", file=sys.stderr)
         print(e, file=sys.stderr)
-        sys.exit(5)
+        sys.exit(93)
diff --git a/elbepack/commands/pin_versions.py b/elbepack/commands/pin_versions.py
index bf77fc74..7b022ce5 100644
--- a/elbepack/commands/pin_versions.py
+++ b/elbepack/commands/pin_versions.py
@@ -23,7 +23,7 @@ def run_command(argv):
     if len(args) != 1:
         print("Wrong number of arguments")
         oparser.print_help()
-        sys.exit(20)
+        sys.exit(94)
 
     if not opt.skip_validation:
         validation = validate_xml(args[0])
@@ -31,17 +31,17 @@ def run_command(argv):
             print("xml validation failed. Bailing out")
             for i in validation:
                 print(i)
-            sys.exit(20)
+            sys.exit(95)
 
     try:
         xml = etree(args[0])
     except BaseException:
         print("Error reading xml file!")
-        sys.exit(20)
+        sys.exit(96)
 
     if not xml.has("fullpkgs"):
         print("xml file does not have fullpkgs node")
-        sys.exit(20)
+        sys.exit(97)
 
     plist = xml.ensure_child("/target/pkg-list")
     plist.clear()
@@ -61,4 +61,4 @@ def run_command(argv):
         xml.write(args[0])
     except BaseException:
         print("Unable to write new xml file")
-        sys.exit(20)
+        sys.exit(98)
diff --git a/elbepack/commands/pkgdiff.py b/elbepack/commands/pkgdiff.py
index a94e7c4e..20cd287b 100644
--- a/elbepack/commands/pkgdiff.py
+++ b/elbepack/commands/pkgdiff.py
@@ -31,7 +31,7 @@ def run_command(argv):
     if len(args) != 2:
         print("Wrong number of arguments")
         oparser.print_help()
-        sys.exit(20)
+        sys.exit(41)
 
     gen_rfs = args[0]
     fix_rfs = args[1]
diff --git a/elbepack/commands/preprocess.py b/elbepack/commands/preprocess.py
index f99f456e..e42fe857 100644
--- a/elbepack/commands/preprocess.py
+++ b/elbepack/commands/preprocess.py
@@ -32,11 +32,11 @@ def run_command(argv):
     if len(args) != 1:
         print("Wrong number of arguments", file=sys.stderr)
         oparser.print_help()
-        sys.exit(20)
+        sys.exit(112)
 
     if not os.path.isfile(args[0]):
         print(f"{args[0]} doesn't exist", file=sys.stderr)
-        sys.exit(20)
+        sys.exit(113)
 
     variants = []
     if opt.variant:
@@ -46,4 +46,4 @@ def run_command(argv):
         xmlpreprocess(args[0], opt.output, variants, opt.proxy, opt.gzip)
     except XMLPreprocessError as e:
         print(e, file=sys.stderr)
-        sys.exit(20)
+        sys.exit(114)
diff --git a/elbepack/commands/prjrepo.py b/elbepack/commands/prjrepo.py
index 9e597f40..67e2d272 100644
--- a/elbepack/commands/prjrepo.py
+++ b/elbepack/commands/prjrepo.py
@@ -88,7 +88,7 @@ def run_command(argv):
             "Check, wether the Soap Server is running inside the initvm",
             file=sys.stderr)
         print("try 'elbe initvm attach'", file=sys.stderr)
-        sys.exit(10)
+        sys.exit(11)
     except BadStatusLine as e:
         print(
             f"Failed to connect to Soap server {opt.host}:{opt.port}\n",
@@ -98,7 +98,7 @@ def run_command(argv):
         print(
             "try 'elbe initvm --directory /path/to/initvm start'",
             file=sys.stderr)
-        sys.exit(10)
+        sys.exit(12)
 
     # Check Elbe version
     try:
@@ -118,7 +118,7 @@ def run_command(argv):
 get_version interface. Please create a new initvm or upgrade \
 elbe inside the existing initvm.", file=sys.stderr)
         if not opt.ignore_version:
-            sys.exit(20)
+            sys.exit(21)
 
     # Check whether subcommand exists
     try:
@@ -126,7 +126,7 @@ elbe inside the existing initvm.", file=sys.stderr)
     except KeyError:
         print("elbe prjrepo - unknown subcommand", file=sys.stderr)
         RepoAction.print_actions()
-        sys.exit(20)
+        sys.exit(22)
 
     # Execute command
     try:
diff --git a/elbepack/commands/repodir.py b/elbepack/commands/repodir.py
index a991e548..8c896b47 100644
--- a/elbepack/commands/repodir.py
+++ b/elbepack/commands/repodir.py
@@ -19,12 +19,12 @@ def run_command(argv):
     if len(args) != 1:
         print("Wrong number of arguments", file=sys.stderr)
         oparser.print_help()
-        sys.exit(20)
+        sys.exit(55)
 
     xml_input = args[0]
     if not os.path.isfile(xml_input):
         print(f"{xml_input} does not exist", file=sys.stderr)
-        sys.exit(20)
+        sys.exit(56)
 
     if os.path.exists(opt.output):
         # This will be overridden. Try to delete first to make sure it is a regular file.
@@ -37,4 +37,4 @@ def run_command(argv):
         print()
     except RepodirError as e:
         print(e, file=sys.stderr)
-        sys.exit(20)
+        sys.exit(57)
diff --git a/elbepack/commands/setsel.py b/elbepack/commands/setsel.py
index 6d79f46d..54c3580e 100644
--- a/elbepack/commands/setsel.py
+++ b/elbepack/commands/setsel.py
@@ -39,7 +39,7 @@ def run_command(argv):
     if len(args) != 2:
         print("Wrong number of arguments")
         oparser.print_help()
-        sys.exit(20)
+        sys.exit(23)
 
     xml = etree(args[0])
 
diff --git a/elbepack/commands/show.py b/elbepack/commands/show.py
index 09300222..2f5f2984 100644
--- a/elbepack/commands/show.py
+++ b/elbepack/commands/show.py
@@ -30,12 +30,12 @@ def run_command(argv):
     if not args:
         print("No Filename specified")
         oparser.print_help()
-        sys.exit(20)
+        sys.exit(107)
 
     if len(args) > 1:
         print("too many filenames specified")
         oparser.print_help()
-        sys.exit(20)
+        sys.exit(108)
 
     try:
         if not opt.skip_validation:
@@ -44,16 +44,16 @@ def run_command(argv):
                 print("xml validation failed. Bailing out")
                 for i in validation:
                     print(i)
-                sys.exit(20)
+                sys.exit(109)
 
         xml = etree(args[0])
     except BaseException:
         print("Unable to open xml File. Bailing out")
-        sys.exit(20)
+        sys.exit(110)
 
     if not xml.has("./project"):
         print("no project description available")
-        sys.exit(20)
+        sys.exit(111)
 
     print(f"== {args[0]} ==")
     print(f"Debian suite: {xml.text('./project/suite')}")
diff --git a/elbepack/commands/test.py b/elbepack/commands/test.py
index 8d5de3a5..cfa49f7a 100644
--- a/elbepack/commands/test.py
+++ b/elbepack/commands/test.py
@@ -244,7 +244,7 @@ def run_command(argv):
         print(
             f"Invalid level value '{opt.level}'. Valid values are: "
             f"{', '.join(key for key in ElbeTestLevel.__members__)}")
-        os.sys.exit(20)
+        os.sys.exit(76)
 
     ElbeTestCase.level = ElbeTestLevel[opt.level]
 
@@ -276,4 +276,4 @@ def run_command(argv):
             f.write(result.get_xml())
 
     if not result.wasSuccessful():
-        os.sys.exit(20)
+        os.sys.exit(77)
diff --git a/elbepack/commands/validate.py b/elbepack/commands/validate.py
index 337d3991..351758f4 100644
--- a/elbepack/commands/validate.py
+++ b/elbepack/commands/validate.py
@@ -19,25 +19,25 @@ def run_command(argv):
 
     if not args:
         oparser.print_help()
-        sys.exit(20)
+        sys.exit(58)
 
     if not os.path.exists(args[0]):
         print(f"{args[0]} - file not found")
         oparser.print_help()
-        sys.exit(20)
+        sys.exit(59)
 
     validation = validate_xml(args[0])
     if validation:
         print("validation failed")
         for i in validation:
             print(i)
-        sys.exit(20)
+        sys.exit(60)
 
     if opt.validate_urls:
         try:
             ElbeXML(args[0], url_validation=ValidationMode.CHECK_ALL)
         except ValidationError as e:
             print(e)
-            sys.exit(20)
+            sys.exit(61)
 
     sys.exit(0)
diff --git a/elbepack/commands/xsdtoasciidoc.py b/elbepack/commands/xsdtoasciidoc.py
index ab1bfeb7..bb706e4a 100644
--- a/elbepack/commands/xsdtoasciidoc.py
+++ b/elbepack/commands/xsdtoasciidoc.py
@@ -25,13 +25,13 @@ def run_command(argv):
     if len(args) != 1:
         print("Wrong number of arguments")
         oparser.print_help()
-        sys.exit(20)
+        sys.exit(90)
 
     xml = etree(args[0])
 
     if not opt.out:
         print("--output is mandatory")
-        sys.exit(20)
+        sys.exit(91)
 
     d = {"opt": opt,
          "xml": xml}
diff --git a/elbepack/debinstaller.py b/elbepack/debinstaller.py
index c3d88962..8fe25f63 100644
--- a/elbepack/debinstaller.py
+++ b/elbepack/debinstaller.py
@@ -79,7 +79,7 @@ def setup_apt_keyring(gpg_home, keyring_fname):
         print("/etc/apt/trusted.gpg.d doesn't exist")
         print("apt-get install debian-archive-keyring may "
               "fix this problem")
-        sys.exit(20)
+        sys.exit(115)
 
     if os.path.exists("/etc/apt/trusted.gpg"):
         system(f'cp /etc/apt/trusted.gpg "{ring_path}"')
diff --git a/elbepack/elbeproject.py b/elbepack/elbeproject.py
index 5ba49d92..dc0009e6 100644
--- a/elbepack/elbeproject.py
+++ b/elbepack/elbeproject.py
@@ -715,13 +715,13 @@ class ElbeProject:
             logging.error("Please make sure that you create the pbuilder "
                           "environment with the --cross option if you want to "
                           "use the build command with --cross.")
-            sys.exit(20)
+            sys.exit(116)
 
         if os.path.exists(cross_pbuilderrc) and not cross:
             logging.error("Please make sure that if you created the pbuilder "
                           "environment without the --cross option, you use the "
                           "build command without --cross too.")
-            sys.exit(20)
+            sys.exit(117)
 
         self.pdebuild_init()
 
diff --git a/elbepack/initvmaction.py b/elbepack/initvmaction.py
index b4a37874..99240a73 100644
--- a/elbepack/initvmaction.py
+++ b/elbepack/initvmaction.py
@@ -107,7 +107,7 @@ class InitVMAction:
                     print("Even after waiting 180 seconds.", file=sys.stderr)
                     print("Make sure that package 'libvirt-daemon-system' is", file=sys.stderr)
                     print("installed, and the service is running properly", file=sys.stderr)
-                    sys.exit(20)
+                    sys.exit(118)
 
             elif verr.args[0].startswith('authentication unavailable'):
                 print("", file=sys.stderr)
@@ -115,7 +115,7 @@ class InitVMAction:
                 print("Users which want to use elbe need to be members of the 'libvirt' group.", file=sys.stderr)
                 print("'gpasswd -a <user> libvirt' and logging in again,", file=sys.stderr)
                 print("should fix the problem.", file=sys.stderr)
-                sys.exit(20)
+                sys.exit(119)
 
             elif verr.args[0].startswith('error from service: CheckAuthorization'):
                 print("", file=sys.stderr)
@@ -124,7 +124,7 @@ class InitVMAction:
                 print("timed out. If this occured after 'elbe initvm create'", file=sys.stderr)
                 print("it should be safe to use 'elbe initvm start' to", file=sys.stderr)
                 print("continue.", file=sys.stderr)
-                sys.exit(20)
+                sys.exit(120)
 
             else:
                 # In case we get here, the exception is unknown, and we want to see it
@@ -137,7 +137,7 @@ class InitVMAction:
                 self.initvm = d
 
         if not self.initvm and initvmNeeded:
-            sys.exit(20)
+            sys.exit(121)
 
 
     def execute(self, _initvmdir, _opt, _args):
@@ -175,7 +175,7 @@ class StartAction(InitVMAction):
 
         if self.initvm_state() == libvirt.VIR_DOMAIN_RUNNING:
             print('Initvm already running.')
-            sys.exit(20)
+            sys.exit(122)
         elif self.initvm_state() == libvirt.VIR_DOMAIN_SHUTOFF:
             self._attach_disk_fds(_initvmdir)
 
@@ -217,11 +217,11 @@ class EnsureAction(InitVMAction):
                 if time.time() > stop:
                     print(f"Waited for 5 minutes and the daemon is still not active: {cmd[2]}",
                           file=sys.stderr)
-                    sys.exit(20)
+                    sys.exit(123)
                 time.sleep(10)
         else:
             print("Elbe initvm in bad state.")
-            sys.exit(20)
+            sys.exit(124)
 
 
 
@@ -236,7 +236,7 @@ class StopAction(InitVMAction):
 
         if self.initvm_state() != libvirt.VIR_DOMAIN_RUNNING:
             print('Initvm is not running.')
-            sys.exit(20)
+            sys.exit(125)
 
         while True:
 
@@ -271,7 +271,7 @@ class AttachAction(InitVMAction):
 
         if self.initvm_state() != libvirt.VIR_DOMAIN_RUNNING:
             print('Error: Initvm not running properly.')
-            sys.exit(20)
+            sys.exit(126)
 
         print('Attaching to initvm console.')
         system(f'virsh --connect qemu:///system console {cfg["initvm_domain"]}')
@@ -287,7 +287,7 @@ def submit_with_repodir_and_dl_result(xmlfile, cdrom, opt):
     except RepodirError as err:
         print("elbe repodir failed", file=sys.stderr)
         print(err, file=sys.stderr)
-        sys.exit(20)
+        sys.exit(127)
     finally:
         os.remove(preprocess_xmlfile)
 
@@ -307,7 +307,7 @@ def submit_and_dl_result(xmlfile, cdrom, opt):
                 print("elbe control create_project failed.", file=sys.stderr)
                 print(err, file=sys.stderr)
                 print("Giving up", file=sys.stderr)
-                sys.exit(20)
+                sys.exit(128)
 
             prjdir = prjdir.strip()
 
@@ -317,13 +317,13 @@ def submit_and_dl_result(xmlfile, cdrom, opt):
                 print("elbe control set_xml failed2", file=sys.stderr)
                 print(err, file=sys.stderr)
                 print("Giving up", file=sys.stderr)
-                sys.exit(20)
+                sys.exit(129)
     except CommandError:
         # this is the failure from PreprocessWrapper
         # it already printed the error message from
         # elbe preprocess
         print("Giving up", file=sys.stderr)
-        sys.exit(20)
+        sys.exit(130)
 
     if opt.writeproject:
         with open(opt.writeproject, "w") as wpf:
@@ -336,7 +336,7 @@ def submit_and_dl_result(xmlfile, cdrom, opt):
         except CommandError:
             print("elbe control set_cdrom Failed", file=sys.stderr)
             print("Giving up", file=sys.stderr)
-            sys.exit(20)
+            sys.exit(131)
 
         print("Upload finished")
 
@@ -353,7 +353,7 @@ def submit_and_dl_result(xmlfile, cdrom, opt):
     except CommandError:
         print("elbe control build Failed", file=sys.stderr)
         print("Giving up", file=sys.stderr)
-        sys.exit(20)
+        sys.exit(132)
 
     print("Build started, waiting till it finishes")
 
@@ -375,7 +375,7 @@ def submit_and_dl_result(xmlfile, cdrom, opt):
         print(f'{elbe_exe} control del_project "{prjdir}"',
               file=sys.stderr)
         print("", file=sys.stderr)
-        sys.exit(10)
+        sys.exit(133)
 
     print("")
     print("Build finished !")
@@ -387,7 +387,7 @@ def submit_and_dl_result(xmlfile, cdrom, opt):
         except CommandError:
             print("elbe control build_sdk Failed", file=sys.stderr)
             print("Giving up", file=sys.stderr)
-            sys.exit(20)
+            sys.exit(134)
 
         print("SDK Build started, waiting till it finishes")
 
@@ -411,7 +411,7 @@ def submit_and_dl_result(xmlfile, cdrom, opt):
             print(f'{elbe_exe} control del_project "{prjdir}"',
                   file=sys.stderr)
             print("", file=sys.stderr)
-            sys.exit(10)
+            sys.exit(135)
 
         print("")
         print("SDK Build finished !")
@@ -430,7 +430,7 @@ def submit_and_dl_result(xmlfile, cdrom, opt):
 
             print("Failed to dump log.txt", file=sys.stderr)
             print("Giving up", file=sys.stderr)
-        sys.exit(20)
+        sys.exit(136)
 
     if opt.skip_download:
         print("")
@@ -441,7 +441,7 @@ def submit_and_dl_result(xmlfile, cdrom, opt):
         except CommandError:
             print("elbe control get_files Failed", file=sys.stderr)
             print("Giving up", file=sys.stderr)
-            sys.exit(20)
+            sys.exit(137)
 
         print("")
         print(f'Get Files with: elbe control get_file "{prjdir}" <filename>')
@@ -459,7 +459,7 @@ def submit_and_dl_result(xmlfile, cdrom, opt):
         except CommandError:
             print("elbe control get_files Failed", file=sys.stderr)
             print("Giving up", file=sys.stderr)
-            sys.exit(20)
+            sys.exit(138)
 
         if not opt.keep_files:
             try:
@@ -467,7 +467,7 @@ def submit_and_dl_result(xmlfile, cdrom, opt):
             except CommandError:
                 print("remove project from initvm failed",
                       file=sys.stderr)
-                sys.exit(20)
+                sys.exit(139)
 
 def extract_cdrom(cdrom):
     """ Extract cdrom iso image
@@ -498,7 +498,7 @@ def extract_cdrom(cdrom):
             file=sys.stderr)
         print("", file=sys.stderr)
         print("Exiting !!!", file=sys.stderr)
-        sys.exit(20)
+        sys.exit(140)
 
     try:
         exml = ElbeXML(
@@ -514,7 +514,7 @@ def extract_cdrom(cdrom):
         print("", file=sys.stderr)
         print("Exiting !!!", file=sys.stderr)
         print(e)
-        sys.exit(20)
+        sys.exit(141)
 
     print("Iso Image with valid source.xml detected !")
     print(f"Image was generated using Elbe Version {exml.get_elbe_version()}")
@@ -546,7 +546,7 @@ class CreateAction(InitVMAction):
             print("\t   where <file> is the corresponding libvirt.xml")
             print("\t2) virsh --connect qemu:///system undefine does not delete the image "
                   "of your old initvm.")
-            sys.exit(20)
+            sys.exit(142)
 
         # Upgrade from older versions which used tmux
         try:
@@ -554,7 +554,7 @@ class CreateAction(InitVMAction):
             print ("ElbeInitVMSession exists in tmux. "
                    "It may belong to an old elbe version. "
                    "Please stop it to prevent interfering with this version.", file=sys.stderr)
-            sys.exit(20)
+            sys.exit(143)
         except CommandError:
             pass
 
@@ -584,7 +584,7 @@ class CreateAction(InitVMAction):
                 print(
                     "Unknown file ending (use either xml or iso)",
                     file=sys.stderr)
-                sys.exit(20)
+                sys.exit(144)
         else:
             # No xml File was specified, build the default elbe-init-with-ssh
             xmlfile = os.path.join(
@@ -619,7 +619,7 @@ class CreateAction(InitVMAction):
         except CommandError:
             print("'elbe init' Failed", file=sys.stderr)
             print("Giving up", file=sys.stderr)
-            sys.exit(20)
+            sys.exit(145)
 
         # Read xml file for libvirt
         with open(os.path.join(initvmdir, 'libvirt.xml')) as f:
@@ -632,7 +632,7 @@ class CreateAction(InitVMAction):
             print('Registering initvm in libvirt failed', file=sys.stderr)
             print(f"Try `virsh --connect qemu:///system undefine {cfg['initvm_domain']}` to delete existing initvm",
                   file=sys.stderr)
-            sys.exit(20)
+            sys.exit(146)
 
         # Build initvm
         try:
@@ -640,14 +640,14 @@ class CreateAction(InitVMAction):
         except CommandError:
             print("Building the initvm Failed", file=sys.stderr)
             print("Giving up", file=sys.stderr)
-            sys.exit(20)
+            sys.exit(147)
 
         try:
             system(f'{sys.executable} {elbe_exe} initvm start')
         except CommandError:
             print("Starting the initvm Failed", file=sys.stderr)
             print("Giving up", file=sys.stderr)
-            sys.exit(20)
+            sys.exit(148)
 
         if len(args) == 1:
             # if provided xml file has no initvm section xmlfile is set to a
@@ -658,7 +658,7 @@ class CreateAction(InitVMAction):
                     x = etree(args[0])
                 except ValidationError as e:
                     print(f"XML file is invalid: {e}")
-                    sys.exit(20)
+                    sys.exit(149)
                 if not x.has('project'):
                     print("elbe initvm ready: use 'elbe initvm submit "
                           "myproject.xml' to build a project")
@@ -683,7 +683,7 @@ class SubmitAction(InitVMAction):
         except CommandError:
             print("Starting the initvm Failed", file=sys.stderr)
             print("Giving up", file=sys.stderr)
-            sys.exit(20)
+            sys.exit(150)
 
         # Init cdrom to None, if we detect it, we set it
         cdrom = None
@@ -702,7 +702,7 @@ class SubmitAction(InitVMAction):
                 print(
                     "Unknown file ending (use either xml or iso)",
                     file=sys.stderr)
-                sys.exit(20)
+                sys.exit(151)
 
             submit_with_repodir_and_dl_result(xmlfile, cdrom, opt)
 
diff --git a/elbepack/pbuilderaction.py b/elbepack/pbuilderaction.py
index 256bf610..8725ec7b 100644
--- a/elbepack/pbuilderaction.py
+++ b/elbepack/pbuilderaction.py
@@ -82,7 +82,7 @@ class CreateAction(PBuilderAction):
                               file=sys.stderr)
                         print(err, file=sys.stderr)
                         print("Giving up", file=sys.stderr)
-                        sys.exit(20)
+                        sys.exit(152)
 
                     prjdir = prjdir.strip()
                     ret, _, err = command_out_stderr(
@@ -92,13 +92,13 @@ class CreateAction(PBuilderAction):
                         print("elbe control set_xml failed.", file=sys.stderr)
                         print(err, file=sys.stderr)
                         print("Giving up", file=sys.stderr)
-                        sys.exit(20)
+                        sys.exit(153)
             except CommandError:
                 # this is the failure from PreprocessWrapper
                 # it already printed the error message from
                 # elbe preprocess
                 print("Giving up", file=sys.stderr)
-                sys.exit(20)
+                sys.exit(154)
 
             if opt.writeproject:
                 wpf = open(opt.writeproject, "w")
@@ -109,7 +109,7 @@ class CreateAction(PBuilderAction):
             prjdir = opt.project
         else:
             print("you need to specify --project option", file=sys.stderr)
-            sys.exit(20)
+            sys.exit(155)
 
         print("Creating pbuilder")
 
@@ -118,14 +118,14 @@ class CreateAction(PBuilderAction):
         except CommandError:
             print("elbe control build_pbuilder Failed", file=sys.stderr)
             print("Giving up", file=sys.stderr)
-            sys.exit(20)
+            sys.exit(156)
 
         try:
             system(f'{sys.executable} {elbe_exe} control wait_busy "{prjdir}"')
         except CommandError:
             print("elbe control wait_busy Failed", file=sys.stderr)
             print("Giving up", file=sys.stderr)
-            sys.exit(20)
+            sys.exit(157)
 
         print("")
         print("Building Pbuilder finished !")
@@ -146,7 +146,7 @@ class UpdateAction(PBuilderAction):
 
         if not opt.project:
             print("you need to specify --project option", file=sys.stderr)
-            sys.exit(20)
+            sys.exit(158)
 
         prjdir = opt.project
 
@@ -157,7 +157,7 @@ class UpdateAction(PBuilderAction):
         except CommandError:
             print("elbe control update_pbuilder Failed", file=sys.stderr)
             print("Giving up", file=sys.stderr)
-            sys.exit(20)
+            sys.exit(159)
 
         print("")
         print("Updating Pbuilder finished !")
@@ -191,7 +191,7 @@ class BuildAction(PBuilderAction):
                 print("elbe control create_project failed.", file=sys.stderr)
                 print(err, file=sys.stderr)
                 print("Giving up", file=sys.stderr)
-                sys.exit(20)
+                sys.exit(160)
 
             prjdir = prjdir.strip()
 
@@ -200,14 +200,14 @@ class BuildAction(PBuilderAction):
             except CommandError:
                 print("elbe control build_pbuilder Failed", file=sys.stderr)
                 print("Giving up", file=sys.stderr)
-                sys.exit(20)
+                sys.exit(161)
 
             try:
                 system(f'{sys.executable} {elbe_exe} control wait_busy "{prjdir}"')
             except CommandError:
                 print("elbe control wait_busy Failed", file=sys.stderr)
                 print("Giving up", file=sys.stderr)
-                sys.exit(20)
+                sys.exit(162)
 
             print("")
             print("Building Pbuilder finished !")
@@ -219,7 +219,7 @@ class BuildAction(PBuilderAction):
             print(
                 "you need to specify --project or --xmlfile option",
                 file=sys.stderr)
-            sys.exit(20)
+            sys.exit(163)
 
         print("")
         print("Packing Source into tmp archive")
@@ -229,7 +229,7 @@ class BuildAction(PBuilderAction):
         except CommandError:
             print("tar Failed", file=sys.stderr)
             print("Giving up", file=sys.stderr)
-            sys.exit(20)
+            sys.exit(164)
 
         for of in opt.origfile:
             print("")
@@ -241,7 +241,7 @@ class BuildAction(PBuilderAction):
             except CommandError:
                 print("elbe control set_orig Failed", file=sys.stderr)
                 print("Giving up", file=sys.stderr)
-                sys.exit(20)
+                sys.exit(165)
 
         print("")
         print("Pushing source into pbuilder")
@@ -255,13 +255,13 @@ class BuildAction(PBuilderAction):
         except CommandError:
             print("elbe control set_pdebuild Failed", file=sys.stderr)
             print("Giving up", file=sys.stderr)
-            sys.exit(20)
+            sys.exit(166)
         try:
             system(f'{sys.executable} {elbe_exe} control wait_busy "{prjdir}"')
         except CommandError:
             print("elbe control wait_busy Failed", file=sys.stderr)
             print("Giving up", file=sys.stderr)
-            sys.exit(20)
+            sys.exit(167)
         print("")
         print("Pdebuild finished !")
         print("")
@@ -285,7 +285,7 @@ class BuildAction(PBuilderAction):
                     print("", file=sys.stderr)
                     print("Giving up", file=sys.stderr)
 
-                sys.exit(20)
+                sys.exit(168)
 
             print("")
             print(f"Get Files with: 'elbe control get_file {prjdir} <filename>'")
@@ -312,7 +312,7 @@ class BuildAction(PBuilderAction):
                     print("", file=sys.stderr)
                     print("Giving up", file=sys.stderr)
 
-                sys.exit(20)
+                sys.exit(169)
 
 
 PBuilderAction.register(BuildAction)
diff --git a/elbepack/soapclient.py b/elbepack/soapclient.py
index ba1ad212..0655ba05 100644
--- a/elbepack/soapclient.py
+++ b/elbepack/soapclient.py
@@ -100,11 +100,11 @@ class ElbeSoapClient:
                 if not retry:
                     fp.close()
                     print("file transfer failed", file=sys.stderr)
-                    sys.exit(20)
+                    sys.exit(170)
 
             if ret == "FileNotFound":
                 print(ret, file=sys.stderr)
-                sys.exit(20)
+                sys.exit(171)
             if ret == "EndOfFile":
                 fp.close()
                 return
@@ -166,7 +166,7 @@ class RemoveLogAction(ClientAction):
     def execute(self, client, _opt, args):
         if len(args) != 1:
             print("usage: elbe control rm_log <project_dir>", file=sys.stderr)
-            sys.exit(20)
+            sys.exit(172)
 
         builddir = args[0]
         client.service.rm_log(builddir)
@@ -224,7 +224,7 @@ class AddUserAction(ClientAction):
             print(
                 "usage: elbe control add_user <name> <fullname> <password> <email>",
                 file=sys.stderr)
-            sys.exit(20)
+            sys.exit(173)
 
         name     = args[0]
         fullname = args[1]
@@ -273,7 +273,7 @@ class ResetProjectAction(ClientAction):
             print(
                 "usage: elbe control reset_project <project_dir>",
                 file=sys.stderr)
-            sys.exit(20)
+            sys.exit(174)
 
         builddir = args[0]
         client.service.reset_project(builddir)
@@ -294,7 +294,7 @@ class DeleteProjectAction(ClientAction):
             print(
                 "usage: elbe control del_project <project_dir>",
                 file=sys.stderr)
-            sys.exit(20)
+            sys.exit(175)
 
         builddir = args[0]
         client.service.del_project(builddir)
@@ -315,7 +315,7 @@ class SetXmlAction(ClientAction):
             print(
                 "usage: elbe control set_xml <project_dir> <xml>",
                 file=sys.stderr)
-            sys.exit(20)
+            sys.exit(176)
 
         builddir = args[0]
         filename = args[1]
@@ -327,12 +327,12 @@ class SetXmlAction(ClientAction):
                 url_validation=ValidationMode.NO_CHECK)
         except IOError:
             print(f"{filename} is not a valid elbe xml file")
-            sys.exit(20)
+            sys.exit(177)
 
         if not x.has('target'):
             print("<target> is missing, this file can't be built in an initvm",
                   file=sys.stderr)
-            sys.exit(20)
+            sys.exit(178)
 
         size = 1024 * 1024
         part = 0
@@ -376,7 +376,7 @@ class BuildAction(ClientAction):
     def execute(self, client, opt, args):
         if len(args) != 1:
             print("usage: elbe control build <project_dir>", file=sys.stderr)
-            sys.exit(20)
+            sys.exit(179)
 
         builddir = args[0]
         client.service.build(builddir, opt.build_bin, opt.build_sources,
@@ -398,7 +398,7 @@ class BuildSysrootAction(ClientAction):
             print(
                 "usage: elbe control build-sysroot <project_dir>",
                 file=sys.stderr)
-            sys.exit(20)
+            sys.exit(180)
 
         builddir = args[0]
         client.service.build_sysroot(builddir)
@@ -419,7 +419,7 @@ class BuildSDKAction(ClientAction):
             print(
                 "usage: elbe control build-sdk <project_dir>",
                 file=sys.stderr)
-            sys.exit(20)
+            sys.exit(181)
 
         builddir = args[0]
         client.service.build_sdk(builddir)
@@ -440,13 +440,13 @@ class BuildCDROMsAction(ClientAction):
             print(
                 "usage: elbe control build-cdroms [--build-bin|--build-sources] <project_dir>",
                 file=sys.stderr)
-            sys.exit(20)
+            sys.exit(182)
 
         if (not opt.build_bin) and (not opt.build_sources):
             print(
                 "usage: elbe control build-cdroms [--build-bin|--build-sources] <project_dir>",
                 file=sys.stderr)
-            sys.exit(20)
+            sys.exit(183)
 
         builddir = args[0]
         client.service.build_cdroms(builddir, opt.build_bin, opt.build_sources)
@@ -467,7 +467,7 @@ class GetFileAction(ClientAction):
             print(
                 "usage: elbe control get_file <project_dir> <file>",
                 file=sys.stderr)
-            sys.exit(20)
+            sys.exit(184)
 
         builddir = args[0]
         filename = args[1]
@@ -498,7 +498,7 @@ class BuildChrootAction(ClientAction):
             print(
                 "usage: elbe control build_chroot_tarball <project_dir>",
                 file=sys.stderr)
-            sys.exit(20)
+            sys.exit(185)
 
         builddir = args[0]
 
@@ -520,7 +520,7 @@ class DumpFileAction(ClientAction):
             print(
                 "usage: elbe control dump_file <project_dir> <file>",
                 file=sys.stderr)
-            sys.exit(20)
+            sys.exit(186)
 
         builddir = args[0]
         filename = args[1]
@@ -530,7 +530,7 @@ class DumpFileAction(ClientAction):
             ret = client.service.get_file(builddir, filename, part)
             if ret == "FileNotFound":
                 print(ret, file=sys.stderr)
-                sys.exit(20)
+                sys.exit(187)
             if ret == "EndOfFile":
                 return
 
@@ -553,7 +553,7 @@ class GetFilesAction(ClientAction):
             print(
                 "usage: elbe control get_files <project_dir>",
                 file=sys.stderr)
-            sys.exit(20)
+            sys.exit(188)
 
         builddir = args[0]
         files = client.service.get_files(builddir)
@@ -582,7 +582,7 @@ class GetFilesAction(ClientAction):
                 client.download_file(builddir, f.name, dst_fname)
 
         if nfiles == 0:
-            sys.exit(10)
+            sys.exit(189)
 
 
 ClientAction.register(GetFilesAction)
@@ -600,7 +600,7 @@ class WaitProjectBusyAction(ClientAction):
             print(
                 "usage: elbe control wait_busy <project_dir>",
                 file=sys.stderr)
-            sys.exit(20)
+            sys.exit(190)
 
         builddir = args[0]
 
@@ -636,7 +636,7 @@ class WaitProjectBusyAction(ClientAction):
                 "Project build was not successful, current status: "
                 f"{prj.status}",
                 file=sys.stderr)
-            sys.exit(10)
+            sys.exit(191)
 
 ClientAction.register(WaitProjectBusyAction)
 
@@ -654,7 +654,7 @@ class SetCdromAction(ClientAction):
             print(
                 "usage: elbe control set_cdrom <project_dir> <cdrom file>",
                 file=sys.stderr)
-            sys.exit(20)
+            sys.exit(192)
 
         builddir = args[0]
         filename = args[1]
@@ -679,7 +679,7 @@ class SetOrigAction(ClientAction):
             print(
                 "usage: elbe control set_orig <project_dir> <orig file>",
                 file=sys.stderr)
-            sys.exit(20)
+            sys.exit(193)
 
         builddir = args[0]
         filename = args[1]
@@ -701,7 +701,7 @@ class ShutdownInitvmAction(ClientAction):
     def execute(self, client, _opt, args):
         if args:
             print("usage: elbe control shutdown_initvm", file=sys.stderr)
-            sys.exit(20)
+            sys.exit(194)
 
         # if shutdown kills the daemon before it can answer the request
         try:
@@ -725,7 +725,7 @@ class SetPdebuilderAction(ClientAction):
         if len(args) != 2 and len(args) != 3:
             print("usage: elbe control set_pdebuild "
                   "<project_dir> <pdebuild file>", file=sys.stderr)
-            sys.exit(20)
+            sys.exit(195)
 
         builddir = args[0]
         filename = args[1]
@@ -751,7 +751,7 @@ class BuildPbuilderAction(ClientAction):
             print(
                 "usage: elbe control build_pbuilder <project_dir>",
                 file=sys.stderr)
-            sys.exit(20)
+            sys.exit(196)
 
         builddir = args[0]
         client.service.build_pbuilder(builddir, opt.cross, opt.noccache,
@@ -773,7 +773,7 @@ class UpdatePbuilderAction(ClientAction):
             print(
                 "usage: elbe control update_pbuilder <project_dir>",
                 file=sys.stderr)
-            sys.exit(20)
+            sys.exit(197)
 
         builddir = args[0]
         client.service.update_pbuilder(builddir)
@@ -793,7 +793,7 @@ class InstallElbeVersion(ClientAction):
             print(
                 "usage: elbe control install_elbe_version [version]",
                 file=sys.stderr)
-            sys.exit(20)
+            sys.exit(198)
 
         if args:
             version = args[0]
@@ -845,7 +845,7 @@ class ListPackagesAction(RepoAction):
             print(
                 "usage: elbe prjrepo list_packages <project_dir>",
                 file=sys.stderr)
-            sys.exit(20)
+            sys.exit(199)
 
         builddir = args[0]
         print(client.service.list_packages(builddir))
@@ -865,7 +865,7 @@ class DownloadAction(RepoAction):
         if len(args) != 1:
             print("usage: elbe prjrepo download <project_dir>",
                   file=sys.stderr)
-            sys.exit(20)
+            sys.exit(200)
 
         builddir = args[0]
         filename = "repo.tar.gz"
@@ -928,7 +928,7 @@ class UploadPackageAction(RepoAction):
             print(
                 "usage: elbe prjrepo upload_pkg <project_dir> <deb/dsc/changes file>",
                 file=sys.stderr)
-            sys.exit(20)
+            sys.exit(201)
 
         builddir = args[0]
         filename = args[1]
@@ -943,7 +943,7 @@ class UploadPackageAction(RepoAction):
         # Check filetype
         if filetype not in ['.dsc', '.deb', '.changes']:
             print("Error: Only .dsc, .deb or .changes files allowed to upload.")
-            sys.exit(20)
+            sys.exit(202)
 
         files = [filename]  # list of all files which will be uploaded
 
@@ -964,7 +964,7 @@ class UploadPackageAction(RepoAction):
                 abort = True
         # Abort if one or more source files are missing
         if abort:
-            sys.exit(20)
+            sys.exit(203)
 
         print("Start uploading file(s)...")
         for f in files:
diff --git a/elbepack/virtapt.py b/elbepack/virtapt.py
index cb1ca7d8..4ada75c4 100644
--- a/elbepack/virtapt.py
+++ b/elbepack/virtapt.py
@@ -185,7 +185,7 @@ class VirtApt:
             print("/etc/apt/trusted.gpg.d doesn't exist")
             print("apt-get install debian-archive-keyring may "
                   "fix this problem")
-            sys.exit(20)
+            sys.exit(204)
 
         if os.path.exists("/etc/apt/trusted.gpg"):
             system(f'cp /etc/apt/trusted.gpg "{ring_path}"')
-- 
2.43.0



More information about the elbe-devel mailing list