Merge branch 'rc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6

* 'rc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6:
  nconfig: Fix segfault when help contains special characters
  kbuild: Fix make rpm
  kbuild: Make the setlocalversion script POSIX-compliant
This commit is contained in:
Linus Torvalds 2010-07-23 13:25:00 -07:00
commit 20a52d4f59
3 changed files with 12 additions and 8 deletions

View file

@ -226,7 +226,7 @@ void fill_window(WINDOW *win, const char *text)
int len = get_line_length(line); int len = get_line_length(line);
strncpy(tmp, line, min(len, x)); strncpy(tmp, line, min(len, x));
tmp[len] = '\0'; tmp[len] = '\0';
mvwprintw(win, i, 0, tmp); mvwprintw(win, i, 0, "%s", tmp);
} }
} }

View file

@ -44,7 +44,7 @@ rpm-pkg rpm: $(objtree)/kernel.spec FORCE
fi fi
$(MAKE) clean $(MAKE) clean
$(PREV) ln -sf $(srctree) $(KERNELPATH) $(PREV) ln -sf $(srctree) $(KERNELPATH)
$(CONFIG_SHELL) $(srctree)/scripts/setlocalversion --scm-only > $(objtree)/.scmversion $(CONFIG_SHELL) $(srctree)/scripts/setlocalversion --save-scmversion
$(PREV) tar -cz $(RCS_TAR_IGNORE) -f $(KERNELPATH).tar.gz $(KERNELPATH)/. $(PREV) tar -cz $(RCS_TAR_IGNORE) -f $(KERNELPATH).tar.gz $(KERNELPATH)/.
$(PREV) rm $(KERNELPATH) $(PREV) rm $(KERNELPATH)
rm -f $(objtree)/.scmversion rm -f $(objtree)/.scmversion

View file

@ -10,13 +10,13 @@
# #
usage() { usage() {
echo "Usage: $0 [--scm-only] [srctree]" >&2 echo "Usage: $0 [--save-scmversion] [srctree]" >&2
exit 1 exit 1
} }
scm_only=false scm_only=false
srctree=. srctree=.
if test "$1" = "--scm-only"; then if test "$1" = "--save-scmversion"; then
scm_only=true scm_only=true
shift shift
fi fi
@ -30,11 +30,12 @@ fi
scm_version() scm_version()
{ {
local short=false local short
short=false
cd "$srctree" cd "$srctree"
if test -e .scmversion; then if test -e .scmversion; then
cat "$_" cat .scmversion
return return
fi fi
if test "$1" = "--short"; then if test "$1" = "--short"; then
@ -131,12 +132,15 @@ collect_files()
} }
if $scm_only; then if $scm_only; then
scm_version if test ! -e .scmversion; then
res=$(scm_version)
echo "$res" >.scmversion
fi
exit exit
fi fi
if test -e include/config/auto.conf; then if test -e include/config/auto.conf; then
source "$_" . include/config/auto.conf
else else
echo "Error: kernelrelease not valid - run 'make prepare' to update it" echo "Error: kernelrelease not valid - run 'make prepare' to update it"
exit 1 exit 1