/[pcsx2_0.9.7]/auto_update_from_upstream.sh
ViewVC logotype

Contents of /auto_update_from_upstream.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 155 - (show annotations) (download) (as text)
Mon Sep 13 09:29:45 2010 UTC (9 years, 5 months ago) by william
File MIME type: application/x-sh
File size: 5147 byte(s)
setup post patching scripts (things that need to run before commit)
1 #!/bin/bash
2
3
4 . ./auto_defs.sh
5
6 export OVERRIDE_UPDATE_NEEDED_CHECK="0"
7
8
9 if [ "$1" == "--force-update" ] ; then
10 OVERRIDE_UPDATE_NEEDED_CHECK="1"
11 fi
12
13 echo
14 echo "UPSTREAM TRUNK: $upstream_trunk"
15 echo "DOWNSTREAM EXPORT LOCATION: $downstream_export_location"
16
17
18
19 #if [ "$upstream_revision" == "HEAD" ] ; then
20 cd "$upstream_trunk/trunk"
21 svn update > /dev/null
22 cd "$downstream_export_location"
23 . ./auto_version_defs.sh
24 echo "$PCSX2_REVISION_LOCAL" > "$upstream_trunk/trunk/local_repository_revision.txt"
25 cd "$upstream_trunk/trunk"
26 echo
27 echo -n "Updated Upstream PCSX2 Repository to Revision: "
28 #svn log -r head:prev --xml | grep "revision=" | sed s/".*revision=\""// | sed s/"\".*"// > "$upstream_trunk/trunk/upstream_repository_revision.txt"
29 echo "$PCSX2_REVISION" > "$upstream_trunk/trunk/upstream_repository_revision.txt"
30 export upstream_revision=`cat "$upstream_trunk/trunk/upstream_repository_revision.txt"`
31 echo $upstream_revision
32 upstream_repository_url=`svn info --xml | grep "<url>" | sed s/"^<url>"// | sed s/"<\/url>$"//`
33 echo "$upstream_repository_url" > "$upstream_trunk/trunk/upstream_repository_url.txt"
34 mkdir -p "$upstream_trunk/trunk/bin"
35 echo "$PCSX2_VERSION" > "$upstream_trunk/trunk/bin/pcsx2-version.txt"
36 #echo "$PCSX2_REVISION_LOCAL" > "$upstream_trunk/trunk/local_repository_revision.txt"
37 #else
38 # svn update -r "$upstream_revision" > /dev/null
39 # echo
40 # echo -n "Updated Upstream PCSX2 Repository to Revision: "
41 # #svn log -r head:prev --xml | grep "revision=" | sed s/".*revision=\""// | sed s/"\".*"// > "$upstream_trunk/trunk/upstream_repository_revision.txt"
42 # echo "$PCSX2_REVISION" > "$upstream_trunk/trunk/upstream_repository_revision.txt"
43 # export upstream_revision=`cat "$upstream_trunk/trunk/upstream_repository_revision.txt"`
44 # echo $upstream_revision
45 # upstream_repository_url=`svn info --xml | grep "<url>" | sed s/"^<url>"// | sed s/"<\/url>$"//`
46 # echo "$upstream_repository_url" > "$upstream_trunk/trunk/upstream_repository_url.txt"
47 # mkdir -p "$upstream_trunk/trunk/bin"
48 # echo "$PCSX2_VERSION" > "$upstream_trunk/trunk/bin/pcsx2-version.txt"
49 # #echo "$PCSX2_REVISION_LOCAL" > "$upstream_trunk/trunk/local_repository_revision.txt"
50 #fi
51
52
53
54 export current_downstream_revision=`cat "$downstream_export_location/trunk/upstream_repository_revision.txt"`
55 export current_local_revision=`cat "$downstream_export_location/trunk/local_repository_revision.txt"`
56
57
58
59 if [ "$OVERRIDE_UPDATE_NEEDED_CHECK" != "1" ] ; then
60 if [ "$current_downstream_revision" == "$PCSX2_REVISION" ] ; then
61 if [ $current_local_revision -lt $PCSX2_REVISION_LOCAL ] ; then
62 echo "UPSTREAM REVISION: $PCSX2_REVISION"
63 echo "DOWNSTREAM REVISION: $current_downstream_revision"
64 echo "LOCAL REVISION: $current_local_revision"
65 echo "LOCAL COMMITTED REVISION: $PCSX2_REVISION_LOCAL"
66 else
67 echo "UPSTREAM REVISION: $PCSX2_REVISION"
68 echo "DOWNSTREAM REVISION: $current_downstream_revision"
69 echo "LOCAL REVISION: $current_local_revision"
70 echo "LOCAL COMMITTED REVISION: $PCSX2_REVISION_LOCAL"
71 echo
72 echo -e "\\tThere is no need to update the local repository. reason: upstream repository has not been updated and local has not been modified."
73 echo
74 echo -e "\\tAborting update of $downstream_export_location/trunk"
75 echo
76 exit 1
77 fi
78 else
79 echo "UPSTREAM REVISION: $PCSX2_REVISION"
80 echo "DOWNSTREAM REVISION: $current_downstream_revision"
81 echo "LOCAL REVISION: $current_local_revision"
82 echo "LOCAL COMMITTED REVISION: $PCSX2_REVISION_LOCAL"
83 fi
84 else
85 echo "UPSTREAM REVISION: $PCSX2_REVISION"
86 echo "DOWNSTREAM REVISION: $current_downstream_revision"
87 echo "LOCAL REVISION: $current_local_revision"
88 echo "LOCAL COMMITTED REVISION: $PCSX2_REVISION_LOCAL"
89 echo
90 echo -e "\\tDetected the use of: --force-update ... forcing update ..."
91 fi
92
93
94
95
96 echo
97 echo -n "CLEANING DOWNSTREAM EXPORT LOCATION: $downstream_export_location/trunk ... "
98 cd "$downstream_export_location/trunk"
99 #rm -Rfv * >/dev/null 2>/dev/null && echo "Done." || echo "Failed."
100 find -not -path "*.svn*" -exec rm -f {} 2>/dev/null \;
101 echo "Done."
102
103
104
105 echo
106 echo "CREATING DOWNSTREAM TRUNK FOR VERSION: $PCSX2_VERSION"
107
108 echo
109 echo -n "EXPORTING: $upstream_trunk/trunk to $downstream_export_location/trunk ... "
110 svn export --force "$upstream_trunk/trunk/" "$downstream_export_location/trunk/" 2>/dev/null
111
112 #copy current_revision_tag
113 cp -f "$upstream_trunk/trunk/upstream_repository_revision.txt" "$downstream_export_location/trunk/upstream_repository_revision.txt" > /dev/null 2>/dev/null
114 cp -f "$upstream_trunk/trunk/upstream_repository_url.txt" "$downstream_export_location/trunk/upstream_repository_url.txt" > /dev/null 2>/dev/null
115 cp -f "$upstream_trunk/trunk/bin/pcsx2-version.txt" "$downstream_export_location/trunk/bin/pcsx2-version.txt"
116 cp -f "$upstream_trunk/trunk/local_repository_revision.txt" "$downstream_export_location/trunk/local_repository_revision.txt"
117
118 cd "$downstream_export_location"
119 "$downstream_export_location/auto_import_3rdparty_deps.sh"
120 "$downstream_export_location/auto_import_patches.sh"
121 "$downstream_export_location/auto_import_post_patches.sh"
122 "$downstream_export_location/auto_commit_trunk.sh"

  ViewVC Help
Powered by ViewVC 1.1.22