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

  ViewVC Help
Powered by ViewVC 1.1.22