[patch][core] Update update-dbus-docs.sh

Simon McVittie simon.mcvittie at collabora.co.uk
Mon May 21 08:47:48 PDT 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

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 ..

Index: update-dbus-docs.sh
===================================================================
RCS file: /cvs/dbus/dbus/update-dbus-docs.sh,v
retrieving revision 1.6
diff -u -u -r1.6 update-dbus-docs.sh
- --- update-dbus-docs.sh	12 Mar 2007 21:35:50 -0000	1.6
+++ update-dbus-docs.sh	21 May 2007 15:42:42 -0000
@@ -6,14 +6,15 @@
     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 at 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 @@
 ## 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 @@
 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")'
 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: OpenPGP key: http://www.pseudorandom.co.uk/2003/contact/ or pgp.net

iD8DBQFGUb8kWSc8zVUw7HYRAjysAJ9v6W87JYRW8yM7kc7T//P/NKhGtACfXN2H
QeB9wX61zgNd+V9OdR+bPvE=
=JYgr
-----END PGP SIGNATURE-----


More information about the dbus mailing list