Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
G
gfwlist
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
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
MyCard
gfwlist
Commits
7552cb98
Commit
7552cb98
authored
Mar 15, 2009
by
lovelywcm
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
c2NyaXB0Cg==
parent
b674b5e2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
24 deletions
+27
-24
sendGFWList.sh
sendGFWList.sh
+27
-24
No files found.
sendGFWList.sh
View file @
7552cb98
...
...
@@ -9,7 +9,7 @@
# Update "Last Modified" time;
# Update "Checksum";
# Commit your changes to local git repository;
# Commit your encoded changes to remote svn
repository
with encoded log.
# Commit your encoded changes to remote svn
server
with encoded log.
# Usage:
# Initialize:
# $svn checkout https://autoproxy-gfwlist.googlecode.com/svn/trunk/ gfwList --username your-google-user-name
...
...
@@ -37,23 +37,8 @@ do
fi
done
svn update
&&
if
[
"
$(
git diff
)
"
==
""
]
;
then
echo
"not modified."
;
exit
0
;
fi
# get self last changed revision number
oriLang
=
$LANG
;
export
LANG
=
"en_US"
;
curRevNum
=
$(
svn info | gawk
'/^Last Changed Rev:/ { print $4 }'
)
;
export
LANG
=
$oriLang
;
# save local modification
git diff
>
temp.patch
&&
# get formated author and log information
log
=
$(
svn log
-r
$curRevNum
:HEAD
)
&&
log
=
$(
svn log
-r
BASE
:HEAD
)
&&
log
=
$(
echo
$log
| gawk
-v
RS
=
'------------------------------------------------------------------------'
\
'NR > 2 { if (NF > 10) printf "%s:%s;", $3, $NF; }'
)
&&
...
...
@@ -80,26 +65,44 @@ done
# replace last ";" symbol to "."
convertedLog
=
$(
echo
$convertedLog
|
sed
's/;$/\./'
)
&&
# modified by others, commit to local git repository.
if
[
"
$convertedLog
"
!=
""
]
;
then
# modified by others, commit to local repository.
svn update
&&
# save local modification
git diff
>
temp.patch
&&
# log format: author1:"message1"; author2:"message2"...
base64
-d
gfwlist.txt
>
list.txt
&&
git commit
-a
-m
"
$convertedLog
"
&&
# apply local modification
git apply temp.patch
;
if
[
-s
temp.patch
]
;
then
git apply temp.patch
;
fi
&&
rm
temp.patch
;
fi
if
[
"
$(
git diff
)
"
==
""
]
;
then
echo
"list.txt not modified."
;
exit
0
;
fi
if
[
"
$*
"
==
""
]
;
then
echo
"Empty log, please say something about this modification."
;
exit
1
;
fi
# update date and checksum
sed
-i
s/
"Last Modified:.*$"
/
"Last Modified:
$(
date
-R
-r
list.txt
)
"
/ list.txt
&&
./addChecksum.pl list.txt
&&
# save self change to git
# save self change to git
. exit directly if conflicting.
git commit
-a
-m
"
$*
"
&&
# commit to remote svn server
base64
list.txt
>
gfwlist.txt
&&
svn ci gfwlist.txt
-m
$(
echo
"
$*
"
|
base64
-w
0
)
&&
rm
temp.patch
;
(
# "svn ci" and "git commit" are atomic operations
svn ci gfwlist.txt
-m
$(
echo
"
$*
"
|
base64
-w
0
)
||
# "svn ci" may be failed because of connection problems.
git reset HEAD^
;
)
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