/[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 115 - (show annotations) (download) (as text)
Thu Sep 9 23:53:30 2010 UTC (9 years, 5 months ago) by william
File MIME type: application/x-sh
File size: 3780 byte(s)
implement use of auto_version_defs.sh
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
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
44 fi
45
46
47
48 export current_downstream_revision=`cat "$downstream_export_location/trunk/upstream_repository_revision.txt"`
49
50 if [ "$OVERRIDE_UPDATE_NEEDED_CHECK" != "1" ] ; then
51 if [ "$current_downstream_revision" == "$upstream_revision" ] ; then
52 echo "UPSTREAM REVISION: $upstream_revision"
53 echo "DOWNSTREAM REVISION: $current_downstream_revision"
54 echo
55 echo -e "\\tThere is no need to update the local repository. reason: upstream repository has not been updated."
56 echo
57 echo -e "\\tAborting update of $downstream_export_location/trunk"
58 echo
59 exit 0
60 fi
61 else
62 if [ "$current_downstream_revision" == "$upstream_revision" ] ; then
63 echo "UPSTREAM REVISION: $upstream_revision"
64 echo "DOWNSTREAM REVISION: $current_downstream_revision"
65 echo
66 echo -e "\\tThere is no need to update the local repository. reason: upstream repository has not been updated."
67 echo
68 echo -e "\\tDetected the use of: --force-update ... forcing update ..."
69 fi
70
71 fi
72
73
74
75
76 echo
77 echo -n "CLEANING DOWNSTREAM EXPORT LOCATION: $downstream_export_location/trunk ... "
78 cd "$downstream_export_location/trunk"
79 #rm -Rfv * >/dev/null 2>/dev/null && echo "Done." || echo "Failed."
80 find -not -path "*.svn*" -exec rm -f {} 2>/dev/null \;
81 echo "Done."
82
83
84
85 echo
86 echo "CREATING DOWNSTREAM TRUNK FOR VERSION: $PCSX2_VERSION"
87
88 echo
89 echo -n "EXPORTING: $upstream_trunk/trunk to $downstream_export_location/trunk ... "
90 svn export --force "$upstream_trunk/trunk/" "$downstream_export_location/trunk/" 2>/dev/null
91
92 #copy current_revision_tag
93 cp -f "$upstream_trunk/trunk/upstream_repository_revision.txt" "$downstream_export_location/trunk/upstream_repository_revision.txt" > /dev/null 2>/dev/null
94 cp -f "$upstream_trunk/trunk/upstream_repository_url.txt" "$downstream_export_location/trunk/upstream_repository_url.txt" > /dev/null 2>/dev/null
95 cp -f "$upstream_trunk/trunk/bin/pcsx2-version.txt" "$downstream_export_location/trunk/bin/pcsx2-version.txt"
96
97 cd "$downstream_export_location"
98 "$downstream_export_location/auto_import_3rdparty_deps.sh"
99 "$downstream_export_location/auto_import_patches.sh"
100 "$downstream_export_location/auto_commit_trunk.sh"

  ViewVC Help
Powered by ViewVC 1.1.22