mark .bat files as binary

This commit is contained in:
Kovid Goyal 2013-05-29 17:12:48 +05:30
parent 9c2a919cf9
commit 35db7f8404
2 changed files with 209 additions and 209 deletions

3
.gitattributes vendored
View File

@ -19,7 +19,6 @@
*.xsl text *.xsl text
*.tmpl text *.tmpl text
*.qrc text *.qrc text
*.bat eol=crlf
*.sh text *.sh text
*.xhtml text *.xhtml text
@ -32,6 +31,8 @@
*.gif binary *.gif binary
*.pickle binary *.pickle binary
*.pdf binary *.pdf binary
# This is binary so that git stores it with cr-lf endings in the repo, which means that bzr qdiff does not think it has changed
*.bat binary
# Prevent certain files from being exported: # Prevent certain files from being exported:
.gitattributes export-ignore .gitattributes export-ignore

View File

@ -1,208 +1,207 @@
@echo OFF @echo OFF
REM Calibre-Portable.bat REM Calibre-Portable.bat
REM ¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬ REM ¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬
REM REM
REM Batch File to start a Calibre configuration on Windows REM Batch File to start a Calibre configuration on Windows
REM giving explicit control of the location of: REM giving explicit control of the location of:
REM - Calibre Program Files REM - Calibre Program Files
REM - Calibre Library Files REM - Calibre Library Files
REM - Calibre Config Files REM - Calibre Config Files
REM - Calibre Metadata database REM - Calibre Metadata database
REM - Calibre Source files REM - Calibre Source files
REM - Calibre Temp Files REM - Calibre Temp Files
REM By setting the paths correctly it can be used to run: REM By setting the paths correctly it can be used to run:
REM - A "portable calibre" off a USB stick. REM - A "portable calibre" off a USB stick.
REM - A network installation with local metadata database REM - A network installation with local metadata database
REM (for performance) and books stored on a network share REM (for performance) and books stored on a network share
REM - A local installation using customised settings REM - A local installation using customised settings
REM REM
REM If trying to run off a USB stick then the folder structure REM If trying to run off a USB stick then the folder structure
REM shown below is recommended (relative to the location of REM shown below is recommended (relative to the location of
REM this batch file). This can structure can also be used REM this batch file). This can structure can also be used
REM when running of a local hard disk if you want to get the REM when running of a local hard disk if you want to get the
REM level of control this batch file provides. REM level of control this batch file provides.
REM - Calibre2 Location of program files REM - Calibre2 Location of program files
REM - CalibreConfig Location of Configuration files REM - CalibreConfig Location of Configuration files
REM - CalibreLibrary Location of Books and metadata REM - CalibreLibrary Location of Books and metadata
REM - CalibreSource Location of Calibre Source files (Optional) REM - CalibreSource Location of Calibre Source files (Optional)
REM REM
REM This batch file is designed so that if you create the recommended REM This batch file is designed so that if you create the recommended
REM folder structure then it can be used 'as is' without modification. REM folder structure then it can be used 'as is' without modification.
REM REM
REM More information on the Environment Variables used by Calibre can REM More information on the Environment Variables used by Calibre can
REM be found at: REM be found at:
REM http://manual.calibre-ebook.com/customize.html#environment-variables REM http://manual.calibre-ebook.com/customize.html#environment-variables
REM REM
REM The documentation for this file in the Calibre manual can be found at: REM The documentation for this file in the Calibre manual can be found at:
REM http://manual.calibre-ebook.com/portable.html REM http://manual.calibre-ebook.com/portable.html
REM REM
REM CHANGE HISTORY REM CHANGE HISTORY
REM ¬¬¬¬¬¬¬¬¬¬¬¬¬¬ REM ¬¬¬¬¬¬¬¬¬¬¬¬¬¬
REM 22 Jan 2012 itimpi - Updated to keep it in line with the calibre-portable.sh REM 22 Jan 2012 itimpi - Updated to keep it in line with the calibre-portable.sh
REM file for Linux systems REM file for Linux systems
REM -------------------------------------
REM ------------------------------------- REM Set up Calibre Config folder
REM Set up Calibre Config folder REM
REM REM This is where user specific settings
REM This is where user specific settings REM are stored.
REM are stored. REM -------------------------------------
REM -------------------------------------
IF EXIST CalibreConfig (
IF EXIST CalibreConfig ( SET CALIBRE_CONFIG_DIRECTORY=%cd%\CalibreConfig
SET CALIBRE_CONFIG_DIRECTORY=%cd%\CalibreConfig ECHO CONFIG FILES: %cd%\CalibreConfig
ECHO CONFIG FILES: %cd%\CalibreConfig )
)
REM --------------------------------------------------------------
REM -------------------------------------------------------------- REM Specify Location of ebooks
REM Specify Location of ebooks REM
REM REM Location where Book files are located
REM Location where Book files are located REM Either set explicit path, or if running from a USB stick
REM Either set explicit path, or if running from a USB stick REM a relative path can be used to avoid need to know the
REM a relative path can be used to avoid need to know the REM drive letter of the USB stick.
REM drive letter of the USB stick. REM
REM REM Comment out any of the following that are not to be used
REM Comment out any of the following that are not to be used REM (although leaving them in does not really matter)
REM (although leaving them in does not really matter) REM --------------------------------------------------------------
REM --------------------------------------------------------------
IF EXIST U:\eBooks\CalibreLibrary (
IF EXIST U:\eBooks\CalibreLibrary ( SET CALIBRE_LIBRARY_DIRECTORY=U:\eBOOKS\CalibreLibrary
SET CALIBRE_LIBRARY_DIRECTORY=U:\eBOOKS\CalibreLibrary ECHO LIBRARY FILES: U:\eBOOKS\CalibreLibrary
ECHO LIBRARY FILES: U:\eBOOKS\CalibreLibrary )
) IF EXIST CalibreLibrary (
IF EXIST CalibreLibrary ( SET CALIBRE_LIBRARY_DIRECTORY=%cd%\CalibreLibrary
SET CALIBRE_LIBRARY_DIRECTORY=%cd%\CalibreLibrary ECHO LIBRARY FILES: %cd%\CalibreLibrary
ECHO LIBRARY FILES: %cd%\CalibreLibrary )
)
REM --------------------------------------------------------------
REM -------------------------------------------------------------- REM Specify Location of metadata database (optional)
REM Specify Location of metadata database (optional) REM
REM REM Location where the metadata.db file is located. If not set
REM Location where the metadata.db file is located. If not set REM the same location as Books files will be assumed. This.
REM the same location as Books files will be assumed. This. REM option is typically set to get better performance when the
REM option is typically set to get better performance when the REM Library is on a (slow) network drive. Putting the metadata.db
REM Library is on a (slow) network drive. Putting the metadata.db REM file locally then makes gives a big performance improvement.
REM file locally then makes gives a big performance improvement. REM
REM REM NOTE. If you use this option, then the ability to switch
REM NOTE. If you use this option, then the ability to switch REM libraries within Calibre will be disabled. Therefore
REM libraries within Calibre will be disabled. Therefore REM you do not want to set it if the metadata.db file
REM you do not want to set it if the metadata.db file REM is at the same location as the book files.
REM is at the same location as the book files. REM
REM REM Another point to watch is that plugins can cause problems
REM Another point to watch is that plugins can cause problems REM as they often store absolute path information
REM as they often store absolute path information REM --------------------------------------------------------------
REM --------------------------------------------------------------
IF EXIST %cd%\CalibreMetadata\metadata.db (
IF EXIST %cd%\CalibreMetadata\metadata.db ( IF NOT "%CALIBRE_LIBRARY_DIRECTORY%" == "%cd%\CalibreMetadata" (
IF NOT "%CALIBRE_LIBRARY_DIRECTORY%" == "%cd%\CalibreMetadata" ( SET CALIBRE_OVERRIDE_DATABASE_PATH=%cd%\CalibreMetadata\metadata.db
SET CALIBRE_OVERRIDE_DATABASE_PATH=%cd%\CalibreMetadata\metadata.db ECHO DATABASE: %cd%\CalibreMetadata\metadata.db
ECHO DATABASE: %cd%\CalibreMetadata\metadata.db ECHO '
ECHO ' ECHO ***CAUTION*** Library Switching will be disabled
ECHO ***CAUTION*** Library Switching will be disabled ECHO '
ECHO ' )
) )
)
REM --------------------------------------------------------------
REM -------------------------------------------------------------- REM Specify Location of source (optional)
REM Specify Location of source (optional) REM
REM REM It is easy to run Calibre from source
REM It is easy to run Calibre from source REM Just set the environment variable to where the source is located
REM Just set the environment variable to where the source is located REM When running from source the GUI will have a '*' after the version.
REM When running from source the GUI will have a '*' after the version. REM number that is displayed at the bottom of the Calibre main screen.
REM number that is displayed at the bottom of the Calibre main screen. REM
REM REM More information on setting up a development environment can
REM More information on setting up a development environment can REM be found at:
REM be found at: REM http://manual.calibre-ebook.com/develop.html#develop
REM http://manual.calibre-ebook.com/develop.html#develop REM --------------------------------------------------------------
REM --------------------------------------------------------------
IF EXIST CalibreSource\src (
IF EXIST CalibreSource\src ( SET CALIBRE_DEVELOP_FROM=%cd%\CalibreSource\src
SET CALIBRE_DEVELOP_FROM=%cd%\CalibreSource\src ECHO SOURCE FILES: %cd%\CalibreSource\src
ECHO SOURCE FILES: %cd%\CalibreSource\src ) ELSE (
) ELSE ( ECHO SOURCE FILES: *** Not being Used ***
ECHO SOURCE FILES: *** Not being Used *** )
)
REM --------------------------------------------------------------
REM -------------------------------------------------------------- REM Specify Location of calibre Windows binaries (optional)
REM Specify Location of calibre Windows binaries (optional) REM
REM REM To avoid needing Calibre to be set in the search path, ensure
REM To avoid needing Calibre to be set in the search path, ensure REM that Calibre Program Files is current directory when starting.
REM that Calibre Program Files is current directory when starting. REM The following test falls back to using search path .
REM The following test falls back to using search path . REM This folder can be populated by copying the Calibre2 folder from
REM This folder can be populated by copying the Calibre2 folder from REM an existing installation or by installing direct to here.
REM an existing installation or by installing direct to here. REM
REM REM NOTE. Do not try and put both Windows and Linux binaries into
REM NOTE. Do not try and put both Windows and Linux binaries into REM same folder as this can cause problems.
REM same folder as this can cause problems. REM --------------------------------------------------------------
REM --------------------------------------------------------------
IF EXIST %cd%\Calibre2 (
IF EXIST %cd%\Calibre2 ( CD %cd%\Calibre2
CD %cd%\Calibre2 ECHO PROGRAM FILES: %cd%
ECHO PROGRAM FILES: %cd% ) ELSE (
) ELSE ( ECHO PROGRAM FILES: *** Use System search PATH ***
ECHO PROGRAM FILES: *** Use System search PATH *** )
)
REM --------------------------------------------------------------
REM -------------------------------------------------------------- REM Location of Calibre Temporary files (optional)
REM Location of Calibre Temporary files (optional) REM
REM REM Calibre creates a lot of temporary files while running
REM Calibre creates a lot of temporary files while running REM In theory these are removed when Calibre finishes, but
REM In theory these are removed when Calibre finishes, but REM in practise files can be left behind (particularily if
REM in practise files can be left behind (particularily if REM any errors occur). Using this option allows some
REM any errors occur). Using this option allows some REM explicit clean-up of these files.
REM explicit clean-up of these files. REM If not set Calibre uses the normal system TEMP location
REM If not set Calibre uses the normal system TEMP location REM --------------------------------------------------------------
REM --------------------------------------------------------------
SET CALIBRE_TEMP_DIR=%TEMP%\CALIBRE_TEMP
SET CALIBRE_TEMP_DIR=%TEMP%\CALIBRE_TEMP ECHO TEMPORARY FILES: %CALIBRE_TEMP_DIR%
ECHO TEMPORARY FILES: %CALIBRE_TEMP_DIR%
IF EXIST "%CALIBRE_TEMP_DIR%" RMDIR /s /q "%CALIBRE_TEMP_DIR%"
IF EXIST "%CALIBRE_TEMP_DIR%" RMDIR /s /q "%CALIBRE_TEMP_DIR%" MKDIR "%CALIBRE_TEMP_DIR%"
MKDIR "%CALIBRE_TEMP_DIR%" REM set the following for any components that do
REM set the following for any components that do REM not obey the CALIBRE_TEMP_DIR setting
REM not obey the CALIBRE_TEMP_DIR setting SET TMP=%CALIBRE_TEMP_DIR%
SET TMP=%CALIBRE_TEMP_DIR% SET TEMP=%CALIBRE_TEMP_DIR%
SET TEMP=%CALIBRE_TEMP_DIR%
REM --------------------------------------------------------------
REM -------------------------------------------------------------- REM Set the Interface language (optional)
REM Set the Interface language (optional) REM
REM REM If not set Calibre uses the language set in Preferences
REM If not set Calibre uses the language set in Preferences REM --------------------------------------------------------------
REM --------------------------------------------------------------
SET CALIBRE_OVERRIDE_LANG=EN
SET CALIBRE_OVERRIDE_LANG=EN ECHO INTERFACE LANGUAGE: %CALIBRE_OVERRIDE_LANG%
ECHO INTERFACE LANGUAGE: %CALIBRE_OVERRIDE_LANG%
REM ----------------------------------------------------------
REM ---------------------------------------------------------- REM The following gives a chance to check the settings before
REM The following gives a chance to check the settings before REM starting Calibre. It can be commented out if not wanted.
REM starting Calibre. It can be commented out if not wanted. REM ----------------------------------------------------------
REM ----------------------------------------------------------
ECHO '
ECHO ' ECHO Press CTRL-C if you do not want to continue
ECHO Press CTRL-C if you do not want to continue PAUSE
PAUSE
REM --------------------------------------------------------
REM -------------------------------------------------------- REM Start up the calibre program.
REM Start up the calibre program. REM
REM REM The use of 'belownormal' priority helps keep the system
REM The use of 'belownormal' priority helps keep the system REM responsive while Calibre is running. Within Calibre itself
REM responsive while Calibre is running. Within Calibre itself REM the backgound processes should be set to run with 'low' priority.
REM the backgound processes should be set to run with 'low' priority.
REM Using the START command starts up Calibre in a separate process.
REM Using the START command starts up Calibre in a separate process. REM If used without /WAIT option it launches Calibre and contines batch file.
REM If used without /WAIT option it launches Calibre and contines batch file. REM normally this would simply run off the end and close the Command window.
REM normally this would simply run off the end and close the Command window. REM Use with /WAIT to wait until Calibre completes to run a task on exit
REM Use with /WAIT to wait until Calibre completes to run a task on exit REM --------------------------------------------------------
REM --------------------------------------------------------
ECHO "Starting up Calibre"
ECHO "Starting up Calibre" ECHO OFF
ECHO OFF ECHO %cd%
ECHO %cd% START /belownormal Calibre --with-library "%CALIBRE_LIBRARY_DIRECTORY%"
START /belownormal Calibre --with-library "%CALIBRE_LIBRARY_DIRECTORY%"