refdb-cvs Mailing List for RefDB (Page 58)
Status: Beta
Brought to you by:
mhoenicka
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(47) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(88) |
Feb
(50) |
Mar
(36) |
Apr
(9) |
May
(30) |
Jun
(30) |
Jul
(22) |
Aug
(16) |
Sep
(42) |
Oct
(18) |
Nov
(29) |
Dec
(23) |
2005 |
Jan
(18) |
Feb
(28) |
Mar
(21) |
Apr
(35) |
May
(62) |
Jun
(22) |
Jul
(5) |
Aug
(40) |
Sep
(98) |
Oct
(81) |
Nov
(51) |
Dec
(62) |
2006 |
Jan
(46) |
Feb
(36) |
Mar
(8) |
Apr
(16) |
May
(14) |
Jun
(16) |
Jul
(47) |
Aug
(60) |
Sep
(34) |
Oct
(16) |
Nov
(46) |
Dec
(11) |
2007 |
Jan
(16) |
Feb
(13) |
Mar
(58) |
Apr
(32) |
May
(4) |
Jun
(8) |
Jul
(31) |
Aug
(46) |
Sep
(22) |
Oct
(30) |
Nov
(58) |
Dec
(15) |
2008 |
Jan
(8) |
Feb
(8) |
Mar
(2) |
Apr
(6) |
May
(3) |
Jun
(2) |
Jul
(1) |
Aug
|
Sep
|
Oct
(6) |
Nov
(3) |
Dec
(5) |
2009 |
Jan
(1) |
Feb
(20) |
Mar
(8) |
Apr
(5) |
May
(8) |
Jun
(3) |
Jul
(6) |
Aug
(4) |
Sep
(7) |
Oct
(8) |
Nov
(2) |
Dec
(1) |
2010 |
Jan
(1) |
Feb
(4) |
Mar
|
Apr
|
May
(1) |
Jun
(1) |
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
(1) |
Dec
|
2011 |
Jan
(5) |
Feb
(5) |
Mar
(13) |
Apr
(3) |
May
|
Jun
|
Jul
(4) |
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
2012 |
Jan
(1) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
(5) |
Nov
|
Dec
(3) |
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
(13) |
2014 |
Jan
(2) |
Feb
(2) |
Mar
(2) |
Apr
(4) |
May
(1) |
Jun
(1) |
Jul
|
Aug
(6) |
Sep
(3) |
Oct
|
Nov
(2) |
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(3) |
Sep
|
Oct
(1) |
Nov
(1) |
Dec
|
2016 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(2) |
Dec
|
2017 |
Jan
|
Feb
|
Mar
(5) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2018 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2019 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2021 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
2022 |
Jan
(9) |
Feb
(16) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Markus H. <mho...@us...> - 2005-02-04 00:23:12
|
Update of /cvsroot/refdb/refdb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9986 Modified Files: Tag: Release_0_9_5_stable configure.in Log Message: added config option for trang Index: configure.in =================================================================== RCS file: /cvsroot/refdb/refdb/configure.in,v retrieving revision 1.49.2.9 retrieving revision 1.49.2.10 diff -u -U2 -r1.49.2.9 -r1.49.2.10 --- configure.in 29 Jan 2005 21:30:31 -0000 1.49.2.9 +++ configure.in 4 Feb 2005 00:22:49 -0000 1.49.2.10 @@ -99,4 +99,10 @@ ]) +dnl maintainers may need the trang jar +AC_ARG_WITH(trang_jar, + [ --with-trang-jar=PATH specify the full path to trang], + [trang_cmd="java -jar "$withval], + [trang_cmd="cp"]) + dnl see whether we should build the server ac_server="YES" @@ -278,4 +284,5 @@ AC_SUBST(ULLSPEC) AC_SUBST(psarg) +AC_SUBST(trang_cmd) AC_SUBST(server_subdirs) AC_SUBST(client_subdirs) |
From: Markus H. <mho...@us...> - 2005-02-04 00:22:57
|
Update of /cvsroot/refdb/refdb/dtd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9986/dtd Modified Files: Tag: Release_0_9_5_stable Makefile.am Log Message: added config option for trang Index: Makefile.am =================================================================== RCS file: /cvsroot/refdb/refdb/dtd/Makefile.am,v retrieving revision 1.10.2.1 retrieving revision 1.10.2.2 diff -u -U2 -r1.10.2.1 -r1.10.2.2 --- Makefile.am 29 Jan 2005 21:32:41 -0000 1.10.2.1 +++ Makefile.am 4 Feb 2005 00:22:49 -0000 1.10.2.2 @@ -23,5 +23,5 @@ %.rnc: %.dtd - java -jar /usr/local/share/java/classes/trang.jar $< $@ + @trang_cmd@ $< $@ install-data-local: |
From: Markus H. <mho...@us...> - 2005-02-04 00:22:02
|
Update of /cvsroot/refdb/refdb/styles In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9730 Added Files: Tag: Release_0_9_5_stable schemas.xml.in Log Message: initial version --- NEW FILE --- <?xml version="1.0"?> <locatingRules xmlns="http://thaiopensource.com/ns/locating-rules/1.0"> <namespace ns="http://www.w3.org/1999/xhtml" uri="xhtml.rnc"/> <uri pathSuffix=".xml" uri="<refdblib>/dtd/citestylex.rnc"/> </locatingRules> |
From: David N. <dav...@us...> - 2005-02-03 13:07:18
|
Update of /cvsroot/refdb/refdb/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24235 Modified Files: Tag: Release_0_9_5_stable refdb-restore Log Message: Remove debugging message; harmonise exit routine with 'refdb-backup'. Index: refdb-restore =================================================================== RCS file: /cvsroot/refdb/refdb/scripts/refdb-restore,v retrieving revision 1.3.2.4 retrieving revision 1.3.2.5 diff -u -U2 -r1.3.2.4 -r1.3.2.5 --- refdb-restore 3 Feb 2005 11:45:20 -0000 1.3.2.4 +++ refdb-restore 3 Feb 2005 13:07:02 -0000 1.3.2.5 @@ -35,7 +35,15 @@ # retuns: nil endScript () { + # attempt to change back to initial directory + cd ${start_dir} || \ + echo "Error: Unable to cd to start dir '${start_dir}'." + # attempt to delete temporary files + [ -d ${tempdir} ] && rm -fr ${tempdir} || \ + echo "Error: Unable to delete temporary directory '${tempdir}'." + # provide feedback regarding success of backup echo ; echo "$1" echo ; echo "refdb restore $2." echo "`basename $0` is finished." + # provide exit status to shell if [ "$2" = "succeeded" ] ; then exit 0 ; else exit 1 ; fi } @@ -141,5 +149,4 @@ endScript "Error: Unable to cd to temporary directory '${tempdir}'." \ "failed" -echo "Temporary directory: >>${tempdir}<<" # Informational message |
From: David N. <dav...@us...> - 2005-02-03 11:45:31
|
Update of /cvsroot/refdb/refdb/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9240 Modified Files: Tag: Release_0_9_5_stable refdb-backup refdb-restore Log Message: Portability-related changes (string-chopping, mktemp); removed use of system bell; added '-s' (silent) option to 'refdb-backup'. Index: refdb-backup =================================================================== RCS file: /cvsroot/refdb/refdb/scripts/refdb-backup,v retrieving revision 1.3.2.3 retrieving revision 1.3.2.4 diff -u -U2 -r1.3.2.3 -r1.3.2.4 --- refdb-backup 31 Jan 2005 15:36:58 -0000 1.3.2.3 +++ refdb-backup 3 Feb 2005 11:45:20 -0000 1.3.2.4 @@ -21,43 +21,66 @@ refdba="refdba" # refdba command refdbc="refdbc" # refdbc command -parameters="[-u USER] [-w PWD] [-f FORMAT] [-d DIR]" # cmd-line options +parameters="[-u USER] [-w PWD] [-f FORMAT] [-d DIR] [-s]" # cmd-line args +feedback="true" # whether user receives screen feedback # PROCEDURES +# Give user feedback +# params: 1 - message +# 2 - indent (number of indents|tabs) +# 3 - copy to log? ( 0 = true, 1 = false ) +# 4 - terminate with newline? ( 0 = true, 1 = false ) +# return: nil +feedback () { + # decide on use of newline flag + if [ $4 -ne 0 ] ; then use_newline="-n" ; else use_newline="" ; fi + # add indents as required + msg=$1 + loop=1 + while [ 1 ] ; do + [ ${loop} -gt $2 ] && break + [ ${feedback} ] && echo -n " " + loop=$(( ${loop} + 1 )) + done + # screen feedback + [ ${feedback} ] && echo ${use_newline} ${msg} + # log feedback + [ $3 -eq 0 ] && echo ${use_newline} ${msg} >> ${logfile} +} # Report success of operation +# params: 1 - message +# 2 - copy to log? ("log" = yes, "" = no ) +# return: nil report () { if [ $1 -eq 0 ] ; then - if [ "$2" = "log" ] ; then - echo "OK." | tee -a ${logfile} - else - echo "OK." - fi + [ "$2" = "log" ] && echo "OK." >> ${logfile} + feedback " OK." 0 1 0 else - if [ "$2" = "log" ] ; then - echo "Failed." | tee -a ${logfile} - else - echo "Failed." - fi + [ "$2" = "log" ] && echo "Failed." >> ${logfile} + feedback " Failed." 0 1 0 fi } # Report failure and abort +# params: 1 - message +# 2 - success flag ( "succeeded" = yes | "*" = no ) +# return: nil endScript () { + # attempt to change back to initial directory cd ${start_dir} || \ - "Error: Unable to cd to initial directory '${start_dir}'." - echo ; echo "$1" - echo ; echo "refdb backup $2." - echo "`basename $0` is finished." - if [ "$2" = "succeeded" ] ; then - # Single tone indicates success - echo -ne "\a" - exit 0 - else - # Double tone indicates failure - echo -ne "\a" ; sleep 1s ; echo -ne "\a" - exit 1 - fi + feedback "Error: Unable to cd to start dir '${start_dir}'." 0 1 0 + # attempt to delete temporary files + err_msg="Error: Unable to delete temporary directory '${tempdir}'." + [ -d ${tempdir} ] && rm -fr ${tempdir} || feedback ${err_msg} 0 1 0 + # provide feedback regarding success of backup + feedback " " 0 1 0 ; feedback "$1" 0 1 0 + feedback " " 0 1 0 ; feedback "refdb backup $2." 0 1 0 + feedback "`basename $0` is finished." 0 1 0 + # provide exit status to shell + if [ "$2" = "succeeded" ] ; then exit 0 ; else exit 1 ; fi } # Show usage +# params: nil +# return: nil displayUsage () { echo "`basename $0`: Backs up RefDB data." @@ -74,4 +97,5 @@ echo " -d DIR = directory to place backup file" echo " default is current directory" + echo " -s = silent, i.e., no screen feedback" echo "Note: RefDB clients can be configured for automatic access." echo " If this is so, username and password are not required." @@ -86,5 +110,5 @@ # Read the command line options -while getopts ":hf:d:u:w:" opt ; do +while getopts ":hf:d:u:w:s" opt ; do case ${opt} in h ) displayUsage && exit 0;; @@ -95,4 +119,5 @@ w ) refdba="${refdba} -w \"${OPTARG}\"" refdbc="${refdbc} -w \"${OPTARG}\"";; + s ) feedback="";; \? ) echo "Error: Invalid flag '${OPTARG}' detected" echo "Usage: `basename $0` ${parameters}" @@ -122,5 +147,5 @@ [ `echo ${backup_dir} | grep "\/$"` ] && backup_dir=${backup_dir%%/} # convert relative to absolute dirpath -[ "${backup_dir:0:1}" != "/" ] && \ +[ `echo ${backup_dir} | grep -v "^\/"` ] && \ backup_dir="${start_dir}/${backup_dir}" # now can test @@ -137,7 +162,8 @@ # Will use temporary directory for working # - ensure deletion on exit and change to working directory -tempdir=`mktemp -dq` \ +tempdir_base="`basename $0`.XXXXXX" +tempdir=`mktemp -dq ${tempdir_base}` \ || endScript "Error: Unable to create temporary directory." "failed" -trap "rm -fr ${tempdir}" 0 1 2 3 5 15 # no need to worry about deleting later +trap "rm -fr ${tempdir}" 0 1 2 3 5 15 # delete on exit cd ${tempdir} || \ endScript "Error: Unable to cd to temporary directory '${tempdir}'." \ @@ -145,22 +171,23 @@ # Informational message -echo "`basename $0` is running..." ; echo +feedback "`basename $0` is running..." 0 1 0 ; feedback " " 0 1 0 # Record date/time of backup echo "RefDB backup performed by '`basename $0`'." > ${logfile} echo "Performed: `date '+%Y-%m-%d, %H:%M:%S'`." >> ${logfile} -echo "Storage format: ${format}." | tee -a ${logfile} ; echo +feedback "Storage format: ${format}." 0 0 0 +feedback " " 0 1 0 echo "--------------------------------------------------------" >> ${logfile} # Cycle through databases in turn and backup references and notes for db in `${refdba} -C listdb | cut -d ' ' -f 1` ; do - echo "Processing database: ${db}" | tee -a ${logfile} + feedback "Processing database: ${db}" 0 0 0 dirname="db_${db}" - echo -n " Creating subdirectory '${dirname}' ... " | tee -a ${logfile} + feedback "Creating subdirectory '${dirname}' ..." 1 0 1 mkdir ${dirname} &> /dev/null report $? log # dump references reffile="${dirname}/${references_backup}.${extension}" - echo -n " Backing up references ... " | tee -a ${logfile} + feedback "Backing up references ..." 1 0 1 ${refdbc} -C getref -d ${db} -t ${format} -o ${reffile} ":ID:>0" \ &> /dev/null @@ -168,5 +195,5 @@ # dump notes notefile="${dirname}/${notes_backup}" - echo -n " Backing up notes ... " | tee -a ${logfile} + feedback "Backing up notes ..." 1 0 1 ${refdbc} -C getnote -d ${db} -t xnote -o ${notefile} ":NID:>0" \ &> /dev/null @@ -175,11 +202,10 @@ # Cycle through styles in turn and back them up -echo "Processing styles" | tee -a ${logfile} -echo -n " Creating styles directory '${styles_directory}' ... " \ - | tee -a ${logfile} +feedback "Processing styles" 0 0 0 +feedback "Creating styles directory '${styles_directory}' ..." 1 0 1 mkdir ${styles_directory} &> /dev/null report $? log for style in `${refdba} -C liststyle` ; do - echo -n " Backing up style: ${style} ... " | tee -a ${logfile} + feedback "Backing up style: ${style} ..." 1 0 1 # remove terminal period from file name if present if [ `echo ${style} | grep "\.$" | wc -l` -eq 1 ] ; then @@ -195,9 +221,9 @@ # Now done echo "--------------------------------------------------------" >> ${logfile} -echo "Written log file: ${logfile}." +feedback "Written log file: '${logfile}' (located in archive)." 0 1 0 # Create archive -echo "Create archive" -echo -n " Writing archive ... " +feedback "Create archive" 0 1 0 +feedback "Writing archive ..." 1 1 1 tar -czf ${archive} * exit_status=$? && report ${exit_status} @@ -206,5 +232,5 @@ # Move archive to backup directory -echo -n " Copying archive to target directory... " +feedback "Copying archive to target directory..." 1 1 1 mv -f ${archive} ${backup_dir} &> /dev/null exit_status=$? && report ${exit_status} @@ -215,4 +241,4 @@ # Finished [ "${backup_dir}" != "${start_dir}" ] && archive="${backup_dir}/${archive}" -echo ; echo "Backup archive: '${archive}'." +feedback " " 0 1 0 ; feedback "Backup archive: '${archive}'." 0 1 0 endScript "Backup finished." "succeeded" Index: refdb-restore =================================================================== RCS file: /cvsroot/refdb/refdb/scripts/refdb-restore,v retrieving revision 1.3.2.3 retrieving revision 1.3.2.4 diff -u -U2 -r1.3.2.3 -r1.3.2.4 --- refdb-restore 31 Jan 2005 15:36:58 -0000 1.3.2.3 +++ refdb-restore 3 Feb 2005 11:45:20 -0000 1.3.2.4 @@ -28,9 +28,5 @@ # return: nil report () { - if [ $1 -eq 0 ] ; then - echo "OK." | tee -a ${logfile} - else - echo "Failed." | tee -a ${logfile} - fi + if [ $1 -eq 0 ] ; then echo "OK." ; else echo "Failed." ; fi } # Report failure and abort @@ -42,13 +38,5 @@ echo ; echo "refdb restore $2." echo "`basename $0` is finished." - if [ "$2" = "succeeded" ] ; then - # Single tone indicates success - echo -ne "\a" - exit 0 - else - # Double tone indicates failure - echo -ne "\a" ; sleep 1s ; echo -ne "\a" - exit 1 - fi + if [ "$2" = "succeeded" ] ; then exit 0 ; else exit 1 ; fi } # Show usage @@ -128,5 +116,5 @@ # - run tests on archive # - first, convert relative to absolute filepath -[ "${archive:0:1}" != "/" ] && archive="${start_dir}/${archive}" +[ `echo ${archive} | grep -v "^\/"` ] && archive="${start_dir}/${archive}" # - must exist and be readable [ -r ${archive} ] || \ @@ -145,10 +133,13 @@ # Will use temporary directory for working # - ensure deletion on exit and change to working directory -tempdir=`mktemp -dq` \ +tempdir_base="`basename $0`.XXXXXX" +tempdir=`mktemp -dq ${tempdir_base}` \ || endScript "Error: Unable to create temporary directory." "failed" -trap "rm -fr ${tempdir}" 0 1 2 3 5 15 # no need to worry about deleting later +[ `echo ${tempdir} | grep -v "^\/"` ] && tempdir="${start_dir}/${tempdir}" +trap "rm -fr ${tempdir}" 0 1 2 3 5 15 # delete on exit cd ${tempdir} || \ endScript "Error: Unable to cd to temporary directory '${tempdir}'." \ "failed" +echo "Temporary directory: >>${tempdir}<<" # Informational message |
From: Markus H. <mho...@us...> - 2005-02-02 20:04:23
|
Update of /cvsroot/refdb/refdb/conf In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22308 Modified Files: Tag: Release_0_9_5_stable missing Log Message: updated to match autotools versions Index: missing =================================================================== RCS file: /cvsroot/refdb/refdb/conf/missing,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.4.1 diff -u -U2 -r1.1.1.1 -r1.1.1.1.4.1 --- missing 22 May 2001 05:42:53 -0000 1.1.1.1 +++ missing 2 Feb 2005 20:04:00 -0000 1.1.1.1.4.1 @@ -1,6 +1,6 @@ #! /bin/sh # Common stub for a few missing GNU programs while installing. -# Copyright (C) 1996, 1997 Free Software Foundation, Inc. -# Franc,ois Pinard <pi...@ir...>, 1996. +# Copyright 1996, 1997, 1999, 2000 Free Software Foundation, Inc. +# Originally by Fran,cois Pinard <pi...@ir...>, 1996. # This program is free software; you can redistribute it and/or modify @@ -19,4 +19,9 @@ # 02111-1307, USA. +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" @@ -24,4 +29,25 @@ fi +run=: + +# In the cases where this matters, `missing' is being run in the +# srcdir already. +if test -f configure.ac; then + configure_ac=configure.ac +else + configure_ac=configure.in +fi + +case "$1" in +--run) + # Try to run requested program, and just exit if it succeeds. + run= + shift + "$@" && exit 0 + ;; +esac + +# If it does not exist, or fails to run (possibly an outdated version), +# try to emulate it. case "$1" in @@ -36,4 +62,5 @@ -h, --help display this help and exit -v, --version output version information and exit + --run try to run the given command, and emulate it if it fails Supported PROGRAM values: @@ -44,11 +71,13 @@ bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c + help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file + tar try tar, gnutar, gtar, then tar without non-portable flags yacc create \`y.tab.[ch]', if possible, from existing .[ch]" ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) - echo "missing - GNU libit 0.0" + echo "missing 0.4 - GNU automake" ;; @@ -59,8 +88,13 @@ ;; - aclocal) + aclocal*) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + fi + echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if - you modified \`acinclude.m4' or \`configure.in'. You might want + you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." @@ -69,7 +103,12 @@ autoconf) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + fi + echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if - you modified \`configure.in'. You might want to install the + you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." @@ -78,10 +117,15 @@ autoheader) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + fi + echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if - you modified \`acconfig.h' or \`configure.in'. You might want + you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." - files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' configure.in` + files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= @@ -96,8 +140,13 @@ ;; - automake) + automake*) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + fi + echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if - you modified \`Makefile.am', \`acinclude.m4' or \`configure.in'. + you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." @@ -107,4 +156,32 @@ ;; + autom4te) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + fi + + echo 1>&2 "\ +WARNING: \`$1' is needed, and you do not seem to have it handy on your + system. You might have modified some files without having the + proper tools for further handling them. + You can get \`$1Help2man' as part of \`Autoconf' from any GNU + archive site." + + file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'` + test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'` + if test -f "$file"; then + touch $file + else + test -z "$file" || exec >$file + echo "#! /bin/sh" + echo "# Created by GNU Automake missing as a replacement of" + echo "# $ $@" + echo "exit 0" + chmod +x $file + exit 1 + fi + ;; + bison|yacc) echo 1>&2 "\ @@ -160,5 +237,35 @@ ;; + help2man) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + fi + + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified a dependency of a manual page. You may need the + \`Help2man' package in order for those modifications to take + effect. You can get \`Help2man' from any GNU archive site." + + file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` + if test -z "$file"; then + file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'` + fi + if [ -f "$file" ]; then + touch $file + else + test -z "$file" || exec >$file + echo ".ab help2man is required to generate this page" + exit 1 + fi + ;; + makeinfo) + if test -z "$run" && (makeinfo --version) > /dev/null 2>&1; then + # We have makeinfo, but it failed. + exit 1 + fi + echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if @@ -176,4 +283,43 @@ ;; + tar) + shift + if test -n "$run"; then + echo 1>&2 "ERROR: \`tar' requires --run" + exit 1 + fi + + # We have already tried tar in the generic part. + # Look for gnutar/gtar before invocation to avoid ugly error + # messages. + if (gnutar --version > /dev/null 2>&1); then + gnutar ${1+"$@"} && exit 0 + fi + if (gtar --version > /dev/null 2>&1); then + gtar ${1+"$@"} && exit 0 + fi + firstarg="$1" + if shift; then + case "$firstarg" in + *o*) + firstarg=`echo "$firstarg" | sed s/o//` + tar "$firstarg" ${1+"$@"} && exit 0 + ;; + esac + case "$firstarg" in + *h*) + firstarg=`echo "$firstarg" | sed s/h//` + tar "$firstarg" ${1+"$@"} && exit 0 + ;; + esac + fi + + echo 1>&2 "\ +WARNING: I can't seem to be able to run \`tar' with the given arguments. + You may want to install GNU tar or Free paxutils, or check the + command line arguments." + exit 1 + ;; + *) echo 1>&2 "\ |
From: Markus H. <mho...@us...> - 2005-02-01 21:32:32
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20065/src Modified Files: Tag: Release_0_9_5_stable backend-risx.c Log Message: fixed segfault when exporting to risx Index: backend-risx.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/backend-risx.c,v retrieving revision 1.30.2.2 retrieving revision 1.30.2.3 diff -u -U2 -r1.30.2.2 -r1.30.2.3 --- backend-risx.c 24 Jun 2004 21:17:42 -0000 1.30.2.2 +++ backend-risx.c 1 Feb 2005 21:32:02 -0000 1.30.2.3 @@ -295,4 +295,6 @@ } + item = NULL; + if (!strcmp(type, "BOOK") || !strcmp(type, "UNPB") |
From: Markus H. <mho...@us...> - 2005-02-01 20:39:50
|
Update of /cvsroot/refdb/homepage In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8459 Modified Files: download.html Log Message: updated refdb-cvs archive Index: download.html =================================================================== RCS file: /cvsroot/refdb/homepage/download.html,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -U2 -r1.1.1.1 -r1.2 --- download.html 13 Dec 2004 21:19:23 -0000 1.1.1.1 +++ download.html 1 Feb 2005 20:39:15 -0000 1.2 @@ -162,5 +162,5 @@ <h2 id="cvseasy">CVS made easy</h2> <p>(Thanks to David Nebauer <davidnebauer AT swtch DOT com DOT au> who contributed the scripts)</p> - <p>Like many other open source projects, RefDB source code is controlled using <a href="http://www.cyclic.com/cvs/info.html">CVS</a>. There is a <a href="refdb-cvs-20041026.zip">set of scripts</a> that can checkout a RefDB source tree, build, and install it on your system. This is the most convenient way to keep a CVS version of RefDB up to date. Simply unpack the scripts into a directory in your path, e.g. <code>~/bin</code>, and alter some variables at the start of the script. Then run:</p> + <p>Like many other open source projects, RefDB source code is controlled using <a href="http://www.cyclic.com/cvs/info.html">CVS</a>. There is a <a href="refdb-cvs-20050201.zip">set of scripts</a> that can checkout a RefDB source tree, build, and install it on your system. This is the most convenient way to keep a CVS version of RefDB up to date. Simply unpack the scripts into a directory in your path, e.g. <code>~/bin</code>, and alter some variables at the start of the script. Then run:</p> <pre class="source">refdb-cvs</pre> <p>In order to rebuild an existing source tree without running a CVS update, run this instead:</p> |
From: David N. <dav...@us...> - 2005-01-31 15:37:10
|
Update of /cvsroot/refdb/refdb/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32085 Modified Files: Tag: Release_0_9_5_stable refdb-backup refdb-restore Log Message: Bugfix: Corrected getopts error message -- was showing incorrect command line parameters. Index: refdb-backup =================================================================== RCS file: /cvsroot/refdb/refdb/scripts/refdb-backup,v retrieving revision 1.3.2.2 retrieving revision 1.3.2.3 diff -u -U2 -r1.3.2.2 -r1.3.2.3 --- refdb-backup 31 Jan 2005 13:53:17 -0000 1.3.2.2 +++ refdb-backup 31 Jan 2005 15:36:58 -0000 1.3.2.3 @@ -21,4 +21,5 @@ refdba="refdba" # refdba command refdbc="refdbc" # refdbc command +parameters="[-u USER] [-w PWD] [-f FORMAT] [-d DIR]" # cmd-line options @@ -64,9 +65,9 @@ echo "Backs up references, notes and styles from RefDB." echo - echo "Usage: `basename $0` [-u USER] [-w PWD] [-f FORMAT] [-d DIR]" + echo "Usage: `basename $0` ${parameters}" echo " `basename $0` [ -h ]" echo echo "Options: -u USER = username for RefDB clients ('refdba'|'refdbc')" - echo " w PWD = password for RefDB clients ('refdba'|'refdbc')" + echo " -w PWD = password for RefDB clients ('refdba'|'refdbc')" echo " -f FORMAT = references storage format ('ris'|'risx')" echo " default is 'ris'" @@ -95,10 +96,10 @@ refdbc="${refdbc} -w \"${OPTARG}\"";; \? ) echo "Error: Invalid flag '${OPTARG}' detected" - echo "Usage: `basename $0` [ -f FORMAT ] [ -d DIR ]" + echo "Usage: `basename $0` ${parameters}" echo "Try '`basename $0` -h' for help" echo -ne "\a" exit 1;; \: ) echo "Error: No argument supplied for flag '${OPTARG}'" - echo "Usage: `basename $0` [ -f FORMAT ] [ -d DIR ]" + echo "Usage: `basename $0` ${parameters}" echo "Try '`basename $0` -h' for help" echo -ne "\a" Index: refdb-restore =================================================================== RCS file: /cvsroot/refdb/refdb/scripts/refdb-restore,v retrieving revision 1.3.2.2 retrieving revision 1.3.2.3 diff -u -U2 -r1.3.2.2 -r1.3.2.3 --- refdb-restore 31 Jan 2005 13:53:17 -0000 1.3.2.2 +++ refdb-restore 31 Jan 2005 15:36:58 -0000 1.3.2.3 @@ -20,5 +20,5 @@ refdbc="refdbc" # refdbc command archive=$1 # name of backup archive - +parameters="[-u USER] [-w PWD] <backup_archive>" # cmd-line options # PROCEDURES @@ -60,10 +60,10 @@ echo "Restores references, notes and styles from backup archive." echo - echo "Usage: `basename $0` [-u USER] [-w PWD] <backup_archive>" + echo "Usage: `basename $0` ${parameters}" echo echo "Must be archive created by 'refdb-backup' utility." echo echo "Options: -u USER = username for RefDB clients ('refdba'|'refdbc')" - echo " w PWD = password for RefDB clients ('refdba'|'refdbc')" + echo " -w PWD = password for RefDB clients ('refdba'|'refdbc')" echo "Note: RefDB clients can be configured for automatic access." echo " If this is so, username and password are not required." @@ -111,10 +111,10 @@ refdbc="${refdbc} -w \"${OPTARG}\"";; \? ) echo "Error: Invalid flag '${OPTARG}' detected" - echo "Usage: `basename $0` [ -f FORMAT ] [ -d DIR ]" + echo "Usage: `basename $0` ${parameters}" echo "Try '`basename $0` -h' for help" echo -ne "\a" exit 1;; \: ) echo "Error: No argument supplied for flag '${OPTARG}'" - echo "Usage: `basename $0` [ -f FORMAT ] [ -d DIR ]" + echo "Usage: `basename $0` ${parameters}" echo "Try '`basename $0` -h' for help" echo -ne "\a" @@ -146,5 +146,5 @@ # - ensure deletion on exit and change to working directory tempdir=`mktemp -dq` \ - || endScript "Error: Unable to create temporary directory." "failed" + || endScript "Error: Unable to create temporary directory." "failed" trap "rm -fr ${tempdir}" 0 1 2 3 5 15 # no need to worry about deleting later cd ${tempdir} || \ @@ -178,8 +178,4 @@ refdbc -C addref -d ${db} -t ${format} ${reffile} &> /dev/null report $? -# # - delete file -# echo -n " Deleting temporary file ... " -# rm -f ${reffile} -# report $? # restore notes notefile="db_${db}/${notes_backup}" @@ -193,12 +189,4 @@ refdbc -C addnote -d ${db} ${notefile} &> /dev/null report $? -# # - delete file -# echo -n " Deleting temporary file ... " -# rm -f ${notefile} -# report $? -# # delete database directory -# echo -n " Deleting temporary db directory ... " -# rmdir db_${db} -# report $? fi done @@ -220,7 +208,4 @@ refdba -C addstyle ${stylefile} &> /dev/null report $? -# echo -n " Deleting temporary file ... " -# rm -f ${stylefile} -# report $? else report 1 |
From: David N. <dav...@us...> - 2005-01-31 13:53:30
|
Update of /cvsroot/refdb/refdb/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6640 Modified Files: Tag: Release_0_9_5_stable refdb-backup refdb-restore Log Message: Attempted sh-compatibility; no interactivity - all input via arguments; use temporary directories so no longer need empty directory; added check for refdb access; now accepts username and password arguments to enable client access; and restore no longer generates log file. Index: refdb-backup =================================================================== RCS file: /cvsroot/refdb/refdb/scripts/refdb-backup,v retrieving revision 1.3.2.1 retrieving revision 1.3.2.2 diff -u -U2 -r1.3.2.1 -r1.3.2.2 --- refdb-backup 30 Jan 2005 14:12:31 -0000 1.3.2.1 +++ refdb-backup 31 Jan 2005 13:53:17 -0000 1.3.2.2 @@ -11,9 +11,14 @@ # VARIABLES -references_backup="references" -notes_backup="xnotes.xml" -styles_directory="styles" -logfile="log_backup" -archive="refdb_backup_`date '+%Y%m%d_%H%M'`.tar.gz" +references_backup="references" # base of references backup file name +notes_backup="xnotes.xml" # notes backup file name +styles_directory="styles" # name of styles directory (intra-archive) +logfile="log_backup" # name of log file +archive="refdb_backup_`date '+%Y%m%d_%H%M'`.tar.gz" # archive name +start_dir=`pwd` # directory in which utility is run +backup_dir=${start_dir} # overridden by '-d' option +format="ris" # overridden by '-f' option +refdba="refdba" # refdba command +refdbc="refdbc" # refdbc command @@ -38,4 +43,6 @@ # Report failure and abort endScript () { + cd ${start_dir} || \ + "Error: Unable to cd to initial directory '${start_dir}'." echo ; echo "$1" echo ; echo "refdb backup $2." @@ -55,8 +62,21 @@ echo "`basename $0`: Backs up RefDB data." echo - echo "Usage: `basename $0`" - echo echo "Backs up references, notes and styles from RefDB." - echo "Must be run in an empty directory." + echo + echo "Usage: `basename $0` [-u USER] [-w PWD] [-f FORMAT] [-d DIR]" + echo " `basename $0` [ -h ]" + echo + echo "Options: -u USER = username for RefDB clients ('refdba'|'refdbc')" + echo " w PWD = password for RefDB clients ('refdba'|'refdbc')" + echo " -f FORMAT = references storage format ('ris'|'risx')" + echo " default is 'ris'" + echo " -d DIR = directory to place backup file" + echo " default is current directory" + echo "Note: RefDB clients can be configured for automatic access." + echo " If this is so, username and password are not required." + echo + echo "The backup archive is a gzipped tarfile (for more information" + echo "try 'man tar' and 'man gzip'). The archive filename is" + echo "'refdb_backup_YYYYMMDD_HHMM.tar.gz'." } @@ -64,42 +84,74 @@ # MAIN -# Check parameters -[ $# -gt 1 ] \ - && echo "Invalid parameters. Try '`basename $0` -h'." \ - && exit 1 -[ $# -eq 1 ] && case $1 in - -h | --help ) displayUsage ; exit 0;; - * ) echo "Invalid parameter. Try '`basename $0` -h'." ; exit 1;; -esac - -# Must be run in empty directory -if [ `ls | grep -v total | wc -l` -ne 0 ] ; then - echo ; echo "This directory is not empty." - echo "'`basename $0`' must be run from an empty directory." - endScript "Aborted." "failed" -fi - -# Informational message -echo "`basename $0` is running..." ; echo +# Read the command line options +while getopts ":hf:d:u:w:" opt ; do + case ${opt} in + h ) displayUsage && exit 0;; + f ) format=${OPTARG};; + d ) backup_dir=${OPTARG};; + u ) refdba="${refdba} -u \"${OPTARG}\"" + refdbc="${refdbc} -u \"${OPTARG}\"";; + w ) refdba="${refdba} -w \"${OPTARG}\"" + refdbc="${refdbc} -w \"${OPTARG}\"";; + \? ) echo "Error: Invalid flag '${OPTARG}' detected" + echo "Usage: `basename $0` [ -f FORMAT ] [ -d DIR ]" + echo "Try '`basename $0` -h' for help" + echo -ne "\a" + exit 1;; + \: ) echo "Error: No argument supplied for flag '${OPTARG}'" + echo "Usage: `basename $0` [ -f FORMAT ] [ -d DIR ]" + echo "Try '`basename $0` -h' for help" + echo -ne "\a" + exit 1;; + esac +done +shift $(( ${OPTIND} - 1 )) # not really needed, but... -# Select storage format -old_PS3=${PS3} -PS3="Select the storage format for references: " -select format in "ris" "risx" ; do break ; done +# Check for valid arguments +# - format ('ris'|'risx') case ${format} in ris ) extension="ris";; risx ) extension="xml";; - * ) endScript "No format selected." "failed";; + * ) endScript \ + "Error: '${format}' is an invalid reference storage format." \ + "failed";; esac -echo ; echo "References storage format: ${format}." ; echo +# - directory must be writable + # remove terminal slash '/' +[ `echo ${backup_dir} | grep "\/$"` ] && backup_dir=${backup_dir%%/} + # convert relative to absolute dirpath +[ "${backup_dir:0:1}" != "/" ] && \ + backup_dir="${start_dir}/${backup_dir}" + # now can test +if [ ! -d ${backup_dir} -o ! -w ${backup_dir} ] ; then + endScript "Error: '${backup_dir}' is not a writable directory." "failed" +fi + +# Test for RefDB access +${refdba} -C listdb &> /dev/null || \ + endScript "Error: Unable to access RefDB using client 'refdba'." "failed" +${refdbc} -C listdb &> /dev/null || \ + endScript "Error: Unable to access RefDB using client 'refdbc'." "failed" + +# Will use temporary directory for working +# - ensure deletion on exit and change to working directory +tempdir=`mktemp -dq` \ + || endScript "Error: Unable to create temporary directory." "failed" +trap "rm -fr ${tempdir}" 0 1 2 3 5 15 # no need to worry about deleting later +cd ${tempdir} || \ + endScript "Error: Unable to cd to temporary directory '${tempdir}'." \ + "failed" + +# Informational message +echo "`basename $0` is running..." ; echo # Record date/time of backup echo "RefDB backup performed by '`basename $0`'." > ${logfile} echo "Performed: `date '+%Y-%m-%d, %H:%M:%S'`." >> ${logfile} -echo "Storage format: ${format}." >> ${logfile} +echo "Storage format: ${format}." | tee -a ${logfile} ; echo echo "--------------------------------------------------------" >> ${logfile} # Cycle through databases in turn and backup references and notes -for db in `refdba -C listdb | cut --delimiter=' ' --fields=1` ; do +for db in `${refdba} -C listdb | cut -d ' ' -f 1` ; do echo "Processing database: ${db}" | tee -a ${logfile} dirname="db_${db}" @@ -110,5 +162,5 @@ reffile="${dirname}/${references_backup}.${extension}" echo -n " Backing up references ... " | tee -a ${logfile} - refdbc -C getref -d ${db} -t ${format} -o ${reffile} ":ID:>0" \ + ${refdbc} -C getref -d ${db} -t ${format} -o ${reffile} ":ID:>0" \ &> /dev/null report $? log @@ -116,5 +168,5 @@ notefile="${dirname}/${notes_backup}" echo -n " Backing up notes ... " | tee -a ${logfile} - refdbc -C getnote -d ${db} -t xnote -o ${notefile} ":NID:>0" \ + ${refdbc} -C getnote -d ${db} -t xnote -o ${notefile} ":NID:>0" \ &> /dev/null report $? log @@ -127,5 +179,5 @@ mkdir ${styles_directory} &> /dev/null report $? log -for style in `refdba -C liststyle` ; do +for style in `${refdba} -C liststyle` ; do echo -n " Backing up style: ${style} ... " | tee -a ${logfile} # remove terminal period from file name if present @@ -136,5 +188,5 @@ fi stylefile="${styles_directory}/${stylefile}.xml" - refdba -C getstyle -o ${stylefile} ${style} &> /dev/null + ${refdba} -C getstyle -o ${stylefile} ${style} &> /dev/null report $? log done @@ -144,19 +196,22 @@ echo "Written log file: ${logfile}." -# Zip files -echo "Compressing to archive" +# Create archive +echo "Create archive" echo -n " Writing archive ... " -#find . -name '*' | zip ${archive} -@ &> /dev/null tar -czf ${archive} * -report $? -echo -n " Deleting backup files ... " -for file in `ls -1 | sed -e 's/ \+/ /g' | cut -d ' ' -f 8 | grep -v '^$'` ; do - [ `echo ${file} | grep "^refdb_backup" | wc -l` -ne 1 ] \ - && [ `echo ${file} | grep "^${logfile}" | wc -l` -ne 1 ] \ - && rm -fr ${file} &> /dev/null -done -echo "OK." +exit_status=$? && report ${exit_status} +[ ${exit_status} -ne 0 ] \ + && endScript "Error: Unable to write archive." "failed" + +# Move archive to backup directory +echo -n " Copying archive to target directory... " +mv -f ${archive} ${backup_dir} &> /dev/null +exit_status=$? && report ${exit_status} +[ ${exit_status} -ne 0 ] \ + && endScript "Error: Unable to move archive to backup directory." \ + "failed" # Finished +[ "${backup_dir}" != "${start_dir}" ] && archive="${backup_dir}/${archive}" echo ; echo "Backup archive: '${archive}'." endScript "Backup finished." "succeeded" Index: refdb-restore =================================================================== RCS file: /cvsroot/refdb/refdb/scripts/refdb-restore,v retrieving revision 1.3.2.1 retrieving revision 1.3.2.2 diff -u -U2 -r1.3.2.1 -r1.3.2.2 --- refdb-restore 30 Jan 2005 14:12:31 -0000 1.3.2.1 +++ refdb-restore 31 Jan 2005 13:53:17 -0000 1.3.2.2 @@ -6,5 +6,4 @@ # History: 2004-11-28 Created -# 2005-01-27 Delete directories when done # Purpose: Restores references, notes and styles @@ -14,8 +13,11 @@ # VARIABLES -references_backup="references" -notes_backup="xnotes.xml" -styles_directory="styles" -logfile="log_restore" +references_backup="references" # base of references backup file name +notes_backup="xnotes.xml" # notes backup file name +styles_directory="styles" # name of styles directory (intra-archive) +start_dir=`pwd` # directory in which utility is run +refdba="refdba" # refdba command +refdbc="refdbc" # refdbc command +archive=$1 # name of backup archive @@ -56,8 +58,14 @@ echo "`basename $0`: Restores RefDb data from backup." echo - echo "Usage: `basename $0` <backup_archive>" - echo echo "Restores references, notes and styles from backup archive." + echo + echo "Usage: `basename $0` [-u USER] [-w PWD] <backup_archive>" + echo echo "Must be archive created by 'refdb-backup' utility." + echo + echo "Options: -u USER = username for RefDB clients ('refdba'|'refdbc')" + echo " w PWD = password for RefDB clients ('refdba'|'refdbc')" + echo "Note: RefDB clients can be configured for automatic access." + echo " If this is so, username and password are not required." } # Determine name of reference database backup file @@ -94,87 +102,112 @@ # MAIN -# Check parameters -[ $# -ne 1 ] \ - && echo "Invalid parameters. Try '`basename $0` -h'." \ - && exit 1 -[ $# -eq 1 ] && case $1 in - -h | --help ) displayUsage ; exit 0;; -esac - -# Run tests on archive -# - must exist and be readable -[ -r $1 ] || endScript "Cannot read backup archive '$1'." "failed" -# - must be valid archive (this test is a bit crude - just list -# archive contents and check exit status) -tar -tzf $1 &> /dev/null -[ $? -ne 0 ] && endScript "'$1' is not a valid archive." "failed" +# Read the command line options +while getopts ":hu:w:" opt ; do + case ${opt} in + h ) displayUsage && exit 0;; + u ) refdba="${refdba} -u \"${OPTARG}\"" + refdbc="${refdbc} -u \"${OPTARG}\"";; + w ) refdba="${refdba} -w \"${OPTARG}\"" + refdbc="${refdbc} -w \"${OPTARG}\"";; + \? ) echo "Error: Invalid flag '${OPTARG}' detected" + echo "Usage: `basename $0` [ -f FORMAT ] [ -d DIR ]" + echo "Try '`basename $0` -h' for help" + echo -ne "\a" + exit 1;; + \: ) echo "Error: No argument supplied for flag '${OPTARG}'" + echo "Usage: `basename $0` [ -f FORMAT ] [ -d DIR ]" + echo "Try '`basename $0` -h' for help" + echo -ne "\a" + exit 1;; + esac +done +shift $(( ${OPTIND} - 1 )) # not really needed, but... + + +# Check for valid arguments +# - run tests on archive + # - first, convert relative to absolute filepath +[ "${archive:0:1}" != "/" ] && archive="${start_dir}/${archive}" + # - must exist and be readable +[ -r ${archive} ] || \ + endScript "Cannot read backup archive '${archive}'." "failed" + # - must be valid archive (this test is a bit crude - just list + # archive contents and check exit status) +tar -tzf ${archive} &> /dev/null || \ + endScript "'${archive}' is not a valid archive." "failed" + +# Test for RefDB access +${refdba} -C listdb &> /dev/null || \ + endScript "Error: Unable to access RefDB using client 'refdba'." "failed" +${refdbc} -C listdb &> /dev/null || \ + endScript "Error: Unable to access RefDB using client 'refdbc'." "failed" + +# Will use temporary directory for working +# - ensure deletion on exit and change to working directory +tempdir=`mktemp -dq` \ + || endScript "Error: Unable to create temporary directory." "failed" +trap "rm -fr ${tempdir}" 0 1 2 3 5 15 # no need to worry about deleting later +cd ${tempdir} || \ + endScript "Error: Unable to cd to temporary directory '${tempdir}'." \ + "failed" # Informational message echo "`basename $0` is running..." ; echo -# Record date/time of backup -echo "RefDB restore performed by '`basename $0`'." > ${logfile} -echo "Performed: `date '+%Y-%m-%d, %H:%M:%S'`." >> ${logfile} -echo "Backup archive: '$1'." >> ${logfile} -echo "--------------------------------------------------------" >> ${logfile} - # Cycle through databases in turn and restore references and notes -for dbdir in `tar -tzf $1 | grep "/$"` ; do +for dbdir in `tar -tzf ${archive} | grep "/$"` ; do # get db name if [ ${dbdir} != "styles/" ] ; then db=${dbdir##db_} # remove prefix db=${db%%/} # remove trailing slash - echo "Restoring database: ${db}" | tee -a ${logfile} + echo "Restoring database: ${db}" # restore references - reffile=`get_filename $1 ${db} ${references_backup}` - echo " Restore references" | tee -a ${logfile} + reffile=`get_filename ${archive} ${db} ${references_backup}` + echo " Restore references" # - extract file - echo -n " Extracting temporary file ... " | tee -a ${logfile} - echo "" >> ${logfile} - tar -xzf $1 ${reffile} >> ${logfile} + echo -n " Extracting temporary file ... " + tar -xzf ${archive} ${reffile} &> /dev/null report $? # - create database - echo -n " Create database ... " | tee -a ${logfile} - refdba -C createdb ${db} >> ${logfile} + echo -n " Create database ... " + refdba -C createdb ${db} &> /dev/null report $? # - add references - echo -n " Adding references ... " | tee -a ${logfile} + echo -n " Adding references ... " format=`get_format ${reffile}` - refdbc -C addref -d ${db} -t ${format} ${reffile} >> ${logfile} - report $? - # - delete file - echo -n " Deleting temporary file ... " | tee -a ${logfile} - rm -f ${reffile} + refdbc -C addref -d ${db} -t ${format} ${reffile} &> /dev/null report $? +# # - delete file +# echo -n " Deleting temporary file ... " +# rm -f ${reffile} +# report $? # restore notes notefile="db_${db}/${notes_backup}" - echo " Restore notes" | tee -a ${logfile} + echo " Restore notes" # - extract file - echo -n " Extracting temporary file ... " | tee -a ${logfile} - echo "" >> ${logfile} - tar -xzf $1 ${notefile} >> ${logfile} + echo -n " Extracting temporary file ... " + tar -xzf ${archive} ${notefile} &> /dev/null report $? # - add notes - echo -n " Adding notes ... " | tee -a ${logfile} - refdbc -C addnote -d ${db} ${notefile} >> ${logfile} - report $? - # - delete file - echo -n " Deleting temporary file ... " | tee -a ${logfile} - rm -f ${notefile} - report $? - # delete database directory - echo -n " Deleting temporary db directory ... " | tee -a ${logfile} - rmdir db_${db} + echo -n " Adding notes ... " + refdbc -C addnote -d ${db} ${notefile} &> /dev/null report $? +# # - delete file +# echo -n " Deleting temporary file ... " +# rm -f ${notefile} +# report $? +# # delete database directory +# echo -n " Deleting temporary db directory ... " +# rmdir db_${db} +# report $? fi done # Restore styles -echo "Restoring styles" | tee -a ${logfile} -for stylefile in `tar -tzf $1 | grep "^styles/[[:print:]]\+"` ; do +echo "Restoring styles" +for stylefile in `tar -tzf ${archive} | grep "^styles/[[:print:]]\+"` ; do # extract style file - echo -n " Extracting style: " | tee -a ${logfile} - echo "" >> ${logfile} - tar -xzf $1 ${stylefile} >> ${logfile} + echo -n " Extracting style: " + tar -xzf ${archive} ${stylefile} &> /dev/null if [ $? -eq 0 ] ; then # extract style name @@ -184,22 +217,14 @@ echo ${stylename} # add style - echo -n " Adding style ... " | tee -a ${logfile} - refdba -C addstyle ${stylefile} >> ${logfile} - report $? - echo -n " Deleting temporary file ... " | tee -a ${logfile} - rm -f ${stylefile} + echo -n " Adding style ... " + refdba -C addstyle ${stylefile} &> /dev/null report $? +# echo -n " Deleting temporary file ... " +# rm -f ${stylefile} +# report $? else report 1 fi done -# delete styles directory -echo -n " Deleting styles directory ... " | tee -a ${logfile} -rmdir styles -report $? - -# Now done -echo "--------------------------------------------------------" >> ${logfile} -echo "Written log file: ${logfile}." # Finished |
From: Markus H. <mho...@us...> - 2005-01-30 14:12:41
|
Update of /cvsroot/refdb/refdb/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25119 Added Files: Tag: Release_0_9_5_stable refdb-backup refdb-restore Log Message: moved over to stable branch --- NEW FILE --- #!/bin/sh # File: refdb-backup # Author: David Nebauer # History: 2004-11-28 Created # Purpose: Backups references, notes and styles # VARIABLES references_backup="references" notes_backup="xnotes.xml" styles_directory="styles" logfile="log_backup" archive="refdb_backup_`date '+%Y%m%d_%H%M'`.tar.gz" # PROCEDURES # Report success of operation report () { if [ $1 -eq 0 ] ; then if [ "$2" = "log" ] ; then echo "OK." | tee -a ${logfile} else echo "OK." fi else if [ "$2" = "log" ] ; then echo "Failed." | tee -a ${logfile} else echo "Failed." fi fi } # Report failure and abort endScript () { echo ; echo "$1" echo ; echo "refdb backup $2." echo "`basename $0` is finished." if [ "$2" = "succeeded" ] ; then # Single tone indicates success echo -ne "\a" exit 0 else # Double tone indicates failure echo -ne "\a" ; sleep 1s ; echo -ne "\a" exit 1 fi } # Show usage displayUsage () { echo "`basename $0`: Backs up RefDB data." echo echo "Usage: `basename $0`" echo echo "Backs up references, notes and styles from RefDB." echo "Must be run in an empty directory." } # MAIN # Check parameters [ $# -gt 1 ] \ && echo "Invalid parameters. Try '`basename $0` -h'." \ && exit 1 [ $# -eq 1 ] && case $1 in -h | --help ) displayUsage ; exit 0;; * ) echo "Invalid parameter. Try '`basename $0` -h'." ; exit 1;; esac # Must be run in empty directory if [ `ls | grep -v total | wc -l` -ne 0 ] ; then echo ; echo "This directory is not empty." echo "'`basename $0`' must be run from an empty directory." endScript "Aborted." "failed" fi # Informational message echo "`basename $0` is running..." ; echo # Select storage format old_PS3=${PS3} PS3="Select the storage format for references: " select format in "ris" "risx" ; do break ; done case ${format} in ris ) extension="ris";; risx ) extension="xml";; * ) endScript "No format selected." "failed";; esac echo ; echo "References storage format: ${format}." ; echo # Record date/time of backup echo "RefDB backup performed by '`basename $0`'." > ${logfile} echo "Performed: `date '+%Y-%m-%d, %H:%M:%S'`." >> ${logfile} echo "Storage format: ${format}." >> ${logfile} echo "--------------------------------------------------------" >> ${logfile} # Cycle through databases in turn and backup references and notes for db in `refdba -C listdb | cut --delimiter=' ' --fields=1` ; do echo "Processing database: ${db}" | tee -a ${logfile} dirname="db_${db}" echo -n " Creating subdirectory '${dirname}' ... " | tee -a ${logfile} mkdir ${dirname} &> /dev/null report $? log # dump references reffile="${dirname}/${references_backup}.${extension}" echo -n " Backing up references ... " | tee -a ${logfile} refdbc -C getref -d ${db} -t ${format} -o ${reffile} ":ID:>0" \ &> /dev/null report $? log # dump notes notefile="${dirname}/${notes_backup}" echo -n " Backing up notes ... " | tee -a ${logfile} refdbc -C getnote -d ${db} -t xnote -o ${notefile} ":NID:>0" \ &> /dev/null report $? log done # Cycle through styles in turn and back them up echo "Processing styles" | tee -a ${logfile} echo -n " Creating styles directory '${styles_directory}' ... " \ | tee -a ${logfile} mkdir ${styles_directory} &> /dev/null report $? log for style in `refdba -C liststyle` ; do echo -n " Backing up style: ${style} ... " | tee -a ${logfile} # remove terminal period from file name if present if [ `echo ${style} | grep "\.$" | wc -l` -eq 1 ] ; then stylefile=${style%*.} else stylefile=${style} fi stylefile="${styles_directory}/${stylefile}.xml" refdba -C getstyle -o ${stylefile} ${style} &> /dev/null report $? log done # Now done echo "--------------------------------------------------------" >> ${logfile} echo "Written log file: ${logfile}." # Zip files echo "Compressing to archive" echo -n " Writing archive ... " #find . -name '*' | zip ${archive} -@ &> /dev/null tar -czf ${archive} * report $? echo -n " Deleting backup files ... " for file in `ls -1 | sed -e 's/ \+/ /g' | cut -d ' ' -f 8 | grep -v '^$'` ; do [ `echo ${file} | grep "^refdb_backup" | wc -l` -ne 1 ] \ && [ `echo ${file} | grep "^${logfile}" | wc -l` -ne 1 ] \ && rm -fr ${file} &> /dev/null done echo "OK." # Finished echo ; echo "Backup archive: '${archive}'." endScript "Backup finished." "succeeded" --- NEW FILE --- #!/bin/sh # File: refdb-backup # Author: David Nebauer # History: 2004-11-28 Created # 2005-01-27 Delete directories when done # Purpose: Restores references, notes and styles # Parameter: 1 - backup archive # VARIABLES references_backup="references" notes_backup="xnotes.xml" styles_directory="styles" logfile="log_restore" # PROCEDURES # Report success of operation # params: 1 - exit status # return: nil report () { if [ $1 -eq 0 ] ; then echo "OK." | tee -a ${logfile} else echo "Failed." | tee -a ${logfile} fi } # Report failure and abort # params: 1 - exit message # 2 - success indicator ( 'succeeded'|* ) # retuns: nil endScript () { echo ; echo "$1" echo ; echo "refdb restore $2." echo "`basename $0` is finished." if [ "$2" = "succeeded" ] ; then # Single tone indicates success echo -ne "\a" exit 0 else # Double tone indicates failure echo -ne "\a" ; sleep 1s ; echo -ne "\a" exit 1 fi } # Show usage # params: nil # return: nil displayUsage () { echo "`basename $0`: Restores RefDb data from backup." echo echo "Usage: `basename $0` <backup_archive>" echo echo "Restores references, notes and styles from backup archive." echo "Must be archive created by 'refdb-backup' utility." } # Determine name of reference database backup file # params: 1 - archive name # 2 - database name # 3 - backup file basename # return: filename ('db_DBNAME/BACKUPFILE.EXTENSION') get_filename () { archive=$1 db=$2 base=$3 filelist=`tar -tzf $1 | grep -v "/$" | grep "^db_"` [ `echo "${filelist}" | grep "^db_${db}/${references_backup}.xml"` ] \ && extension="xml" [ `echo "${filelist}" | grep "^db_${db}/${references_backup}.ris"` ] \ && extension="ris" echo "db_${db}/${references_backup}.${extension}" } # Determines format of backup reference file # params: 1 - backup filepath # return: format ('ris'|'risx') get_format () { filepath=$1 filename=${filepath##*/} # strip path extension=${filename##*.} # strip basename case ${extension} in ris ) echo "ris";; xml ) echo "risx";; * ) echo "ERROR";; esac } # MAIN # Check parameters [ $# -ne 1 ] \ && echo "Invalid parameters. Try '`basename $0` -h'." \ && exit 1 [ $# -eq 1 ] && case $1 in -h | --help ) displayUsage ; exit 0;; esac # Run tests on archive # - must exist and be readable [ -r $1 ] || endScript "Cannot read backup archive '$1'." "failed" # - must be valid archive (this test is a bit crude - just list # archive contents and check exit status) tar -tzf $1 &> /dev/null [ $? -ne 0 ] && endScript "'$1' is not a valid archive." "failed" # Informational message echo "`basename $0` is running..." ; echo # Record date/time of backup echo "RefDB restore performed by '`basename $0`'." > ${logfile} echo "Performed: `date '+%Y-%m-%d, %H:%M:%S'`." >> ${logfile} echo "Backup archive: '$1'." >> ${logfile} echo "--------------------------------------------------------" >> ${logfile} # Cycle through databases in turn and restore references and notes for dbdir in `tar -tzf $1 | grep "/$"` ; do # get db name if [ ${dbdir} != "styles/" ] ; then db=${dbdir##db_} # remove prefix db=${db%%/} # remove trailing slash echo "Restoring database: ${db}" | tee -a ${logfile} # restore references reffile=`get_filename $1 ${db} ${references_backup}` echo " Restore references" | tee -a ${logfile} # - extract file echo -n " Extracting temporary file ... " | tee -a ${logfile} echo "" >> ${logfile} tar -xzf $1 ${reffile} >> ${logfile} report $? # - create database echo -n " Create database ... " | tee -a ${logfile} refdba -C createdb ${db} >> ${logfile} report $? # - add references echo -n " Adding references ... " | tee -a ${logfile} format=`get_format ${reffile}` refdbc -C addref -d ${db} -t ${format} ${reffile} >> ${logfile} report $? # - delete file echo -n " Deleting temporary file ... " | tee -a ${logfile} rm -f ${reffile} report $? # restore notes notefile="db_${db}/${notes_backup}" echo " Restore notes" | tee -a ${logfile} # - extract file echo -n " Extracting temporary file ... " | tee -a ${logfile} echo "" >> ${logfile} tar -xzf $1 ${notefile} >> ${logfile} report $? # - add notes echo -n " Adding notes ... " | tee -a ${logfile} refdbc -C addnote -d ${db} ${notefile} >> ${logfile} report $? # - delete file echo -n " Deleting temporary file ... " | tee -a ${logfile} rm -f ${notefile} report $? # delete database directory echo -n " Deleting temporary db directory ... " | tee -a ${logfile} rmdir db_${db} report $? fi done # Restore styles echo "Restoring styles" | tee -a ${logfile} for stylefile in `tar -tzf $1 | grep "^styles/[[:print:]]\+"` ; do # extract style file echo -n " Extracting style: " | tee -a ${logfile} echo "" >> ${logfile} tar -xzf $1 ${stylefile} >> ${logfile} if [ $? -eq 0 ] ; then # extract style name stylename=`grep "^[[:print:]]*<STYLENAME>" ${stylefile}` stylename=${stylename#[[:print:]]*<STYLENAME>} stylename=${stylename%<\/STYLENAME>} echo ${stylename} # add style echo -n " Adding style ... " | tee -a ${logfile} refdba -C addstyle ${stylefile} >> ${logfile} report $? echo -n " Deleting temporary file ... " | tee -a ${logfile} rm -f ${stylefile} report $? else report 1 fi done # delete styles directory echo -n " Deleting styles directory ... " | tee -a ${logfile} rmdir styles report $? # Now done echo "--------------------------------------------------------" >> ${logfile} echo "Written log file: ${logfile}." # Finished endScript "Restore finished." "succeeded" |
From: David N. <dav...@us...> - 2005-01-30 13:39:43
|
Update of /cvsroot/refdb/refdb/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17912 Modified Files: refdb-backup refdb-restore Log Message: Changed archive format from 'zip' to 'tar.gz'. Index: refdb-backup =================================================================== RCS file: /cvsroot/refdb/refdb/scripts/refdb-backup,v retrieving revision 1.2 retrieving revision 1.3 diff -u -U2 -r1.2 -r1.3 --- refdb-backup 30 Jan 2005 10:31:25 -0000 1.2 +++ refdb-backup 30 Jan 2005 13:39:34 -0000 1.3 @@ -14,6 +14,6 @@ notes_backup="xnotes.xml" styles_directory="styles" -logfile="log" -zipfile="refdb_backup_`date '+%Y%m%d_%H%M'`" +logfile="log_backup" +archive="refdb_backup_`date '+%Y%m%d_%H%M'`.tar.gz" @@ -92,4 +92,5 @@ * ) endScript "No format selected." "failed";; esac +echo ; echo "References storage format: ${format}." ; echo # Record date/time of backup @@ -146,5 +147,6 @@ echo "Compressing to archive" echo -n " Writing archive ... " -find . -name '*' | zip ${zipfile} -@ &> /dev/null +#find . -name '*' | zip ${archive} -@ &> /dev/null +tar -czf ${archive} * report $? echo -n " Deleting backup files ... " @@ -157,4 +159,4 @@ # Finished -echo ; echo "Backup archive: '${zipfile}.zip'." +echo ; echo "Backup archive: '${archive}'." endScript "Backup finished." "succeeded" Index: refdb-restore =================================================================== RCS file: /cvsroot/refdb/refdb/scripts/refdb-restore,v retrieving revision 1.2 retrieving revision 1.3 diff -u -U2 -r1.2 -r1.3 --- refdb-restore 30 Jan 2005 10:31:25 -0000 1.2 +++ refdb-restore 30 Jan 2005 13:39:34 -0000 1.3 @@ -17,5 +17,5 @@ notes_backup="xnotes.xml" styles_directory="styles" -logfile="log" +logfile="log_restore" @@ -70,5 +70,5 @@ db=$2 base=$3 - filelist=`unzip -l $1 | sed -e 's/ \+/ /g' | cut -d ' ' -f 5 | grep -v '^$' | sed -e '1,2d' | grep -v "/$" | grep "^db_"` + filelist=`tar -tzf $1 | grep -v "/$" | grep "^db_"` [ `echo "${filelist}" | grep "^db_${db}/${references_backup}.xml"` ] \ && extension="xml" @@ -105,7 +105,8 @@ # - must exist and be readable [ -r $1 ] || endScript "Cannot read backup archive '$1'." "failed" -# - must be valid archive -unzip -t $1 &> /dev/null -[ $? -ne 0 ] && endScript "'$1' is not a valid zip archive." "failed" +# - must be valid archive (this test is a bit crude - just list +# archive contents and check exit status) +tar -tzf $1 &> /dev/null +[ $? -ne 0 ] && endScript "'$1' is not a valid archive." "failed" # Informational message @@ -119,5 +120,5 @@ # Cycle through databases in turn and restore references and notes -for dbdir in `unzip -l $1 | sed -e 's/ \+/ /g' | cut -d ' ' -f 5 | grep -v '^$' | sed -e '1,2d' | grep "/$"` ; do +for dbdir in `tar -tzf $1 | grep "/$"` ; do # get db name if [ ${dbdir} != "styles/" ] ; then @@ -126,5 +127,4 @@ echo "Restoring database: ${db}" | tee -a ${logfile} # restore references - #reffile="db_${db}/${references_backup}" reffile=`get_filename $1 ${db} ${references_backup}` echo " Restore references" | tee -a ${logfile} @@ -132,5 +132,5 @@ echo -n " Extracting temporary file ... " | tee -a ${logfile} echo "" >> ${logfile} - unzip $1 ${reffile} >> ${logfile} + tar -xzf $1 ${reffile} >> ${logfile} report $? # - create database @@ -153,5 +153,5 @@ echo -n " Extracting temporary file ... " | tee -a ${logfile} echo "" >> ${logfile} - unzip $1 ${notefile} >> ${logfile} + tar -xzf $1 ${notefile} >> ${logfile} report $? # - add notes @@ -172,9 +172,9 @@ # Restore styles echo "Restoring styles" | tee -a ${logfile} -for stylefile in `unzip -l $1 | sed -e 's/ \+/ /g' | cut -d ' ' -f 5 | grep -v '^$' | sed -e '1,2d' | grep "^styles/[[:print:]]\+"` ; do +for stylefile in `tar -tzf $1 | grep "^styles/[[:print:]]\+"` ; do # extract style file echo -n " Extracting style: " | tee -a ${logfile} echo "" >> ${logfile} - unzip $1 ${stylefile} >> ${logfile} + tar -xzf $1 ${stylefile} >> ${logfile} if [ $? -eq 0 ] ; then # extract style name |
From: David N. <dav...@us...> - 2005-01-30 10:31:40
|
Update of /cvsroot/refdb/refdb/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5893 Modified Files: refdb-backup refdb-restore Log Message: Backup script now gives choice of 'ris' or 'risx' backup formats. Restore script detects format and handles accordingly. Log file no longer deleted after backup. Index: refdb-backup =================================================================== RCS file: /cvsroot/refdb/refdb/scripts/refdb-backup,v retrieving revision 1.1 retrieving revision 1.2 diff -u -U2 -r1.1 -r1.2 --- refdb-backup 30 Jan 2005 01:09:09 -0000 1.1 +++ refdb-backup 30 Jan 2005 10:31:25 -0000 1.2 @@ -11,5 +11,5 @@ # VARIABLES -references_backup="references.ris" +references_backup="references" notes_backup="xnotes.xml" styles_directory="styles" @@ -83,7 +83,18 @@ echo "`basename $0` is running..." ; echo +# Select storage format +old_PS3=${PS3} +PS3="Select the storage format for references: " +select format in "ris" "risx" ; do break ; done +case ${format} in + ris ) extension="ris";; + risx ) extension="xml";; + * ) endScript "No format selected." "failed";; +esac + # Record date/time of backup echo "RefDB backup performed by '`basename $0`'." > ${logfile} echo "Performed: `date '+%Y-%m-%d, %H:%M:%S'`." >> ${logfile} +echo "Storage format: ${format}." >> ${logfile} echo "--------------------------------------------------------" >> ${logfile} @@ -96,7 +107,8 @@ report $? log # dump references - reffile="${dirname}/${references_backup}" + reffile="${dirname}/${references_backup}.${extension}" echo -n " Backing up references ... " | tee -a ${logfile} - refdbc -C getref -d ${db} -t ris -o ${reffile} ":ID:>0" &> /dev/null + refdbc -C getref -d ${db} -t ${format} -o ${reffile} ":ID:>0" \ + &> /dev/null report $? log # dump notes @@ -139,5 +151,6 @@ for file in `ls -1 | sed -e 's/ \+/ /g' | cut -d ' ' -f 8 | grep -v '^$'` ; do [ `echo ${file} | grep "^refdb_backup" | wc -l` -ne 1 ] \ - && rm -fr ${file} &> /dev/null + && [ `echo ${file} | grep "^${logfile}" | wc -l` -ne 1 ] \ + && rm -fr ${file} &> /dev/null done echo "OK." Index: refdb-restore =================================================================== RCS file: /cvsroot/refdb/refdb/scripts/refdb-restore,v retrieving revision 1.1 retrieving revision 1.2 diff -u -U2 -r1.1 -r1.2 --- refdb-restore 30 Jan 2005 01:09:09 -0000 1.1 +++ refdb-restore 30 Jan 2005 10:31:25 -0000 1.2 @@ -14,5 +14,5 @@ # VARIABLES -references_backup="references.ris" +references_backup="references" notes_backup="xnotes.xml" styles_directory="styles" @@ -23,4 +23,6 @@ # Report success of operation +# params: 1 - exit status +# return: nil report () { if [ $1 -eq 0 ] ; then @@ -31,4 +33,7 @@ } # Report failure and abort +# params: 1 - exit message +# 2 - success indicator ( 'succeeded'|* ) +# retuns: nil endScript () { echo ; echo "$1" @@ -46,4 +51,6 @@ } # Show usage +# params: nil +# return: nil displayUsage () { echo "`basename $0`: Restores RefDb data from backup." @@ -54,4 +61,33 @@ echo "Must be archive created by 'refdb-backup' utility." } +# Determine name of reference database backup file +# params: 1 - archive name +# 2 - database name +# 3 - backup file basename +# return: filename ('db_DBNAME/BACKUPFILE.EXTENSION') +get_filename () { + archive=$1 + db=$2 + base=$3 + filelist=`unzip -l $1 | sed -e 's/ \+/ /g' | cut -d ' ' -f 5 | grep -v '^$' | sed -e '1,2d' | grep -v "/$" | grep "^db_"` + [ `echo "${filelist}" | grep "^db_${db}/${references_backup}.xml"` ] \ + && extension="xml" + [ `echo "${filelist}" | grep "^db_${db}/${references_backup}.ris"` ] \ + && extension="ris" + echo "db_${db}/${references_backup}.${extension}" +} +# Determines format of backup reference file +# params: 1 - backup filepath +# return: format ('ris'|'risx') +get_format () { + filepath=$1 + filename=${filepath##*/} # strip path + extension=${filename##*.} # strip basename + case ${extension} in + ris ) echo "ris";; + xml ) echo "risx";; + * ) echo "ERROR";; + esac +} @@ -90,5 +126,6 @@ echo "Restoring database: ${db}" | tee -a ${logfile} # restore references - reffile="db_${db}/${references_backup}" + #reffile="db_${db}/${references_backup}" + reffile=`get_filename $1 ${db} ${references_backup}` echo " Restore references" | tee -a ${logfile} # - extract file @@ -103,5 +140,6 @@ # - add references echo -n " Adding references ... " | tee -a ${logfile} - refdbc -C addref -d ${db} -t ris ${reffile} >> ${logfile} + format=`get_format ${reffile}` + refdbc -C addref -d ${db} -t ${format} ${reffile} >> ${logfile} report $? # - delete file |
From: David N. <dav...@us...> - 2005-01-30 01:09:17
|
Update of /cvsroot/refdb/refdb/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29129 Added Files: refdb-backup refdb-restore Log Message: Initial checkin of scripts 'refdb-backup' and 'refdb-restore'. --- NEW FILE --- #!/bin/sh # File: refdb-backup # Author: David Nebauer # History: 2004-11-28 Created # Purpose: Backups references, notes and styles # VARIABLES references_backup="references.ris" notes_backup="xnotes.xml" styles_directory="styles" logfile="log" zipfile="refdb_backup_`date '+%Y%m%d_%H%M'`" # PROCEDURES # Report success of operation report () { if [ $1 -eq 0 ] ; then if [ "$2" = "log" ] ; then echo "OK." | tee -a ${logfile} else echo "OK." fi else if [ "$2" = "log" ] ; then echo "Failed." | tee -a ${logfile} else echo "Failed." fi fi } # Report failure and abort endScript () { echo ; echo "$1" echo ; echo "refdb backup $2." echo "`basename $0` is finished." if [ "$2" = "succeeded" ] ; then # Single tone indicates success echo -ne "\a" exit 0 else # Double tone indicates failure echo -ne "\a" ; sleep 1s ; echo -ne "\a" exit 1 fi } # Show usage displayUsage () { echo "`basename $0`: Backs up RefDB data." echo echo "Usage: `basename $0`" echo echo "Backs up references, notes and styles from RefDB." echo "Must be run in an empty directory." } # MAIN # Check parameters [ $# -gt 1 ] \ && echo "Invalid parameters. Try '`basename $0` -h'." \ && exit 1 [ $# -eq 1 ] && case $1 in -h | --help ) displayUsage ; exit 0;; * ) echo "Invalid parameter. Try '`basename $0` -h'." ; exit 1;; esac # Must be run in empty directory if [ `ls | grep -v total | wc -l` -ne 0 ] ; then echo ; echo "This directory is not empty." echo "'`basename $0`' must be run from an empty directory." endScript "Aborted." "failed" fi # Informational message echo "`basename $0` is running..." ; echo # Record date/time of backup echo "RefDB backup performed by '`basename $0`'." > ${logfile} echo "Performed: `date '+%Y-%m-%d, %H:%M:%S'`." >> ${logfile} echo "--------------------------------------------------------" >> ${logfile} # Cycle through databases in turn and backup references and notes for db in `refdba -C listdb | cut --delimiter=' ' --fields=1` ; do echo "Processing database: ${db}" | tee -a ${logfile} dirname="db_${db}" echo -n " Creating subdirectory '${dirname}' ... " | tee -a ${logfile} mkdir ${dirname} &> /dev/null report $? log # dump references reffile="${dirname}/${references_backup}" echo -n " Backing up references ... " | tee -a ${logfile} refdbc -C getref -d ${db} -t ris -o ${reffile} ":ID:>0" &> /dev/null report $? log # dump notes notefile="${dirname}/${notes_backup}" echo -n " Backing up notes ... " | tee -a ${logfile} refdbc -C getnote -d ${db} -t xnote -o ${notefile} ":NID:>0" \ &> /dev/null report $? log done # Cycle through styles in turn and back them up echo "Processing styles" | tee -a ${logfile} echo -n " Creating styles directory '${styles_directory}' ... " \ | tee -a ${logfile} mkdir ${styles_directory} &> /dev/null report $? log for style in `refdba -C liststyle` ; do echo -n " Backing up style: ${style} ... " | tee -a ${logfile} # remove terminal period from file name if present if [ `echo ${style} | grep "\.$" | wc -l` -eq 1 ] ; then stylefile=${style%*.} else stylefile=${style} fi stylefile="${styles_directory}/${stylefile}.xml" refdba -C getstyle -o ${stylefile} ${style} &> /dev/null report $? log done # Now done echo "--------------------------------------------------------" >> ${logfile} echo "Written log file: ${logfile}." # Zip files echo "Compressing to archive" echo -n " Writing archive ... " find . -name '*' | zip ${zipfile} -@ &> /dev/null report $? echo -n " Deleting backup files ... " for file in `ls -1 | sed -e 's/ \+/ /g' | cut -d ' ' -f 8 | grep -v '^$'` ; do [ `echo ${file} | grep "^refdb_backup" | wc -l` -ne 1 ] \ && rm -fr ${file} &> /dev/null done echo "OK." # Finished echo ; echo "Backup archive: '${zipfile}.zip'." endScript "Backup finished." "succeeded" --- NEW FILE --- #!/bin/sh # File: refdb-backup # Author: David Nebauer # History: 2004-11-28 Created # 2005-01-27 Delete directories when done # Purpose: Restores references, notes and styles # Parameter: 1 - backup archive # VARIABLES references_backup="references.ris" notes_backup="xnotes.xml" styles_directory="styles" logfile="log" # PROCEDURES # Report success of operation report () { if [ $1 -eq 0 ] ; then echo "OK." | tee -a ${logfile} else echo "Failed." | tee -a ${logfile} fi } # Report failure and abort endScript () { echo ; echo "$1" echo ; echo "refdb restore $2." echo "`basename $0` is finished." if [ "$2" = "succeeded" ] ; then # Single tone indicates success echo -ne "\a" exit 0 else # Double tone indicates failure echo -ne "\a" ; sleep 1s ; echo -ne "\a" exit 1 fi } # Show usage displayUsage () { echo "`basename $0`: Restores RefDb data from backup." echo echo "Usage: `basename $0` <backup_archive>" echo echo "Restores references, notes and styles from backup archive." echo "Must be archive created by 'refdb-backup' utility." } # MAIN # Check parameters [ $# -ne 1 ] \ && echo "Invalid parameters. Try '`basename $0` -h'." \ && exit 1 [ $# -eq 1 ] && case $1 in -h | --help ) displayUsage ; exit 0;; esac # Run tests on archive # - must exist and be readable [ -r $1 ] || endScript "Cannot read backup archive '$1'." "failed" # - must be valid archive unzip -t $1 &> /dev/null [ $? -ne 0 ] && endScript "'$1' is not a valid zip archive." "failed" # Informational message echo "`basename $0` is running..." ; echo # Record date/time of backup echo "RefDB restore performed by '`basename $0`'." > ${logfile} echo "Performed: `date '+%Y-%m-%d, %H:%M:%S'`." >> ${logfile} echo "Backup archive: '$1'." >> ${logfile} echo "--------------------------------------------------------" >> ${logfile} # Cycle through databases in turn and restore references and notes for dbdir in `unzip -l $1 | sed -e 's/ \+/ /g' | cut -d ' ' -f 5 | grep -v '^$' | sed -e '1,2d' | grep "/$"` ; do # get db name if [ ${dbdir} != "styles/" ] ; then db=${dbdir##db_} # remove prefix db=${db%%/} # remove trailing slash echo "Restoring database: ${db}" | tee -a ${logfile} # restore references reffile="db_${db}/${references_backup}" echo " Restore references" | tee -a ${logfile} # - extract file echo -n " Extracting temporary file ... " | tee -a ${logfile} echo "" >> ${logfile} unzip $1 ${reffile} >> ${logfile} report $? # - create database echo -n " Create database ... " | tee -a ${logfile} refdba -C createdb ${db} >> ${logfile} report $? # - add references echo -n " Adding references ... " | tee -a ${logfile} refdbc -C addref -d ${db} -t ris ${reffile} >> ${logfile} report $? # - delete file echo -n " Deleting temporary file ... " | tee -a ${logfile} rm -f ${reffile} report $? # restore notes notefile="db_${db}/${notes_backup}" echo " Restore notes" | tee -a ${logfile} # - extract file echo -n " Extracting temporary file ... " | tee -a ${logfile} echo "" >> ${logfile} unzip $1 ${notefile} >> ${logfile} report $? # - add notes echo -n " Adding notes ... " | tee -a ${logfile} refdbc -C addnote -d ${db} ${notefile} >> ${logfile} report $? # - delete file echo -n " Deleting temporary file ... " | tee -a ${logfile} rm -f ${notefile} report $? # delete database directory echo -n " Deleting temporary db directory ... " | tee -a ${logfile} rmdir db_${db} report $? fi done # Restore styles echo "Restoring styles" | tee -a ${logfile} for stylefile in `unzip -l $1 | sed -e 's/ \+/ /g' | cut -d ' ' -f 5 | grep -v '^$' | sed -e '1,2d' | grep "^styles/[[:print:]]\+"` ; do # extract style file echo -n " Extracting style: " | tee -a ${logfile} echo "" >> ${logfile} unzip $1 ${stylefile} >> ${logfile} if [ $? -eq 0 ] ; then # extract style name stylename=`grep "^[[:print:]]*<STYLENAME>" ${stylefile}` stylename=${stylename#[[:print:]]*<STYLENAME>} stylename=${stylename%<\/STYLENAME>} echo ${stylename} # add style echo -n " Adding style ... " | tee -a ${logfile} refdba -C addstyle ${stylefile} >> ${logfile} report $? echo -n " Deleting temporary file ... " | tee -a ${logfile} rm -f ${stylefile} report $? else report 1 fi done # delete styles directory echo -n " Deleting styles directory ... " | tee -a ${logfile} rmdir styles report $? # Now done echo "--------------------------------------------------------" >> ${logfile} echo "Written log file: ${logfile}." # Finished endScript "Restore finished." "succeeded" |
From: Markus H. <mho...@us...> - 2005-01-29 21:36:02
|
Update of /cvsroot/refdb/refdb/styles In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17571/styles Modified Files: Tag: Release_0_9_5_stable bibtex-abbrev.xml bibtex-full.xml Log Message: updated for new DTD version Index: bibtex-abbrev.xml =================================================================== RCS file: /cvsroot/refdb/refdb/styles/bibtex-abbrev.xml,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -u -U2 -r1.3 -r1.3.2.1 --- bibtex-abbrev.xml 6 Jan 2004 21:49:40 -0000 1.3 +++ bibtex-abbrev.xml 29 Jan 2005 21:35:54 -0000 1.3.2.1 @@ -1,24 +1,27 @@ <?xml version="1.0"?> -<!DOCTYPE CITESTYLE PUBLIC "-//Markus Hoenicka//DTD CiteStyle V1.0//EN" - "http://refdb.sourceforge.net/dtd/citestylex-1.0/citestylex.dtd"> -<CITESTYLE> - <STYLENAME>bibtex-abbrev</STYLENAME> - <!-- $Id$ --> - <REFSTYLE> - <PUBTYPE TYPE="GEN"> - <JOURNALNAME CASE="ASIS" DEFAULTTEXT="ABBREV" ALTERNATETEXT="AFULL" - PUNCTUATION="SPACE"> - </JOURNALNAME> - </PUBTYPE> - </REFSTYLE> - <CITSTYLE INTEXTSEQUENCE="ASIS" BIBLIOSEQUENCE="BASIS"> - <PRECEEDING>(</PRECEEDING> - <FOLLOWING>)</FOLLOWING> - <CITSEPARATOR>; </CITSEPARATOR> - <RANGESEPARATOR>-</RANGESEPARATOR> - <BIBLIOTITLE>Reference List</BIBLIOTITLE> - <INTEXTDEF> - <REFNUMBER></REFNUMBER> - </INTEXTDEF> - </CITSTYLE> -</CITESTYLE> +<!DOCTYPE STYLESET PUBLIC "-//Markus Hoenicka//DTD CiteStyle V1.3//EN" "http://refdb.sourceforge.net/dtd/citestylex-1.3/citestylex.dtd"> +<STYLESET> + <CITESTYLE> + <STYLENAME>bibtex-abbrev</STYLENAME> + <!-- $Id$ --> + <REFSTYLE> + <PUBTYPE TYPE="GEN"> + <JOURNALNAME CASE="ASIS" DEFAULTTEXT="ABBREV" ALTERNATETEXT="AFULL" + PUNCTUATION="SPACE"> + </JOURNALNAME> + </PUBTYPE> + </REFSTYLE> + <CITSTYLE INTEXTSEQUENCE="ASIS"> + <PRECEEDING>(</PRECEEDING> + <FOLLOWING>)</FOLLOWING> + <CITSEPARATOR>; </CITSEPARATOR> + <RANGESEPARATOR>-</RANGESEPARATOR> + <INTEXTDEF> + <REFNUMBER></REFNUMBER> + </INTEXTDEF> + </CITSTYLE> + <BIBSTYLE BIBLIOSEQUENCE="BASIS"> + <BIBLIOTITLE>Reference List</BIBLIOTITLE> + </BIBSTYLE> + </CITESTYLE> +</STYLESET> Index: bibtex-full.xml =================================================================== RCS file: /cvsroot/refdb/refdb/styles/bibtex-full.xml,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -u -U2 -r1.3 -r1.3.2.1 --- bibtex-full.xml 6 Jan 2004 21:49:40 -0000 1.3 +++ bibtex-full.xml 29 Jan 2005 21:35:54 -0000 1.3.2.1 @@ -1,24 +1,27 @@ <?xml version="1.0"?> -<!DOCTYPE CITESTYLE PUBLIC "-//Markus Hoenicka//DTD CiteStyle V1.0//EN" - "http://refdb.sourceforge.net/dtd/citestylex-1.0/citestylex.dtd"> -<CITESTYLE> - <STYLENAME>bibtex-full</STYLENAME> - <!-- $Id$ --> - <REFSTYLE> - <PUBTYPE TYPE="GEN"> - <JOURNALNAME CASE="ASIS" DEFAULTTEXT="FULL" ALTERNATETEXT="AABBREV" - PUNCTUATION="SPACE"> - </JOURNALNAME> - </PUBTYPE> - </REFSTYLE> - <CITSTYLE INTEXTSEQUENCE="ASIS" BIBLIOSEQUENCE="BASIS"> - <PRECEEDING>(</PRECEEDING> - <FOLLOWING>)</FOLLOWING> - <CITSEPARATOR>; </CITSEPARATOR> - <RANGESEPARATOR>-</RANGESEPARATOR> - <BIBLIOTITLE>Reference List</BIBLIOTITLE> - <INTEXTDEF> - <REFNUMBER></REFNUMBER> - </INTEXTDEF> - </CITSTYLE> -</CITESTYLE> +<!DOCTYPE STYLESET PUBLIC "-//Markus Hoenicka//DTD CiteStyle V1.3//EN" "http://refdb.sourceforge.net/dtd/citestylex-1.3/citestylex.dtd"> +<STYLESET> + <CITESTYLE> + <STYLENAME>bibtex-full</STYLENAME> + <!-- $Id$ --> + <REFSTYLE> + <PUBTYPE TYPE="GEN"> + <JOURNALNAME CASE="ASIS" DEFAULTTEXT="FULL" ALTERNATETEXT="AABBREV" + PUNCTUATION="SPACE"> + </JOURNALNAME> + </PUBTYPE> + </REFSTYLE> + <CITSTYLE INTEXTSEQUENCE="ASIS"> + <PRECEEDING>(</PRECEEDING> + <FOLLOWING>)</FOLLOWING> + <CITSEPARATOR>; </CITSEPARATOR> + <RANGESEPARATOR>-</RANGESEPARATOR> + <INTEXTDEF> + <REFNUMBER></REFNUMBER> + </INTEXTDEF> + </CITSTYLE> + <BIBSTYLE BIBLIOSEQUENCE="BASIS"> + <BIBLIOTITLE>Reference List</BIBLIOTITLE> + </BIBSTYLE> + </CITESTYLE> +</STYLESET> |
From: Markus H. <mho...@us...> - 2005-01-29 21:35:29
|
Update of /cvsroot/refdb/refdb/styles In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17510/styles Modified Files: Tag: Release_0_9_5_stable Makefile.am Log Message: added schemas.xml file Index: Makefile.am =================================================================== RCS file: /cvsroot/refdb/refdb/styles/Makefile.am,v retrieving revision 1.4 retrieving revision 1.4.4.1 diff -u -U2 -r1.4 -r1.4.4.1 --- Makefile.am 19 Jun 2002 19:44:30 -0000 1.4 +++ Makefile.am 29 Jan 2005 21:35:20 -0000 1.4.4.1 @@ -1,11 +1,22 @@ ## Process this file with automake to produce Makefile.in -objects = Eur.J.Pharmacol.xml J.Biol.Chem.xml bibtex-abbrev.xml bibtex-full.xml +installobjects = Eur.J.Pharmacol.xml J.Biol.Chem.xml bibtex-abbrev.xml bibtex-full.xml schemas.xml + +objects = Eur.J.Pharmacol.xml J.Biol.Chem.xml bibtex-abbrev.xml bibtex-full.xml schemas.xml.in +noinst_DATA = schemas.xml EXTRA_DIST = $(objects) +MOSTLYCLEANFILES=schemas.xml + +all: $(installobjects) + +schemas.xml: schemas.xml.in + sed 's%<refdblib>%$(pkgdatadir)%' < $(srcdir)/schemas.xml.in > schemas.xml + install-data-local: $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/styles - @for f in $(objects); do \ + @for f in $(installobjects); do \ $(INSTALL_DATA) $(srcdir)/$$f $(DESTDIR)$(pkgdatadir)/styles/$$f; \ done + |
From: Markus H. <mho...@us...> - 2005-01-29 21:34:10
|
Update of /cvsroot/refdb/refdb/styles In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17270/styles Modified Files: Tag: Release_0_9_5_stable Eur.J.Pharmacol.xml J.Biol.Chem.xml Log Message: updated to work with nxml mode Index: Eur.J.Pharmacol.xml =================================================================== RCS file: /cvsroot/refdb/refdb/styles/Eur.J.Pharmacol.xml,v retrieving revision 1.7.2.1 retrieving revision 1.7.2.2 diff -u -U2 -r1.7.2.1 -r1.7.2.2 --- Eur.J.Pharmacol.xml 8 Sep 2004 20:35:32 -0000 1.7.2.1 +++ Eur.J.Pharmacol.xml 29 Jan 2005 21:33:52 -0000 1.7.2.2 @@ -1,507 +1,509 @@ <?xml version="1.0"?> <!DOCTYPE CITESTYLE PUBLIC "-//Markus Hoenicka//DTD CiteStyle V1.3//EN" "http://refdb.sourceforge.net/dtd/citestylex-1.3/citestylex.dtd"> -<CITESTYLE> - <STYLENAME>Eur.J.Pharmacol.</STYLENAME> - <!-- $Id$ --> - <REFSTYLE> - - <!-- GEN **************************************************************--> - - <PUBTYPE TYPE="GEN"> - <AUTHORLIST ROLE="PRIMARY"> [...982 lines suppressed...] + <BIBLIOTITLE>Reference List</BIBLIOTITLE> + <MONTHS> + <JAN FULL="January" ABBREV="Jan." THREELET="Jan"/> + <FEB FULL="February" ABBREV="Feb." THREELET="Feb"/> + <MAR FULL="March" ABBREV="Mar." THREELET="Mar"/> + <APR FULL="April" ABBREV="Apr." THREELET="Apr"/> + <MAY FULL="May" ABBREV="May" THREELET="May"/> + <JUN FULL="June" ABBREV="Jun." THREELET="Jun"/> + <JUL FULL="July" ABBREV="Jul." THREELET="Jul"/> + <AUG FULL="August" ABBREV="Aug." THREELET="Aug"/> + <SEP FULL="September" ABBREV="Sep." THREELET="Sep"/> + <OCT FULL="October" ABBREV="Oct." THREELET="Oct"/> + <NOV FULL="November" ABBREV="Nov." THREELET="Nov"/> + <DEC FULL="December" ABBREV="Dec." THREELET="Dec"/> + </MONTHS> + </BIBSTYLE> -</CITESTYLE> + </CITESTYLE> +</STYLESET> Index: J.Biol.Chem.xml =================================================================== RCS file: /cvsroot/refdb/refdb/styles/J.Biol.Chem.xml,v retrieving revision 1.8.2.1 retrieving revision 1.8.2.2 diff -u -U2 -r1.8.2.1 -r1.8.2.2 --- J.Biol.Chem.xml 8 Sep 2004 20:35:32 -0000 1.8.2.1 +++ J.Biol.Chem.xml 29 Jan 2005 21:33:52 -0000 1.8.2.2 @@ -1,501 +1,500 @@ <?xml version="1.0"?> <!DOCTYPE CITESTYLE PUBLIC "-//Markus Hoenicka//DTD CiteStyle V1.3//EN" "http://refdb.sourceforge.net/dtd/citestylex-1.3/citestylex.dtd"> -<CITESTYLE> - <STYLENAME>J.Biol.Chem.</STYLENAME> - <!-- $Id$ --> - <REFSTYLE> - - <!-- GEN **************************************************************--> - <PUBTYPE TYPE="GEN"> - <REFNUMBER> - <FOLLOWING>. </FOLLOWING> [...966 lines suppressed...] + <BIBSTYLE BIBLIOSEQUENCE="BASIS" BIBLIOBLOCKINDENT="1cm"> + <BIBLIOTITLE>Reference List</BIBLIOTITLE> + <MONTHS> + <JAN FULL="January" ABBREV="Jan." THREELET="Jan"/> + <FEB FULL="February" ABBREV="Feb." THREELET="Feb"/> + <MAR FULL="March" ABBREV="Mar." THREELET="Mar"/> + <APR FULL="April" ABBREV="Apr." THREELET="Apr"/> + <MAY FULL="May" ABBREV="May" THREELET="May"/> + <JUN FULL="June" ABBREV="Jun." THREELET="Jun"/> + <JUL FULL="July" ABBREV="Jul." THREELET="Jul"/> + <AUG FULL="August" ABBREV="Aug." THREELET="Aug"/> + <SEP FULL="September" ABBREV="Sep." THREELET="Sep"/> + <OCT FULL="October" ABBREV="Oct." THREELET="Oct"/> + <NOV FULL="November" ABBREV="Nov." THREELET="Nov"/> + <DEC FULL="December" ABBREV="Dec." THREELET="Dec"/> + </MONTHS> + </BIBSTYLE> + </CITESTYLE> +</STYLESET> |
From: Markus H. <mho...@us...> - 2005-01-29 21:32:50
|
Update of /cvsroot/refdb/refdb/dtd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17064/dtd Modified Files: Tag: Release_0_9_5_stable Makefile.am Log Message: build, distribute and install schemas Index: Makefile.am =================================================================== RCS file: /cvsroot/refdb/refdb/dtd/Makefile.am,v retrieving revision 1.10 retrieving revision 1.10.2.1 diff -u -U2 -r1.10 -r1.10.2.1 --- Makefile.am 28 Jan 2004 00:19:09 -0000 1.10 +++ Makefile.am 29 Jan 2005 21:32:41 -0000 1.10.2.1 @@ -2,8 +2,10 @@ objects = citestylex.dtd citationlistx.dtd risx.dtd xnote.dtd -install_objects = catalog $(objects) -EXTRA_DIST = $(objects) catalog.in -noinst_DATA = catalog -MOSTLYCLEANFILES=catalog +schemas = citestylex.rnc citationlistx.rnc risx.rnc xnote.rnc +install_objects = catalog $(objects) $(schemas) +EXTRA_DIST = $(objects) $(schemas) catalog.in +noinst_DATA = catalog $(schemas) +MOSTLYCLEANFILES = catalog +MAINTAINERCLEANFILES = $(schemas) RISXVERSION = $(shell grep DOCTYPE $(srcdir)/risx.dtd | sed 's%.*V\([^/]*\).*%\1%') @@ -12,9 +14,5 @@ CITATIONLISTXVERSION = $(shell grep DOCTYPE $(srcdir)/citationlistx.dtd | sed 's%.*V\([^/]*\).*%\1%') -install-data-local: - $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/dtd - @for f in $(install_objects); do \ - $(INSTALL_DATA) $(srcdir)/$$f $(DESTDIR)$(pkgdatadir)/dtd/$$f; \ - done +all: catalog $(schemas) catalog: catalog.in @@ -23,2 +21,12 @@ sed 's%<citestylexversion>%$(CITESTYLEXVERSION)%' | \ sed 's%<citationlistxversion>%$(CITATIONLISTXVERSION)%' > catalog + +%.rnc: %.dtd + java -jar /usr/local/share/java/classes/trang.jar $< $@ + +install-data-local: + $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/dtd + @for f in $(install_objects); do \ + $(INSTALL_DATA) $(srcdir)/$$f $(DESTDIR)$(pkgdatadir)/dtd/$$f; \ + done + |
From: Markus H. <mho...@us...> - 2005-01-29 21:30:41
|
Update of /cvsroot/refdb/refdb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16605 Modified Files: Tag: Release_0_9_5_stable configure.in Log Message: removed the lispdir stuff; bumped up version number Index: configure.in =================================================================== RCS file: /cvsroot/refdb/refdb/configure.in,v retrieving revision 1.49.2.8 retrieving revision 1.49.2.9 diff -u -U2 -r1.49.2.8 -r1.49.2.9 --- configure.in 10 Dec 2004 09:56:10 -0000 1.49.2.8 +++ configure.in 29 Jan 2005 21:30:31 -0000 1.49.2.9 @@ -10,5 +10,5 @@ dnl Use automake -AM_INIT_AUTOMAKE(refdb, 0.9.5) +AM_INIT_AUTOMAKE(refdb, 0.9.6-pre1) dnl see where the libdbi lib is @@ -339,9 +339,4 @@ fi dnl end if build clients -dnl Check for Emacs site-lisp folder NB we could do this here but -dnl the Debian policy requires that packages should not depend on -dnl Emacs without a very good reason -dnl AM_PATH_LISPDIR - AC_OUTPUT(src/Makefile scripts/Makefile cgi/Makefile etc/Makefile dtd/Makefile declarations/Makefile examples/Makefile styles/Makefile dsssl/Makefile dsssl/refdb/Makefile dsssl/refdb/html/Makefile dsssl/refdb/print/Makefile dsssl/refdb/lib/Makefile xsl/Makefile xsl/refdb/Makefile xsl/refdb/common-refdb/Makefile xsl/refdb/docbk-refdb-xsl/Makefile xsl/refdb/docbk-refdb-xsl/docbk-fo/Makefile xsl/refdb/docbk-refdb-xsl/docbk-html/Makefile xsl/refdb/docbk-refdb-xsl/docbk-xhtml/Makefile xsl/refdb/docbk-refdb-xsl/docbk-lib/Makefile xsl/refdb/tei-refdb-xsl/Makefile xsl/refdb/tei-refdb-xsl/tei-fo/Makefile xsl/refdb/tei-refdb-xsl/tei-html/Makefile xsl/refdb/tei-refdb-xsl/tei-lib/Makefile Makefile) |
From: Markus H. <mho...@us...> - 2005-01-22 01:13:25
|
Update of /cvsroot/refdb/perlmod/RefDBClient/testdata In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20743/testdata Modified Files: alltypes.xml Log Message: updated to latest DTD Index: alltypes.xml =================================================================== RCS file: /cvsroot/refdb/perlmod/RefDBClient/testdata/alltypes.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -u -U2 -r1.2 -r1.3 --- alltypes.xml 24 Jun 2003 23:45:11 -0000 1.2 +++ alltypes.xml 22 Jan 2005 01:13:01 -0000 1.3 @@ -1,4 +1,4 @@ -<?xml version="1.0"?> -<!DOCTYPE ris PUBLIC "-//Markus Hoenicka//DTD Ris//EN" "http://refdb.sourceforge.net/dtd/risx.dtd"> +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE ris PUBLIC "-//Markus Hoenicka//DTD Ris V1.0.2//EN" "http://refdb.sourceforge.net/dtd/risx.dtd"> <ris> <entry type="BOOK" id="31" citekey="MILLER1999"> @@ -205,5 +205,6 @@ </author> </part> -<publication><pubinfo><pubdate type="primary"><date><year>2003</year> +<publication><title>10th Intern Congress of Radiation Research</title> +<pubinfo><pubdate type="primary"><date><year>2003</year> </date> </pubdate> @@ -219,6 +220,228 @@ </pubinfo> </publication> -<set><title>10th Intern Congress of Radiation Research</title> +<libinfo user="markus"><reprint status="INFILE"/></libinfo> +<contents><abstract>blablablalablalbl balalblaalb baalhalbllaalalbalalbalbal</abstract> +<keyword>conf</keyword> +<keyword>radiation</keyword> +<keyword>translocation</keyword> +</contents> +</entry> +<entry type="BOOK" id="31" citekey="MILLER1999A"> +<publication> +<title>My first book about dinosaurs</title> +<author> +<lastname>Miller</lastname> +<firstname>A</firstname> +</author> +<author> +<lastname>Myers</lastname> +<firstname>B</firstname> +<middlename>B</middlename> +<suffix>Jr.</suffix> +</author> +<pubinfo> +<pubdate type="primary"> +<date> +<year>1999</year> +</date> +</pubdate> +<city>Sebastopol</city> +<publisher>O'Reilly</publisher> +<serial>1-56592-580-7</serial> +<address>mi...@di...</address> +<url>http://www.dinosaurs.upenn.edu/</url> +</pubinfo> +</publication> +<set> +<title>My first book series</title> +<author> +<lastname>Smith</lastname> +<firstname>K</firstname> +</author> +</set> +<libinfo user="markus"> +<notes>Not bad, after all</notes> +<reprint status="ONREQUEST"> +<date> +<year>2002</year> +<month>2</month> +<day>24</day> +</date> +</reprint> +<availability type="useroot">palaeontology/dinosaurs/millera2002.pdf</availability> +</libinfo> +<contents> +<abstract>Dinosaurs were big animals that ate a lot</abstract> +<keyword>dinosaurs</keyword> +<keyword>evolution</keyword> +<keyword>animals</keyword> +</contents> +</entry> +<entry type="CHAP"> +<part> +<title>XML: Principles, Tools, and Techniques</title> +<author> +<lastname>Walsh</lastname> +<firstname>N</firstname> +</author> +</part> +<publication> +<title>Guide to XML</title> +<author> +<lastname>Connolly</lastname> +<firstname>D</firstname> +</author> +<pubinfo> +<pubdate type="primary"> +<date> +<year>1999</year> +</date> +</pubdate> +<city>Sebastopol</city> +<publisher>O'Reilly</publisher> +</pubinfo> +</publication> +<libinfo user="markus"><notes>Not bad</notes> +<reprint status="NOTINFILE"/></libinfo> +<contents><abstract>An introduction how to deal with XML</abstract> +<keyword>XML</keyword> +<keyword>computer</keyword> +<keyword>markup languages</keyword> +</contents> +</entry> +<entry type="CONF"><part><title>Application of global positioning systems to electrical systems synchronized phasor measurements techniques and uses</title> +<author><lastname>Phadke</lastname> +<firstname>Arun</firstname> +<middlename>G</middlename> +</author> +</part> +<publication><title>Colloquium on Developments in the Use of Global Positioning Systems (GPS) in Power Systems,Feb 8 1994</title> +<pubinfo><pubdate type="primary"><date><year>1994</year> +<month>02</month> +<day>08</day> +</date> +</pubdate> +<issue>032</issue> +<startpage>4/1</startpage> +<endpage>4/2</endpage> +<city>London,USA</city> +<publisher>IEE,Stevenage,Engl</publisher> +<serial>0963-3308</serial> +<address>Virginia Tech, Blacksburg, VA, USA</address> +</pubinfo> +</publication> +<set><title>IEE Colloquium (Digest)</title> </set> +<libinfo user="markus"><reprint status="NOTINFILE"/></libinfo> +<contents><abstract>GPS navigational satellites provide an ideal method for distributing a common timing pulse at any point in the power network. Receivers of GPS transmission can reproduce the 1 pulse-per-second at any location on earth with better than 1 &mu;sec accuracy. Thus, if GPS receivers are built into each measuring system, phasors measured by these systems could be used as simultaneous measurements from all points of the power system, offering far more accuracy than needed for performing engineering analysis functions.</abstract> +<keyword>Global positioning system</keyword> +<keyword>Electric power systems</keyword> +<keyword>Digital computers</keyword> +<keyword>Electric current measurement</keyword> +<keyword>Voltage measurement</keyword> +<keyword>Communication satellites</keyword> +<keyword>Satellite relay systems</keyword> +<keyword>Iterative methods</keyword> +<keyword>Algorithms</keyword> +<keyword>Units of measurement</keyword> +</contents> +</entry> +<entry type="STAT"><publication><title>The Anti-Riot Act</title> +<pubinfo><pubdate type="primary"><date><year>1968</year> +</date> +</pubdate> +<pubdate type="secondary"><date></date> +</pubdate> +<volume>Code Number: 18 U.S.C.</volume> +<issue>Public Law Number: P.L. 90-284</issue> +<startpage>Sections 2101, 2102</startpage> +</pubinfo> +</publication> +<libinfo user="markus"><reprint status="NOTINFILE"/></libinfo> +<contents></contents> +</entry> +<entry type="JOUR"><part><title>Inhibition of superoxide anion generation by YC-1 in rat neutrophils through cyclic GMP-dependent and -independent mechanisms</title> +<author><lastname>Wang</lastname> +<firstname>J</firstname> +<middlename>P</middlename> +</author> +<author><lastname>Chang</lastname> +<firstname>L</firstname> +<middlename>C</middlename> +</author> +<author><lastname>Raung</lastname> +<firstname>S</firstname> +<middlename>L</middlename> +</author> +<author><lastname>Hsu</lastname> +<firstname>M</firstname> +<middlename>F</middlename> +</author> +<author><lastname>Huang</lastname> +<firstname>L</firstname> +<middlename>J</middlename> +</author> +<author><lastname>Kuo</lastname> +<firstname>S</firstname> +<middlename>C</middlename> +</author> +</part> +<publication><title type="abbrev">Biochem.Pharmacol.</title> +<pubinfo> +<pubdate type="primary"> +<date> +<year>2002</year> +</date> +<otherinfo>Feb 15</otherinfo> +</pubdate> +<volume>63</volume> +<issue>4</issue> +<startpage>577</startpage> +<endpage>85</endpage> +<address>Department of Education and Research, Taichung Veterans General Hospital, 160 Chung Kang Road, Sec. 3, 407, ROC, Taichung, Taiwan. w1...@vg...</address> +</pubinfo> +</publication> +<libinfo user="markus"><reprint status="NOTINFILE"/></libinfo> +<contents><abstract>3-(5'-Hydroxymethyl-2'-furyl)-1-benzyl indazole (YC-1), a soluble guanylyl cyclase (sGC) activator, inhibited formyl-methionyl-leucyl-phenylalanine (fMLP)-induced superoxide anion (O(2)*(-)) generation and O(2) consumption in rat neutrophils (IC(50) values of 12.7+/-3.1 and 17.7+/-6.9 microM, respectively). Inhibition of O(2)*(-) generation by YC-1 was partially reversed by the cyclic GMP-lowering agent 6-anilinoquinoline-5,8-quinone (LY83583) and by the Rp isomer of 8-(4-chlorophenylthio)guanosine-3',5'-monophosphorothioate (Rp-8-pCPT-cGMPS), a cyclic GMP-dependent protein kinase inhibitor. In cell-free systems, YC-1 failed to alter O(2)*(-) generation during dihydroxyfumaric acid autoxidation, phorbol 12-myristate 13-acetate (PMA)-activated neutrophil particulate NADPH oxidase preparation, and arachidonic acid-induced NADPH oxidase activation. YC-1 increased cellular cyclic GMP levels through the activation of sGC and the inhibition of cyclic GMP-hydrolyzing phosphodiesterase activity. The plateau phase, but not the initial spike, of fMLP-induced [Ca(2+)](i) changes was inhibited by YC-1 (IC(50) about 15 microM). fMLP- but not PMA-induced phospholipase D activation was inhibited by YC-1 (IC(50) about 28 microM). Membrane-associated ADP-ribosylation factor and Rho A in cell activation was also reduced by YC-1 at a similar concentration range. Neither cytosolic protein kinase C (PKC) activity nor PKC membrane translocation was altered by YC-1. YC-1 did not affect either fMLP-induced phosphatidylinositol 3-kinase activation or p38 mitogen-activated protein kinase phosphorylation, but slightly attenuated the phosphorylation of extracellular signal-regulated kinase. Collectively, these results indicate that the inhibition of the fMLP-induced respiratory burst by YC-1 is mediated by cyclic GMP-dependent and -independent signaling mechanisms.</abstract> +<keyword>translocation</keyword> +</contents> +</entry> +<entry type="CONF"><part><title>Radiation induced translocations</title> +<author><lastname>Jackquet</lastname> +</author> +<author><lastname>De Saint Georges</lastname> +<firstname>J</firstname> +<middlename>M</middlename> +</author> +<author><lastname>Couwberghs</lastname> +<firstname>T</firstname> +</author> +<author><lastname>Melis</lastname> +<firstname>H</firstname> +</author> +<author><lastname>Joris</lastname> +<firstname>J</firstname> +</author> +<author><lastname>Machiels</lastname> +<firstname>W</firstname> +</author> +<author><lastname>Bens</lastname> +<firstname>M</firstname> +</author> +</part> +<publication><title>10th Intern Congress of Radiation Research</title><pubinfo><pubdate type="primary"><date><year>2003</year> +</date> +</pubdate> +<pubdate type="secondary"><date><year>1995</year> +</date> +<otherinfo>August 27 - September 1</otherinfo> +</pubdate> +<volume>2</volume> +<startpage>2275</startpage> +<endpage>81</endpage> +<city>New York</city> +<publisher>Uitgeverij de standaard</publisher> +</pubinfo> +</publication> <libinfo user="markus"><reprint status="INFILE"/></libinfo> <contents><abstract>blablablalablalbl balalblaalb baalhalbllaalalbalalbalbal</abstract> @@ -228,3 +451,19 @@ </contents> </entry> + <entry type="NEWS" citekey="Comm1968a"> + <part> + <title>Jailing Hayden?</title> + </part> + <publication> + <title type="full">Commonweal</title> + </publication> + <libinfo user="markus"> + <notes>cited in Dee (1990) @104: +the government is about to crack down on the New Left by singling Tom +Hayden out for arrest. The FBI has been scouring the country for +evidence to indict Hayden under the infamous Rap Brown lawcrossing +state lines to incite to riot. @393</notes> + <reprint status="INFILE" /> + </libinfo> + </entry> </ris> |
From: Markus H. <mho...@us...> - 2005-01-22 01:12:18
|
Update of /cvsroot/refdb/perlmod/RefDBClient In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20529 Modified Files: test.pl Log Message: added password encryption test Index: test.pl =================================================================== RCS file: /cvsroot/refdb/perlmod/RefDBClient/test.pl,v retrieving revision 1.7 retrieving revision 1.8 diff -u -U2 -r1.7 -r1.8 --- test.pl 17 Feb 2004 22:45:41 -0000 1.7 +++ test.pl 22 Jan 2005 01:12:08 -0000 1.8 @@ -62,5 +62,57 @@ my $numtest = 1; my $numok = 1; -my $numtotal =25; +my $numtotal =26; + +# password encryption test +print "$numtest..$numtotal: "; +$numtest++; + +my $enigma = new RefDBClient::Enigma; + +my $scramble; +my $randno = abs(rand() * 6); + +if ($randno < 1) { + $scramble = "012"; +} +elsif ($randno < 2) { + $scramble = "021"; +} +elsif ($randno < 3) { + $scramble = "120"; +} +elsif ($randno < 4) { + $scramble = "102"; +} +elsif ($randno < 5) { + $scramble = "201"; +} +else { + $scramble = "210"; +} + +for my $i (0 .. 2) { + $randno = abs(rand() * 93); + $scramble .= sprintf("-%02d", $randno); +} +$enigma->init("heinzmeier", $scramble); + +$enigma->eenc(); + +my $renigma = new RefDBClient::Enigma; + +$renigma->init($enigma->{encodedpass}, $scramble); + +$renigma->eenc(); + +if ($enigma->{rawpass} eq $renigma->{encodedpass}) { + print "password encryption ok:$renigma->{encodedpass}\n"; +} +else { + print "password encryption broken\n"; + exit 1; +} + +#exit 0; # we need two clients for the refdba and refdbc functions as the |
From: Markus H. <mho...@us...> - 2005-01-22 01:11:30
|
Update of /cvsroot/refdb/perlmod/RefDBClient In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20369 Modified Files: Client.pm Log Message: implemented password encryption in Perl Index: Client.pm =================================================================== RCS file: /cvsroot/refdb/perlmod/RefDBClient/Client.pm,v retrieving revision 1.9 retrieving revision 1.10 diff -u -U2 -r1.9 -r1.10 --- Client.pm 17 Feb 2004 22:44:44 -0000 1.9 +++ Client.pm 22 Jan 2005 01:11:04 -0000 1.10 @@ -191,4 +191,257 @@ ###################################################################### ###################################################################### +## defines a helper class for password encryption + +package RefDBClient::Enigma; + +use strict; +use vars qw($VERSION @ISA @EXPORT @EXPORT_OK); + + +=head2 new + +Title : new + +Usage : $enigma = new RefDBClient::Enigma; + +Function: creates a new Enigma element + +=cut + +###################################################################### +## new(): creates a new Enigma element +###################################################################### +sub new() { + my $class = shift; + my $self = {}; + + ## the buffer that holds the raw password string + $self->{rawpass} = undef; + + ## the buffer that receives the encoded password string + $self->{encodedpass} = undef; + + ## the buffer that receives the numberized encoded password string + $self->{numberpass} = undef; + + ## the buffer that holds the scramble string + $self->{scramble} = undef; + + ## this array maps the available rotors 0-2 to the slots 0-2 + @{$self->{rotormap}} = (); + + ## this array holds the rotor positions for the rotors in the slots 0-2 + @{$self->{rotorpos}} = (); + + ## the rotor wirings for the rotors 0-2 + @{$self->{rotor}} = ( + # Input "!\"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~" + ["0", "u", "V", "`", "\$", "/", "z", "G", "7", "3", "L", "a", "*", "N", "[", ";", "U", "F", "Z", "^", "l", "t", "m", "{", "]", "\"", "s", "=", "b", "Q", "+", "?", "O", "A", "g", "w", "T", "5", "c", "W", "v", "#", "~", "}", ")", "o", "M", "S", "\'", "_", "\\", "@", "K", "(", "d", "D", "p", "|", "y", "8", "B", "%", "Y", "x", "J", "2", ":", "9", "&", "r", "4", "!", "k", "f", "-", "j", ".", "h", "1", "6", "I", "C", "i", ",", "R", "n", "e", "<", "E", "P", "q", ">", "X", "H"], # 0 + ["E", "P", "l", "b", "(", "S", "O", "\'", "D", "p", "|", "y", "8", "B", "x", "t", "J", "2", ":", "j", ".", "h", "f", "-", "I", "C", "i", ",", "R", "n", "e", "0", "G", "\"", "1", "6", "9", "&", "%", "Y", "_", "\\", "k", "7", "3", "u", "V", "\$", "/", "z", "N", "@", "F", "Z", "^", "m", "{", "]", "s", "w", "X", "U", "T", "5", "c", "W", "v", "#", "=", "H", "q", "r", "4", "!", "[", ";", "<", ">", "g", "~", "}", ")", "Q", "+", "L", "a", "*", "d", "?", "A", "K", "`", "o", "M"], # 1 + ["r", "4", "!", "[", ";", "<", "/", "z", "\$", "s", "`", "w", "X", "U", "T", "q", "{", "]", ">", "S", "5", ")", "@", "F", "Z", "Q", "D", "M", "|", "y", "8", "c", "W", "0", "G", "\"", "u", "v", "R", "Y", "_", "\\", "#", "=", "p", "a", "*", "d", "?", "A", "K", "+", "L", "E", "P", "l", "b", "(", "\'", "H", "1", "6", "t", "J", "2", ":", "j", ".", "n", "e", "9", "&", "%", "h", "f", "-", "I", "C", "i", "m", "o", "B", "x", ",", "k", "7", "O", "3", "V", "g", "~", "}", "N", "^"] # 2 + ); + + # the reflector array must be symmetrical, e.g. if ! maps to /, / must also map to ! + @{$self->{reflector}} = ( + "/", "-", "Q", "=", "~", "E", "1", ".", "6", "4", "2", "H", "\"", "(", "!", "?", "\'", "+", "X", "*", ">", ")", "S", "c", "v", "@", "<", ";", "\$", "5", "0", ":", "R", "u", "n", "Z", "&", "r", "{", ",", "Y", "M", "s", "p", "J", "^", "z", "q", "#", "A", "7", "g", "\\", "f", "h", "3", "I", "D", "e", "U", "}", "N", "y", "w", "d", "o", "8", "a", "[", "V", "T", "W", "|", "m", "x", "t", "j", "C", "b", "L", "P", "F", "K", "l", "B", "9", "`", "k", "_", "O", "G", "i", "]", "%" + ); + + bless $self, $class; + return $self; +} + +###################################################################### +## init(): set the parameters +## Arguments: - raw password +## - scramble string +###################################################################### +sub init { + my ($self, $rawpass, $scramble) = @_; + + $self->{rawpass} = $rawpass; + $self->{scramble} = $scramble; +} + +###################################################################### +## get_pass(): get the numberized encoded password +###################################################################### +sub get_pass { + my ($self) = @_; + + return $self->{numberpass}; +} + +###################################################################### +## eenc(): encode or decode a password string +## returns the numberized encoded password +###################################################################### +sub eenc { + my ($self) = @_; + + # set initial wheel sequence and wheel positions + $self->_set_wheels(); + + # split the raw password into individual characters + my @pw = split(/ */, $self->{rawpass}); + + my $scrambledchar = undef; + + # this array will receive the permuted characters + my @encchar = (); + + # loop over all characters in the raw password + foreach my $pwchar (@pw) { + + # first send the character through all rotors in the forward direction + $scrambledchar = $self->_wheel($pwchar, 0); + $scrambledchar = $self->_wheel($scrambledchar, 1); + $scrambledchar = $self->_wheel($scrambledchar, 2); + + # send the character through the reflector + $scrambledchar = $self->_reflect($scrambledchar); + + # send the character through all rotors in the reverse direction + $scrambledchar = $self->_rwheel($scrambledchar, 2); + $scrambledchar = $self->_rwheel($scrambledchar, 1); + $scrambledchar = $self->_rwheel($scrambledchar, 0); + + # advance all wheels one position + $self->_move_wheels(); + + # add the permuted character to the encoded password + push @encchar, $scrambledchar; + } + + # glue the permuted characters together + $self->{encodedpass} = join('', @encchar); + + # numberize the encoded password and return it + $self->_numberize(); +} + +###################################################################### +## _set_wheels(): set the wheel position +###################################################################### +sub _set_wheels { + my ($self) = @_; + + # sanity check + if (length($self->{scramble}) < 12) { + return 1; + } + + # use first three characters of the scramble string as rotor map + $self->{rotormap}[0] = ord(substr($self->{scramble}, 0, 1)) - 48; + $self->{rotormap}[1] = ord(substr($self->{scramble}, 1, 1)) - 48; + $self->{rotormap}[2] = ord(substr($self->{scramble}, 2, 1)) - 48; + + # slot values must be between 0 and 2 and we don't use + # a wheel twice + if ($self->{rotormap}[0] == $self->{rotormap}[1] + || $self->{rotormap}[1] == $self->{rotormap}[2] + || $self->{rotormap}[0] == $self->{rotormap}[2] + || $self->{rotormap}[0] < 0 + || $self->{rotormap}[0] > 2 + || $self->{rotormap}[1] < 0 + || $self->{rotormap}[1] > 2 + || $self->{rotormap}[2] < 0 + || $self->{rotormap}[2] > 2) { + return 1; + } + + # loop over slots + foreach my $i (0 .. 2) { + # retrieve wheel positions from scramble string + $self->{rotorpos}->[$i] = substr($self->{scramble}, ($i*3)+4, 2); + if ($self->{rotorpos}->[$i] < 0 + || $self->{rotorpos}->[$i] > 94) { + return 1; # out of range + } + } + + return 0; +} + +###################################################################### +## _wheel(): performs character permutation on a wheel in the forward +## direction +###################################################################### +sub _wheel { + my ($self, $char, $wheel) = @_; + + my $outchar = undef; + + $outchar = $self->{rotor}[$self->{rotormap}[$wheel]][(ord($char)-33+$self->{rotorpos}->[$wheel]) % 94]; + + return $outchar; +} + +###################################################################### +## _reflect(): performs character permutation on the reflector +###################################################################### +sub _reflect { + my ($self, $char) = @_; + + my $outchar = undef; + my $conv = ord($char)-33; + + $outchar = $self->{reflector}[ord($char)-33]; +} + + +###################################################################### +## _rwheel(): performs character permutation on a wheel in the reverse +## direction +###################################################################### +sub _rwheel { + my ($self, $char, $wheel) = @_; + + my $outchar = undef; + my $charindex = 0; + + # loop over all characters in the rotor to do a reverse lookup + foreach my $wheelchar (@{$self->{rotor}[$self->{rotormap}[$wheel]]}) { + if ($char eq $wheelchar) { + $outchar = $charindex + 33 - $self->{rotorpos}[$wheel]; + while ($outchar < 33) { + $outchar += 94; + } + last; # jump out when the character is found + } + $charindex++; + } + +# $outchar = sprintf "%c", $outchar; + $outchar = chr($outchar); +} + +###################################################################### +## _move_wheels(): advance the wheels one position +###################################################################### +sub _move_wheels { + my ($self) = @_; + + $self->{rotorpos}[0] = ($self->{rotorpos}[0]+1) % 94; + $self->{rotorpos}[1] = ($self->{rotorpos}[1]+1) % 94; + $self->{rotorpos}[2] = ($self->{rotorpos}[2]+1) % 94; + +} + +###################################################################### +## _numberize(): converts the encoded password to a numerical form +###################################################################### +sub _numberize { + my ($self) = @_; + + # split password into characters and loop over them + foreach my $char (split(/ */, $self->{encodedpass})) { + $self->{numberpass} .= sprintf("%03d", ord($char)); + } + return $self->{numberpass}; +} + + +###################################################################### +###################################################################### ## defines the main class to talk to the refdbd server @@ -362,11 +615,19 @@ # password encoding is currently done by the external application # "eenc" which is part of the RefDB package proper +# if (length($self->{passwd}) > 0) { +# $self->{numberized_passwd} = `eenc $self->{passwd} -p $self->{scramble_string}`; +# } +# else { +# $self->{numberized_passwd} = ""; +# } + if (length($self->{passwd}) > 0) { - $self->{numberized_passwd} = `eenc $self->{passwd} -p $self->{scramble_string}`; + my $enigma = new RefDBClient::Enigma; + $enigma->init($self->{passwd}, $self->{scramble_string}); + $self->{numberized_passwd} = $enigma->eenc(); } else { $self->{numberized_passwd} = ""; } - #print $self->{numberized_passwd}; |
From: Markus H. <mho...@us...> - 2005-01-09 21:30:06
|
Update of /cvsroot/refdb/homepage In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14124 Added Files: refdb.css getref.html Log Message: initial version --- NEW FILE --- h1.h1 { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 140%; visibility: "hidden"; } h2.id { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 90%; } p.title { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 110%; font-weight: bold; } p.authors { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 90%; font-weight: bold; color: #003366; background-color: transparent; } p.abstract { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 90%; font-weight: normal; margin-left: 30px; } p.citekey { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 90%; font-weight: bold; } p.note { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 90%; font-weight: normal; margin-left: 30px; } p.m1 { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 70%; font-weight: bold; margin-left: 30px; } p.m2 { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 70%; font-weight: bold; margin-left: 30px; } p.m3 { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 70%; font-weight: bold; margin-left: 30px; } p.ur { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 70%; font-weight: normal; color: #003366; background-color: transparent; margin-left: 30px; } em.periodical { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 80%; font-style: italic; color: #003366; background-color: transparent; } em.volume { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 80%; font-weight: bold; color: #003366; background-color: transparent; } em.issue { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 80%; font-weight: bold; color: #003366; background-color: transparent; } em.page { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 80%; color: #003366; background-color: transparent; } --- NEW FILE --- <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <title>refdb reference list</title><meta name="generator" content="refdb 0.9.5" id="generator" /><link rel="stylesheet" type="text/css" href="refdb.css" /> </head> <body> <h1 class='h1'>refdb reference list</h1> <div class="record"> <h2 class='ID'>ID*:3 (1994)</h2> <p class='authors'>Phadke,Arun G.</p> <p class='title'>Application of global positioning systems to electrical systems synchronized phasor measurements techniques and uses</p> <p class='book'>Colloquium on Developments in the Use of Global Positioning Systems (GPS) in Power Systems,Feb 8 1994; part of: IEE Colloquium (Digest)</p> <em class='issue'>(032)</em>:<em class='page'>4/1-4/2</em><p class='citekey'>CITEKEY:Phadke1994</p> <p class='abstract'>ABSTRACT: GPS navigational satellites provide an ideal method for distributing a common timing pulse at any point in the power network. Receivers of GPS transmission can reproduce the 1 pulse-per-second at any location on earth with better than 1 μsec accuracy. Thus, if GPS receivers are built into each measuring system, phasors measured by these systems could be used as simultaneous measurements from all points of the power system, offering far more accuracy than needed for performing engineering analysis functions.</p> <p class='address'>ADDRESS: Virginia Tech, Blacksburg, VA, USA</p> <p class='rp'>REPRINT: NOT IN FILE</p> <p class='issn'>ISSN: 0963-3308</p> <p class='publisher'>PUBLISHER: IEE,Stevenage,Engl</p> <p class='city'>CITY: London,USA</p> </div> <div class="record"> <h2 class='ID'>ID*:5 (2002)</h2> <p class='authors'>Wang,J.P.; Chang,L.C.; Raung,S.L.; Hsu,M.F.; Huang,L.J.; Kuo,S.C.</p> <p class='title'>Inhibition of superoxide anion generation by YC-1 in rat neutrophils through cyclic GMP-dependent and -independent mechanisms</p> <p><em class='periodical'>Biochem.Pharmacol.</em> <em class='volume'>63</em><em class='issue'>(4)</em>:<em class='page'>577-85</em></p> <p class='citekey'>CITEKEY:Wang2002</p> <p class='abstract'>ABSTRACT: 3-(5'-Hydroxymethyl-2'-furyl)-1-benzyl indazole (YC-1), a soluble guanylyl cyclase (sGC) activator, inhibited formyl-methionyl-leucyl-phenylalanine (fMLP)-induced superoxide anion (O(2)*(-)) generation and O(2) consumption in rat neutrophils (IC(50) values of 12.7+/-3.1 and 17.7+/-6.9 microM, respectively). Inhibition of O(2)*(-) generation by YC-1 was partially reversed by the cyclic GMP-lowering agent 6-anilinoquinoline-5,8-quinone (LY83583) and by the Rp isomer of 8-(4-chlorophenylthio)guanosine-3',5'-monophosphorothioate (Rp-8-pCPT-cGMPS), a cyclic GMP-dependent protein kinase inhibitor. In cell-free systems, YC-1 failed to alter O(2)*(-) generation during dihydroxyfumaric acid autoxidation, phorbol 12-myristate 13-acetate (PMA)-activated neutrophil particulate NADPH oxidase preparation, and arachidonic acid-induced NADPH oxidase activation. YC-1 increased cellular cyclic GMP levels through the activation of sGC and the inhibition of cyclic GMP-hydrolyzing phosphodiesterase activity. The plateau phase, but not the initial spike, of fMLP-induced [Ca(2+)](i) changes was inhibited by YC-1 (IC(50) about 15 microM). fMLP- but not PMA-induced phospholipase D activation was inhibited by YC-1 (IC(50) about 28 microM). Membrane-associated ADP-ribosylation factor and Rho A in cell activation was also reduced by YC-1 at a similar concentration range. Neither cytosolic protein kinase C (PKC) activity nor PKC membrane translocation was altered by YC-1. YC-1 did not affect either fMLP-induced phosphatidylinositol 3-kinase activation or p38 mitogen-activated protein kinase phosphorylation, but slightly attenuated the phosphorylation of extracellular signal-regulated kinase. Collectively, these results indicate that the inhibition of the fMLP-induced respiratory burst by YC-1 is mediated by cyclic GMP-dependent and -independent signaling mechanisms.</p> <p class='address'>ADDRESS: Department of Education and Research, Taichung Veterans General Hospital, 160 Chung Kang Road, Sec. 3, 407, ROC, Taichung, Taiwan. w1...@vg...</p> <p class='rp'>REPRINT: NOT IN FILE</p> </div> </body> </html> |
From: Markus H. <mho...@us...> - 2005-01-09 21:29:06
|
Update of /cvsroot/refdb/homepage In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13881 Modified Files: examples.html Log Message: added getref output Index: examples.html =================================================================== RCS file: /cvsroot/refdb/homepage/examples.html,v retrieving revision 1.3 retrieving revision 1.4 diff -u -U2 -r1.3 -r1.4 --- examples.html 17 Dec 2004 22:17:14 -0000 1.3 +++ examples.html 9 Jan 2005 21:28:57 -0000 1.4 @@ -124,4 +124,7 @@ </tr> <tr> + <td class="localnav"><a href="#getref">getref output</a></td> + </tr> + <tr> <td class="localnav"><a href="#sources">XML source documents</a></td> </tr> @@ -215,4 +218,40 @@ </pre> + <h2 id="getref">getref output</h2> + <p><code>getref</code> is the client command which retrieves reference data from your database. There are various output formats to choose from. The two most common formats are the plain-text screen output shown below, and the <a href="getref.html">(X)HTML output</a> to view the results in a web browser. The latter is fully customizable by CSS stylesheets.</p> +<pre class="source"> +refdbc: getref -s ALL :ID:=3 OR :ID:=5 +ID*:3 (1994) +Key: Phadke1994 +Phadke,Arun G. +Application of global positioning systems to electrical systems synchronized pha +sor measurements techniques and uses +Colloquium on Developments in the Use of Global Positioning Systems (GPS) in Pow +er Systems,Feb 8 1994; part of: IEE Colloquium (Digest) +(032):4/1-4/2 +ABSTRACT: GPS navigational satellites provide an ideal method for distributing a + common timing pulse at any point in the power network. Receivers of GPS transmi +ssion can reproduce the 1 pulse-per-second at any location on earth with better +than 1 μsec accuracy. [...] +ADDRESS: Virginia Tech, Blacksburg, VA, USA +REPRINT: NOT IN FILE +ISSN: 0963-3308 +PUBLISHER: IEE,Stevenage,Engl +CITY: London,USA + +ID*:5 (2002) +Key: Wang2002 +Wang,J.P., Chang,L.C., Raung,S.L., Hsu,M.F., Huang,L.J., Kuo,S.C. +Inhibition of superoxide anion generation by YC-1 in rat neutrophils through cyc +lic GMP-dependent and -independent mechanisms +Biochem.Pharmacol. 63(4):577-85 +ABSTRACT: 3-(5'-Hydroxymethyl-2'-furyl)-1-benzyl indazole (YC-1), a soluble guan +ylyl cyclase (sGC) activator, inhibited formyl-methionyl-leucyl-phenylalanine (f +MLP)-induced superoxide anion (O(2)*(-)) generation and O(2) consumption in rat +neutrophils (IC(50) values of 12.7+/-3.1 and 17.7+/-6.9 microM, respectively). [...] +ADDRESS: Department of Education and Research, Taichung Veterans General Hospita +l, 160 Chung Kang Road, Sec. 3, 407, ROC, Taichung, Taiwan. w1...@vg... +REPRINT: NOT IN FILE +</pre> <h2 id="sources">XML source document</h2> <p>RefDB supports DocBook SGML and XML as well as TEI XML documents out of the box. TeX/LaTeX support is a bit whacky, but basically available. In order to get a bibliography for your document, all you need to do is to enter the citations into the text. This is done within the limits of the original DTDs, so the documents that you write will validate against the unaltered DTDs. When the document is processed with the RefDB tools, a list of cited references is extracted from your document. RefDB will then look up these references in the database and create a suitable bibliography file. This file can be inserted as an external entity into your document.</p> |
From: Markus H. <mho...@us...> - 2005-01-07 21:20:28
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14732 Modified Files: Tag: Release_0_9_5_stable refdbc.c Log Message: changed cgi query strings from exact to regexp match Index: refdbc.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/refdbc.c,v retrieving revision 1.72.2.3 retrieving revision 1.72.2.4 diff -u -U2 -r1.72.2.3 -r1.72.2.4 --- refdbc.c 10 Dec 2004 13:19:08 -0000 1.72.2.3 +++ refdbc.c 7 Jan 2005 21:20:17 -0000 1.72.2.4 @@ -5291,23 +5291,23 @@ if (ptr_listmem) { if (!strcmp(ptr_listmem->value, "title")) { - strcat(buffer, ":TI:="); + strcat(buffer, ":TI:~"); } else if (!strcmp(ptr_listmem->value, "booktitle")) { - strcat(buffer, ":T2:="); + strcat(buffer, ":T2:~"); } else if (!strcmp(ptr_listmem->value, "seriestitle")) { - strcat(buffer, ":T3:="); + strcat(buffer, ":T3:~"); } else if (!strcmp(ptr_listmem->value, "keyword")) { - strcat(buffer, ":KW:="); + strcat(buffer, ":KW:~"); } else if (!strcmp(ptr_listmem->value, "editor")) { - strcat(buffer, ":A2:="); + strcat(buffer, ":A2:~"); } else if (!strcmp(ptr_listmem->value, "seditor")) { - strcat(buffer, ":A3:="); + strcat(buffer, ":A3:~"); } else { /* default is author */ - strcat(buffer, ":AU:="); + strcat(buffer, ":AU:~"); } |