mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-pkg
synced 2026-01-15 03:53:32 +01:00
linux-rpm.mk: Use awk to edit EXTRAVERSION
This commit is contained in:
parent
42b3aa5359
commit
d8d2b867fc
1 changed files with 17 additions and 4 deletions
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
# abbreviations
|
||||
define EXTRAVERSION
|
||||
$(shell sed '/^ *EXTRAVERSION *=/ !d; s/^ *EXTRAVERSION *= *-*//; s/ *$$//' linux-$(KERNEL_VERSION)/Makefile)
|
||||
$(shell sed '/^ *EXTRAVERSION *=/ !d; s/^ *EXTRAVERSION *= *-*//; s/ *$$//' linux-$(KERNEL_VERSION)/Makefile 2>/dev/null)
|
||||
endef
|
||||
|
||||
KERNEL_MINOR := $(shell echo $(KERNEL_VERSION) | cut -d\. -f2)
|
||||
|
|
@ -102,9 +102,22 @@ config-$(KERNEL_VERSION):
|
|||
cvs add $@
|
||||
cvs commit
|
||||
|
||||
toplevel-makefile: unpack.done
|
||||
sed "s/\(^ *EXTRAVERSION *= *[^ ]*\) *$$/\\1$(shell echo _$(KERNEL_RELEASE) | sed 's/^_/-/')/" \
|
||||
linux-$(KERNEL_VERSION)/Makefile >$@
|
||||
# if ($$0 ~ "^ *EXTRAVERSION *= [0-9]*.[0-9]*.[0-9]") { \
|
||||
|
||||
toplevel-makefile: patches.done
|
||||
awk -v release=$(KERNEL_RELEASE) '{ \
|
||||
if ($$0 ~ /EXTRAVERSION *= *-/) { \
|
||||
oldextra=$$3; \
|
||||
gsub(/-/,_,oldextra); \
|
||||
printf "EXTRAVERSION = -%s_%s \n", release, oldextra \
|
||||
} else if ($$0 ~ /EXTRAVERSION *= *$$/) { \
|
||||
printf "EXTRAVERSION = -%s\n",release \
|
||||
} else { \
|
||||
print $$0 \
|
||||
} \
|
||||
}' linux-$(KERNEL_VERSION)/Makefile >$@
|
||||
|
||||
# sed "s/\(^ *EXTRAVERSION *= *[^ ]*\) *$$/\\1$(shell echo _$(KERNEL_RELEASE) | sed 's/^_/-/')/" \
|
||||
|
||||
linux-$(KERNEL_VERSION)/Makefile: toplevel-makefile
|
||||
cp $< $@
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue