Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dolibarr
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software_Artifact_Infrastructure_Repository
dolibarr
Commits
a5ba5931
Commit
a5ba5931
authored
11 years ago
by
Laurent Destailleur
Browse files
Options
Downloads
Patches
Plain Diff
Fix: Fix some bug into script to detect bad utf8 and dos files
parent
307ae659
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dev/fixdosfiles.sh
+2
-2
2 additions, 2 deletions
dev/fixdosfiles.sh
dev/fixutf8bomfiles.sh
+10
-4
10 additions, 4 deletions
dev/fixutf8bomfiles.sh
with
12 additions
and
6 deletions
dev/fixdosfiles.sh
+
2
−
2
View file @
a5ba5931
...
...
@@ -16,13 +16,13 @@ fi
# To detec
if
[
"x
$1
"
=
"xlist"
]
then
find
.
-iname
"*.php"
-o
-iname
"*.sh"
-o
-iname
"*.pl"
-o
-iname
"*.lang"
-o
-iname
"*.txt"
-exec
file
"{}"
+ |
grep
-v
'htdocs\/includes'
|
grep
CRLF
find
.
\(
-iname
"*.php"
-o
-iname
"*.sh"
-o
-iname
"*.pl"
-o
-iname
"*.lang"
-o
-iname
"*.txt"
\)
-exec
file
"{}"
+ |
grep
-v
'htdocs\/includes'
|
grep
CRLF
fi
# To convert
if
[
"x
$1
"
=
"xfix"
]
then
for
fic
in
`
find
.
-iname
"*.php"
-o
-iname
"*.sh"
-o
-iname
"*.pl"
-o
-iname
"*.lang"
-o
-iname
"*.txt"
-exec
file
"{}"
+ |
grep
-v
'htdocs\/includes'
|
grep
CRLF |
awk
-F
':'
'{ print $1 }'
`
for
fic
in
`
find
.
\(
-iname
"*.php"
-o
-iname
"*.sh"
-o
-iname
"*.pl"
-o
-iname
"*.lang"
-o
-iname
"*.txt"
\)
-exec
file
"{}"
+ |
grep
-v
'htdocs\/includes'
|
grep
CRLF |
awk
-F
':'
'{ print $1 }'
`
do
echo
"Fix file
$fic
"
dos2unix
$fic
...
...
This diff is collapsed.
Click to expand it.
dev/fixutf8bomfiles.sh
+
10
−
4
View file @
a5ba5931
...
...
@@ -12,20 +12,26 @@
# Syntax
if
[
"x
$1
"
!=
"xlist"
-a
"x
$1
"
!=
"xfix"
]
then
echo
"Usage: fixutf8bomfiles.sh [list|fix]"
echo
"Usage: fixutf8bomfiles.sh (list|fix) [addincludes]"
fi
if
[
"x
$2
"
!=
"xaddincludes"
]
then
export
moreoptions
=
"--exclude-dir='includes'"
fi
# To detec
if
[
"x
$1
"
=
"xlist"
]
then
#find . -iname '*.php' -print0 -o -iname '*.sh' -print0 -o -iname '*.pl' -print0 -o -iname '*.lang' -print0 -o -iname '*.txt' -print0 | xargs -0 awk '/^\xEF\xBB\xBF/ {print FILENAME} {nextfile}'
grep
-rlIZ
--include
=
'*.php'
--include
=
'*.sh'
--include
=
'*.pl'
--include
=
'*.lang'
--include
=
'*.txt'
--exclude-dir
=
'.git'
--exclude-dir
=
'includes'
--exclude-dir
=
'custom'
.
.
| xargs
-0
awk
'/^\xEF\xBB\xBF/ {print FILENAME} {nextfile}'
#find . \( -iname '*.php' -print0 -o -iname '*.sh' -print0 -o -iname '*.pl' -print0 -o -iname '*.lang' -print0 -o -iname '*.txt' \) -print0 | xargs -0 awk '/^\xEF\xBB\xBF/ {print FILENAME} {nextfile}'
echo
"grep -rlIZ --include='*.php' --include='*.sh' --include='*.pl' --include='*.lang' --include='*.txt' --exclude-dir='.git' --exclude-dir='.tx'
$moreoptions
--exclude-dir='custom' . . | xargs -0 awk '/^
\x
EF
\x
BB
\x
BF/ {print FILENAME} {nextfile}'"
grep
-rlIZ
--include
=
'*.php'
--include
=
'*.sh'
--include
=
'*.pl'
--include
=
'*.lang'
--include
=
'*.txt'
--exclude-dir
=
'.git'
--exclude-dir
=
'.tx'
$moreoptions
--exclude-dir
=
'custom'
.
.
| xargs
-0
awk
'/^\xEF\xBB\xBF/ {print FILENAME} {nextfile}'
fi
# To convert
if
[
"x
$1
"
=
"xfix"
]
then
for
fic
in
`
grep
-rlIZ
--include
=
'*.php'
--include
=
'*.sh'
--include
=
'*.pl'
--include
=
'*.lang'
--include
=
'*.txt'
--exclude-dir
=
'.git'
--exclude-dir
=
'
includes'
--exclude-dir
=
'custom'
.
.
| xargs
-0
awk
'/^\xEF\xBB\xBF/ {print FILENAME} {nextfile}'
`
for
fic
in
`
grep
-rlIZ
--include
=
'*.php'
--include
=
'*.sh'
--include
=
'*.pl'
--include
=
'*.lang'
--include
=
'*.txt'
--exclude-dir
=
'.git'
--exclude-dir
=
'
.tx'
$moreoptions
--exclude-dir
=
'custom'
.
.
| xargs
-0
awk
'/^\xEF\xBB\xBF/ {print FILENAME} {nextfile}'
`
do
echo
"Fixing
$fic
"
sed
-i
'1s/^\xEF\xBB\xBF//'
$fic
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment