fix(kernel-update): handle ebuild revisions
Signed-off-by: Martin Matous <m@matous.dev>
This commit is contained in:
parent
3ad6ce63c4
commit
77bec8cf55
1 changed files with 8 additions and 8 deletions
|
|
@ -7,7 +7,6 @@ import shutil
|
|||
import subprocess
|
||||
import sys
|
||||
|
||||
from packaging.version import Version
|
||||
from pathlib import Path
|
||||
from typing import Any, Dict, List, Tuple
|
||||
|
||||
|
|
@ -100,7 +99,12 @@ def install_kernel(kernel_dir: Path, boot_dir: Path, boot_files: Dict[str, Path]
|
|||
|
||||
|
||||
def linux_folder(src_dir: Path, version: str) -> Path:
|
||||
return (src_dir / (f'linux-{version}-gentoo'))
|
||||
revision = ''
|
||||
version = version.split('-')
|
||||
if len(version) > 1:
|
||||
revision = '-' + version[1]
|
||||
version = version[0]
|
||||
return (src_dir / (f'linux-{version}-gentoo{revision}'))
|
||||
|
||||
|
||||
def module_check(boot_dir: Path, boot_files: Dict[str, Path]) -> Tuple[bool, Path]:
|
||||
|
|
@ -172,12 +176,8 @@ def main() -> None:
|
|||
update.add_argument(
|
||||
'--install', '-i', action='store_true',
|
||||
help='Install new kernel')
|
||||
update.add_argument(
|
||||
'old_version', type=Version,
|
||||
help='Old kernel version')
|
||||
update.add_argument(
|
||||
'new_version', type=Version,
|
||||
help='New kernel version')
|
||||
update.add_argument('old_version', help='Old kernel version')
|
||||
update.add_argument('new_version', help='New kernel version')
|
||||
update.set_defaults(func=update_kernel)
|
||||
|
||||
args = parser.parse_args()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue