This should hopefully avoid needing device‐specific character set
configuration for repositories.
# 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/>.
# 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 .))
-
+GREP := grep
+ICONV := iconv
endif
RSYNCOPTS := --checksum --compress --del --links --omit-dir-times --prune-empty-dirs --recursive --times --verbose
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)),)
override comma := ,
ifneq ($(wildcard $(BUILDTARGET)),)
- `rsync` (version 3.0 or later)
- `sed`
- `test`
- `rsync` (version 3.0 or later)
- `sed`
- `test`
The following variables configuer R·Sync :—
- **`CLIENTCHARSET`:**
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.
If both this and `SERVERCHARSET` are set and not equal, an appropriate
`--iconv` option will be added to the R·Sync call.