epubname 2.3.0 → 2.3.1
raw patch · 6 files changed
+49/−24 lines, 6 filesdep +directorydep −unixsetup-changed
Dependencies added: directory
Dependencies removed: unix
Files
- Setup.hs +2/−16
- doc/INSTALL +23/−0
- epubname.cabal +8/−5
- src/EpubName/Opts.hs +1/−1
- src/epubname.hs +2/−2
- util/win-dist.sh +13/−0
Setup.hs view
@@ -4,29 +4,15 @@ -- License: BSD3 (see LICENSE) -- Author: Dino Morelli <dino@ui3.info> -import Control.Monad ( unless ) import Distribution.Simple-import System.Cmd-import System.FilePath-import System.Posix.Files ( createSymbolicLink, fileExist )+import System.Cmd ( system ) main = defaultMainWithHooks (simpleUserHooks - { postBuild = customPostBuild- , runTests = testRunner+ { runTests = testRunner } ) where- -- Create symlink to the binary after build for developer - -- convenience- customPostBuild _ _ _ _ = do- let dest = "epubname"-- exists <- fileExist dest- unless exists $ do- let src = "dist" </> "build" </> dest </> dest- createSymbolicLink src dest- -- Target for running all unit tests testRunner _ _ _ _ = do system $ "runhaskell -isrc testsuite/runtests.hs"
+ doc/INSTALL view
@@ -0,0 +1,23 @@+Installation information for the Windows binary distribution+++First, understand that this is command-line software. You don't run+it with the mouse. There is no icon. It's not going in your Start+menu. It's to be run from within a command shell.+++Although not my preferred way, epubname will run from the Windows+cmd.exe shell.++What I would do is install the cygwin tools and run it from a+bash shell. Having cygwin in place, I would place the binary in+/usr/local/bin, which should be on your PATH in cygwin shells. And+you're good to go.+++If you're confused about how to use epubname, do this in your shell:++ > epubname.exe --help+++And if you find bugs or problems, email: dino@ui3.info
epubname.cabal view
@@ -1,6 +1,6 @@ name: epubname cabal-version: >= 1.2-version: 2.3.0+version: 2.3.1 build-type: Simple license: BSD3 license-file: LICENSE@@ -13,11 +13,14 @@ description: Command-line utility for renaming epub ebook files based on the OPF Package metadata. category: Application, Console-tested-with: GHC>=6.12.3+tested-with: GHC >= 6.12.3 executable epubname main-is: epubname.hs- build-depends: base >= 3 && < 5, epub-metadata >= 2.0.2, mtl, - regex-compat, unix- ghc-options: -Wall+ build-depends: base >= 3 && < 5, directory, epub-metadata >= 2.0.2, + mtl, regex-compat hs-source-dirs: src++ -- To strip debug symbols from the binary, for Windows, not portable+ --ghc-options: -Wall -optl-s+ ghc-options: -Wall
src/EpubName/Opts.hs view
@@ -103,5 +103,5 @@ , "" , "Magazines are kind of a sticky problem in that it's often desireable to have edition and/or date info in the filename. There's a lot of chaos out there with titling the epub editions of magazines. The solution in this software is to do some pattern matching on multiple fields in the magazine's metadata combined with custom naming code for specific magazines. This means that support for future magazines will likely have to be hand-coded into future versions of this utility. Modifying this just isn't very non-programmer friendly." , ""- , "Version 2.3.0 Dino Morelli <dino@ui3.info>"+ , "Version 2.3.1 Dino Morelli <dino@ui3.info>" ]
src/epubname.hs view
@@ -7,12 +7,12 @@ import Codec.Epub.Opf.Parse import Control.Monad import Control.Monad.Trans+import System.Directory ( renameFile ) import System.Environment ( getArgs ) import System.Exit import System.IO ( BufferMode ( NoBuffering ) , hSetBuffering, stdout, stderr )-import System.Posix.Files ( rename ) import Text.Printf import EpubName.Formatters ( tryFormatting )@@ -51,7 +51,7 @@ pkg <- parseEpubOpf oldPath let md = opMeta pkg (fmtUsed, newPath) <- tryFormatting (oldPath, md)- unless (optNoAction opts) $ liftIO $ rename oldPath newPath+ unless (optNoAction opts) $ liftIO $ renameFile oldPath newPath return (oldPath, newPath, fmtUsed, pkg) let (success, report) = either ((,) False)
+ util/win-dist.sh view
@@ -0,0 +1,13 @@+#! /bin/bash++if [ -z "$1" ]+then+ echo "ERROR: Please give basename for zip file"+ echo "example: ./util/win-dist.sh epubname-2.3.1-win"+ exit 1+fi++zipFile="$1.zip"++rm $zipFile+zip -j $zipFile doc/INSTALL dist/build/epubname/epubname.exe