Patrick Georgi has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/37023 )
Change subject: util/release: Don't wildly rename Makefiles ......................................................................
util/release: Don't wildly rename Makefiles
Even with four cloc invocations it's faster than doing the rename dance and messes up the tree less. It also opens up using cloc's git mode to work on a git tree instead of a checkout.
Change-Id: I3ad8fc6802ecedb332359d00b28ea61c33ed2ea0 Signed-off-by: Patrick Georgi pgeorgi@google.com --- M util/release/genrelnotes 1 file changed, 21 insertions(+), 6 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/23/37023/1
diff --git a/util/release/genrelnotes b/util/release/genrelnotes index 0990f77..d0f1a7a 100755 --- a/util/release/genrelnotes +++ b/util/release/genrelnotes @@ -225,14 +225,29 @@
get_sloc () { # Because cloc works on extensions, and .inc identifies as pascal, - # rename Makefile.inc, then remap the other .inc files to c - find 'src' -name 'Makefile.inc' -exec rename 's/Makefile.inc/gnumakefile/' {} ; + # while we use it both for Makefile.inc and some files that are + # really C, do three passes: everything but .inc files, all .inc files + # that aren't Makefiles, all Makefile.inc, then combine them.
- cloc --progress-rate=0 --quiet --script-lang="Bourne Shell",bash \ - --force-lang=c,inc --exclude-dir=vendorcode src + local base=`mktemp` + find src -name Makefile.inc > ${base}.mak
- # Change all the makefiles back to Makefile.inc - find 'src' -name 'gnumakefile' -exec rename 's/gnumakefile/Makefile.inc/' {} ; + cloc --progress-rate=0 --quiet \ + --script-lang="Bourne Shell",bash --exclude-ext=inc \ + --exclude-dir=vendorcode --out=${base} src + cloc --progress-rate=0 --quiet \ + --exclude-list-file=${base}.mak --force-lang=c,inc \ + --exclude-dir=vendorcode --out=${base}.c src + cloc --progress-rate=0 --quiet \ + --list-file=${base}.mak --force-lang=make,inc \ + --exclude-dir=vendorcode --out=${base}.m src + cloc --progress-rate=0 --quiet --sum-reports \ + ${base} ${base}.c ${base}.m --out ${base}.result + + echo + cat ${base}.result.lang + + rm -f ${base}* }
# Start collecting data from the old and new revisions.
Stefan Reinauer has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/37023 )
Change subject: util/release: Don't wildly rename Makefiles ......................................................................
Patch Set 1: Code-Review+2
Patrick Georgi has submitted this change. ( https://review.coreboot.org/c/coreboot/+/37023 )
Change subject: util/release: Don't wildly rename Makefiles ......................................................................
util/release: Don't wildly rename Makefiles
Even with four cloc invocations it's faster than doing the rename dance and messes up the tree less. It also opens up using cloc's git mode to work on a git tree instead of a checkout.
Change-Id: I3ad8fc6802ecedb332359d00b28ea61c33ed2ea0 Signed-off-by: Patrick Georgi pgeorgi@google.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/37023 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Stefan Reinauer stefan.reinauer@coreboot.org --- M util/release/genrelnotes 1 file changed, 21 insertions(+), 6 deletions(-)
Approvals: build bot (Jenkins): Verified Stefan Reinauer: Looks good to me, approved
diff --git a/util/release/genrelnotes b/util/release/genrelnotes index e3af48c..c19aaa7 100755 --- a/util/release/genrelnotes +++ b/util/release/genrelnotes @@ -226,14 +226,29 @@
get_sloc () { # Because cloc works on extensions, and .inc identifies as pascal, - # rename Makefile.inc, then remap the other .inc files to c - find 'src' -name 'Makefile.inc' -exec rename 's/Makefile.inc/gnumakefile/' {} ; + # while we use it both for Makefile.inc and some files that are + # really C, do three passes: everything but .inc files, all .inc files + # that aren't Makefiles, all Makefile.inc, then combine them.
- cloc --progress-rate=0 --quiet --script-lang="Bourne Shell",bash \ - --force-lang=c,inc --exclude-dir=vendorcode src + local base=`mktemp` + find src -name Makefile.inc > ${base}.mak
- # Change all the makefiles back to Makefile.inc - find 'src' -name 'gnumakefile' -exec rename 's/gnumakefile/Makefile.inc/' {} ; + cloc --progress-rate=0 --quiet \ + --script-lang="Bourne Shell",bash --exclude-ext=inc \ + --exclude-dir=vendorcode --out=${base} src + cloc --progress-rate=0 --quiet \ + --exclude-list-file=${base}.mak --force-lang=c,inc \ + --exclude-dir=vendorcode --out=${base}.c src + cloc --progress-rate=0 --quiet \ + --list-file=${base}.mak --force-lang=make,inc \ + --exclude-dir=vendorcode --out=${base}.m src + cloc --progress-rate=0 --quiet --sum-reports \ + ${base} ${base}.c ${base}.m --out ${base}.result + + echo + cat ${base}.result.lang + + rm -f ${base}* }
# Start collecting data from the old and new revisions.