ALT Linux Team development discussions
 help / color / mirror / Atom feed
From: "Vladimir V. Kamarzin" <vvk@vvk.pp.ru>
To: ALT Devel discussion list <devel@lists.altlinux.org>
Subject: Re: [devel] [SCM] packages/update-kernel: heads/master
Date: Mon, 27 Sep 2010 16:52:13 +0600
Message-ID: <m31v8f792a.fsf@vvk.distance.ru> (raw)
In-Reply-To: <20100927100957.48A9F21848F4@ssh.git.altlinux.org> (Dmitriy Kulik's message of "Mon, 27 Sep 2010 14:09:57 +0400 (MSD)")

>>>>> 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



       reply	other threads:[~2010-09-27 10:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-27 10:52 ` Vladimir V. Kamarzin [this message]
2010-09-27 10:57   ` Dmitriy Kulik
2010-09-27 11:13     ` Vladimir V. Kamarzin
2010-09-27 11:20       ` Dmitriy Kulik
2010-09-27 12:09         ` Vladimir V. Kamarzin
2010-09-27 12:17           ` Dmitriy Kulik
2010-09-27 12:43             ` Dmitriy Kulik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m31v8f792a.fsf@vvk.distance.ru \
    --to=vvk@vvk.pp.ru \
    --cc=devel@lists.altlinux.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

ALT Linux Team development discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/devel/0 devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 devel devel/ http://lore.altlinux.org/devel \
		devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru
	public-inbox-index devel

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git