/[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 129 - (hide 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 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     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 william 115 mkdir -p "$upstream_trunk/trunk/bin"
30     echo "$PCSX2_VERSION" > "$upstream_trunk/trunk/bin/pcsx2-version.txt"
31 william 129 #echo "$PCSX2_REVISION_LOCAL" > "$upstream_trunk/trunk/local_repository_revision.txt"
32 william 93 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 william 115 mkdir -p "$upstream_trunk/trunk/bin"
42     echo "$PCSX2_VERSION" > "$upstream_trunk/trunk/bin/pcsx2-version.txt"
43 william 129 #echo "$PCSX2_REVISION_LOCAL" > "$upstream_trunk/trunk/local_repository_revision.txt"
44 william 93 fi
45    
46    
47    
48     export current_downstream_revision=`cat "$downstream_export_location/trunk/upstream_repository_revision.txt"`
49 william 129 export current_local_revision=`cat "$downstream_export_location/trunk/local_repository_revision.txt"`
50 william 93
51     if [ "$OVERRIDE_UPDATE_NEEDED_CHECK" != "1" ] ; then
52 william 129 if [ "$current_downstream_revision" == "$PCSX2_REVISION" -a "$current_local_revision" == "$PCSX2_REVISION_LOCAL" ] ; then
53 william 93 echo "UPSTREAM REVISION: $upstream_revision"
54     echo "DOWNSTREAM REVISION: $current_downstream_revision"
55 william 129 echo "LOCAL REVISION: $current_local_revision"
56 william 93 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 william 129 else
63     echo "UPSTREAM REVISION: $upstream_revision"
64     echo "DOWNSTREAM REVISION: $current_downstream_revision"
65     echo "LOCAL REVISION: $current_local_revision"
66     fi
67 william 93 else
68 william 129 if [ "$current_downstream_revision" == "$PCSX2_REVISION" -a "$current_local_revision" == "$PCSX2_REVISION_LOCAL" ] ; then
69 william 93 echo "UPSTREAM REVISION: $upstream_revision"
70     echo "DOWNSTREAM REVISION: $current_downstream_revision"
71 william 129 echo "LOCAL REVISION: $current_local_revision"
72 william 93 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 william 129 else
77     echo "UPSTREAM REVISION: $upstream_revision"
78     echo "DOWNSTREAM REVISION: $current_downstream_revision"
79     echo "LOCAL REVISION: $current_local_revision"
80 william 93 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 william 115 svn export --force "$upstream_trunk/trunk/" "$downstream_export_location/trunk/" 2>/dev/null
102 william 93
103 william 115 #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 william 129 cp -f "$upstream_trunk/trunk/local_repository_revision.txt" "$downstream_export_location/trunk/local_repository_revision.txt"
108 william 115
109 william 108 cd "$downstream_export_location"
110 william 94 "$downstream_export_location/auto_import_3rdparty_deps.sh"
111 william 104 "$downstream_export_location/auto_import_patches.sh"
112 william 93 "$downstream_export_location/auto_commit_trunk.sh"

  ViewVC Help
Powered by ViewVC 1.1.22