# HG changeset patch # User Heiko Schlittermann (JUMPER) # Date 1314872639 -7200 # Node ID 24417d8949b5c52eb1e971e7f241a7d12c50800d # Parent 7fc329e733c50a9286ed79728718447be38b4897 best version ever ☺ diff -r 7fc329e733c5 -r 24417d8949b5 .hgignore --- a/.hgignore Wed Aug 31 17:20:19 2011 +0200 +++ b/.hgignore Thu Sep 01 12:23:59 2011 +0200 @@ -22,3 +22,4 @@ debian/littlebird-tc-sql.debhelper.log debian/littlebird-tc-sql.postrm.debhelper debian/littlebird-tc-sql.substvars +debian/littlebird-tc-core.postrm.debhelper diff -r 7fc329e733c5 -r 24417d8949b5 debian/changelog --- a/debian/changelog Wed Aug 31 17:20:19 2011 +0200 +++ b/debian/changelog Thu Sep 01 12:23:59 2011 +0200 @@ -1,20 +1,8 @@ -littlebird (2011072500-14) stable; urgency=low - - * removed the meta package, the -core just provices littlebird-tc - - -- Heiko Schlittermann Wed, 31 Aug 2011 17:06:17 +0200 - -littlebird (2011072500-13) stable; urgency=low +littlebird (2011072500-17) stable; urgency=low - * create the database if not already existing - - -- Heiko Schlittermann Wed, 31 Aug 2011 16:20:13 +0200 + * database handling seems to be better than ever before. -littlebird (2011072500-2) unstable; urgency=low - - * fixed depends, fixed permissions in /srv/www/littlebird/TrustCenter/Data - - -- Heiko Schlittermann Tue, 30 Aug 2011 13:57:36 +0200 + -- Heiko Schlittermann Thu, 01 Sep 2011 12:23:19 +0200 littlebird (2011072500-1) unstable; urgency=low diff -r 7fc329e733c5 -r 24417d8949b5 debian/littlebird-tc-common.config --- a/debian/littlebird-tc-common.config Wed Aug 31 17:20:19 2011 +0200 +++ b/debian/littlebird-tc-common.config Thu Sep 01 12:23:59 2011 +0200 @@ -1,4 +1,5 @@ #! /bin/sh +echo "$0: $@" >&2 set -e . /usr/share/debconf/confmodule db_version 2.0 diff -r 7fc329e733c5 -r 24417d8949b5 debian/littlebird-tc-common.templates --- a/debian/littlebird-tc-common.templates Wed Aug 31 17:20:19 2011 +0200 +++ b/debian/littlebird-tc-common.templates Thu Sep 01 12:23:59 2011 +0200 @@ -13,6 +13,11 @@ You may append (separeted by a colon (":")) a port number, if your server does not listen on the default (currently 3306) port. +Template: littlebird-tc/db/name +Type: string +Default: littlebird +Description: The name of the database we should use. + Template: littlebird-tc/db/user Type: string Default: littlebird @@ -24,9 +29,3 @@ Type: password Default: Description: The password to be used for the database connection. - -Template: littlebird-tc/db/name -Type: string -Default: littlebird -Description: The name of the database we should use. - diff -r 7fc329e733c5 -r 24417d8949b5 debian/littlebird-tc-core.postinst --- a/debian/littlebird-tc-core.postinst Wed Aug 31 17:20:19 2011 +0200 +++ b/debian/littlebird-tc-core.postinst Thu Sep 01 12:23:59 2011 +0200 @@ -1,4 +1,5 @@ #!/bin/sh +echo "$0: $@" >&2 # postinst script for littlebird # # see: dh_installdeb(1) diff -r 7fc329e733c5 -r 24417d8949b5 debian/littlebird-tc-core.postrm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/debian/littlebird-tc-core.postrm Thu Sep 01 12:23:59 2011 +0200 @@ -0,0 +1,46 @@ +#!/bin/sh +# postrm script for littlebird +# +# see: dh_installdeb(1) + +set -e +. /usr/share/debconf/confmodule + +# summary of how this script can be called: +# * `remove' +# * `purge' +# * `upgrade' +# * `failed-upgrade' +# * `abort-install' +# * `abort-install' +# * `abort-upgrade' +# * `disappear' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) + + case "$1" in + purge|remove) + db_subst littlebird-tc/removal action ${1%e}ing || true + db_input high littlebird-tc/removal || true + db_go || true + ;; + esac + ;; + + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff -r 7fc329e733c5 -r 24417d8949b5 debian/littlebird-tc-core.templates --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/debian/littlebird-tc-core.templates Thu Sep 01 12:23:59 2011 +0200 @@ -0,0 +1,9 @@ +Template: littlebird-tc/removal +Type: note +Description: The database needs to be cleaned!? + You are ${action} the littlebird trustcenter, + however we do not purge/empty/clean the database. + . + Please think about it, if you need to remove ANY traces, + you should consider dropping the database. Contact your friendly + database admin for doing it :-) diff -r 7fc329e733c5 -r 24417d8949b5 debian/littlebird-tc-sql.config --- a/debian/littlebird-tc-sql.config Wed Aug 31 17:20:19 2011 +0200 +++ b/debian/littlebird-tc-sql.config Thu Sep 01 12:23:59 2011 +0200 @@ -1,4 +1,5 @@ #! /bin/sh +echo "$0: $@" >&2 set -e . /usr/share/debconf/confmodule db_version 2.0 @@ -9,22 +10,20 @@ if test "$1" = "clear"; then - for key in db/adminuser db/adminpass + for key in db/have-admin db/adminuser db/adminpass do db_reset $prefix/$key; done fi db_settitle $prefix-sql/TITLE -db_beginblock - db_input medium $prefix/db/adminuser || true - db_input critical $prefix/db/adminpass || true -db_endblock - +db_input critical $prefix/db/have-admin || true db_go || true -db_get $prefix/db/adminpass || true -if test -z "$RET" ; then - db_fset $prefix/db/noadminpass seen false - db_input critical $prefix/db/noadminpass || true - db_go || true - exit 1 +db_get $prefix/db/have-admin +if test "$RET" = "true"; then + db_beginblock + db_input medium $prefix/db/adminuser || true + db_input critical $prefix/db/adminpass || true + db_endblock fi + +db_go || true diff -r 7fc329e733c5 -r 24417d8949b5 debian/littlebird-tc-sql.postinst --- a/debian/littlebird-tc-sql.postinst Wed Aug 31 17:20:19 2011 +0200 +++ b/debian/littlebird-tc-sql.postinst Thu Sep 01 12:23:59 2011 +0200 @@ -1,4 +1,5 @@ #!/bin/sh +echo "$0: $@" >&2 # postinst script for littlebird # # see: dh_installdeb(1) @@ -17,41 +18,52 @@ # for details, see http://www.debian.org/doc/debian-policy/ or # the debian-policy package +_mysql() { mysql -h"$host" -u"$adminuser" -p"$adminpass" "$@"; } + case "$1" in configure) - db_get littlebird-tc/db/adminuser && adminuser="$RET" || true - db_get littlebird-tc/db/adminpass && adminpass="$RET" || true - db_get littlebird-tc/db/user && user="$RET" || true - db_get littlebird-tc/db/pass && pass="$RET" || true - db_get littlebird-tc/db/host && host="$RET" || true - db_get littlebird-tc/db/name && name="$RET" || true -# cat <&2 + exit 1 + } - if test "$host" = "localhost"; then client="localhost" - else client="%" - fi + if _mysql -e "" "$name" 2>/dev/null; then + db_subst littlebird-tc/db/exists name "$name" || true + db_input medium littlebird-tc/db/exists || true + db_go || true + else + # ok, setup the database + + db_get littlebird-tc/db/user && user="$RET" || true + db_get littlebird-tc/db/pass && pass="$RET" || true + if test "$host" = "localhost"; then client="localhost" + else client="%" + fi - mysql -h"$host" -u"$adminuser" -p"$adminpass" < `remove' +# * `upgrade' +# * `failed-upgrade' +# * `remove' `in-favour' +# * `deconfigure' `in-favour' +# `removing' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + remove) + db_input littlebird-tc/remove || true + db_go || true + ;; + + upgrade|deconfigure) + ;; + + failed-upgrade) + ;; + + *) + echo "prerm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff -r 7fc329e733c5 -r 24417d8949b5 debian/patches/debian-changes-2011072500-14 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/debian/patches/debian-changes-2011072500-14 Thu Sep 01 12:23:59 2011 +0200 @@ -0,0 +1,111 @@ +Description: Upstream changes introduced in version 2011072500-14 + This patch has been created by dpkg-source during the package build. + Here's the last changelog entry, hopefully it gives details on why + those changes were made: + . + littlebird (2011072500-14) stable; urgency=low + . + * removed the meta package, the -core just provices littlebird-tc + . + The person named in the Author field signed this changelog entry. +Author: Heiko Schlittermann + +--- +The information above should follow the Patch Tagging Guidelines, please +checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here +are templates for supplementary fields that you might want to add: + +Origin: , +Bug: +Bug-Debian: http://bugs.debian.org/ +Bug-Ubuntu: https://launchpad.net/bugs/ +Forwarded: +Reviewed-By: +Last-Update: + +--- littlebird-2011072500.orig/LittleBird/encoded/LittleBird-Test/Database/install_test_iteration_2011-06.sh ++++ littlebird-2011072500/LittleBird/encoded/LittleBird-Test/Database/install_test_iteration_2011-06.sh +@@ -2,30 +2,67 @@ + # leichte Anpassungen durch hs@schlittermann.de + # Aufruf wie immer, dann werden die bisherigen Angaben *root* und das bisherige + # Passwort verwendet. Oder +-# install_test_iteration_2011-06.sh DB_HOST DB_NAME DB_ADMIN DB_ADMINPASS DB_USER DB_USERPASS ++# install_test_iteration_2011-06.sh DB_HOST DB_NAME DB_ADMINUSER DB_ADMINPASS DB_USER DB_PASS + + # ACHTUNG: DIE DATENBANK WIRD KOMPLETT GEERDET! + + #DB Update Dev - Test, + #Iteration Mai, Juni + +-#Test Stand vor der Iteration +-DB_HOST=${1-localhost}; shift +-DB_NAME=${1-trustcenter_history_test}; shift +- +-DB_ADMIN=${1-root}; shift +-DB_ADMINPASS=${1-Pa55w0rd}; shift ++fix_db_name() { sed "s/trustcenter_history_test/$DB_NAME/g"; } ++mysql() { fix_db_name | command mysql "$@" -h"$DB_HOST" -D"$DB_NAME" --default-character-set=utf8; } ++mysql_as_admin() { echo "as admin: $1"; <"$DIR/$1" mysql -u "$DB_ADMINUSER" -p"$DB_ADMINPASS"; } ++mysql_as_user() { echo "as user: $1"; <"$DIR/$1" mysql -u "$DB_USER" -p"$DB_PASS"; } + +-DB_USER=${1-$DB_ADMIN}; shift +-DB_USERPASS=${1-$DB_ADMINPASS}; shift ++#Test Stand vor der Iteration ++DIR=$(dirname $0) ++DB_HOST=localhost ++DB_NAME=trustcenter_history_test ++DB_ADMINUSER=root ++DB_ADMINPASS=Pa55w0rd ++DB_USER="$DB_ADMINUSER" ++DB_PASS="$DB_ADMINPASS" ++REPLACING= ++ ++tmp=$(getopt --name $0 --options "" \ ++ --long help,replacing:,host:,db:,adminuser:,adminpass:,user:,pass: \ ++ -- "$@") || exit 2 ++eval set -- "$tmp" ++echo "$@" ++while true; do ++ opt="$1"; shift ++ case "$opt" in ++ --replacing) REPLACING="$1"; shift;; ++ --adminuser) DB_ADMINUSER="$1"; shift;; ++ --adminpass) DB_ADMINPASS="$1"; shift;; ++ --user) DB_USER="$1"; shift;; ++ --pass) DB_PASS="$1"; shift;; ++ --host) DB_HOST="$1"; shift;; ++ --db) DB_NAME="$1"; shift;; ++ --help) cat <<_HELP ++Usage: $0 [options] ++ Options are ++ --host=s The address of the database host ($DB_HOST). ++ --db=s The name of the database to be used ($DB_NAME). ++ --adminuser=s The name of the SUPER user on the db server ($DB_ADMINUSER). ++ --adminpass=s The password for the user above ($DB_ADMINPASS). ++ --user=s The name of the user for NORMAL db operations ($DB_USER). ++ --pass=s The password for the user above ($DB_PASS). ++ --replacing=s The version of the package being replaced ($REPLACING). ++_HELP ++ exit;; ++ *) echo "$0: bad usage" >&2; exit 2;; ++ esac ++done ++ ++# for v in ${!DB_*}; do echo $v ${!v}; done ++ ++if test -n "$REPLACING"; then ++ echo "This is an update, I'll do noting!" >&2 ++ exit 0 ++fi + +-#echo "$DB_ADMIN $DB_ADMINPASS $DB_NAME" +-#echo "$DB_USER $DB_USERPASS $DB_NAME" +- +-fix_db_name() { sed "s/trustcenter_history_test/$DB_NAME/g"; } +-mysql() { fix_db_name | command mysql "$@" -h"$DB_HOST" -D"$DB_NAME" --default-character-set=utf8; } +-mysql_as_admin() { echo "as admin: $1"; <"$1" mysql -u "$DB_ADMIN" -p"$DB_ADMINPASS"; } +-mysql_as_user() { echo "as user: $1"; <"$1" mysql -u "$DB_USER" -p"$DB_USERPASS"; } ++# The filenames here get the name of the scripts directory prepended! + + mysql_as_admin install_dev_tc_2011-04-30_023.sql + mysql_as_admin update_install_dev_tc_2011-04-30_023.sql diff -r 7fc329e733c5 -r 24417d8949b5 debian/patches/series --- a/debian/patches/series Wed Aug 31 17:20:19 2011 +0200 +++ b/debian/patches/series Thu Sep 01 12:23:59 2011 +0200 @@ -1,1 +1,2 @@ debian-changes-2011072500-8 +debian-changes-2011072500-14