/[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 93 - (hide annotations) (download) (as text)
Thu Sep 9 16:36:45 2010 UTC (9 years, 5 months ago) by william
File MIME type: application/x-sh
File size: 4164 byte(s)
rename scripts:
update_from_upstream.sh -> auto_update_from_upstream.sh
import_3rdparty_deps.sh -> auto_import_3rdparty_deps.sh
import_patches.sh -> auto_import_patches.sh
1 william 93 #!/bin/bash
2    
3     export SVNTMP="svntmp"
4     export SVNROOT_URL="https://svn.netsolutions.dnsalias.com/websvn/ps2/pcsx2/pcsx2_0.9.7/"
5     export downstream_export_location="`pwd`"
6     export upstream_trunk="$downstream_export_location/upstream"
7     export upstream_repsoitory_url=""
8    
9     export upstream_current_version_branch="0.9.7"
10     export downstream_build_configuration="debug"
11    
12     export upstream_revision="HEAD"
13     #export upstream_revision="3113"
14    
15     export PCSX2_VERSION="pcsx2-$upstream_current_version_branch-r$upstream_revision-$downstream_build_configuration";
16    
17     export OVERRIDE_UPDATE_NEEDED_CHECK="0"
18    
19    
20     if [ "$1" == "--force-update" ] ; then
21     OVERRIDE_UPDATE_NEEDED_CHECK="1"
22     fi
23    
24     echo
25     echo "UPSTREAM TRUNK: $upstream_trunk"
26     echo "DOWNSTREAM EXPORT LOCATION: $downstream_export_location"
27    
28     cd "$upstream_trunk/trunk"
29    
30    
31     if [ "$upstream_revision" == "HEAD" ] ; then
32     svn update > /dev/null
33     echo
34     echo -n "Updated Upstream PCSX2 Repository to Revision: "
35     svn log -r head:prev --xml | grep "revision=" | sed s/".*revision=\""// | sed s/"\".*"// > "$upstream_trunk/trunk/upstream_repository_revision.txt"
36     export upstream_revision=`cat "$upstream_trunk/trunk/upstream_repository_revision.txt"`
37     echo $upstream_revision
38     upstream_repository_url=`svn info --xml | grep "<url>" | sed s/"^<url>"// | sed s/"<\/url>$"//`
39     echo "$upstream_repository_url" > "$upstream_trunk/trunk/upstream_repository_url.txt"
40     else
41     svn update -r "$upstream_revision" > /dev/null
42     echo
43     echo -n "Updated Upstream PCSX2 Repository to Revision: "
44     svn log -r "$upstream_revision" --xml | grep "revision=" | sed s/".*revision=\""// | sed s/"\".*"// > "$upstream_trunk/trunk/upstream_repository_revision.txt"
45     export upstream_revision=`cat "$upstream_trunk/trunk/upstream_repository_revision.txt"`
46     echo $upstream_revision
47     upstream_repository_url=`svn info --xml | grep "<url>" | sed s/"^<url>"// | sed s/"<\/url>$"//`
48     echo "$upstream_repository_url" > "$upstream_trunk/trunk/upstream_repository_url.txt"
49     fi
50    
51    
52     #UPDATE PCSX2 VERSION
53     PCSX2_VERSION="pcsx2-$upstream_current_version_branch-r$upstream_revision-$downstream_build_configuration"
54    
55     export current_downstream_revision=`cat "$downstream_export_location/trunk/upstream_repository_revision.txt"`
56    
57     if [ "$OVERRIDE_UPDATE_NEEDED_CHECK" != "1" ] ; then
58     if [ "$current_downstream_revision" == "$upstream_revision" ] ; then
59     echo "UPSTREAM REVISION: $upstream_revision"
60     echo "DOWNSTREAM REVISION: $current_downstream_revision"
61     echo
62     echo -e "\\tThere is no need to update the local repository. reason: upstream repository has not been updated."
63     echo
64     echo -e "\\tAborting update of $downstream_export_location/trunk"
65     echo
66     exit 0
67     fi
68     else
69     if [ "$current_downstream_revision" == "$upstream_revision" ] ; then
70     echo "UPSTREAM REVISION: $upstream_revision"
71     echo "DOWNSTREAM REVISION: $current_downstream_revision"
72     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     fi
77    
78     fi
79    
80    
81    
82    
83     echo
84     echo -n "CLEANING DOWNSTREAM EXPORT LOCATION: $downstream_export_location/trunk ... "
85     cd "$downstream_export_location/trunk"
86     #rm -Rfv * >/dev/null 2>/dev/null && echo "Done." || echo "Failed."
87     find -not -path "*.svn*" -exec rm -f {} 2>/dev/null \;
88     echo "Done."
89    
90    
91     #copy current_revision_tag
92     cp -f "$upstream_trunk/trunk/upstream_repository_revision.txt" "$downstream_export_location/trunk/upstream_repository_revision.txt" > /dev/null 2>/dev/null
93     cp -f "$upstream_trunk/trunk/upstream_repository_url.txt" "$downstream_export_location/trunk/upstream_repository_url.txt" > /dev/null 2>/dev/null
94    
95    
96     mkdir -p "$downstream_export_location/trunk/bin"
97     echo "$PCSX2_VERSION" > "$downstream_export_location/trunk/bin/pcsx2-version.txt"
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     svn export --force "$upstream_trunk" "$downstream_export_location" 2>/dev/null
106    
107    
108     "$downstream_export_location/import_3rdparty_deps.sh"
109     #"$downstream_export_location/import_patches.sh"
110     "$downstream_export_location/auto_commit_trunk.sh"

  ViewVC Help
Powered by ViewVC 1.1.22