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

  ViewVC Help
Powered by ViewVC 1.1.22