diff options
Diffstat (limited to 'util')
-rwxr-xr-x | util/bump_version.sh | 22 | ||||
-rw-r--r-- | util/ci/clang-format-whitelist.txt | 2 | ||||
-rw-r--r-- | util/ci/common.sh | 6 | ||||
-rwxr-xr-x[-rw-r--r--] | util/ci/lint.sh | 0 | ||||
-rwxr-xr-x | util/gather_git_credits.py | 67 | ||||
-rw-r--r-- | util/wireshark/minetest.lua | 35 |
6 files changed, 86 insertions, 46 deletions
diff --git a/util/bump_version.sh b/util/bump_version.sh index 996962199..4b12935bd 100755 --- a/util/bump_version.sh +++ b/util/bump_version.sh @@ -21,14 +21,14 @@ prompt_for_number() { # * Commit the changes # * Tag with current version perform_release() { + RELEASE_DATE=$(date +%Y-%m-%d) + sed -i -re "s/^set\(DEVELOPMENT_BUILD TRUE\)$/set(DEVELOPMENT_BUILD FALSE)/" CMakeLists.txt + sed -i 's/project.ext.set("versionExtra", "-dev")/project.ext.set("versionExtra", "")/' build/android/build.gradle sed -i -re "s/\"versionCode\", [0-9]+/\"versionCode\", $NEW_ANDROID_VERSION_CODE/" build/android/build.gradle sed -i '/\<release/s/\(version\)="[^"]*"/\1="'"$RELEASE_VERSION"'"/' misc/net.minetest.minetest.appdata.xml - - RELEASE_DATE=`date +%Y-%m-%d` - sed -i 's/\(<release date\)="[^"]*"/\1="'"$RELEASE_DATE"'"/' misc/net.minetest.minetest.appdata.xml git add -f CMakeLists.txt build/android/build.gradle misc/net.minetest.minetest.appdata.xml @@ -47,20 +47,24 @@ perform_release() { back_to_devel() { echo 'Creating "return back to development" commit' + # Update CMakeList.txt versions sed -i -re 's/^set\(DEVELOPMENT_BUILD FALSE\)$/set(DEVELOPMENT_BUILD TRUE)/' CMakeLists.txt - sed -i -re "s/^set\(VERSION_MAJOR [0-9]+\)$/set(VERSION_MAJOR $NEXT_VERSION_MAJOR)/" CMakeLists.txt - sed -i -re "s/^set\(VERSION_MINOR [0-9]+\)$/set(VERSION_MINOR $NEXT_VERSION_MINOR)/" CMakeLists.txt - sed -i -re "s/^set\(VERSION_PATCH [0-9]+\)$/set(VERSION_PATCH $NEXT_VERSION_PATCH)/" CMakeLists.txt - sed -i -re "1s/[0-9]+\.[0-9]+\.[0-9]+/$NEXT_VERSION/g" doc/menu_lua_api.txt + # Update Android versions + sed -i 's/set("versionExtra", "")/set("versionExtra", "-dev")/' build/android/build.gradle + sed -i -re "s/set\(\"versionMajor\", [0-9]+\)/set(\"versionMajor\", $NEXT_VERSION_MAJOR)/" build/android/build.gradle + sed -i -re "s/set\(\"versionMinor\", [0-9]+\)/set(\"versionMinor\", $NEXT_VERSION_MINOR)/" build/android/build.gradle + sed -i -re "s/set\(\"versionPatch\", [0-9]+\)/set(\"versionPatch\", $NEXT_VERSION_PATCH)/" build/android/build.gradle + # Update doc versions + sed -i -re "1s/[0-9]+\.[0-9]+\.[0-9]+/$NEXT_VERSION/g" doc/menu_lua_api.txt sed -i -re "1s/[0-9]+\.[0-9]+\.[0-9]+/$NEXT_VERSION/g" doc/client_lua_api.txt - git add -f CMakeLists.txt doc/menu_lua_api.txt doc/client_lua_api.txt - + # Commit + git add -f CMakeLists.txt build/android/build.gradle doc/menu_lua_api.txt doc/client_lua_api.txt git commit -m "Continue with $NEXT_VERSION-dev" } ################################## diff --git a/util/ci/clang-format-whitelist.txt b/util/ci/clang-format-whitelist.txt index 3334257ae..75d99f4cd 100644 --- a/util/ci/clang-format-whitelist.txt +++ b/util/ci/clang-format-whitelist.txt @@ -183,6 +183,8 @@ src/gui/guiMainMenu.h src/gui/guiPasswordChange.cpp src/gui/guiPathSelectMenu.cpp src/gui/guiPathSelectMenu.h +src/gui/guiScene.cpp +src/gui/guiScene.h src/gui/guiScrollBar.cpp src/gui/guiSkin.cpp src/gui/guiSkin.h diff --git a/util/ci/common.sh b/util/ci/common.sh index a2e4beac9..7523fa7ff 100644 --- a/util/ci/common.sh +++ b/util/ci/common.sh @@ -7,13 +7,9 @@ install_linux_deps() { libhiredis-dev libogg-dev libgmp-dev libvorbis-dev libopenal-dev \ gettext libpq-dev postgresql-server-dev-all libleveldb-dev \ libcurl4-openssl-dev) - # for better coverage, build some jobs with luajit - if [ -n "$WITH_LUAJIT" ]; then - pkgs+=(libluajit-5.1-dev) - fi sudo apt-get update - sudo apt-get install -y --no-install-recommends ${pkgs[@]} + sudo apt-get install -y --no-install-recommends ${pkgs[@]} "$@" } # Mac OSX build only diff --git a/util/ci/lint.sh b/util/ci/lint.sh index 395445ca7..395445ca7 100644..100755 --- a/util/ci/lint.sh +++ b/util/ci/lint.sh diff --git a/util/gather_git_credits.py b/util/gather_git_credits.py new file mode 100755 index 000000000..1b2865182 --- /dev/null +++ b/util/gather_git_credits.py @@ -0,0 +1,67 @@ +#!/usr/bin/env python3 +import subprocess +import re +from collections import defaultdict + +codefiles = r"(\.[ch](pp)?|\.lua|\.md|\.cmake|\.java|\.gradle|Makefile|CMakeLists\.txt)$" + +# two minor versions back, for "Active Contributors" +REVS_ACTIVE = "5.2.0..HEAD" +# all time, for "Previous Contributors" +REVS_PREVIOUS = "HEAD" + +CUTOFF_ACTIVE = 3 +CUTOFF_PREVIOUS = 21 + +# For a description of the points system see: +# https://github.com/minetest/minetest/pull/9593#issue-398677198 + +def load(revs): + points = defaultdict(int) + p = subprocess.Popen(["git", "log", "--mailmap", "--pretty=format:%h %aN <%aE>", revs], + stdout=subprocess.PIPE, universal_newlines=True) + for line in p.stdout: + hash, author = line.strip().split(" ", 1) + n = 0 + + p2 = subprocess.Popen(["git", "show", "--numstat", "--pretty=format:", hash], + stdout=subprocess.PIPE, universal_newlines=True) + for line in p2.stdout: + added, deleted, filename = re.split(r"\s+", line.strip(), 2) + if re.search(codefiles, filename) and added != "-": + n += int(added) + p2.wait() + + if n == 0: + continue + if n > 1200: + n = 8 + elif n > 700: + n = 4 + elif n > 100: + n = 2 + else: + n = 1 + points[author] += n + p.wait() + + # Some authors duplicate? Don't add manual workarounds here, edit the .mailmap! + for author in ("updatepo.sh <script@mt>", "Weblate <42@minetest.ru>"): + points.pop(author, None) + return points + +points_active = load(REVS_ACTIVE) +points_prev = load(REVS_PREVIOUS) + +with open("results.txt", "w") as f: + for author, points in sorted(points_active.items(), key=(lambda e: e[1]), reverse=True): + if points < CUTOFF_ACTIVE: break + points_prev.pop(author, None) # active authors don't appear in previous + f.write("%d\t%s\n" % (points, author)) + f.write('\n---------\n\n') + once = True + for author, points in sorted(points_prev.items(), key=(lambda e: e[1]), reverse=True): + if points < CUTOFF_PREVIOUS and once: + f.write('\n---------\n\n') + once = False + f.write("%d\t%s\n" % (points, author)) diff --git a/util/wireshark/minetest.lua b/util/wireshark/minetest.lua index 13cd6d482..d954c7597 100644 --- a/util/wireshark/minetest.lua +++ b/util/wireshark/minetest.lua @@ -299,7 +299,7 @@ do t:add(f_length, buffer(2,2)) local textlen = buffer(2,2):uint() if minetest_check_length(buffer, 4 + textlen*2, t) then - t:add(f_message, minetest_convert_utf16(buffer(4, textlen*2), "Converted chat message")) + t:add(f_message, buffer(4, textlen*2), buffer(4, textlen*2):ustring()) end end } @@ -873,7 +873,7 @@ end -- TOCLIENT_HP do - local f_hp = ProtoField.uint16("minetest.server.hp", "Hitpoints", base.DEC) + local f_hp = ProtoField.uint16("minetest.server.hp", "Health points", base.DEC) minetest_server_commands[0x33] = { "HP", 4, @@ -1379,35 +1379,6 @@ function minetest_check_length(tvb, min_len, t) end end --- Takes a Tvb or TvbRange (i.e. part of a packet) that --- contains a UTF-16 string and returns a TvbRange containing --- string converted to ASCII. Any characters outside the range --- 0x20 to 0x7e are replaced by a question mark. --- Parameter: tvb: Tvb or TvbRange that contains the UTF-16 data --- Parameter: name: will be the name of the newly created Tvb. --- Returns: New TvbRange containing the ASCII string. --- TODO: Handle surrogates (should only produce one question mark) --- TODO: Remove this when Wireshark supports UTF-16 strings natively. -function minetest_convert_utf16(tvb, name) - local hex, pos, char - hex = "" - for pos = 0, tvb:len() - 2, 2 do - char = tvb(pos, 2):uint() - if (char >= 0x20 and char <= 0x7e) or char == 0x0a then - hex = hex .. string.format(" %02x", char) - else - hex = hex .. " 3F" - end - end - if hex == "" then - -- This is a hack to avoid a failed assertion in tvbuff.c - -- (function: ensure_contiguous_no_exception) - return ByteArray.new("00"):tvb(name):range(0,0) - else - return ByteArray.new(hex):tvb(name):range() - end -end - -- Decodes a variable-length string as ASCII text -- t_textlen, t_text should be the ProtoFields created by minetest_field_helper -- alternatively t_text can be a ProtoField.string and t_textlen can be nil @@ -1438,7 +1409,7 @@ function minetest_decode_helper_utf16(tvb, t, lentype, offset, f_textlen, f_text end local textlen = tvb(offset, n):uint() * 2 if minetest_check_length(tvb, offset + n + textlen, t) then - t:add(f_text, minetest_convert_utf16(tvb(offset + n, textlen), "UTF-16 text")) + t:add(f_text, tvb(offset + n, textlen), tvb(offset + n, textlen):ustring()) return offset + n + textlen end end |