/[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 132 - (show annotations) (download) (as text)
Fri Sep 10 12:30:03 2010 UTC (9 years, 5 months ago) by william
File MIME type: application/x-sh
File size: 4898 byte(s)
add logic to better detect when/if to update the trunk
add auto_build logs
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
54
55 if [ "$OVERRIDE_UPDATE_NEEDED_CHECK" != "1" ] ; then
56 if [ "$current_downstream_revision" == "$PCSX2_REVISION" ] ; then
57 if [ $current_local_revision -lt $PCSX2_REVISION_LOCAL ] ; then
58 echo "UPSTREAM REVISION: $PCSX2_REVISION"
59 echo "DOWNSTREAM REVISION: $current_downstream_revision"
60 echo "LOCAL REVISION: $current_local_revision"
61 echo "LOCAL COMMITTED REVISION: $PCSX2_REVISION_LOCAL"
62 else
63 echo "UPSTREAM REVISION: $PCSX2_REVISION"
64 echo "DOWNSTREAM REVISION: $current_downstream_revision"
65 echo "LOCAL REVISION: $current_local_revision"
66 echo "LOCAL COMMITTED REVISION: $PCSX2_REVISION_LOCAL"
67 echo
68 echo -e "\\tThere is no need to update the local repository. reason: upstream repository has not been updated and local has not been modified."
69 echo
70 echo -e "\\tAborting update of $downstream_export_location/trunk"
71 echo
72 exit 0
73 fi
74 else
75 echo "UPSTREAM REVISION: $PCSX2_REVISION"
76 echo "DOWNSTREAM REVISION: $current_downstream_revision"
77 echo "LOCAL REVISION: $current_local_revision"
78 echo "LOCAL COMMITTED REVISION: $PCSX2_REVISION_LOCAL"
79 fi
80 else
81 echo "UPSTREAM REVISION: $PCSX2_REVISION"
82 echo "DOWNSTREAM REVISION: $current_downstream_revision"
83 echo "LOCAL REVISION: $current_local_revision"
84 echo "LOCAL COMMITTED REVISION: $PCSX2_REVISION_LOCAL"
85 echo
86 echo -e "\\tDetected the use of: --force-update ... forcing update ..."
87 fi
88
89
90
91
92 echo
93 echo -n "CLEANING DOWNSTREAM EXPORT LOCATION: $downstream_export_location/trunk ... "
94 cd "$downstream_export_location/trunk"
95 #rm -Rfv * >/dev/null 2>/dev/null && echo "Done." || echo "Failed."
96 find -not -path "*.svn*" -exec rm -f {} 2>/dev/null \;
97 echo "Done."
98
99
100
101 echo
102 echo "CREATING DOWNSTREAM TRUNK FOR VERSION: $PCSX2_VERSION"
103
104 echo
105 echo -n "EXPORTING: $upstream_trunk/trunk to $downstream_export_location/trunk ... "
106 svn export --force "$upstream_trunk/trunk/" "$downstream_export_location/trunk/" 2>/dev/null
107
108 #copy current_revision_tag
109 cp -f "$upstream_trunk/trunk/upstream_repository_revision.txt" "$downstream_export_location/trunk/upstream_repository_revision.txt" > /dev/null 2>/dev/null
110 cp -f "$upstream_trunk/trunk/upstream_repository_url.txt" "$downstream_export_location/trunk/upstream_repository_url.txt" > /dev/null 2>/dev/null
111 cp -f "$upstream_trunk/trunk/bin/pcsx2-version.txt" "$downstream_export_location/trunk/bin/pcsx2-version.txt"
112 cp -f "$upstream_trunk/trunk/local_repository_revision.txt" "$downstream_export_location/trunk/local_repository_revision.txt"
113
114 cd "$downstream_export_location"
115 "$downstream_export_location/auto_import_3rdparty_deps.sh"
116 "$downstream_export_location/auto_import_patches.sh"
117 "$downstream_export_location/auto_commit_trunk.sh"

  ViewVC Help
Powered by ViewVC 1.1.22