]> gitweb.hhaalo.de Git - scantopdf.git/commitdiff
add keyword script
authorBastian Dehn <hhaalo@arcor.de>
Sat, 4 Apr 2026 08:07:25 +0000 (10:07 +0200)
committerBastian Dehn <hhaalo@arcor.de>
Sat, 4 Apr 2026 08:07:25 +0000 (10:07 +0200)
Makefile
src/addkeywords [new file with mode: 0644]
src/addocr
src/scantopdf [changed mode: 0755->0644]
src/scantopdfbw [changed mode: 0755->0644]
src/scantopdfgray [changed mode: 0755->0644]

index 7462f7fba72821b794965a7e532eb3ab5bd4896b..bb09b07c73d5347cae5a1d9d0a9da333daefa6e7 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -16,9 +16,7 @@ SHAREDIR = usr/local/share
 
 all: test package
 
-test: $(BUILDDIR)/parts/scanbasic.sh \
-       $(SRCDIR)/errlog.sh \
-       $(SRCDIR)/addocr.sh
+test: $(BUILDDIR)/parts/scanbasic.sh
 
        ./tests/addocr.bats
        ./tests/scanbasic.bats
@@ -26,7 +24,8 @@ test: $(BUILDDIR)/parts/scanbasic.sh \
 build: $(PACKAGEDIR)/$(BINDIR)/scantopdf \
        $(PACKAGEDIR)/$(BINDIR)/scantopdfgray \
        $(PACKAGEDIR)/$(BINDIR)/scantopdfbw \
-       $(PACKAGEDIR)/$(BINDIR)/addocr
+       $(PACKAGEDIR)/$(BINDIR)/addocr \
+       $(PACKAGEDIR)/$(BINDIR)/addkeywords
 
 package: $(BUILDDIR)/$(PACKAGENAME).deb
 
@@ -48,8 +47,7 @@ $(BUILDDIR)/parts/scanbasic.sh: \
 ################################################################################
 
 $(PACKAGEDIR)/$(BINDIR)/scantopdf: \
-       $(BUILDDIR)/parts/scanbasic.sh \
-       $(SRCDIR)/scantopdf
+       $(BUILDDIR)/parts/scanbasic.sh
 
        mkdir -p $(@D)
        ./tools/includer $(SRCDIR)/scantopdf \
@@ -58,8 +56,7 @@ $(PACKAGEDIR)/$(BINDIR)/scantopdf: \
        chmod 755 $(PACKAGEDIR)/$(BINDIR)/scantopdf
 
 $(PACKAGEDIR)/$(BINDIR)/scantopdfgray: \
-       $(BUILDDIR)/parts/scanbasic.sh \
-       $(SRCDIR)/scantopdfgray
+       $(BUILDDIR)/parts/scanbasic.sh
 
        mkdir -p $(@D)
        ./tools/includer $(SRCDIR)/scantopdfgray \
@@ -68,8 +65,7 @@ $(PACKAGEDIR)/$(BINDIR)/scantopdfgray: \
        chmod 755 $(PACKAGEDIR)/$(BINDIR)/scantopdfgray
 
 $(PACKAGEDIR)/$(BINDIR)/scantopdfbw: \
-       $(BUILDDIR)/parts/scanbasic.sh \
-       $(SRCDIR)/scantopdfbw
+       $(BUILDDIR)/parts/scanbasic.sh
 
        mkdir -p $(@D)
        ./tools/includer $(SRCDIR)/scantopdfgray \
@@ -77,9 +73,7 @@ $(PACKAGEDIR)/$(BINDIR)/scantopdfbw: \
                > $(PACKAGEDIR)/$(BINDIR)/scantopdfbw
        chmod 755 $(PACKAGEDIR)/$(BINDIR)/scantopdfbw
 
-$(PACKAGEDIR)/$(BINDIR)/addocr: \
-       $(SRCDIR)/errlog.sh \
-       $(SRCDIR)/addocr.sh
+$(PACKAGEDIR)/$(BINDIR)/addocr:
 
        mkdir -p $(@D)
        ./tools/includer $(SRCDIR)/addocr \
@@ -87,18 +81,24 @@ $(PACKAGEDIR)/$(BINDIR)/addocr: \
                > $(PACKAGEDIR)/$(BINDIR)/addocr
        chmod 755 $(PACKAGEDIR)/$(BINDIR)/addocr
 
+$(PACKAGEDIR)/$(BINDIR)/addkeywords:
+
+       mkdir -p $(@D)
+       ./tools/includer $(SRCDIR)/keywords \
+               | sed "s/@VERSION@/$(VERSION)/" \
+               > $(PACKAGEDIR)/$(BINDIR)/addkeywords
+       chmod 755 $(PACKAGEDIR)/$(BINDIR)/addkeywords
+
 ################################################################################
 
-$(PACKAGEDIR)/$(SHAREDIR)/scantopdf/cutpage.html: \
-       $(SRCDIR)/cutpage.html
+$(PACKAGEDIR)/$(SHAREDIR)/scantopdf/cutpage.html:
 
        mkdir -p $(@D)
        cp $(SRCDIR)/cutpage.html $(PACKAGEDIR)/$(SHAREDIR)/scantopdf/cutpage.html
 
 ################################################################################
 
-$(PACKAGEDIR)/DEBIAN/control: \
-       $(SRCDIR)/control
+$(PACKAGEDIR)/DEBIAN/control:
 
        mkdir -p $(@D)
        cat $(SRCDIR)/control   \
@@ -110,6 +110,7 @@ $(BUILDDIR)/$(PACKAGENAME).deb: \
        $(PACKAGEDIR)/$(BINDIR)/scantopdfgray \
        $(PACKAGEDIR)/$(BINDIR)/scantopdfbw \
        $(PACKAGEDIR)/$(BINDIR)/addocr \
+       $(PACKAGEDIR)/$(BINDIR)/addkeywords \
        $(PACKAGEDIR)/$(SHAREDIR)/scantopdf/cutpage.html \
        $(PACKAGEDIR)/DEBIAN/control
 
diff --git a/src/addkeywords b/src/addkeywords
new file mode 100644 (file)
index 0000000..4e6cb5b
--- /dev/null
@@ -0,0 +1,27 @@
+#!/bin/bash
+#include "errlog.sh"
+#include "keywwords.sh"
+
+main()
+{
+       local file="$1"
+       local keywords="$2"
+
+       echo "⭐ START: addkeywords @VERSION@"
+
+       [ -n "$file" ] \
+               || errlog "missing file" \
+               || return $?
+       [ -f "$file" ] \
+               || errlog "file $file does not exists" \
+               || return $?
+       [ -n "$keywords" ] \
+               || errlog "missing keywords" \
+               || return $?
+
+       add_keywords "$file" "$keywords"
+
+       echo "✅ SUCCESS: addkeywords  @VERSION@"
+}
+
+main $*
\ No newline at end of file
index c9c562e77f1765c385c352a68bb7dd36e33c24db..9fa585ac2e1824fdaf1a6d3281b36e8d85ca23ee 100644 (file)
@@ -6,7 +6,7 @@ main()
 {
        local file="$1"
 
-       echo "⭐ START: addocr"
+       echo "⭐ START: addocr @VERSION@"
 
        [ -n "$file" ] \
                || errlog "missing file" \
@@ -17,7 +17,7 @@ main()
 
        addocr "$file"
 
-       echo "✅ SUCCESS: addocr"
+       echo "✅ SUCCESS: addocr @VERSION@"
 }
 
 main $*
\ No newline at end of file
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)