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

  ViewVC Help
Powered by ViewVC 1.1.22