]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
dedup: split more dedup1 & dedup2
authorAlain Spineux <alain@baculasystems.com>
Fri, 3 Apr 2020 17:09:58 +0000 (19:09 +0200)
committerEric Bollengier <eric@baculasystems.com>
Thu, 24 Mar 2022 08:02:57 +0000 (09:02 +0100)
- dedup2 tweak Makefile
  - remove () and exit 1
  - populate .PHONY

bacula/src/stored/Makefile.in
bacula/src/stored/bsdjson.c
bacula/src/stored/dedup_dev.h
bacula/src/stored/stored.c

index f35f415d1fb5da0f8b5feb1cfd011c415af7380e..11d13bb07ee784c34978f1e4229649a7705027c9 100644 (file)
@@ -151,7 +151,7 @@ SD_LIBS = -lbacsd -lbaccfg -lbac -lbacfind
 
 
 .SUFFIXES:     .c .o .lo
-.PHONY:
+.PHONY: dedup1/libdedup1.la dedup2/libdedup2.la
 .DONTCARE:
 
 # inference rules
@@ -209,9 +209,6 @@ gs-driver: bacula-sd-cloud-gs-driver.la
 
 swift-driver: bacula-sd-cloud-swift-driver.la
 
-dedup2: Makefile
-       (cd dedup2 && make DESTDIR=$(DESTDIR) || exit 1)
-
 bacula-sd-cloud-driver.la: Makefile $(CLOUD_ALL_LOBJS)
         $(LIBTOOL_LINK) $(CXX) $(LDFLAGS) -shared $(CLOUD_ALL_LOBJS) -o $@ -R $(libdir) -rpath $(libdir) -module -export-dynamic -release $(LIBBACSD_LT_RELEASE)
 
@@ -237,11 +234,14 @@ bacula-sd-cloud-swift-driver.la: Makefile $(CLOUD_GENERIC_LOBJS)
         $(LIBTOOL_LINK) $(CXX) $(LDFLAGS) -shared $(CLOUD_GENERIC_LOBJS) -o $@ -R $(libdir) -rpath $(libdir) -module -export-dynamic -release $(LIBBACSD_LT_RELEASE)
 
 dedup1/libdedup1.la:
-       (cd dedup1 && make libdedup1.la || exit 1)
+       cd dedup1 && make libdedup1.la
+
+dedup2/libdedup2.la:
+       cd dedup2 && make libdedup2.la
 
-bacula-sd-dedup-driver.la: Makefile $(DEDUP_LOBJS) dedup1/libdedup1.la
+bacula-sd-dedup-driver.la: Makefile $(DEDUP_LOBJS) dedup1/libdedup1.la dedup2/libdedup2.la
        @echo "Making $@ ..."
-       $(LIBTOOL_LINK) $(CXX) $(LDFLAGS) -shared $(DEDUP_LOBJS) dedup1/libdedup1.la -o $@ -rpath $(plugindir) -module -export-dynamic -release $(LIBBACSD_LT_RELEASE) \
+       $(LIBTOOL_LINK) $(CXX) $(LDFLAGS) -shared $(DEDUP_LOBJS) dedup1/libdedup1.la dedup2/libdedup2.la -o $@ -rpath $(plugindir) -module -export-dynamic -release $(LIBBACSD_LT_RELEASE) \
        $(TOKYOCABINET_LIBS)
 
 bacula-sd-aligned-driver.la: Makefile $(ALIGNED_LOBJS)
@@ -477,12 +477,14 @@ libtool-clean:
        @find . -name '*.lo' -print | xargs $(LIBTOOL_CLEAN) $(RMF)
        @$(RMF) -r .libs _libs
        @$(RMF) *.la
-       (cd dedup1 && make libtool-clean)
+       #(cd dedup1 && make libtool-clean)
+       #(cd dedup2 && make libtool-clean)
 
 clean: libtool-clean
        @$(RMF) bacula-sd stored bls bextract bpool btape shmfree core core.* a.out *.o *.bak *~ *.intpro *.extpro 1 2 3
        @$(RMF) bscan bsdjson bcopy static-bacula-sd acsls-changer
