From: Alain Spineux Date: Fri, 3 Apr 2020 17:09:58 +0000 (+0200) Subject: dedup: split more dedup1 & dedup2 X-Git-Tag: Release-11.3.2~982 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8a8ceccae7e513394c6cec787c3f8ef082921ee4;p=thirdparty%2Fbacula.git dedup: split more dedup1 & dedup2 - dedup2 tweak Makefile - remove () and exit 1 - populate .PHONY --- diff --git a/bacula/src/stored/Makefile.in b/bacula/src/stored/Makefile.in index f35f415d1..11d13bb07 100644 --- a/bacula/src/stored/Makefile.in +++ b/bacula/src/stored/Makefile.in @@ -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 diff --git a/bacula/src/stored/bsdjson.c b/bacula/src/stored/bsdjson.c index dbb9be0c5..3e8f3a56a 100644 --- a/bacula/src/stored/bsdjson.c +++ b/bacula/src/stored/bsdjson.c @@ -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 Dedup2 . DedupDirectory not defined for Dedup \"%s\"\n"), dedup->hdr.name); OK = false; } diff --git a/bacula/src/stored/dedup_dev.h b/bacula/src/stored/dedup_dev.h index ffd0f3f5e..f25223144 100644 --- a/bacula/src/stored/dedup_dev.h +++ b/bacula/src/stored/dedup_dev.h @@ -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 { diff --git a/bacula/src/stored/stored.c b/bacula/src/stored/stored.c index fc863e81c..4bad8a7d4 100644 --- a/bacula/src/stored/stored.c +++ b/bacula/src/stored/stored.c @@ -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; }