update-kernel: Distinguish --dry-run and --download-only options

Reformat help output for a new longer options.

Link: https://bugzilla.altlinux.org/49340
Signed-off-by: Vitaly Chikunov <vt@altlinux.org>
This commit is contained in:
Виталий Чикунов 2024-02-10 04:45:31 +03:00
parent b574739cc4
commit 1e5cfc393e
3 changed files with 32 additions and 21 deletions

View File

@ -51,23 +51,25 @@ show_help()
cat <<EOF
Usage: $PROG [options]
Valid options are:
-l, --list list available kernels
-a, --all select all available kernel modules to install
-i, --interactive interactive modules selection
-H, --headers add kernel headers to install
--debuginfo add debuginfo package to install
-A modulename include (add) external module (by a short name)
-D modulename exclude (del) external module from install
-f, -y, --force force kernel upgrade
-t, --type select desired kernel flavour (un-def, std-def, etc)
by default it's same as of booted kernel
-r, --release desired kernel release (allowed formats by example:
old format: alt1, 5.7.19-alt1
classic kernel release: 5.7.19-std-def-alt1
package name: [kernel-image-]std-def-5.7.19-alt1)
-u, --update run 'apt-get update' automatically
-n, --dry-run download packages, but don't install (--download-only)
-h, --help show this text and exit
-l, --list list available kernels
-a, --all select all available kernel modules to install
-i, --interactive interactive modules selection
-H, --headers add kernel headers to install
--debuginfo add debuginfo package to install
-A modulename include (add) external module (by a short name)
-D modulename exclude (del) external module from install
-f, -y, --force force kernel upgrade
-t, --type select desired kernel flavour (un-def, std-def, etc)
by default it's same as of booted kernel
-r, --release desired kernel release (allowed formats by example:
old format: alt1, 5.7.19-alt1
classic kernel release: 5.7.19-std-def-alt1
package name: [kernel-image-]std-def-5.7.19-alt1)
-u, --update run 'apt-get update' automatically
-n, --dry-run perform a simulation of events that would occur but
do not actually change the system
-d, --download-only download packages, but don't install
-h, --help show this text and exit
Run remove-old-kernels to uninstall unused kernels.
EOF
exit "$@"
@ -114,7 +116,7 @@ apt_get_update=
debuginfo=
#parse command line options
TEMP=$(getopt -n "$PROG" -o A:,D:,a,i,l,f,y,t:,r:,v,n,H,u,h -l interactive,list,all,add:,force,type:,release:,verbose,reinstall,dry-run,download-only,headers,update,debuginfo,help -- "$@") || show_help 1
TEMP=$(getopt -n "$PROG" -o A:,D:,a,d,i,l,f,y,t:,r:,v,n,H,u,h -l interactive,list,all,add:,force,type:,release:,verbose,reinstall,dry-run,download-only,headers,update,debuginfo,help -- "$@") || show_help 1
eval set -- "$TEMP"
while :; do
@ -145,7 +147,9 @@ while :; do
;;
--reinstall) reinstall=$1
;;
-n|--dry-run|--download-only) dryrun="--dry-run"
-n|--dry-run) dryrun="--dry-run"
;;
-d|--download-only) dryrun="--download-only"
;;
-u|--update) apt_get_update=y
;;

View File

@ -46,7 +46,11 @@ desired kernel release
package name: [kernel\-image\-]std\-def\-5.7.19\-alt1)
.TP
\-n, \-\-dry-run
download packages, but don't install (\-\-download\-only)
perform a simulation of events that would occur but
do not actually change the system
.TP
\-d, \-\-download\-only
download packages but don't install
.TP
\-h, \-\-help
show this text and exit

View File

@ -46,7 +46,10 @@ update-kernel позволяет установить пакеты нового
имя пакета: [kernel\-image\-]std\-def\-5.7.19\-alt1)
.TP
\-n, \-\-dry-run
скачать пакеты, но не устанавливать (\-\-download\-only)
провести симуляцию действий, но не менять систему
.TP
\-d, \-\-download\-only
скачать пакеты, но не устанавливать
.TP
\-h, \-\-help
показать этот текст и выйти