Small fixes
authorNiki Roo <niki@nikiroo.be>
Sun, 12 Feb 2017 14:26:11 +0000 (15:26 +0100)
committerNiki Roo <niki@nikiroo.be>
Sun, 12 Feb 2017 14:26:11 +0000 (15:26 +0100)
Samll fixes:
- configure.sh fix to include sources into the created JARs
- fix source name of MangaFox (.me, not .met)
- fix a check in Library to be more verbose in case of error

Makefile.base
configure.sh
src/be/nikiroo/fanfix/Library.java
src/be/nikiroo/fanfix/supported/MangaFox.java

index 300db504c67c2f31c9fa6ffef42117d8a3617baa..86050e6d3e9e7db7da1bcc2015895c0da8364a75 100644 (file)
@@ -62,7 +62,7 @@ test:
 clean:
        rm -rf bin/
        @echo Removing sources taken from libs...
-       @for lib in libs/*.jar; do \
+       @for lib in libs/*-sources.jar; do \
                basename "$$lib"; \
                jar tf "$$lib" | while read -r ln; do \
                        [ -f "src/$$ln" ] && rm "src/$$ln"; \
@@ -92,7 +92,7 @@ resources: libs
 
 libs: bin
        @[ -e bin/libs -o ! -d libs ] || echo Extracting sources from libs...
-       @[ -e bin/libs -o ! -d libs ] || (cd src&& for lib in ../libs/*.jar;do \
+       @[ -e bin/libs -o ! -d libs ] || (cd src && for lib in ../libs/*-sources.jar; do \
                basename "$$lib"; \
                jar xf "$$lib"; \
        done )
@@ -105,6 +105,8 @@ $(NAME).jar: resources
        @echo "Main-Class: `echo "$(MAIN)" | sed 's:/:.:g'`" > bin/manifest
        @echo >> bin/manifest
        $(JAR) cfm $(NAME).jar bin/manifest $(JAR_FLAGS)
+       @[ ! -e VERSION ] || echo Copying to "$(NAME)-`cat VERSION`.jar"
+       @[ ! -e VERSION ] || cp $(NAME).jar "$(NAME)-`cat VERSION`.jar"
 
 run: 
        @[ -e bin/$(MAIN).class ] || echo You need to build the sources
index 2eab91b5b7ce49f952f7ad279f5fd32a67279c31..76697d995a9f48a6c7d498e762d6762ad4e89123 100755 (executable)
@@ -36,7 +36,7 @@ done
 echo "MAIN = be/nikiroo/fanfix/Main" > Makefile
 echo "NAME = fanfix" >> Makefile
 echo "PREFIX = $PREFIX" >> Makefile
-echo "JAR_FLAGS += -C bin/ org -C bin/ be" >> Makefile
+echo "JAR_FLAGS += -C bin/ org -C bin/ be -C ./ src" >> Makefile
 
 cat Makefile.base >> Makefile
 
index 9864ad773d085527c28e1dba467bf7a01be6ca1b..602a25fd16e702dcea6e64fc79e479f9c9614884 100644 (file)
@@ -230,18 +230,26 @@ public class Library {
                                                                        && !path.endsWith(format)) {
                                                                MetaData meta = itSupport.processMeta(
                                                                                file.toURI().toURL()).getMeta();
-                                                               stories.put(meta, file);
-
-                                                               try {
-                                                                       int id = Integer.parseInt(meta.getLuid());
-                                                                       if (id > lastId) {
-                                                                               lastId = id;
+                                                               if (meta != null) {
+                                                                       stories.put(meta, file);
+                                                                       try {
+                                                                               int id = Integer.parseInt(meta
+                                                                                               .getLuid());
+                                                                               if (id > lastId) {
+                                                                                       lastId = id;
+                                                                               }
+                                                                       } catch (Exception e) {
+                                                                               // not normal!!
+                                                                               Instance.syserr(new IOException(
+                                                                                               "Cannot understand the LUID of "
+                                                                                                               + file.getPath() + ": "
+                                                                                                               + meta.getLuid(), e));
                                                                        }
-                                                               } catch (Exception e) {
+                                                               } else {
                                                                        // not normal!!
                                                                        Instance.syserr(new IOException(
-                                                                                       "Cannot read the LUID of: "
-                                                                                                       + file.getPath(), e));
+                                                                                       "Cannot get metadata for: "
+                                                                                                       + file.getPath()));
                                                                }
                                                        }
                                                } catch (IOException e) {
index fb72bf531d00d9e6b20d88f127b9a19e98dc64e3..2c4c2f3063f2cbcc6daa0ad7f0ae9fb9cbfeca35 100644 (file)
@@ -21,7 +21,7 @@ class MangaFox extends BasicSupport {
 
        @Override
        public String getSourceName() {
-               return "MangaFox.met";
+               return "MangaFox.me";
        }
 
        @Override