/[pcsx2_0.9.7]/auto_update_from_upstream.sh
ViewVC logotype

Annotation of /auto_update_from_upstream.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 132 - (hide 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 william 93 #!/bin/bash
2    
3    
4 william 94 . ./auto_defs.sh
5 william 93
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 william 130 #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 william 93 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 william 115 mkdir -p "$upstream_trunk/trunk/bin"
31     echo "$PCSX2_VERSION" > "$upstream_trunk/trunk/bin/pcsx2-version.txt"
32 william 129 #echo "$PCSX2_REVISION_LOCAL" > "$upstream_trunk/trunk/local_repository_revision.txt"
33 william 93 else
34     svn update -r "$upstream_revision" > /dev/null
35     echo
36     echo -n "Updated Upstream PCSX2 Repository to Revision: "
37 william 130 #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 william 93 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 william 115 mkdir -p "$upstream_trunk/trunk/bin"
44     echo "$PCSX2_VERSION" > "$upstream_trunk/trunk/bin/pcsx2-version.txt"
45 william 129 #echo "$PCSX2_REVISION_LOCAL" > "$upstream_trunk/trunk/local_repository_revision.txt"
46 william 93 fi
47    
48    
49    
50     export current_downstream_revision=`cat "$downstream_export_location/trunk/upstream_repository_revision.txt"`
51 william 129 export current_local_revision=`cat "$downstream_export_location/trunk/local_repository_revision.txt"`
52 william 93
53 william 132
54    
55 william 93 if [ "$OVERRIDE_UPDATE_NEEDED_CHECK" != "1" ] ; then
56 william 132 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 william 129 else
75 william 131 echo "UPSTREAM REVISION: $PCSX2_REVISION"
76 william 129 echo "DOWNSTREAM REVISION: $current_downstream_revision"
77     echo "LOCAL REVISION: $current_local_revision"
78 william 131 echo "LOCAL COMMITTED REVISION: $PCSX2_REVISION_LOCAL"
79     fi
80 william 93 else
81 william 132 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 william 93 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 william 115 svn export --force "$upstream_trunk/trunk/" "$downstream_export_location/trunk/" 2>/dev/null
107 william 93
108 william 115 #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 william 129 cp -f "$upstream_trunk/trunk/local_repository_revision.txt" "$downstream_export_location/trunk/local_repository_revision.txt"
113 william 115
114 william 108 cd "$downstream_export_location"
115 william 94 "$downstream_export_location/auto_import_3rdparty_deps.sh"
116 william 104 "$downstream_export_location/auto_import_patches.sh"
117 william 93 "$downstream_export_location/auto_commit_trunk.sh"

  ViewVC Help
Powered by ViewVC 1.1.22