Skip to content

Commit 9953c6c

Browse files
authored
Merge pull request #605 from git-for-windows/fix-nano-syntax-coloring
Fix `nano`'s syntax coloring
2 parents 86ef359 + aca5df3 commit 9953c6c

File tree

3 files changed

+17
-13
lines changed

3 files changed

+17
-13
lines changed

git-extra/PKGBUILD

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ pkgbase="mingw-w64-${_realname}"
55
pkgname=($_realname
66
"${MINGW_PACKAGE_PREFIX}-${_realname}")
77
_ver_base=1.1
8-
pkgver=1.1.649.af5925057
8+
pkgver=1.1.653.48e2403b3
99
pkgrel=1
1010
pkgdesc="Git for Windows extra files"
1111
arch=('any')
@@ -19,8 +19,8 @@ install='git-extra.install'
1919
pkgver() {
2020
cd "$startdir"
2121
test ! -f "$(git rev-parse --git-path shallow)" || git -c http.sslbackend fetch --unshallow
22-
rev="$(git rev-list -1 HEAD -- .)"
23-
test -n "$(git show . |
22+
rev="$(git rev-list -1 HEAD -- . ':(exclude)./git-extra.install')"
23+
test -n "$(git show . ':(exclude)./git-extra.install' |
2424
sed -n -e '1,/^@@/d' -e '/^[-+]pkgver=/d' -e '/^[-+]pkgver=/d' -e "/^[-+] *'[0-9a-f]\{64\}'$/d" -e '/^[-+]/p')" ||
2525
rev="$(git rev-list -1 $rev^ -- .)"
2626
printf "%s.%s.%s" "${_ver_base}" "$(git rev-list --count $rev -- .)" \

git-extra/git-extra.install

+7-5
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ GITATTRIBUTES
120120
grep -q "$otherpacman" etc/pacman.conf ||
121121
sed -i -e '/^\[mingw32\]/i['$otherpacman']\nServer = https://wingit.blob.core.windows.net/'$otherarch'\n' etc/pacman.conf
122122

123-
test -z "$(find /clangarm64 -type f -print -quit)" || # if /clangarm64 exists and contains at least one file
123+
test -z "$(find /clangarm64 -type f -print -quit 2>/dev/null)" || # if /clangarm64 exists and contains at least one file
124124
grep -q "git-for-windows-aarch64" etc/pacman.conf || # then add Git for Windows' aarch64 repository (unless it's already added)
125125
sed -i -e '/^\[clangarm64]/i[git-for-windows-aarch64]\nServer = https://wingit.blob.core.windows.net/aarch64\n' etc/pacman.conf
126126

@@ -247,10 +247,12 @@ test -d "$TMPDIR" || test ! -d "$TMP" || {\
247247
}
248248

249249
# Enable color and syntax-highlighting in GNU nano
250-
test ! -f /etc/nanorc ||
251-
grep -q '^set titlecolor' /etc/nanorc ||
252-
sed -i -e '/Paint the interface elements/,/root.s .nanorc/s/^# //' \
253-
-e 's/^# \(include .*nanorc"\)$/\1/' /etc/nanorc
250+
test ! -f /etc/nanorc || {
251+
grep -q '^set titlecolor' /etc/nanorc ||
252+
sed -i '/Paint the interface elements/,/root.s .nanorc/s/^# //' /etc/nanorc
253+
grep -q '^include .*\*\.nanorc' /etc/nanorc ||
254+
sed -i 's/^# \(include .*\*\.nanorc"\?\)$/\1/' /etc/nanorc
255+
}
254256

255257
# Do not require /usr/bin/cmd in /usr/bin/start
256258
grep -q '^"\$COMSPEC" ' /usr/bin/start ||

git-extra/git-extra.install.in

+7-5
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ GITATTRIBUTES
8686
grep -q "$otherpacman" etc/pacman.conf ||
8787
sed -i -e '/^\[mingw32\]/i['$otherpacman']\nServer = https://wingit.blob.core.windows.net/'$otherarch'\n' etc/pacman.conf
8888

89-
test -z "$(find /clangarm64 -type f -print -quit)" || # if /clangarm64 exists and contains at least one file
89+
test -z "$(find /clangarm64 -type f -print -quit 2>/dev/null)" || # if /clangarm64 exists and contains at least one file
9090
grep -q "git-for-windows-aarch64" etc/pacman.conf || # then add Git for Windows' aarch64 repository (unless it's already added)
9191
sed -i -e '/^\[clangarm64]/i[git-for-windows-aarch64]\nServer = https://wingit.blob.core.windows.net/aarch64\n' etc/pacman.conf
9292

@@ -213,10 +213,12 @@ test -d "$TMPDIR" || test ! -d "$TMP" || {\
213213
}
214214

215215
# Enable color and syntax-highlighting in GNU nano
216-
test ! -f /etc/nanorc ||
217-
grep -q '^set titlecolor' /etc/nanorc ||
218-
sed -i -e '/Paint the interface elements/,/root.s .nanorc/s/^# //' \
219-
-e 's/^# \(include .*nanorc"\)$/\1/' /etc/nanorc
216+
test ! -f /etc/nanorc || {
217+
grep -q '^set titlecolor' /etc/nanorc ||
218+
sed -i '/Paint the interface elements/,/root.s .nanorc/s/^# //' /etc/nanorc
219+
grep -q '^include .*\*\.nanorc' /etc/nanorc ||
220+
sed -i 's/^# \(include .*\*\.nanorc"\?\)$/\1/' /etc/nanorc
221+
}
220222

221223
# Do not require /usr/bin/cmd in /usr/bin/start
222224
grep -q '^"\$COMSPEC" ' /usr/bin/start ||

0 commit comments

Comments
 (0)