Hello community, here is the log from the commit of package perl-Bootloader checked in at Thu Nov 9 14:13:54 CET 2006. -------- --- perl-Bootloader/perl-Bootloader.changes 2006-11-08 13:57:56.000000000 +0100 +++ /mounts/work_src_done/STABLE/perl-Bootloader/perl-Bootloader.changes 2006-11-09 13:13:18.000000000 +0100 @@ -1,0 +2,6 @@ +Thu Nov 9 13:12:23 CET 2006 - aosthof@suse.de + +- accept old arguments and new arguments in bootloader_entry +- fixed usage() and did some cleanup + +------------------------------------------------------------------- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-Bootloader.spec ++++++ --- /var/tmp/diff_new_pack.MC776n/_old 2006-11-09 14:13:31.000000000 +0100 +++ /var/tmp/diff_new_pack.MC776n/_new 2006-11-09 14:13:31.000000000 +0100 @@ -12,7 +12,7 @@ Name: perl-Bootloader Version: 0.4.0 -Release: 3 +Release: 5 Requires: perl >= %{perl_version} Requires: perl-gettext Requires: mdadm e2fsprogs @@ -64,6 +64,9 @@ /usr/lib/bootloader %changelog -n perl-Bootloader +* Thu Nov 09 2006 - aosthof@suse.de +- accept old arguments and new arguments in bootloader_entry +- fixed usage() and did some cleanup * Wed Nov 08 2006 - schwab@suse.de - Fix error checking. * Tue Nov 07 2006 - aosthof@suse.de ++++++ bootloader_entry ++++++ --- perl-Bootloader/bootloader_entry 2006-11-08 13:57:37.000000000 +0100 +++ /mounts/work_src_done/STABLE/perl-Bootloader/bootloader_entry 2006-11-09 13:09:57.000000000 +0100 @@ -21,6 +21,10 @@ { echo "Unknown or missing parameter." echo "Usage: $0 [add|remove] <kernel-flavor> <kernel-release> <image-name> <initrd-name>" + echo + echo "The old interface with 4 parameters is still supported, but deprecated." + echo "This interface will be dropped in the near future." + echo "Usage: $0 [add|remove] <kernel-package-name> <image-name> <initrd-name>" exit 1 } @@ -28,11 +32,25 @@ # Get all command line arguments function getargs() { - action=$1 # contains the action to be executed, e.g. "add" or "remove" - flavor=$2 # contains the kernel-flavor, e.g. "default" or "xen" - release=$3 # contains the kernel-release, e.g. "2.6.18-4-default" - image=$4 # contains the full image name, e.g. "vmlinuz-2.6.18-4-default" - initrd=$5 # contains the full initrd name, e.g. "initrd-2.6.18-4-default" + # old interface with 4 parameters + if [ $# -eq 4 ] ; then + action=${1} # contains the action to be executed, e.g. "add" or "remove" + flavor=${2#*-} # contains the kernel-flavor, e.g. "default" or "xen" + flavor=${flavor%%-*} + release=${2#*-*-} # contains the kernel-release, e.g. "2.6.18-4-default" + release=${release%.*.*} + release="${release}-${flavor}" + image=${3} # contains the full image name, e.g. "vmlinuz-2.6.18-4-default" + initrd=${4} # contains the full initrd name, e.g. "initrd-2.6.18-4-default" + + # new interface with 5 parameters + else + action=${1} # contains the action to be executed, e.g. "add" or "remove" + flavor=${2} # contains the kernel-flavor, e.g. "default" or "xen" + release=${3} # contains the kernel-release, e.g. "2.6.18-4-default" + image=${4} # contains the full image name, e.g. "vmlinuz-2.6.18-4-default" + initrd=${5} # contains the full initrd name, e.g. "initrd-2.6.18-4-default" + fi } @@ -52,30 +70,31 @@ { # Set up the new kernel if [ "$YAST_IS_RUNNING" != instsys ]; then - case $flavor in - (kdump|um) - ;; - (*) - opt_xen_kernel= - case $flavor in - xen*) - set -- $flavor - set -- ${1#xen} - opt_xen_kernel=--xen-kernel=/boot/xen${1:+-$1}.gz - ;; - esac - - # Add the new bootloader entry - update_bootloader --image /boot/$image \ - --initrd /boot/$initrd \ - --default --add \ - --force $opt_xen_kernel \ - --name "Kernel-$release" - - # Run the bootloader (e.g., lilo). - update_bootloader --refresh - ;; - esac + case $flavor in + (kdump|um) + ;; + (*) + opt_xen_kernel= + case $flavor in + xen*) + set -- $flavor + set -- ${1#xen} + opt_xen_kernel=--xen-kernel=/boot/xen${1:+-$1}.gz + ;; + esac + + # Add the new bootloader entry + update_bootloader --image /boot/$image \ + --initrd /boot/$initrd \ + --default \ + --add \ + --force $opt_xen_kernel \ + --name "Kernel-$release" + + # Run the bootloader (e.g., lilo). + update_bootloader --refresh + ;; + esac fi } @@ -86,9 +105,10 @@ function remove_entry() { update_bootloader --image /boot/$image \ - --initrd /boot/$initrd \ - --remove --force \ - --name "Kernel-$release" + --initrd /boot/$initrd \ + --remove \ + --force \ + --name "Kernel-$release" # Run the bootloader (e.g., lilo). update_bootloader --refresh @@ -100,23 +120,23 @@ # Checks if correct amount of arguments is given -if [ "$#" -ne "5" ] ; then +if [ "$#" -ne "4" -a "$#" -ne "5" ] ; then usage fi # Get all given arguments -getargs "$@" +getargs $@ # Find out which action should be executed -case $1 in +case $action in add) # Add a new bootloader entry add_entry - ;; + ;; remove) # Remove an existing bootloader entry remove_entry - ;; + ;; *) # Unknown argument usage ++++++ perl-Bootloader-0.4.0.tar.bz2 ++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org