Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
e0984ff7
Commit
e0984ff7
authored
Jul 01, 2011
by
Claes Sjofors
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Script for license text replacement added
parent
62a5f6e4
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
160 additions
and
0 deletions
+160
-0
src/tools/com/src/license.awk
src/tools/com/src/license.awk
+32
-0
src/tools/com/src/license_sh.awk
src/tools/com/src/license_sh.awk
+32
-0
src/tools/com/src/license_wbl.awk
src/tools/com/src/license_wbl.awk
+32
-0
src/tools/com/src/replace_all.sh
src/tools/com/src/replace_all.sh
+49
-0
src/tools/com/src/replace_all_exec.sh
src/tools/com/src/replace_all_exec.sh
+15
-0
No files found.
src/tools/com/src/license.awk
0 → 100644
View file @
e0984ff7
BEGIN
{
inlicense
=
0
;
rowcnt
=
0
;
}
{
if
(
$2
==
"This"
&&
$3
==
"file"
&&
$4
==
"is"
&&
$5
==
"part"
&&
$6
==
"of"
&&
$7
==
"Proview."
)
{
inlicense
=
1
;
printf
(
"%s\n"
,
$0
);
}
else
if
(
inlicense
)
{
rowcnt
++
;
if
(
rowcnt
==
21
)
{
printf
(
" * Proview give you permission to, from the build function in the\n"
);
}
else
if
(
rowcnt
==
22
)
{
printf
(
" * Proview Configurator, combine Proview with modules generated by the\n"
);
}
else
if
(
rowcnt
==
23
)
{
printf
(
" * Proview PLC Editor to a PLC program, regardless of the license\n"
);
}
else
if
(
rowcnt
==
24
)
{
printf
(
" * terms of these modules. You may copy and distribute the resulting\n"
);
inlicense
=
0
;
}
else
printf
(
"%s\n"
,
$0
);
}
else
printf
(
"%s\n"
,
$0
);
}
src/tools/com/src/license_sh.awk
0 → 100644
View file @
e0984ff7
BEGIN
{
inlicense
=
0
;
rowcnt
=
0
;
}
{
if
(
$2
==
"This"
&&
$3
==
"file"
&&
$4
==
"is"
&&
$5
==
"part"
&&
$6
==
"of"
&&
$7
==
"Proview."
)
{
inlicense
=
1
;
printf
(
"%s\n"
,
$0
);
}
else
if
(
inlicense
)
{
rowcnt
++
;
if
(
rowcnt
==
21
)
{
printf
(
"# Proview give you permission to, from the build function in the\n"
);
}
else
if
(
rowcnt
==
22
)
{
printf
(
"# Proview Configurator, combine Proview with modules generated by the\n"
);
}
else
if
(
rowcnt
==
23
)
{
printf
(
"# Proview PLC Editor to a PLC program, regardless of the license\n"
);
}
else
if
(
rowcnt
==
24
)
{
printf
(
"# terms of these modules. You may copy and distribute the resulting\n"
);
inlicense
=
0
;
}
else
printf
(
"%s\n"
,
$0
);
}
else
printf
(
"%s\n"
,
$0
);
}
src/tools/com/src/license_wbl.awk
0 → 100644
View file @
e0984ff7
BEGIN
{
inlicense
=
0
;
rowcnt
=
0
;
}
{
if
(
$2
==
"This"
&&
$3
==
"file"
&&
$4
==
"is"
&&
$5
==
"part"
&&
$6
==
"of"
&&
$7
==
"Proview."
)
{
inlicense
=
1
;
printf
(
"%s\n"
,
$0
);
}
else
if
(
inlicense
)
{
rowcnt
++
;
if
(
rowcnt
==
21
)
{
printf
(
"! Proview give you permission to, from the build function in the\n"
);
}
else
if
(
rowcnt
==
22
)
{
printf
(
"! Proview Configurator, combine Proview with modules generated by the\n"
);
}
else
if
(
rowcnt
==
23
)
{
printf
(
"! Proview PLC Editor to a PLC program, regardless of the license\n"
);
}
else
if
(
rowcnt
==
24
)
{
printf
(
"! terms of these modules. You may copy and distribute the resulting\n"
);
inlicense
=
0
;
}
else
printf
(
"%s\n"
,
$0
);
}
else
printf
(
"%s\n"
,
$0
);
}
src/tools/com/src/replace_all.sh
0 → 100755
View file @
e0984ff7
#set -o xtrace
if
[
"
$1
"
==
"cpp"
]
;
then
file
=
"*.cpp"
ftype
=
"c"
elif
[
"
$1
"
==
"c"
]
;
then
file
=
"*.c"
ftype
=
"c"
elif
[
"
$1
"
==
"h"
]
;
then
file
=
"*.h"
ftype
=
"c"
elif
[
"
$1
"
==
"hpp"
]
;
then
file
=
"*.hpp"
ftype
=
"c"
elif
[
"
$1
"
==
"java"
]
;
then
file
=
"*.java"
ftype
=
"c"
elif
[
"
$1
"
==
"sh"
]
;
then
file
=
"*.sh"
ftype
=
"sh"
elif
[
"
$1
"
==
"pwr_com"
]
;
then
file
=
"*.pwr_com"
ftype
=
"sh"
elif
[
"
$1
"
==
"wb_load"
]
;
then
file
=
"*.wb_load"
ftype
=
"wbl"
elif
[
"
$1
"
==
"msg"
]
;
then
file
=
"*.msg"
ftype
=
"wbl"
elif
[
"
$1
"
==
"uil"
]
;
then
file
=
"*.uil"
ftype
=
"wbl"
elif
[
"
$1
"
==
"xxx"
]
;
then
file
=
"*.xxx"
ftype
=
"c"
else
echo
""
echo
"Replace a string in all files of a certain type"
echo
"Note! Edit the awk-files first."
echo
""
echo
"Usage: replace_all.sh 'filetype'"
echo
""
echo
"filetype c, cpp, h, hpp, java, sh, pwr_com, wb_load, msg, uil"
echo
" or xxx (for test)"
echo
""
exit
fi
find
$pwre_croot
-name
"
$file
"
-exec
./replace_all_exec.sh
{}
$ftype
\;
src/tools/com/src/replace_all_exec.sh
0 → 100755
View file @
e0984ff7
if
[
"
$2
"
==
"c"
]
;
then
echo
"executing
$1
"
awk
-f
license.awk
$1
>
t.tmp
mv
t.tmp
$1
elif
[
"
$2
"
==
"sh"
]
;
then
echo
"executing
$1
"
awk
-f
license_sh.awk
$1
>
t.tmp
mv
t.tmp
$1
elif
[
"
$2
"
==
"wbl"
]
;
then
echo
"executing
$1
"
awk
-f
license_wbl.awk
$1
>
t.tmp
mv
t.tmp
$1
else
echo
"Unknown filtype"
fi
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment