[SCM] Render HTML and CSS content with tk branch, debian, updated. 2b03cdc68e19df312240190e334a2dcad9810c5b

Ole Streicher debian at liska.ath.cx
Mon Feb 27 12:34:25 UTC 2012


The following commit has been merged in the debian branch:
commit 2b03cdc68e19df312240190e334a2dcad9810c5b
Author: Ole Streicher <debian at liska.ath.cx>
Date:   Mon Feb 27 13:33:33 2012 +0100

    Replace constant cookie with proper login-postdata procedure.
    The cokies seem to expire after some time.

diff --git a/debian/get-orig-source.sh b/debian/get-orig-source.sh
index 449aede..e149c86 100644
--- a/debian/get-orig-source.sh
+++ b/debian/get-orig-source.sh
@@ -17,19 +17,35 @@ SID=$(echo ${UUID} | cut -c-16)
 INCOMING_TAR=tkHTML-${SID}.tar.gz
 
 #
-# The session cookie was created with a browser using "login" and logging in
-# as anonymous.
+# Get the values for login
 #
-SESSION_COOKIE_NAME="fossil-ec6e60882bf46696"
-SESSION_COOKIE_CONTENT="06b18caac9aff9015003789307f94f568710ae7b%2F2455978.88206901%2Fanonymous"
-SESSION_COOKIE="${SESSION_COOKIE_NAME}=${SESSION_COOKIE_CONTENT}"
+wget -O fossil_login.html http://tkhtml.tcl.tk/fossil/login
+PASSWD=$(fgrep "getElementById('p')" fossil_login.html | cut -d\' -f4)
+CS=$(fgrep \"cs\" fossil_login.html | cut -d\" -f6)
+echo $PASSWD $CS
+rm -f fossil_login.html
 
-wget --no-cookies --header "Cookie: ${SESSION_COOKIE}" -O ${INCOMING_TAR} "http://tkhtml.tcl.tk/fossil/tarball/tkHTML-${SID}.tar.gz?uuid=${UUID}"
+#
+# Save the login cookie
+#
+wget -O /dev/null --save-cookies fossil_cookies.txt \
+     --post-data "cs=${CS}&u=anonymous&p=${PASSWD}&in=Login" \
+     http://tkhtml.tcl.tk/fossil/login
+
+#
+# Retrieve file with the login cookie
+# 
+wget --load-cookies fossil_cookies.txt -O ${INCOMING_TAR} \
+     "http://tkhtml.tcl.tk/fossil/tarball/${INCOMING_TAR}?uuid=${UUID}"
+rm -f fossil_cookies.txt
 
 VERSION=$(tar xOf ${INCOMING_TAR} --wildcards \*/configure.in |\
           grep ^AC_INIT | cut -d, -f2 | cut -d\) -f1)
 VERSION=$(echo ${VERSION} | tr -d \[\])
 
-DEBIAN_ORIG_TAR=tk-html3_${VERSION}~fossil${DATE}.orig.tar.gz
-
-ln -sf ${INCOMING_TAR} ${DEBIAN_ORIG_TAR}
+if [ "${VERSION}" != "" ] ; then
+  DEBIAN_ORIG_TAR=tk-html3_${VERSION}~fossil${DATE}.orig.tar.gz
+  ln -sf ${INCOMING_TAR} ${DEBIAN_ORIG_TAR}
+else
+  echo "Could not find version info in tar file. Check ${INCOMING_TAR}"
+fi

-- 
Render HTML and CSS content with tk



More information about the debian-science-commits mailing list