Skip to content

turnkey-version fails if version string given #2113

@JedMeister

Description

@JedMeister

The documented functionality of `turnkey-version --string" does not work as documented. Instead of parsing the string and returning result, it still tries to read the TurnKey version from a file - and fails, raising an exception.

Documented functionality - from --help:

-s TKL_VER_STR, --string TKL_VER_STR
Process a string, instead of reading from a file ('turnkey-' prefix optional). NOTE: Conflicts with -f|--file.

When actually used:

# turnkey-version -s "turnkey-lamp-19.0-trixie-amd64"
Traceback (most recent call last):
  File "/turnkey/public/turnkey-version/./turnkey-version", line 131, in <module>
    main()
  File "/turnkey/public/turnkey-version/./turnkey-version", line 105, in main
    tkl_appver_cls = sysversion.AppVer(turnkey_version, rootfs=rootfs)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/turnkey/public/turnkey-version/sysversion/__init__.py", line 74, in __init__
    self.deb_codename = get_debian_codename(rootfs=rootfs)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/turnkey/public/turnkey-version/sysversion/__init__.py", line 35, in get_debian_codename
    proc = subprocess.run(comm, capture_output=True, text=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/subprocess.py", line 548, in run
    with Popen(*popenargs, **kwargs) as process:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/subprocess.py", line 1024, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.11/subprocess.py", line 1901, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'chroot'

Ideally the functionality should be fixed - alternatively it could be removed as it's obviously not being used much (or at all?).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugturnkey-versionTurnKey custom command to provide version related info.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions