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

Contents of /auto_branch_latest_upstream.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 412 - (show annotations) (download) (as text)
Fri Feb 25 20:08:58 2011 UTC (9 years, 8 months ago) by william
File MIME type: application/x-sh
File size: 4987 byte(s)
update build scripts to correct some long standing issues
1 #!/bin/bash
2 . ./auto_defs.sh
3
4 export BRANCH_CREATE_SUCCESS="0"
5
6 export OVERRIDE_UPDATE_NEEDED_CHECK="0"
7 if [ "$1" == "--force-update" ] ; then
8 OVERRIDE_UPDATE_NEEDED_CHECK="1"
9 fi
10
11 export current_downstream_revision=`cat "$BRANCH_LOCATION/$BRANCH_NAME/upstream_repository_revision.txt"`
12 export current_local_revision=`cat "$BRANCH_LOCATION/$BRANCH_NAME/local_repository_revision.txt"`
13
14 if [ "$OVERRIDE_UPDATE_NEEDED_CHECK" != "1" ] ; then
15 if [ "$current_downstream_revision" == "$PCSX2_REVISION" ] ; then
16 if [ $current_local_revision -lt $PCSX2_REVISION_LOCAL ] ; then
17 echo "UPSTREAM REVISION: $PCSX2_REVISION"
18 echo "DOWNSTREAM REVISION: $current_downstream_revision"
19 echo "LOCAL REVISION: $current_local_revision"
20 echo "LOCAL COMMITTED REVISION: $PCSX2_REVISION_LOCAL"
21 else
22 echo "UPSTREAM REVISION: $PCSX2_REVISION"
23 echo "DOWNSTREAM REVISION: $current_downstream_revision"
24 echo "LOCAL REVISION: $current_local_revision"
25 echo "LOCAL COMMITTED REVISION: $PCSX2_REVISION_LOCAL"
26 echo
27 echo -e "\\tThere is no need to update the local repository. reason: upstream repository has not been updated and local has not been modified."
28 echo
29 echo -e "\\tAborting update of $downstream_export_location/trunk"
30 echo
31 exit 0
32 fi
33 else
34 echo "UPSTREAM REVISION: $PCSX2_REVISION"
35 echo "DOWNSTREAM REVISION: $current_downstream_revision"
36 echo "LOCAL REVISION: $current_local_revision"
37 echo "LOCAL COMMITTED REVISION: $PCSX2_REVISION_LOCAL"
38 fi
39 else
40 echo "UPSTREAM REVISION: $PCSX2_REVISION"
41 echo "DOWNSTREAM REVISION: $current_downstream_revision"
42 echo "LOCAL REVISION: $current_local_revision"
43 echo "LOCAL COMMITTED REVISION: $PCSX2_REVISION_LOCAL"
44 echo
45 echo -e "\\tDetected the use of: --force-update ... forcing update ..."
46 fi
47
48 export BRANCH_COMMIT_MESSAGE="Creating $BRANCH_NAME branch for r$PCSX2_REVISION"
49
50 echo $BRANCH_COMMIT_MESSAGE
51
52 rm -Rf "$BRANCH_LOCATION/$BRANCH_NAME"
53 #remove the latest branch from the base repository
54 #echo "calling: svn delete $BRANCH_LOCATION/$BRANCH_NAME"
55 svn delete "$BRANCH_LOCATION/$BRANCH_NAME" --non-interactive --trust-server-cert && BRANCH_CREATE_SUCCESS="1" || BRANCH_CREATE_SUCCESS="0"
56 #svn delete "$BRANCH_LOCATION/$BRANCH_NAME" --non-interactive --trust-server-cert >/dev/null 2>/dev/null && BRANCH_CREATE_SUCCESS="1" || BRANCH_CREATE_SUCCESS="0"
57
58 #update the working copy
59 #echo "calling: svn commit $BRANCH_LOCATION"
60 #svn commit "$BRANCH_LOCATION" --non-interactive --trust-server-cert --depth immediates -m "remove latest branch for re-branching" && BRANCH_CREATE_SUCCESS="1" || BRANCH_CREATE_SUCCESS="0"
61 svn commit "$BRANCH_LOCATION" --non-interactive --trust-server-cert --depth immediates -m "remove latest branch for re-branching" >/dev/null 2>/dev/null && BRANCH_CREATE_SUCCESS="1" || BRANCH_CREATE_SUCCESS="0"
62 echo
63 echo -n "EXPORTING: $downstream_export_location/trunk to $BRANCH_LOCATION/$BRANCH_NAME ... "
64 svn export --force $downstream_export_location/trunk "$BRANCH_LOCATION/$BRANCH_NAME" && BRANCH_CREATE_SUCCESS="1" || BRANCH_CREATE_SUCCESS="0"
65 #svn export --force $downstream_export_location/trunk "$BRANCH_LOCATION/$BRANCH_NAME" 2>/dev/null && BRANCH_CREATE_SUCCESS="1" || BRANCH_CREATE_SUCCESS="0"
66
67
68 echo -n "Branch Bin Dir Exists: "
69 if [ -d "$BRANCH_LOCATION/$BRANCH_NAME/bin" ] ; then
70 echo "Yes\!"
71 else
72 echo "No\!"
73 exit 1
74 fi
75 # add new branch to svn
76 echo
77 echo -n "Adding latest branch to svn ... "
78 svn add "$BRANCH_LOCATION/$BRANCH_NAME" && BRANCH_CREATE_SUCCESS="1" || BRANCH_CREATE_SUCCESS="0"
79 #svn add "$BRANCH_LOCATION/$BRANCH_NAME" >/dev/null 2>/dev/null && BRANCH_CREATE_SUCCESS="1" || BRANCH_CREATE_SUCCESS="0"
80 echo "Done."
81
82 cd "$BRANCH_LOCATION/$BRANCH_NAME"
83 echo
84
85 #echo "$BRANCH_LOCATION/$BRANCH_NAME"
86
87 echo -n "Committing latest branch to svn ... "
88 # commit the newly created branch
89 svn commit -m "$BRANCH_COMMIT_MESSAGE" "$BRANCH_LOCATION/$BRANCH_NAME" --non-interactive --trust-server-cert && BRANCH_CREATE_SUCCESS="1" || BRANCH_CREATE_SUCCESS="0"
90 #svn commit -m "$BRANCH_COMMIT_MESSAGE" "$BRANCH_LOCATION/$BRANCH_NAME" --non-interactive --trust-server-cert >/dev/null 2>/dev/null && BRANCH_CREATE_SUCCESS="1" || BRANCH_CREATE_SUCCESS="0"
91 echo "Done."
92
93
94 # call auto_build_latest_upstream.sh
95 #"$downstream_export_location/auto_import_patches.sh"
96 #"$downstream_export_location/auto_build.sh"
97 if [ "$BRANCH_CREATE_SUCCESS" == "1" ] ; then
98 cd "$downstream_export_location/"
99 "$downstream_export_location/auto_tag_latest_upstream.sh"
100 else
101 echo "AUTO BRANCH FAILED ... AUTO TAGGING NOT PERFORMED."
102 exit 1
103 fi

  ViewVC Help
Powered by ViewVC 1.1.22