]> Lady’s Gitweb - Yseme/commitdiff
Only use utf-8-mac when iconv supports it current 0.1.1
authorLady <redacted>
Mon, 22 Jan 2024 01:05:45 +0000 (20:05 -0500)
committerLady <redacted>
Mon, 5 Feb 2024 15:27:45 +0000 (10:27 -0500)
This should hopefully avoid needing device‐specific character set
configuration for repositories.

GNUmakefile
README.markdown

index e07079b15656423732686e3155f27f9456d97275..9f17dbc18454acaef788c291b135af4b7f97c19a 100644 (file)
@@ -5,16 +5,10 @@ SHELL = /bin/sh
 # This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
 # If a copy of the M·P·L was not distributed with this file, You can obtain one at <https://mozilla.org/MPL/2.0/>.
 
-BUILDTARGET := .grass
-DESTDIR := .
-
-CLIENTCHARSET := utf-8-mac
-SERVER := computer
-SERVERCHARSET := utf-8
-SERVERPATH := $(notdir $(abspath .))
-
 AWK := awk
 ECHO := echo
+GREP := grep
+ICONV := iconv
 SED := sed
 TEST := test
 
@@ -29,6 +23,14 @@ RSYNCFILTER := .rsync-filter
 endif
 RSYNCOPTS := --checksum --compress --del --links --omit-dir-times --prune-empty-dirs --recursive --times --verbose
 
+BUILDTARGET := .grass
+DESTDIR := .
+
+CLIENTCHARSET := $(if $(shell $(ICONV) -l | $(GREP) -i 'utf-8-mac' - || true),utf-8-mac,utf-8)
+SERVER := computer
+SERVERCHARSET := utf-8
+SERVERPATH := $(notdir $(abspath .))
+
 override comma := ,
 
 ifneq ($(wildcard $(BUILDTARGET)),)
index f52b25ef16bcb935104ead21123c3eeb0cc4e18c..217bf70471188c3d06bf56c9fd730659fccf2ec6 100644 (file)
@@ -91,6 +91,8 @@ In every case, you may supply your own implementation by overriding the
 - `awk`
 - `echo`
 - `git`
+- `grep`
+- `iconv`
 - `rsync` (version 3.0 or later)
 - `sed`
 - `test`
@@ -120,7 +122,8 @@ The following variables configure Git :⁠—
 The following variables configuer R·Sync :⁠—
 
 - **`CLIENTCHARSET`:**
-  The character set of the local machine (default: `utf-8-mac`).
+  The character set of the local machine (default: `utf-8-mac` if
+    supported by `iconv`; `utf-8` otherwise).
   If both this and `SERVERCHARSET` are set and not equal, an appropriate
     `--iconv` option will be added to the R·Sync call.
 
This page took 0.02458 seconds and 4 git commands to generate.