summaryrefslogtreecommitdiffstats
path: root/update-dbus-docs.sh
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2007-05-21 16:43:57 +0000
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2007-05-21 16:43:57 +0000
commit4895a3bb33a444e6592089108afbf61ccb5da453 (patch)
tree89f3548e621b237398610acac2ed5972127a3f9b /update-dbus-docs.sh
parentc9780cf5ed958cd28a9aa2cd76d2d826e0fe01ff (diff)
* update-dbus-docs.sh: Assorted improvements:
- Default user if $FDUSER is not set is the ssh default (set in ~/.ssh/config or based on the local username), not a hard-coded "johnp" - Temporary checkout directory is created securely (preventing symlink attacks), if mktemp(1) is available - Use make -C rather than cd && make && cd ..
Diffstat (limited to 'update-dbus-docs.sh')
-rwxr-xr-xupdate-dbus-docs.sh21
1 files changed, 10 insertions, 11 deletions
diff --git a/update-dbus-docs.sh b/update-dbus-docs.sh
index 1caa40a5..e7cf861d 100755
--- a/update-dbus-docs.sh
+++ b/update-dbus-docs.sh
@@ -6,14 +6,15 @@ function die()
exit 1
}
-if test -z "$FDUSER" ; then
- FDUSER=johnp
+if test -n "$FDUSER" ; then
+ echo "Using freedesktop.org account $FDUSER"
+ user="$FDUSER@"
+else
+ echo "Using freedesktop.org account from ~/.ssh/config, or local username"
fi
-echo "Using freedesktop.org account $FDUSER"
-
-CHECKOUTDIR=/tmp/dbus-for-docs
-export CVSROOT=:ext:$FDUSER@cvs.freedesktop.org:/cvs/dbus
+CHECKOUTDIR=`mktemp -d || echo /tmp/dbus-for-docs`
+export CVSROOT=":ext:${user}cvs.freedesktop.org:/cvs/dbus"
cd $CHECKOUTDIR || die "could not changedir to $CHECKOUTDIR"
@@ -29,9 +30,7 @@ echo "Configuring and building docs"
## you won't fail to update those docs
./autogen.sh --enable-xml-docs=yes --enable-doxygen-docs=yes || die "could not autogen"
doxygen Doxyfile || die "could not run Doxygen"
-cd doc || die "could not cd to doc dir"
-make || die "could not build docs"
-cd .. || die "could not cd up"
+make -C doc || die "could not build docs"
MANFILES=`find -name "dbus*.1"`
for M in $MANFILES ; do
@@ -50,6 +49,6 @@ find doc -not -type d | grep -v CVS | grep -v -E '.~[0-9.]+~' | grep -v Makefile
diff -u filesystem.list tarball.list || die "some files were not included"
echo "Uploading docs to server"
-scp dbus-docs.tar.gz "$FDUSER"@pdx.freedesktop.org:
-ssh "$FDUSER"@pdx.freedesktop.org '(cd /srv/dbus.freedesktop.org/www/ && /bin/cp -f ~/dbus-docs.tar.gz . && tar zxf dbus-docs.tar.gz && echo "Successfully unpacked tarball on server")'
+scp dbus-docs.tar.gz "${user}"dbus.freedesktop.org:
+ssh "${user}"dbus.freedesktop.org '(cd /srv/dbus.freedesktop.org/www/ && /bin/cp -f ~/dbus-docs.tar.gz . && tar zxf dbus-docs.tar.gz && echo "Successfully unpacked tarball on server")'