[devel] [SCM] packages/update-kernel: heads/master

Vladimir V. Kamarzin vvk на vvk.pp.ru
Пн Сен 27 10:52:13 UTC 2010


>>>>> On 27 Sep 2010 at 16:09 "DK" == Dmitriy Kulik writes:

DK> Update of /people/lnkvisitor/packages/update-kernel.git
DK> Changes statistics since `0.9.2-alt1' follows:
DK>  update-kernel.spec             |    6 +++++-
DK>  update_kernel_modules_cetus.sh |   37 +++++++++++++++++++++++++++++++++----
DK>  2 files changed, 38 insertions(+), 5 deletions(-)

DK> Changelog since `0.9.2-alt1' follows:
DK> commit a372000db6555c92ce04c0d2003d6055436dd609
DK> Author: Dmitriy Kulik <lnkvisitor на altlinux.org>
DK> Date:   Mon Sep 27 13:05:24 2010 +0300

DK>     0.9.3-alt1
    
DK>     - Add interactive mode (-i)
DK>     - Add options -a|--all (Closes: #22271)

DK> Full diff since `0.9.2-alt1' follows:
DK> diff --git a/update-kernel.spec b/update-kernel.spec
DK> index 11e8619..3dd79d1 100644
DK> --- a/update-kernel.spec
DK> +++ b/update-kernel.spec
DK> @@ -1,5 +1,5 @@
DK>  Name: update-kernel
DK> -Version: 0.9.2
DK> +Version: 0.9.3
DK>  Release: alt1
 
DK>  Summary: Update kernel and modules
DK> @@ -37,6 +37,10 @@ install -pm755 remove-old-kernels %buildroot%_sbindir/
DK>  %_sbindir/*
 
DK>  %changelog
DK> +* Mon Sep 27 2010 Dmitriy Kulik <lnkvisitor на altlinux.org> 0.9.3-alt1
DK> +- Add interactive mode (-i)
DK> +- Add options -a|--all (Closes: #22271)
DK> +
DK>  * Sat Oct 17 2009 Michael Shigorin <mike на altlinux.org> 0.9.2-alt1
DK>  - removed warning on x11setupdrv absence due to its obsolescence
DK>    (closes: #21872)

Повышение версии в спеке лучше делать отдельным коммитом.


DK> diff --git a/update_kernel_modules_cetus.sh b/update_kernel_modules_cetus.sh
DK> index 86af74c..0653454 100755
DK> --- a/update_kernel_modules_cetus.sh
DK> +++ b/update_kernel_modules_cetus.sh
DK> @@ -4,6 +4,7 @@
DK>  # Copyright (C) 2008-2009 Vladimir V. Kamarzin <vvk на altlinux.org>
DK>  # Copyright (C) 2008-2009 Michael Shigorin <mike на altlinux.org>
DK>  # Copyright (C) 2008 Konstantin Baev <kipruss на altlinux.org>
DK> +# Copyright (C) 2010 Dmitry Kulik <lnkvisitor на altlinux.org>
DK>  #
DK>  # Update kernel with modules
DK>  #
DK> @@ -28,7 +29,9 @@ show_help()
DK>          cat <<EOF
DK>  Usage: $PROG [options]
DK>  Valid options are:
DK> -	-f, --force	force kernel upgrade
DK> +	-a, --all	install all kernel modules
DK> +	-i		interactive modules install, exclude force install

А где длинная форма?

DK> +	-f, --force	force kernel upgrade, non-interactively
DK>  	-t, --type	install kernel with specified flavour (ovz-smp, std-def, etc)
DK>  	-r, --release	install kernel with specified release (alt10, alt22, etc)
DK>  	-h, --help	show this text and exit
DK> @@ -37,14 +40,18 @@ exit 1
DK>  }
 
DK>  #parse command line options
DK> -TEMP=`getopt -n $PROG -o f,t:,r:,h -l force,type:,release:,help -- "$@"` || show_help
DK> +TEMP=`getopt -n $PROG -o a,i,f,t:,r:,h -l all,force,type:,release:,help -- "$@"` || show_help
DK>  eval set -- "$TEMP"
 
DK>  while :; do
DK>          case "$1" in
DK>                  --) shift; break
DK>                          ;;
DK> -                -f|--force) force=1
DK> +                -a|--all) all=1
DK> +            		;;

";;" съехало

DK> +                -i) interactive=1 ; force=0
DK> +                        ;;
DK> +                -f|--force) force=1 ; interactive=0

Так лучше не делать. Надо просто сделать проверку на взаимоисключающие опции
(примеры можно посмотреть в gear, hasher, sisyphus-mirror - ключевая фраза "are mutually exclusive")

DK>                          ;;
DK>  		-t|--type) shift ; kernel_flavour="$1"
DK>  			;;
DK> @@ -129,11 +136,33 @@ message "Updating modules for kernel: $newkernel_ver_flav_rel"
DK>  # get list of all available modules
DK>  ALLMODULES="$(apt-cache pkgnames kernel-modules | grep $kernel_flavour | sed -e "s,^kernel-modules-\(.*\)-$kernel_flavour.*,\1,g"| sed -e "s,-[[:digit:]]\.[[:digit:]]\.[[:digit:]].*,,g" | sort -u)"
 
DK> +function module_install() {

Слово function можно убрать.

DK> +    module=$1
DK> +    if [ "$interactive" == 1 ]; then

"==" можно заменить на "="

-- 
vvk



Подробная информация о списке рассылки Devel