[d-kernel] script that upgrades module specs

Dmitry V. Levin ldv at altlinux.org
Thu Jul 31 18:05:30 MSD 2003


On Thu, Jul 31, 2003 at 05:33:33PM +0400, Peter Novodvorsky wrote:
> Я написал подобие скрипта о котором недавно шла речь. Он обновляет
> krelease и kversion в спеках модулей и добавляет соответствующую
> запись в changelog.

как минимум,
замени sed && rm
на subst

> ------- CUT HERE --------
> # upgrade all specs
> 
> if [ $# -lt 3 ]; then
>   echo "Usage: $0 NEW_KERNEL_VERSION NEW_KERNEL_RELEASE <spec_files>"
> fi
> 
> kernel_version=$1
> shift
> kernel_release=$1
> shift
> spec_list=$@
> 
> for i in $spec_list; do 
> 	sed -e "s/kversion .*/kversion $kernel_version/" -e "s/krelease .*/krelease $kernel_release/" < $i > $i.new
> 	new_release=$(expr `grep '%define.*module_release' $i | sed -e 's/.*alt\([[:digit:]]*\)/\1/'` + 1)
> 	sed -e "s/module_release .*/module_release alt$new_release/" < $i.new > $i
> 	rm -f $i.new
> 	add_changelog -e "- rebuilt with $kernel_version-$kernel_release" $i
> done
> ------- CUT HERE --------


--
ldv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : /pipermail/devel-kernel/attachments/20030731/c23a1d38/attachment-0002.bin


More information about the devel-kernel mailing list