Skip to content

Commit

Permalink
[deprecated] compatibility: add entry-points for the kernel-xyz commands
Browse files Browse the repository at this point in the history
This patch implements backward compatibility for the deprecated 'kernel-xyz'
command line scripts:

- kernel-doc      --> linuxdoc.rest
- kernel-autodoc  --> linuxdoc.autodoc
- kernel-lintdoc  --> linuxdoc.lintdoc
- kernel-grepdoc  --> linuxdoc.grepdoc

The old implementations had bugs and quirks.  The bugs have been fixed and the
quirks (quirks related to the Linux kernel documentation) have been removed in
the linuxdoc.xyz scripts.

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
  • Loading branch information
return42 committed Apr 3, 2023
1 parent c2e578a commit 575939e
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 0 deletions.
9 changes: 9 additions & 0 deletions linuxdoc/__pkginfo__.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,19 @@ def get_entry_points():
"""get entry points of the python package"""
return {
'console_scripts': [

'linuxdoc.rest = linuxdoc.rest:main',
'linuxdoc.autodoc = linuxdoc.autodoc:main',
'linuxdoc.lintdoc = linuxdoc.lint:main',
'linuxdoc.grepdoc = linuxdoc.grepdoc:main',

# compatibility / deprecated

'kernel-doc = linuxdoc.deprecated:cmd_kernel_doc',
'kernel-autodoc = linuxdoc.deprecated:cmd_kernel_autodoc',
'kernel-lintdoc = linuxdoc.deprecated:cmd_kernel_lintdoc',
'kernel-grepdoc = linuxdoc.deprecated:cmd_kernel_grepdoc',

]
}

Expand Down
58 changes: 58 additions & 0 deletions linuxdoc/deprecated.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
"""
deprecated
~~~~~~~~~~
Deprecated Operations implemented for compatibility.
"""
# pylint: disable=import-outside-toplevel

import sys

def _report(msg):
sys.stderr.write(' '.join(line.strip() for line in msg.splitlines()) + '\n')

# ------------------------------------------------------------------------------
# command-lines deprecated
# ------------------------------------------------------------------------------

def cmd_kernel_doc():
"""DEPRECATED: The maintenance of the ``kernel-doc`` command endet in
version 20230321. The command will be removed in a future release: use
command ``linuxdoc.rest``!
"""
_report(cmd_kernel_doc.__doc__)
from .rest import main
return main()

def cmd_kernel_autodoc():
"""DEPRECATED: The maintenance of the ``kernel-autodoc`` command endet in
version 20230321. The command will be removed in a future release: use
command ``linuxdoc.autodoc``!
"""
_report(cmd_kernel_autodoc.__doc__)
from .autodoc import main
return main()

def cmd_kernel_lintdoc():
"""DEPRECATED: The maintenance of the ``kernel-lintdoc`` command endet in
version 20230321. The command will be removed in a future release: use
command ``linuxdoc.lintdoc``!
"""
_report(cmd_kernel_lintdoc.__doc__)
from .lint import main
return main()

def cmd_kernel_grepdoc():
"""DEPRECATED: The maintenance of the ``kernel-grepdoc`` command endet in
version 20230321. The command will be removed in a future release: use
command ``linuxdoc.grepdoc``!
"""
_report(cmd_kernel_grepdoc.__doc__)
from .grepdoc import main
return main()

0 comments on commit 575939e

Please sign in to comment.