koha-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Koha-cvs] koha/misc export_frameworks.bat export_framewor... [rel_2_2]


From: Thomas D
Subject: [Koha-cvs] koha/misc export_frameworks.bat export_framewor... [rel_2_2]
Date: Tue, 11 Dec 2007 22:37:51 +0000

CVSROOT:        /sources/koha
Module name:    koha
Branch:         rel_2_2
Changes by:     Thomas D <thd>  07/12/11 22:37:51

Added files:
        misc           : export_frameworks.bat export_frameworks.sh 

Log message:
        Adding frameworks export scripts.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/misc/export_frameworks.bat?cvsroot=koha&only_with_tag=rel_2_2&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/misc/export_frameworks.sh?cvsroot=koha&only_with_tag=rel_2_2&rev=1.1.2.1

Patches:
Index: export_frameworks.bat
===================================================================
RCS file: export_frameworks.bat
diff -N export_frameworks.bat
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ export_frameworks.bat       11 Dec 2007 22:37:51 -0000      1.1.2.1
@@ -0,0 +1,523 @@
address@hidden off
+
+REM **************************************************************************
+REM Koha 2.2.X MARC Frameworks Export Script
+REM for Microsoft Windows systems.
+REM
+REM version 0.0.1
+REM 2007-12-11
+REM
+REM by
+REM
+REM Thomas Dukleth
+REM Agogme
+REM 109 E 9th Street
+REM New York, NY  10003
+REM USA
+REM http://www.agogme.com
+REM koha AT agogme.com
+REM 212-674-3783
+REM
+REM for
+REM
+REM LibLime
+REM 449 E. State Street
+REM PO Box 892
+REM Athens, OH 45701
+REM USA
+REM (888) Koha ILS (564-2457)
+REM fax: 740-593-5800
+REM info AT liblime.com
+REM
+REM
+REM Copyright (C) 2007 Thomas Dukleth.
+REM
+REM
+REM LICENSE INFORMATION.
+REM
+REM This program is free software; you may redistribute it and/or
+REM modify it under the terms of the GNU General Public License
+REM as published by the Free Software Foundation; either version 2
+REM of the License, or (at your option) any later version.
+REM
+REM
+REM NO WARRANTY.
+REM
+REM This program is distributed in the hope that it will be useful,
+REM but WITHOUT ANY WARRANTY; without even the implied warranty of
+REM MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+REM GNU General Public License for more details.
+REM
+REM
+REM LICENSE COPY.
+REM
+REM You should have received a copy of the GNU General Public License
+REM along with the full Koha program; if not, write to the Free Software
+REM Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+REM 02110-1301, USA.  The license may be found online at
+REM http://www.gnu.org/licenses/old-licenses/gpl-2.0.html .
+REM 
+REM 
+REM PURPOSE.
+REM 
+REM The purpose of this script is to prepare a copy of your MARC frameworks
+REM frameworks variations if you have significant ones for inclusion in
+REM Koha 3.0 to share them with others.
+REM
+REM
+REM UPDATES.
+REM
+REM Updated versions for Koha 2.2.X should be available from
+REM ECHO http://cvs.savannah.nongnu.org/viewvc/koha/misc/?root=koha as long as
+REM Savannah is hosting the Koha 2.2.X code repository.
+REM
+REM Otherwise, consult the Koha website, http://www.koha.org .
+REM **************************************************************************
+
+
+REM INSTALLATION REQUIREMENTS.
+
+REM This script may be run on any system which includes the directory
+REM containing mysqldump in the $PATH.  For help setting the $PATH if
+REM needed, you may consult
+REM http://www.computerhope.com/issues/ch000549.htm .
+
+REM This script may be run on any system which has network access to the
+REM Koha MySQL database as the administrative user specified in your
+REM koha.conf which may be in C:\etc\koha.conf or another MySQL user with
+REM sufficient privileges over your Koha MySQL database.
+
+REM Having a fully functional Win32 version of the Unix utility tar included
+REM in bsdtar is necessary for the full use of this program.  [The Win32
+REM version of GNU tar is incomplete and cannot be used with this program.]
+REM Download and install the libarchive package of the GNU Win32 project using
+REM the libarchive Setup program available from
+REM http://gnuwin32.sourceforge.net/packages/libarchive.htm .
+REM bsdtar is included as part of libarchive.
+
+
+REM USER VARIABLES.
+
+REM Edit these variables to match your Koha installation.  They may be found
+REM in your koha.conf file which may be in C:\koha.conf .  Do not leave any
+REM spaces before or after the '=' sign or the variable will be set to nothing.
+
+REM You will need to enter your Koha MySQL user password when prompted.
+
+set database=YourKohaDatabaseName
+set hostname=localhost
+set user=YourKohaDatabaseUser
+set kohaversion=2.2.?
+
+REM Specify the filename to which to export your Koha MARC frameworks.
+
+set exportFilename=koha_frameworks.sql
+
+
+REM **************************************************************************
+
+
+REM SCRIPT VARIABLES.
+
+set scriptVersion=0.0.1
+set scriptDate=2007-12-11
+set scriptYear=2007
+set optionName=
+
+REM ERROR EXIT CODES.
+
+REM Help command issued.
+set exitHelp=10
+
+REM Compression failed.
+set exitCompress=40
+
+REM Frameworks export from database failed.
+set exitExport=60
+
+REM Improper usage.
+set exitUsage=90
+
+set errorCode=
+
+
+REM DISPLAY VARIABLES.
+
+set scriptFile=%0
+
+goto SKIPDVAR
+:HELPT
+       echo HELP.
+       echo.
+       echo Edit the %scriptFile% script file
+       echo to change the user variables at the beginning to match your
+       echo Koha installation or supply them using the interactive options.
+       echo.
+       echo Usage: %scriptFile% [OPTIONS]
+       echo.
+       echo  -d DATABASE              Override script set Koha MySQL database.
+       echo  -f FILENAME              Override script set Koha frameworks 
export filename.
+       echo  -h HOST                  Override script set Koha MySQL hostname.
+       echo  -u USER                  Override script set Koha MySQL user.
+       echo  -V VERSION               Override script set Koha version.
+       echo.
+       echo  -?                       Display this help message and exit.
+       echo  -? e                     Display usage example and exit.
+       echo  -? i                     Display installation requirements and 
exit.
+       echo  -? u                     Display update information and exit.
+       echo.
+       echo  -? c                     Display copyright and licensing 
information and exit.
+       echo  -? w                     Display no warranty information and exit.
+       echo.
+       goto BYE
+       
+:COPYRT
+       echo COPYRIGHT NOTICE.
+       echo.
+       echo Koha 2.2.X MARC Frameworks Export Script
+       echo for Microsoft Windows systems.
+       echo.
+       echo version %scriptVersion%
+       echo %scriptDate%
+       echo.
+       echo by
+       echo.
+       echo Thomas Dukleth
+       echo Agogme
+       echo 109 E 9th Street
+       echo New York, NY  10003
+       echo USA
+       echo http://www.agogme.com
+       echo koha AT agogme.com
+       echo 212-674-3783
+       echo.
+       echo for
+       echo.
+       echo LibLime
+       echo 449 E. State Street
+       echo PO Box 892
+       echo Athens, OH  45701
+       echo USA
+       echo (888) Koha ILS (564-2457)
+       echo fax: 740-593-5800
+       echo info AT liblime.com
+       echo.
+       echo Copyright (C) %scriptYear% Thomas Dukleth.
+       echo.
+       echo LICENSE INFORMATION.
+       echo.
+       echo This program is free software; you may redistribute it and/or
+       echo modify it under the terms of the GNU General Public License
+       echo as published by the Free Software Foundation; either version 2
+       echo of the License, or (at your option) any later version.
+       echo.
+       echo NO WARRANTY.
+       echo.
+       echo This program is distributed in the hope that it will be useful,
+       echo but WITHOUT ANY WARRANTY; without even the implied warranty of
+       echo MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+       echo GNU General Public License for more details.
+       echo.
+       echo LICENSE COPY.
+       echo.
+       echo You should have received a copy of the GNU General Public License
+       echo along with the full Koha program; if not, write to the Free 
Software
+       echo Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+       echo 02110-1301, USA.  The license may be found online at
+       echo http://www.gnu.org/licenses/old-licenses/gpl-2.0.html .
+       echo.
+       goto BYE
+
+:EXAMPLET
+       echo USAGE EXAMPLES.
+       echo.
+       echo Examples should be typed on one line.
+       echo.
+       echo Values may be obtained from your koha.conf which may be in
+       echo C:\etc\koha.conf .
+       echo.
+       echo If you have already set values by editing this script, running the
+       echo script without options is sufficient.
+       echo.
+       echo  %scriptFile%
+       echo.
+       echo Otherwise, supply values using the command line.
+       echo.
+       echo  %scriptFile% -d KohaDatabaseName
+       echo   -h ComputerHostNameRunningDatabase -u KohaDatabaseUser
+       echo   -V KohaVersion -f ChooseAnExportFilename
+       echo.
+       echo [The piping symbol 'vertical bar' is shown as 'l'.  The 'right
+       echo angled bracket' is shown as '}' for display from a batch file.
+       echo Substitute the correct piping symbol when you type the command.]
+       echo.
+       echo Long help messages may be piped to a pager
+       echo.
+       echo  %scriptFile% -? c l more
+       echo.
+       echo or file for reading.
+       echo.
+       echo  %scriptFile% -? c } copyright_license_info.txt
+       echo.
+       goto BYE
+
+:INSTALLT
+       echo INSTALLATION REQUIREMENTS.
+       echo.
+       echo This script may be run on any system which includes the directory
+       echo containing mysqldump in the $PATH.  For help setting the $PATH if
+       echo needed, you may consult
+       echo http://www.computerhope.com/issues/ch000549.htm .
+       echo.
+       echo This script may be run on any system which has network access to 
the
+       echo Koha MySQL database as the administrative user specified in your
+       echo koha.conf which may be in C:\etc\koha.conf or another MySQL user 
with
+       echo sufficient privileges over your Koha MySQL database.
+       echo.
+       echo Having a fully functional Win32 version of the Unix utility tar 
included
+       echo in bsdtar is necessary for the full use of this script.  [The Win32
+       echo version of GNU tar is incomplete and cannot be used with this 
script.]
+       echo Download and install the libarchive package of the GNU Win32 
project using
+       echo the libarchive Setup program available from
+       echo http://gnuwin32.sourceforge.net/packages/libarchive.htm .
+       echo bsdtar is included as part of libarchive.
+       echo.
+       goto BYE
+
+:UPDATET
+       echo UPDATES.
+       echo.
+       echo Updated versions for Koha 2.2.X should be available from
+       echo http://cvs.savannah.nongnu.org/viewvc/koha/misc/?root=koha as long 
as
+       echo Savannah is hosting the Koha 2.2.X code repository.
+       echo.
+       echo Otherwise, consult the Koha website, http://www.koha.org .
+       echo.
+       goto BYE
+
+:WARRANTT
+       echo NO WARRANTY.
+       echo.
+       echo This program is distributed in the hope that it will be useful,
+       echo but WITHOUT ANY WARRANTY; without even the implied warranty of
+       echo MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+       echo GNU General Public License for more details.
+       echo.
+       echo LICENSE COPY.
+       echo.
+       echo You should have received a copy of the GNU General Public License
+       echo along with the full Koha program; if not, write to the Free 
Software
+       echo Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+       echo 02110-1301, USA.  The license may be found online at
+       echo http://www.gnu.org/licenses/old-licenses/gpl-2.0.html .
+       echo.
+       goto BYE
+
+:SKIPDVAR
+
+echo.
+echo Koha 2.2.X MARC Frameworks Export Script
+echo for Microsoft Windows systems.
+echo version %scriptVersion%
+echo Copyright (C) %scriptYear% Thomas Dukleth.
+echo View the help message by starting this program using option '-?'.
+echo This program comes with ABSOLUTELY NO WARRANTY; for details
+echo start this program using option '-? w'.
+echo This is free software, and you are welcome to redistribute it
+echo and/or modify it under certain conditions; for details
+echo start this program using option '-? c'.
+echo.
+
+
+REM SCRIPT.
+
+:OPTCHK
+       if not "%1" == "" (
+               if "%1" == "-d" (
+                       goto OPTVALUE
+               )
+               if "%1" == "-f" (
+                       goto OPTVALUE
+               )
+               if "%1" == "-h" (
+                       goto OPTVALUE
+               )
+               if "%1" == "-u" (
+                       goto OPTVALUE
+               )
+               if "%1" == "-V" (
+                       goto OPTVALUE
+               )
+               if "%1" == "-?" (
+                       goto OPTVALUE
+               )
+               set exitCode=%exitUsage%
+               echo Oops try again
+               goto HELPT
+       ) else (
+       goto OPTNONE
+       )
+
+       :OPTVALUE
+       set optionName=%1
+       shift
+               if "%optionName%" == "-d" (
+                       if not "%1" == "" (
+                               set database=%1
+                               goto OPTCHKN
+                       ) else (
+                               set exitCode=%exitUsage%
+                               goto HELPT
+                       )
+               )
+               if "%optionName%" == "-f" (
+                       if not "%1" == "" (
+                               set exportFilename=%1
+                               goto OPTCHKN
+                       ) else (
+                               set exitCode=%exitUsage%
+                               goto HELPT
+                       )
+               )
+               if "%optionName%" == "-h" (
+                       if not "%1" == "" (
+                               set hostname=%1
+                               goto OPTCHKN
+                       ) else (
+                               set exitCode=%exitUsage%
+                               goto HELPT
+                       )
+               )
+               if "%optionName%" == "-u" (
+                       if not "%1" == "" (
+                               set user=%1
+                               goto OPTCHKN
+                       ) else (
+                               set exitCode=%exitUsage%
+                               goto HELPT
+                       )
+               )
+               if "%optionName%" == "-V" (
+                       if not "%1" == "" (
+                               set kohaversion=%1
+                               goto OPTCHKN
+                       ) else (
+                               set exitCode=%exitUsage%
+                               goto HELPT
+                       )
+               )
+               if "%optionName%"=="-?" (
+                       if not "%1" == "" (
+                               if "%1" == "c" (
+                                       set errorCode=%exitHelp%
+                                       goto COPYRT
+                               )
+                               if "%1" == "e" (
+                                       set errorCode=%exitHelp%
+                                       goto EXAMPLET
+                               )
+                               if "%1" == "i" (
+                                       set errorCode=%exitHelp%
+                                       goto INSTALLT
+                               )
+                               if "%1" == "u" (
+                                       set errorCode=%exitHelp%
+                                       goto UPDATET
+                               )
+                               if "%1" == "w" (
+                                       set errorCode=%exitHelp%
+                                       goto WARRANTT
+                               ) else (
+                                       set exitCode=%exitUsage%
+                                       goto HELPT
+                               )
+                       ) else (
+                               set exitCode=%exitHelp%
+                               goto HELPT
+                       )
+               )
+               set exitCode=%exitUsage%
+               goto HELPT
+
+       :OPTCHKN
+       shift
+       goto OPTCHK
+
+:OPTNONE
+
+if "%database%" == "YourKohaDatabaseName" (
+       set exitCode=%exitUsage%
+       goto HELPT
+)
+
+echo *****************************************************************
+echo Preparing to export Koha MARC frameworks.
+echo *****************************************************************
+echo.
+call mysqldump --allow-keywords --opt --single-transaction -qv -h %hostname% 
-u %user% -p %database% biblio_framework marc_tag_structure 
marc_subfield_structure auth_types auth_tag_structure auth_subfield_structure > 
%exportFilename%
+if ERRORLEVEL 1 (
+       echo.
+       echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+       echo Oops, something went wrong trying to export data from your Koha
+       echo MySQL database!  Check that the user variables for this script
+       echo have been set correctly for your Koha installation and try again.
+       echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+       echo.
+       set errorCode=%exitExport%
+       goto BYE
+)
+if ERRORLEVEL 0 (
+       echo >> %exportFilename%
+       echo -- Koha version %kohaversion% >> %exportFilename%
+       call bsdtar -czvvf %exportFilename%.tgz %exportFilename%
+       if ERRORLEVEL 1 (
+               echo.
+               echo 
*****************************************************************
+               echo Oops, we could not compress the exported frameworks file.
+               echo.
+               echo If you can find some means to compress the exported 
frameworks
+               echo file, %exportFilename%, please send the compressed copy as 
an email
+               echo attachment to koha AT agogme.com along with a message 
indicating
+               echo what MARC standards are represented in your frameworks and 
what
+               echo languages they use.
+               echo.
+               echo If you cannot compress %exportFilename%,
+               echo please send it as an email attachment with the message
+               echo to jmf AT liblime.com .  Please send a copy of the message
+               echo without the attachment to koha AT agogme.com .
+               echo 
*****************************************************************
+               echo.
+               set errorCode=%exitCompress%
+               goto BYE
+       )
+       if ERRORLEVEL 0 (
+               call del %exportFilename%
+               echo.
+               echo 
*****************************************************************
+               echo Please send the compressed copy of the exported frameworks 
file,
+               echo %exportFilename%.tgz, as an email attachment
+               echo to koha AT agogme.com along with a message indicating what
+               echo MARC standards are represented in your frameworks and
+               echo what languages they use.
+               echo 
*****************************************************************
+               echo.
+       )
+)
+
+:BYE
+REM UNSET TEMPORARY ENVIRONMENT VARIABLES.
+
+set database=
+set hostname=
+set user=
+set kohaversion=
+set exportFilename=
+set scriptVersion=
+set scriptDate=
+set scriptYear=
+set optionName=
+set exitHelp=
+set exitCompress=
+set exitExport=
+set exitUsage=
+

