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

  ViewVC Help
Powered by ViewVC 1.1.22