Procházet zdrojové kódy

build: check the source code with LANG=C to avoid locale-related parse

discrepancies.
legacy
Sam Hocevar sam před 12 roky
rodič
revize
d18b7698c7
1 změnil soubory, kde provedl 4 přidání a 3 odebrání
  1. +4
    -3
      build/check-source.sh

+ 4
- 3
build/check-source.sh Zobrazit soubor

@@ -118,12 +118,12 @@ for file in $FILES; do
fi

# Check for trailing spaces
nspaces="$(sed 's/.*[^ \t]//' "$file" | tr -cd '\t ' | wc -c)"
nspaces="$(LANG=C sed 's/.*[^ \t]//' "$file" | tr -cd '\t ' | wc -c)"
total_spaces="$(($total_spaces + $nspaces))"
if [ "$nspaces" -gt 0 ]; then
clean=false
if [ "$fix" = true ]; then
sed -i 's/[[:space:]][[:space:]]*$//g' "$file"
LANG=C sed -i 's/[[:space:]][[:space:]]*$//g' "$file"
info "$file has $nspaces trailing spaces"
else
error "$file has $nspaces trailing spaces"
@@ -136,7 +136,7 @@ for file in $FILES; do
if [ "$ntabs" -gt 0 ]; then
clean=false
if [ "$fix" = true ]; then
sed -i 's/\t/ /g' "$file"
LANG=C sed -i 's/\t/ /g' "$file"
info "$file has $ntabs tabs"
else
error "$file has $ntabs tabs"
@@ -172,6 +172,7 @@ EOF
if [ "$total_tabs" -gt 0 ]; then
info " - fixed $total_tabs tabs"
fi
info "re-run with -c to commit fixes"
else
# OR: warn about how to fix errors
info "re-run with -w to fix errors"


Načítá se…
Zrušit
Uložit