Skip to content

Commit bc0a3e2

Browse files
committed
fix(common-files/building-system-patches): update version check workaround
- Better way that matches what will be upstreamed
1 parent 9c46a3a commit bc0a3e2

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed
Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,27 @@
1-
'git reset HEAD~' is TEMPORARY - work around bug in lint-packages.sh
2-
will discuss with Tomjo2000 and fix upstream later
1+
Part of this will be rebased after
2+
https://github.com/termux/termux-packages/pull/27095
33

44
--- a/scripts/lint-packages.sh
55
+++ b/scripts/lint-packages.sh
6-
@@ -124,7 +124,8 @@ check_indentation() {
6+
@@ -123,9 +123,9 @@ check_indentation() {
7+
78
# We'll need the 'origin/master' as a base commit when running the version check.
89
# So try fetching it now if it doesn't exist.
9-
+git reset HEAD~
10-
if ! base_commit="HEAD~$(git rev-list --count FETCH_HEAD..)"; then
10+
-if ! base_commit="HEAD~$(git rev-list --count FETCH_HEAD..)"; then
1111
- git fetch https://github.com/termux/termux-packages.git
12+
- base_commit="HEAD~$(git rev-list --count FETCH_HEAD..)"
13+
+if ! base_commit="HEAD~$(git rev-list --no-merges --count FETCH_HEAD..)"; then
1214
+ git fetch https://github.com/termux-user-repository/tur.git
13-
base_commit="HEAD~$(git rev-list --count FETCH_HEAD..)"
15+
+ base_commit="HEAD~$(git rev-list --no-merges --count FETCH_HEAD..)"
1416
fi
1517

18+
check_version() {
19+
@@ -155,7 +155,7 @@ check_version() {
20+
}
21+
22+
# Was the package modified in this branch?
23+
- git diff --exit-code "${base_commit}" -- "${package_dir}" &> /dev/null && {
24+
+ git diff --no-merges --exit-code "${base_commit}" -- "${package_dir}" &> /dev/null && {
25+
printf '%s\n' "PASS - ${version} (not modified in this branch)"
26+
continue
27+
}

0 commit comments

Comments
 (0)