From 9ea4b5885f64089fddb7c46f158fa5fcbb8a43de Mon Sep 17 00:00:00 2001 From: probonopd Date: Sun, 15 Nov 2026 20:04:29 +0000 Subject: [PATCH 1/2] check-name: an entry that differs only in capitalization is a warning, not an error It may be another application with a similar name; the warning asks to update the existing entry if it is the same application and names the problem for case-insensitive file systems. Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01DZvaN9tm5taf5avUvVtmyq --- AGENTS.md | 2 ++ code/check-name.sh | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/AGENTS.md b/AGENTS.md index 0be91f1c7c0..9c2fda50afd 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -63,6 +63,8 @@ GitHub Pages (Jekyll) from this repository. or a name with capitals with `Terminal=true`: all-lowercase names are typically command line tools; the publish workflow only shows a note that `check-name.sh --note-text` generates exactly; + an existing entry whose name differs only in capitalization (`Shift` and `shift`) + is only a warning, never an error, since it may be another application; - `code/check-name.sh` also rejects the word "App" in a name (`Foo-App`, `foo_app`, `App_Outlet`: a token between `-`, `_`, `.` or blanks; not `WhatsApp`, `Apple`), an error for files a PR adds and a warning for the 32 old ones, and `code/pick-name.sh` diff --git a/code/check-name.sh b/code/check-name.sh index f8651084ed8..186361f2228 100755 --- a/code/check-name.sh +++ b/code/check-name.sh @@ -96,7 +96,8 @@ if [ -z "$DESKTOP" ] ; then for OTHER in "$DATADIR"/* ; do OTHER=$(basename "$OTHER") if [ "$OTHER" != "$NAME" ] && [ "$(echo "$OTHER" | tr 'A-Z' 'a-z')" == "$LOWER" ] ; then - problem "an entry with the same name in different capitalization exists already: data/$OTHER; please change that file instead" + # only a warning: it may be another application with a similar name + remark "an entry with the same name in different capitalization exists already: data/$OTHER. If it is the same application, please change that file instead of adding a second entry; if not, this is fine, although file systems that ignore case (macOS, Windows) cannot hold both files in a clone of this repository" break fi done From a46aa6bb739491958ee0360baa62d4a67283f99c Mon Sep 17 00:00:00 2001 From: probonopd Date: Sun, 15 Nov 2026 20:08:52 +0000 Subject: [PATCH 2/2] check-name: compare an entry that differs only in capitalization with the existing one Same download location (or a renamed repository): error, it is a second entry for the same application. Same owner: warning. Another owner: nothing, another application with a similar name. Only a name checked (discovery): error as before. Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01DZvaN9tm5taf5avUvVtmyq --- AGENTS.md | 8 ++++++-- code/check-name.sh | 39 +++++++++++++++++++++++++++++++++++++-- 2 files changed, 43 insertions(+), 4 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 9c2fda50afd..0a994be62fe 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -63,8 +63,12 @@ GitHub Pages (Jekyll) from this repository. or a name with capitals with `Terminal=true`: all-lowercase names are typically command line tools; the publish workflow only shows a note that `check-name.sh --note-text` generates exactly; - an existing entry whose name differs only in capitalization (`Shift` and `shift`) - is only a warning, never an error, since it may be another application; + an existing entry whose name differs only in capitalization (`Shift` and `shift`) is + compared by the first lines of the two files: the same download location (or a + repository that was renamed) is an error (a second entry for the same application); + the same owner (GitHub user or organization, forge project, domain) is a warning; + another owner is not mentioned (another application with a similar name); when + only a name is checked (discovery) it stays an error; - `code/check-name.sh` also rejects the word "App" in a name (`Foo-App`, `foo_app`, `App_Outlet`: a token between `-`, `_`, `.` or blanks; not `WhatsApp`, `Apple`), an error for files a PR adds and a warning for the 32 old ones, and `code/pick-name.sh` diff --git a/code/check-name.sh b/code/check-name.sh index 186361f2228..7ef7e837854 100755 --- a/code/check-name.sh +++ b/code/check-name.sh @@ -96,8 +96,43 @@ if [ -z "$DESKTOP" ] ; then for OTHER in "$DATADIR"/* ; do OTHER=$(basename "$OTHER") if [ "$OTHER" != "$NAME" ] && [ "$(echo "$OTHER" | tr 'A-Z' 'a-z')" == "$LOWER" ] ; then - # only a warning: it may be another application with a similar name - remark "an entry with the same name in different capitalization exists already: data/$OTHER. If it is the same application, please change that file instead of adding a second entry; if not, this is fine, although file systems that ignore case (macOS, Windows) cannot hold both files in a clone of this repository" + SAME=unknown + # Is the entry that differs only in capitalization the same application? Compare + # where the two entries get the AppImage from (the first line of the files), if + # both files are there (not when a name is only proposed, e.g., by the discovery) + if [ -r "$DATADIR/$NAME" ] && [ -r "$DATADIR/$OTHER" ] ; then + MINE=$(head -n 1 "$DATADIR/$NAME" | tr -d '\r' | sed -E 's/^[[:space:]]+//; s/[[:space:]]+$//') + THEIRS=$(head -n 1 "$DATADIR/$OTHER" | tr -d '\r' | sed -E 's/^[[:space:]]+//; s/[[:space:]]+$//') + # Repository (or download location) without the channel, host in lower case + loc() { echo "$1" | sed -E 's/#.*//; s/[?].*//; s|^[a-zA-Z]+://||; s|^www[.]||; s|/+$||; s|[.]git$||' | tr 'A-Z' 'a-z' ; } + chan() { case "$1" in *"#"*) echo "${1#*#}" | tr 'A-Z' 'a-z' ;; esac ; } + if [ -z "$MINE" ] || [ -z "$THEIRS" ] ; then + SAME=unknown + elif [ "$(loc "$MINE")" == "$(loc "$THEIRS")" ] && [ "$(chan "$MINE")" == "$(chan "$THEIRS")" ] ; then + SAME=same # the same download location + else + timeout 60 bash "$(dirname "$0")/check-origin.sh" "$THEIRS" "$MINE" >/dev/null 2>&1 + case $? in + 0) SAME=owner ;; # the same GitHub user or organization, forge project or domain + 2) SAME=same ;; # the repository was renamed or moved: the same project + 1) SAME=different ;; # another owner: a different application with a similar name + *) SAME=unknown ;; + esac + fi + fi + case "$SAME" in + same) problem "this is the same application as the entry data/$OTHER (the same download location): please change that file instead of adding a second entry whose name differs only in capitalization" ;; + owner) remark "data/$OTHER has the same name in different capitalization and comes from the same owner. If it is the same application, please change that file instead of adding a second entry; if it is another one, this is fine, although file systems that ignore case (macOS, Windows) cannot hold both files in a clone of this repository" ;; + different) ;; # another owner: another application that happens to have a similar name + *) + if [ -r "$DATADIR/$NAME" ] ; then + remark "an entry with the same name in different capitalization exists already: data/$OTHER. If it is the same application, please change that file instead of adding a second entry; if not, this is fine, although file systems that ignore case (macOS, Windows) cannot hold both files in a clone of this repository" + else + # only a name is checked (e.g., one that the discovery proposes): it cannot be told + # whether it is the same application, so do not propose it + problem "an entry with the same name in different capitalization exists already: data/$OTHER; please change that file instead" + fi ;; + esac break fi done