From fcbc2bf36d668f537012be5ae05f8e452e0acd44 Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Sun, 17 Jan 2021 03:37:50 -0500 Subject: cmd/install: Make suite argument optional --- diff --git a/NEWS b/NEWS index 34d6ccc..4a7f5c5 100644 --- a/NEWS +++ b/NEWS @@ -25,6 +25,8 @@ New features: requested platform. The "-a" option is now only necessary if installing ProteanOS's "dev" platform for an architecture different from but compatible with the native architecture. + * "prokit install"'s "" argument is now optional. On ProteanOS + the default is "rel/trunk", the rolling release suite. * "prokit build" now passes an "-a" option, if supported, to opkg to install host-architecture non-coinstallable dependencies (such as library development packages) when cross building. diff --git a/TODO b/TODO index 4508d98..65da220 100644 --- a/TODO +++ b/TODO @@ -2,5 +2,4 @@ Tasks for version 3.0.0 ----------------------- * `man/prokit-install.8in`: Update -* `prokit install`: Consider making `` argument optional * `_install_get_pkgs()`: Resolve `FIXME` diff --git a/locale/C.sh b/locale/C.sh index ee4e237..18cddde 100644 --- a/locale/C.sh +++ b/locale/C.sh @@ -86,7 +86,7 @@ There is NO WARRANTY, to the extent permitted by law.' # src/cmd/install.sh msg_prokit_cmd_install_summary='install a system into a directory' msg_prokit_cmd_install_usage='[-a ] [-p ] [-m ] [-F] '\ -' ' +'[] ' # src/cmd/shell.sh msg_prokit_cmd_shell_summary='run a shell in an isolated environment' diff --git a/man/prokit-install.8in b/man/prokit-install.8in index 2c68b8b..c28b051 100644 --- a/man/prokit-install.8in +++ b/man/prokit-install.8in @@ -6,7 +6,7 @@ prokit-install \- Install a system into a directory .SH SYNOPSIS \fBprokit install\fP [\fB-a\fP \fIarch\fP] [\fB-p\fP \fIplat\fP] -[\fB-m\fP \fImirror\fP] [\fB-F\fP] \fIsuite\fP \fIroot\fP +[\fB-m\fP \fImirror\fP] [\fB-F\fP] [\fIsuite\fP] \fIroot\fP .SH DESCRIPTION \fBprokit install\fP installs a basic system of \fIsuite\fP into \fIroot\fP. diff --git a/src/cmd/install.sh b/src/cmd/install.sh index 0e4a8b9..ecdfe8c 100644 --- a/src/cmd/install.sh +++ b/src/cmd/install.sh @@ -33,15 +33,20 @@ cmd_install_main() fi shift $((${OPTIND} - 1)) - if [ ${#} -lt 2 ]; then + if [ ${#} -eq 1 ]; then + suite='' + root="${1}" + shift 1 + fi + if [ ${#} -eq 2 ]; then + suite="${1}" + root="${2}" + shift 2 + else print_cmd_usage 'install' >&2 return 1 fi - suite="${1}" - root="${2}" - shift 2 - if [ "x${suite%%:*}" != "x${suite}" ]; then profile="${suite%%:*}" suite="${suite#*:}" -- cgit v0.9.1