Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(539)

Side by Side Diff: tools/update-doxygen.sh

Issue 14772003: Housekeeper should not fail when skia-autogen is reset (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/bin/bash 1 #!/bin/bash
2 # 2 #
3 # Runs doxygen and stores its results in the skia-autogen repo, so that they 3 # Runs doxygen and stores its results in the skia-autogen repo, so that they
4 # can be browsed at http://skia-autogen.googlecode.com/svn/docs/html/index.html 4 # can be browsed at http://skia-autogen.googlecode.com/svn/docs/html/index.html
5 # 5 #
6 # The DOXYGEN_TEMPDIR env variable is the working directory within which we will 6 # The DOXYGEN_TEMPDIR env variable is the working directory within which we will
7 # check out the code, generate documentation, and store the doxygen log 7 # check out the code, generate documentation, and store the doxygen log
8 # (by default, /tmp/skia-doxygen). The DOXYGEN_COMMIT env variable determines 8 # (by default, /tmp/skia-doxygen). The DOXYGEN_COMMIT env variable determines
9 # whether docs should be commited (true by default). 9 # whether docs should be commited (true by default).
10 # 10 #
11 # Sample Usage: 11 # Sample Usage:
12 # export DOXYGEN_TEMPDIR=/tmp/doxygen 12 # export DOXYGEN_TEMPDIR=/tmp/doxygen
13 # export DOXYGEN_COMMIT=false 13 # export DOXYGEN_COMMIT=false
14 # bash update-doxygen.sh 14 # bash update-doxygen.sh
15 15
16 function check_out_docs {
17 svn checkout https://skia-autogen.googlecode.com/svn/docs # writeable
18 ret_code=$?
19 if [ $ret_code != 0 ]; then
20 # docs directory does not exist, skia-autogen must have been reset.
21 # Create a non svn docs directory instead.
22 mkdir docs
borenet 2013/05/01 12:10:39 Should you "svn add" docs here? I would think tha
rmistry 2013/05/01 12:15:22 Yes svn status will fail since its not yet a worki
23 fi
24 }
25
16 # Prepare a temporary dir and check out Skia trunk and docs. 26 # Prepare a temporary dir and check out Skia trunk and docs.
17 cd 27 cd
18 DOXYGEN_TEMPDIR=${DOXYGEN_TEMPDIR:-/tmp/skia-doxygen} 28 DOXYGEN_TEMPDIR=${DOXYGEN_TEMPDIR:-/tmp/skia-doxygen}
19 DOXYGEN_COMMIT=${DOXYGEN_COMMIT:-true} 29 DOXYGEN_COMMIT=${DOXYGEN_COMMIT:-true}
20 30
21 mkdir -p $DOXYGEN_TEMPDIR 31 mkdir -p $DOXYGEN_TEMPDIR
22 cd $DOXYGEN_TEMPDIR 32 cd $DOXYGEN_TEMPDIR
23 33
24 if [ -d "trunk" ]; then 34 if [ -d "trunk" ]; then
25 svn update --accept theirs-full trunk 35 svn update --accept theirs-full trunk
26 else 36 else
27 svn checkout http://skia.googlecode.com/svn/trunk # read-only 37 svn checkout http://skia.googlecode.com/svn/trunk # read-only
28 fi 38 fi
29 if [ -d "docs" ]; then 39 if [ -d "docs" ]; then
30 svn update --accept theirs-full docs 40 svn update --accept theirs-full docs
41 svn info docs
42 ret_code=$?
43 if [ $ret_code != 0 ]; then
44 # This is not a valid SVN checkout.
45 rm -rf docs
46 check_out_docs
47 fi
31 else 48 else
32 svn checkout https://skia-autogen.googlecode.com/svn/docs # writeable 49 check_out_docs
50 fi
51
33 if [ ! -f "docs/static_footer.txt" ]; then 52 if [ ! -f "docs/static_footer.txt" ]; then
34 cp trunk/tools/doxygen_footer.txt docs/static_footer.txt 53 cp trunk/tools/doxygen_footer.txt docs/static_footer.txt
35 fi 54 fi
36 fi
37 55
38 # Run Doxygen. 56 # Run Doxygen.
39 cd trunk 57 cd trunk
40 doxygen Doxyfile 58 doxygen Doxyfile
41 ret_code=$? 59 ret_code=$?
42 if [ $ret_code != 0 ]; then 60 if [ $ret_code != 0 ]; then
43 echo "Error while executing Doxygen command" 61 echo "Error while executing Doxygen command"
44 exit $ret_code 62 exit $ret_code
45 fi 63 fi
46 64
47 cd ../docs 65 cd ../docs
48 66
49 # Add any newly created files to Subversion. 67 # Add any newly created files to Subversion.
50 NEWFILES=$(svn status | grep ^\? | awk '{print $2}') 68 NEWFILES=$(svn status | grep ^\? | awk '{print $2}')
borenet 2013/05/01 13:45:34 Here's what worries me. If we had to run "mkdir d
rmistry 2013/05/01 13:49:39 This command just returns with 'not a working copy
51 if [ -n "$NEWFILES" ]; then 69 if [ -n "$NEWFILES" ]; then
52 svn add $NEWFILES 70 svn add $NEWFILES
borenet 2013/05/01 13:45:34 Which will cause this command to fail. Now, *none*
rmistry 2013/05/01 13:49:39 This also outputs 'not a working copy'.
53 fi 71 fi
54 72
55 # We haven't updated the timestamp footer yet... if there are no changes 73 # We haven't updated the timestamp footer yet... if there are no changes
56 # yet, just exit. (We'll wait until there are any actual doc changes before 74 # yet, just exit. (We'll wait until there are any actual doc changes before
57 # updating the timestamp and committing changes to the repository.) 75 # updating the timestamp and committing changes to the repository.)
58 MODFILES=$(svn status | grep ^[AM]) 76 MODFILES=$(svn status | grep ^[AM])
59 if [ -z "$MODFILES" ]; then 77 if [ -z "$MODFILES" ]; then
60 echo "No documentation updates, exiting early." 78 echo "No documentation updates, exiting early."
61 exit 0 79 exit 0
62 fi 80 fi
(...skipping 16 matching lines...) Expand all
79 find . -name '*.png' -exec svn propset svn:mime-type image/png '{}' \; 97 find . -name '*.png' -exec svn propset svn:mime-type image/png '{}' \;
80 98
81 # Output files with documentation updates. 99 # Output files with documentation updates.
82 echo -e "\n\nThe following are the documentation updates:" 100 echo -e "\n\nThe following are the documentation updates:"
83 echo $MODFILES 101 echo $MODFILES
84 102
85 if $DOXYGEN_COMMIT ; then 103 if $DOXYGEN_COMMIT ; then
86 # Commit the updated docs to the subversion repo. 104 # Commit the updated docs to the subversion repo.
87 svn commit --message 'commit doxygen-generated documentation' 105 svn commit --message 'commit doxygen-generated documentation'
88 fi 106 fi
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698