cmds.distro.CmdInfo: Rename to cmds.platform.CmdInfo
Rename command "distro" to "pkg" together with "info", its last remaining subcommand. "distro" is often used in the sense of "Linux distribution", which would be too narrow for the targets jw-pkg could theoretically support.
Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
5830984bfc
commit
514d66dac1
10 changed files with 20 additions and 20 deletions
|
|
@ -11,7 +11,7 @@ include $(JWBDIR)/make/dev-utils.mk
|
||||||
CACHED_FILES ?= $(VERSION_FILE) $(wildcard $(TOPDIR)/make/project.conf)
|
CACHED_FILES ?= $(VERSION_FILE) $(wildcard $(TOPDIR)/make/project.conf)
|
||||||
CACHED_VARS ?= PROJECT PREREQ VERSION HEX_VERSION FULL_NAME \
|
CACHED_VARS ?= PROJECT PREREQ VERSION HEX_VERSION FULL_NAME \
|
||||||
WHICH PYTHON ECHO TEST BROWSER SED RM PWD ID CUT TR \
|
WHICH PYTHON ECHO TEST BROWSER SED RM PWD ID CUT TR \
|
||||||
AWK GETENT XARGS FIND PRINTF HOST_DISTRO_INFO OS_NAME_VERSION \
|
AWK GETENT XARGS FIND PRINTF PLATFORM_INFO OS_NAME_VERSION \
|
||||||
CAT BIN_INSTALL SUDO \
|
CAT BIN_INSTALL SUDO \
|
||||||
JW_PKG_LD_LIBRARY_PATH JW_PKG_EXE_PATH JW_PKG_PYTHON_PATH
|
JW_PKG_LD_LIBRARY_PATH JW_PKG_EXE_PATH JW_PKG_PYTHON_PATH
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -71,17 +71,17 @@ endif
|
||||||
|
|
||||||
# -- arch, vendor, os, libc
|
# -- arch, vendor, os, libc
|
||||||
|
|
||||||
ifeq ($(HOST_DISTRO_INFO),)
|
ifeq ($(PLATFORM_INFO),)
|
||||||
HOST_DISTRO_INFO := $(shell $(JW_PKG_PY) distro info --format '%{gnu-triplet} %{cascade}')
|
PLATFORM_INFO := $(shell $(JW_PKG_PY) platform info --format '%{gnu-triplet} %{cascade}')
|
||||||
endif
|
endif
|
||||||
HOST_TUPLE ?= $(word 1,$(HOST_DISTRO_INFO))
|
HOST_TUPLE ?= $(word 1,$(PLATFORM_INFO))
|
||||||
HOST_TUPLE_WORDS := $(subst -, ,$(HOST_TUPLE))
|
HOST_TUPLE_WORDS := $(subst -, ,$(HOST_TUPLE))
|
||||||
HOST_ARCH := $(word 1,$(HOST_TUPLE_WORDS))
|
HOST_ARCH := $(word 1,$(HOST_TUPLE_WORDS))
|
||||||
HOST_VENDOR := $(word 2,$(HOST_TUPLE_WORDS))
|
HOST_VENDOR := $(word 2,$(HOST_TUPLE_WORDS))
|
||||||
HOST_OS := $(word 3,$(HOST_TUPLE_WORDS))
|
HOST_OS := $(word 3,$(HOST_TUPLE_WORDS))
|
||||||
HOST_ABI := $(word 4,$(HOST_TUPLE_WORDS))
|
HOST_ABI := $(word 4,$(HOST_TUPLE_WORDS))
|
||||||
HOST_TRIPLET := $(HOST_ARCH)-$(HOST_OS)-$(HOST_ABI)
|
HOST_TRIPLET := $(HOST_ARCH)-$(HOST_OS)-$(HOST_ABI)
|
||||||
HOST_OS_CASCADE := $(wordlist 2,$(words $(HOST_DISTRO_INFO)),$(HOST_DISTRO_INFO))
|
HOST_OS_CASCADE := $(wordlist 2,$(words $(PLATFORM_INFO)),$(PLATFORM_INFO))
|
||||||
PKG_FORMAT ?= $(patsubst pkg-%,%,$(filter pkg-%,$(HOST_OS_CASCADE)))
|
PKG_FORMAT ?= $(patsubst pkg-%,%,$(filter pkg-%,$(HOST_OS_CASCADE)))
|
||||||
|
|
||||||
ifndef TARGET
|
ifndef TARGET
|
||||||
|
|
@ -176,7 +176,7 @@ else
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(OS_NAME_VERSION),)
|
ifeq ($(OS_NAME_VERSION),)
|
||||||
OS_NAME_VERSION := $(shell $(JW_PKG_PY) distro info --format '%{id}-%{codename}')
|
OS_NAME_VERSION := $(shell $(JW_PKG_PY) platform info --format '%{id}-%{codename}')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(OS_NAME),)
|
ifeq ($(OS_NAME),)
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,7 @@ JW_PKG_PY = python3 $(JWB_SCRIPT_DIR)/jw-pkg.py --prefix $(sh
|
||||||
SSH_WRAPPER_SH := $(CWD)/ssh-wrapper.sh
|
SSH_WRAPPER_SH := $(CWD)/ssh-wrapper.sh
|
||||||
|
|
||||||
EXCLUDES_FILE ?= exclude.txt
|
EXCLUDES_FILE ?= exclude.txt
|
||||||
EXCLUDES_FILES := $(wildcard $(patsubst %,exclude-%.txt,$(shell $(JW_PKG_PY) distro info --format '%{cascade}')) $(EXCLUDES_FILE))
|
EXCLUDES_FILES := $(wildcard $(patsubst %,exclude-%.txt,$(shell $(JW_PKG_PY) platform info --format '%{cascade}')) $(EXCLUDES_FILE))
|
||||||
|
|
||||||
ifneq ($(EXCLUDES_FILES),)
|
ifneq ($(EXCLUDES_FILES),)
|
||||||
EXCLUDE_FROM_BUILD += $(shell sed 's/\#.*//g' $(EXCLUDES_FILES))
|
EXCLUDE_FROM_BUILD += $(shell sed 's/\#.*//g' $(EXCLUDES_FILES))
|
||||||
|
|
@ -194,7 +194,7 @@ echo-install-deps:
|
||||||
echo-release-deps:
|
echo-release-deps:
|
||||||
$(Q)$(JW_PKG_PY_PROJECTS) required-os-pkg --quote --skip-excluded "build,run,release" $(TARGET_PROJECTS)
|
$(Q)$(JW_PKG_PY_PROJECTS) required-os-pkg --quote --skip-excluded "build,run,release" $(TARGET_PROJECTS)
|
||||||
echo-os:
|
echo-os:
|
||||||
$(Q)$(JW_PKG_PY) distro info
|
$(Q)$(JW_PKG_PY) platform info
|
||||||
|
|
||||||
echo-projects:
|
echo-projects:
|
||||||
@echo $(PROJECTS)
|
@echo $(PROJECTS)
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ subpackage_description()
|
||||||
|
|
||||||
os_cascade()
|
os_cascade()
|
||||||
{
|
{
|
||||||
/usr/bin/python3 $JWB_SCRIPT_DIR/jw-pkg.py distro info --format '%{cascade}'
|
/usr/bin/python3 $JWB_SCRIPT_DIR/jw-pkg.py platform info --format '%{cascade}'
|
||||||
}
|
}
|
||||||
|
|
||||||
# -- here we go
|
# -- here we go
|
||||||
|
|
|
||||||
|
|
@ -34,14 +34,14 @@ fatal()
|
||||||
quit 1
|
quit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
distro_info()
|
platform_info()
|
||||||
{
|
{
|
||||||
/usr/bin/python3 $JWB_SCRIPT_DIR/jw-pkg.py distro info --format "$1"
|
/usr/bin/python3 $JWB_SCRIPT_DIR/jw-pkg.py platform info --format "$1"
|
||||||
}
|
}
|
||||||
|
|
||||||
get_os()
|
get_os()
|
||||||
{
|
{
|
||||||
[ "$__get_os" ] || __get_os=`distro_info '%{id}-%{codename}'`
|
[ "$__get_os" ] || __get_os=`platform_info '%{id}-%{codename}'`
|
||||||
echo $__get_os
|
echo $__get_os
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -616,7 +616,7 @@ upload_pkg()
|
||||||
;;
|
;;
|
||||||
debian|deb)
|
debian|deb)
|
||||||
local -r server=apt.janware.com
|
local -r server=apt.janware.com
|
||||||
local -r distro_subdir=$(distro_info '%{id}/%{codename}')
|
local -r distro_subdir=$(platform_info '%{id}/%{codename}')
|
||||||
local conf=`mktemp "/tmp/$myname"_XXXXXX`
|
local conf=`mktemp "/tmp/$myname"_XXXXXX`
|
||||||
cat <<-EOT > $conf
|
cat <<-EOT > $conf
|
||||||
[DEFAULT]
|
[DEFAULT]
|
||||||
|
|
@ -1096,7 +1096,7 @@ cmd_milk_install_log()
|
||||||
|
|
||||||
echo "== processing stage $stage: cfg_section pkg.$p.$stage" >&2
|
echo "== processing stage $stage: cfg_section pkg.$p.$stage" >&2
|
||||||
local os content=""
|
local os content=""
|
||||||
for os in '' `distro_info '%{cascade}'`; do
|
for os in '' `platform_info '%{cascade}'`; do
|
||||||
local sec=pkg.$p.$stage head=""
|
local sec=pkg.$p.$stage head=""
|
||||||
if [ "$os" ]; then
|
if [ "$os" ]; then
|
||||||
sec="$sec.$os"
|
sec="$sec.$os"
|
||||||
|
|
|
||||||
|
|
@ -5,10 +5,10 @@ from argparse import ArgumentParser
|
||||||
from ..App import App
|
from ..App import App
|
||||||
from .Cmd import Cmd as CmdBase
|
from .Cmd import Cmd as CmdBase
|
||||||
|
|
||||||
class CmdDistro(CmdBase): # export
|
class CmdPlatform(CmdBase): # export
|
||||||
|
|
||||||
def __init__(self, parent: App) -> None:
|
def __init__(self, parent: App) -> None:
|
||||||
super().__init__(parent, 'distro', help="Miscellaneous platform-related comamnds")
|
super().__init__(parent, 'platform', help="Miscellaneous platform-related comamnds")
|
||||||
self._add_subcommands()
|
self._add_subcommands()
|
||||||
|
|
||||||
def add_arguments(self, p: ArgumentParser) -> None:
|
def add_arguments(self, p: ArgumentParser) -> None:
|
||||||
|
|
@ -6,11 +6,11 @@ from typing import TYPE_CHECKING
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from ...lib.Distro import Distro
|
from ...lib.Distro import Distro
|
||||||
from ..CmdDistro import CmdDistro
|
from ..CmdPlatform import CmdPlatform
|
||||||
|
|
||||||
from ..Cmd import Cmd as Base
|
from ..Cmd import Cmd as Base
|
||||||
|
|
||||||
class Cmd(Base): # export
|
class Cmd(Base): # export
|
||||||
|
|
||||||
def __init__(self, parent: CmdDistro, name: str, help: str) -> None:
|
def __init__(self, parent: CmdPlatform, name: str, help: str) -> None:
|
||||||
super().__init__(parent, name, help)
|
super().__init__(parent, name, help)
|
||||||
|
|
@ -5,11 +5,11 @@ from argparse import Namespace, ArgumentParser
|
||||||
from ...lib.log import *
|
from ...lib.log import *
|
||||||
from ...lib.Distro import Distro
|
from ...lib.Distro import Distro
|
||||||
from ..Cmd import Cmd
|
from ..Cmd import Cmd
|
||||||
from ..CmdProjects import CmdProjects
|
from ..CmdPlatform import CmdPlatform
|
||||||
|
|
||||||
class CmdInfo(Cmd): # export
|
class CmdInfo(Cmd): # export
|
||||||
|
|
||||||
def __init__(self, parent: CmdProjects) -> None:
|
def __init__(self, parent: CmdPlatform) -> None:
|
||||||
super().__init__(parent, 'info', help='Retrieve information about target platform')
|
super().__init__(parent, 'info', help='Retrieve information about target platform')
|
||||||
|
|
||||||
def add_arguments(self, parser: ArgumentParser) -> None:
|
def add_arguments(self, parser: ArgumentParser) -> None:
|
||||||
Loading…
Add table
Add a link
Reference in a new issue