-       (cd dedup1 && make clean)
+       #(cd dedup1 && make clean)
+       #(cd dedup2 && make clean)
 
 realclean: clean
        @$(RMF) tags bacula-sd.conf acsls-changer.conf
@@ -490,7 +492,8 @@ realclean: clean
 distclean: realclean
        if test $(srcdir) = .; then $(MAKE) realclean; fi
        (cd $(srcdir); $(RMF) Makefile)
-       (cd dedup1 && make distclean)
+       #(cd dedup1 && make distclean)
+       #(cd dedup2 && make distclean)
 
 devclean: realclean
        if test $(srcdir) = .; then $(MAKE) realclean; fi
@@ -513,7 +516,8 @@ depend:
           $(MV) Makefile.bak Makefile; \
           echo " ======= Something went wrong with make depend. ======="; \
        fi
-       (cd dedup1 && make depend)
+       #(cd dedup1 && make depend)
+       #(cd dedup2 && make depend)
 
 # -----------------------------------------------------------------------
 # DO NOT DELETE: nice dependency list follows
index dbb9be0c531450c93f9e3505409f11f4ddc17c81..3e8f3a56a24f81cc6eece29cd4a0ec194a5f5a15 100644 (file)
@@ -703,11 +703,17 @@ static int check_resources()
 #ifdef SD_DEDUP_SUPPORT
    DEDUPRES *dedup;
    foreach_res(dedup, R_DEDUP) {
-      if (dedup->driver_type == D_LEGACY_DRIVER)
-      {
+      if (dedup->driver_type == D_LEGACY_DRIVER) {
+         if (dedup->dedup_dir == NULL) {
+            Jmsg(NULL, M_FATAL, 0,
+                 _("Failed to initialize Dedup Legasy. DedupDirectory not defined for Dedup \"%s\"\n"),
+                 dedup->hdr.name);
+            OK = false;
+         }
+      } else if (dedup->driver_type == D_DEDUP2_DRIVER) {
          if (dedup->dedup_dir == NULL) {
             Jmsg(NULL, M_FATAL, 0,
-                 _("Failed to initialize Dedup. DedupDirectory not defined for Dedup \"%s\"\n"),
+                 _("Failed to initialize Dedup. DedupDirectory not defined for Dedup \"%s\"\n"),
                  dedup->hdr.name);
             OK = false;
          }
index ffd0f3f5eacac51bf5050b9009717b0885ce8fa5..f25223144be0ae560183125dc4144bb6a9d22c4f 100644 (file)
@@ -25,7 +25,8 @@
 
 /* enum loadable dedup drivers */
 enum {
-   D_LEGACY_DRIVER  = 1
+   D_LEGACY_DRIVER  = 1,
+   D_DEDUP2_DRIVER  = 2
 };
 
 class dedup_dev : public file_dev {
index fc863e81c05631125ff21e4e58b7b2791b791893..4bad8a7d4337cfd11549f310b3f6995d462688dc 100644 (file)
@@ -564,11 +564,17 @@ static int check_resources()
 #ifdef SD_DEDUP_SUPPORT
    DEDUPRES *dedup;
    foreach_res(dedup, R_DEDUP) {
-      if (dedup->driver_type == D_LEGACY_DRIVER)
-      {
+      if (dedup->driver_type == D_LEGACY_DRIVER) {
+         if (dedup->dedup_dir == NULL) {
+            Jmsg(NULL, M_FATAL, 0,
+                 _("Failed to initialize Dedup Legacy. DedupDirectory not defined for Dedup \"%s\"\n"),
+                 dedup->hdr.name);
+            OK = false;
+         }
+      } else if (dedup->driver_type == D_DEDUP2_DRIVER) {
          if (dedup->dedup_dir == NULL) {
             Jmsg(NULL, M_FATAL, 0,
-                 _("Failed to initialize Dedup. DedupDirectory not defined for Dedup \"%s\"\n"),
+                 _("Failed to initialize Dedup 2. DedupDirectory not defined for Dedup \"%s\"\n"),
                  dedup->hdr.name);
             OK = false;
          }