Index: export_frameworks.sh
===================================================================
RCS file: export_frameworks.sh
diff -N export_frameworks.sh
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ export_frameworks.sh        11 Dec 2007 22:37:51 -0000      1.1.2.1
@@ -0,0 +1,437 @@
+#!/bin/sh
+
+# **************************************************************************
+# Koha 2.2.X MARC Frameworks Export Script
+# for Unix based systems (Unix, GNU/Linux, Mac OS X, etc.)
+#
+# version 0.0.1
+# 2007-11-29
+#
+# by
+#
+# Thomas Dukleth
+# Agogme
+# 109 E 9th Street
+# New York, NY  10003
+# USA
+# http://www.agogme.com
+# koha AT agogme.com
+# 212-674-3783
+#
+# for
+#
+# LibLime
+# 449 E. State Street
+# PO Box 892
+# Athens, OH 45701
+# USA
+# (888) Koha ILS (564-2457)
+# fax: 740-593-5800
+# info AT liblime.com
+#
+#
+# Copyright (C) 2007 Thomas Dukleth.
+#
+#
+# LICENSE INFORMATION.
+#
+# This program is free software; you may redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+#
+# NO WARRANTY.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+#
+# LICENSE COPY.
+#
+# You should have received a copy of the GNU General Public License
+# along with the full Koha program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301, USA.  The license may be found online at
+# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html .
+# 
+# 
+# PURPOSE.
+# 
+# The purpose of this script is to prepare a copy of your MARC frameworks
+# frameworks variations if you have significant ones for inclusion in
+# Koha 3.0 to share them with others.
+#
+#
+# UPDATES.
+#
+# Updated versions for Koha 2.2.X should be available from
+# http://cvs.savannah.nongnu.org/viewvc/koha/misc/?root=koha as long as
+# Savannah is hosting the Koha 2.2.X code repository.
+#
+# Otherwise, consult the Koha website, http://www.koha.org .
+# **************************************************************************
+
+# INSTALLATION REQUIREMENTS.
+
+# This script may be run on any system which includes the directory
+# containing mysqldump in the $PATH.
+
+# This script may be run on any system which has network access to the
+# Koha MySQL database as the administrative user specified in your
+# koha.conf which may be in /etc/koha.conf or another MySQL user with
+# sufficient privileges over your Koha MySQL database.
+
+
+# USER VARIABLES.
+
+# Edit these variables to match your Koha installation.  They may be found
+# in your koha.conf file which may be in /etc/koha.conf .  Do not leave any
+# spaces before or after the '=' sign or the variable will be set to nothing.
+
+# You will need to enter your Koha MySQL user password when prompted.
+
+database=YourKohaDatabaseName
+hostname=localhost
+user=YourKohaDatabaseUser
+kohaversion=2.2.?
+
+# Specify the filename to which to export your Koha MARC frameworks.
+
+exportFilename=koha_frameworks.sql
+
+
+# **************************************************************************
+
+# SCRIPT VARIABLES.
+
+scriptVersion=0.0.1
+scriptDate=2007-11-29
+scriptYear=2007
+
+# ERROR EXIT CODES.
+
+exitHelp=10      # Help command issued.
+exitCompress=40  # Compression failed.
+exitExport=60    # Frameworks export from database failed.
+exitUsage=90     # Improper usage.
+
+
+# DISPLAY VARIABLES.
+
+helpText='
+HELP.
+
+Edit the '$0' script file
+to change the user variables at the beginning to match your
+Koha installation or supply them using the interactive options.
+
+Usage: '$0' [OPTIONS]
+
+ -d DATABASE              Override script set Koha MySQL database.
+ -f FILENAME              Override script set Koha frameworks export filename.
+ -h HOST                  Override script set Koha MySQL hostname.
+ -u USER                  Override script set Koha MySQL user.
+ -V VERSION               Override script set Koha version.
+
+ -?                       Display this help message and exit.
+ -? e                     Display usage examples and exit.
+ -? i                     Display installation requirements and exit.
+ -? u                     Display update information and exit.
+
+ -? c                     Display copyright and licensing information and exit.
+ -? w                     Display no warranty information and exit.
+'
+
+copyrightText='
+COPYRIGHT NOTICE.
+
+Koha 2.2.X MARC Frameworks Export Script
+for Unix based systems (Unix, GNU/Linux, Mac OS X, etc.)
+
+version '$scriptVersion'
+'$scriptDate'
+
+by
+
+Thomas Dukleth
+Agogme
+109 E 9th Street
+New York, NY  10003
+USA
+http://www.agogme.com
+koha AT agogme.com
+212-674-3783
+
+for
+
+LibLime
+449 E. State Street
+PO Box 892
+Athens, OH  45701
+USA
+(888) Koha ILS (564-2457)
+fax: 740-593-5800
+info AT liblime.com
+
+Copyright (C) '$scriptYear' Thomas Dukleth.
+
+LICENSE INFORMATION.
+
+This program is free software; you may redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+NO WARRANTY.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+LICENSE COPY.
+
+You should have received a copy of the GNU General Public License
+along with the full Koha program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301, USA.  The license may be found online at
+http://www.gnu.org/licenses/old-licenses/gpl-2.0.html .
+'
+
+examplesText='
+USAGE EXAMPLES.
+
+Examples should be typed on one line.
+
+Values may be obtained from your koha.conf which may be in
+/etc/koha.conf .
+
+If you have already set values by editing this script, running the
+script without options is sufficient.
+
+ '$0'
+
+Otherwise, supply values using the command line.
+
+ '$0' -d KohaDatabaseName
+  -h ComputerHostNameRunningDatabase -u KohaDatabaseUser
+  -V KohaVersion -f ChooseAnExportFilename
+
+Long help messages may be piped to a pager
+
+ '$0' -? c | less
+
+or file for reading.
+
+ '$0' -? c > copyright_license_info.txt
+'
+
+installationText='
+INSTALLATION REQUIREMENTS.
+
+This script may be run on any system which includes the directory
+containing mysqldump in the $PATH.
+
+This script may be run on any system which has network access to the
+Koha MySQL database as the administrative user specified in your
+koha.conf which may be in /etc/koha.conf or another MySQL user with
+sufficient privileges over your Koha MySQL database.
+'
+
+updateText='
+UPDATES.
+
+Updated versions for Koha 2.2.X should be available from
+http://cvs.savannah.nongnu.org/viewvc/koha/misc/?root=koha as long as
+Savannah is hosting the Koha 2.2.X code repository.
+
+Otherwise, consult the Koha website, http://www.koha.org .
+'
+
+warrantyText='
+NO WARRANTY.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+LICENSE COPY.
+
+You should have received a copy of the GNU General Public License
+along with the full Koha program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301, USA.  The license may be found online at
+http://www.gnu.org/licenses/old-licenses/gpl-2.0.html .
+'
+
+echo
+echo "Koha 2.2.X MARC Frameworks Export Script"
+echo "for Unix based systems (Unix, GNU/Linux, Mac OS X, etc.)."
+echo "version $scriptVersion"
+echo "Copyright (C) $scriptYear Thomas Dukleth."
+echo "View the help message by starting this program using option '-?'."
+echo "This program comes with ABSOLUTELY NO WARRANTY; for details"
+echo "start this program using option '-? w'."
+echo "This is free software, and you are welcome to redistribute it"
+echo "and/or modify it under certain conditions; for details"
+echo "start this program using option '-? c'."
+echo
+
+
+# SCRIPT.
+
+while getopts ":d:f:h:u:V:?:" option
+       do
+               case $option in
+                       d )
+                               if [ $OPTARG ]
+                                       then
+                                               database=$OPTARG
+                                       else
+                                               echo "$helpText"
+                                               exit $exitUsage
+                               fi
+                               ;;
+                       f )
+                               if [ $OPTARG ]
+                                       then
+                                               exportFilename=$OPTARG
+                                       else
+                                               echo "$helpText"
+                                               exit $exitUsage
+                               fi
+                               ;;
+                       h )
+                               if [ $OPTARG ]
+                                       then
+                                               hostname=$OPTARG
+                                       else
+                                               echo "$helpText"
+                                               exit $exitUsage
+                               fi
+                               ;;
+                       u )
+                               if [ $OPTARG ]
+                                       then
+                                               user=$OPTARG
+                                       else
+                                               echo "$helpText"
+                                               exit $exitUsage
+                               fi
+                               ;;
+                       V )
+                               if [ $OPTARG ]
+                                       then
+                                               kohaversion=$OPTARG
+                                       else
+                                               echo "$helpText"
+                                               exit $exitUsage
+                               fi
+                               ;;
+                       ? )
+                               if [ $OPTARG = "c" ]
+                                       then
+                                               echo "$copyrightText"
+                                               exit $exitHelp
+                               fi
+                               if [ $OPTARG = "e" ]
+                                       then
+                                               echo "$examplesText"
+                                               exit $exitHelp
+                               fi
+                               if [ $OPTARG = "i" ]
+                                       then
+                                               echo "$installationText"
+                                               exit $exitHelp
+                               fi
+                               if [ $OPTARG = "u" ]
+                                       then
+                                               echo "$updateText"
+                                               exit $exitHelp
+                               fi
+                               if [ $OPTARG = "w" ]
+                                       then
+                                               echo "$warrantyText"
+                                               exit $exitHelp
+                                       else
+                                               echo "$helpText"
+                                               exit $exitHelp
+                               fi
+                               ;;
+                       * )
+                               echo "$helpText"
+                               exit $exitUsage
+                               ;;
+               esac
+       done
+       shift $(($OPTIND - 1))
+
+if [ $database = "YourKohaDatabaseName" ]
+       then
+               echo "$helpText"
+               exit $exitUsage
+fi
+
+echo
+echo "*****************************************************************"
+echo "Preparing to export Koha MARC frameworks."
+echo "*****************************************************************"
+echo
+mysqldump --allow-keywords --opt --single-transaction -qv \
+               -h $hostname -u $user -p $database \
+               'biblio_framework' 'marc_tag_structure' 
'marc_subfield_structure' \
+               'auth_types' 'auth_tag_structure' 'auth_subfield_structure' \
+               > $exportFilename
+
+if [ $? -eq 0 ]
+       then
+               echo >> $exportFilename
+               echo -- Koha version $kohaversion >> $exportFilename
+               tar -czvvf $exportFilename.tgz $exportFilename
+               if [ $? -eq 0 ]
+                       then
+                               rm -v $exportFilename
+                               echo
+                               echo 
"*****************************************************************"
+                               echo "Please send the compressed copy of the 
exported frameworks file,"
+                               echo "$exportFilename.tgz, as an email 
attachment"
+                               echo "to koha AT agogme.com along with a 
message indicating what"
+                               echo "MARC standards are represented in your 
frameworks and"
+                               echo "what languages they use."
+                               echo 
"*****************************************************************"
+                               echo
+                       else
+                               echo
+                               echo 
"*****************************************************************"
+                               echo "Oops, we could not compress the exported 
frameworks file."
+                               echo
+                               echo "If you can find some means to compress 
the exported frameworks"
+                               echo "file, $exportFilename, please send the 
compressed copy as an email"
+                               echo "attachment to koha AT agogme.com along 
with a message indicating"
+                               echo "what MARC standards are represented in 
your frameworks and what"
+                               echo "languages they use."
+                               echo
+                               echo "If you cannot compress $exportFilename,"
+                               echo "please send it as an email attachment 
with the message"
+                               echo "to jmf AT liblime.com .  Please send a 
copy of the message"
+                               echo "without the attachment to koha AT 
agogme.com ."
+                               echo 
"*****************************************************************"
+                               echo
+                               exit $exitCompress
+               fi
+       else
+               echo
+               echo 
"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
+               echo "Oops, something went wrong trying to export data from 
your Koha"
+               echo "MySQL database!  Check that the user variables for this 
script"
+               echo "have been set correctly for your Koha installation and 
try again."
+               echo 
"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
+               echo
+               exit $exitExport
+fi
+
+exit 0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]