From: Arvin Schnell Date: Fri, 7 Sep 2012 12:38:48 +0000 (+0200) Subject: - removed obsolete compare-dirs tool X-Git-Tag: v0.1.3~99 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=a9e53ea5c8a3b480e8c8b64df16a3dfaa6855bc3;p=thirdparty%2Fsnapper.git - removed obsolete compare-dirs tool --- diff --git a/Makefile.am b/Makefile.am index a6cae224..2a2244a4 100644 --- a/Makefile.am +++ b/Makefile.am @@ -2,7 +2,7 @@ # Makefile.am for snapper # -SUBDIRS = snapper examples tools dbus server client scripts data doc po testsuite-real bindings +SUBDIRS = snapper examples dbus server client scripts data doc po testsuite-real bindings AUTOMAKE_OPTIONS = foreign dist-bzip2 no-dist-gzip diff --git a/configure.in b/configure.in index 1d4e1a38..bbdf04e7 100644 --- a/configure.in +++ b/configure.in @@ -71,7 +71,6 @@ AC_OUTPUT( examples/Makefile bindings/Makefile bindings/python/Makefile - tools/Makefile dbus/Makefile server/Makefile client/Makefile diff --git a/snapper.spec.in b/snapper.spec.in index c54eab55..10e8a4a2 100644 --- a/snapper.spec.in +++ b/snapper.spec.in @@ -121,9 +121,6 @@ Authors: %else %config(noreplace) %{_sysconfdir}/sysconfig/snapper %endif -%dir %{_libdir}/snapper -%dir %{_libdir}/snapper/bin -%{_libdir}/snapper/bin/compare-dirs %post -n libsnapper@LIBVERSION_MAJOR@ /sbin/ldconfig diff --git a/snapper/AppUtil.cc b/snapper/AppUtil.cc index 5874d4f9..792cec8c 100644 --- a/snapper/AppUtil.cc +++ b/snapper/AppUtil.cc @@ -88,22 +88,6 @@ namespace snapper } - FILE* - mkstemp(string& path) - { - char* tmp = strdup(path.c_str()); - - int fd = ::mkstemp(tmp); - if (fd == -1) - return NULL; - - path = tmp; - free(tmp); - - return fdopen(fd, "w"); - } - - bool clonefile(int src_fd, int dest_fd) { diff --git a/snapper/AppUtil.h b/snapper/AppUtil.h index f9cee595..e9a88b44 100644 --- a/snapper/AppUtil.h +++ b/snapper/AppUtil.h @@ -47,8 +47,6 @@ namespace snapper list glob(const string& path, int flags); - FILE* mkstemp(string& path); - bool clonefile(int src_fd, int dest_fd); bool copyfile(int src_fd, int dest_fd); diff --git a/tools/.gitignore b/tools/.gitignore deleted file mode 100644 index bbbb2da8..00000000 --- a/tools/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -compare-dirs.o -compare-dirs diff --git a/tools/Makefile.am b/tools/Makefile.am deleted file mode 100644 index a27b87d9..00000000 --- a/tools/Makefile.am +++ /dev/null @@ -1,14 +0,0 @@ -# -# Makefile.am for snapper/tools -# - -INCLUDES = -I$(top_srcdir) - - -toolsbindir = $(libdir)/snapper/bin - -toolsbin_PROGRAMS = compare-dirs - -compare_dirs_SOURCES = compare-dirs.cc -compare_dirs_LDADD = ../snapper/libsnapper.la -lboost_thread-mt - diff --git a/tools/compare-dirs.cc b/tools/compare-dirs.cc deleted file mode 100644 index 9df110e3..00000000 --- a/tools/compare-dirs.cc +++ /dev/null @@ -1,80 +0,0 @@ - -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -using namespace snapper; -using namespace std; - - -string tmp_name; - -FILE* file = NULL; - - -void -terminate(int) -{ - if (file != NULL) - fclose(file); - - if (!tmp_name.empty()) - unlink(tmp_name.c_str()); - - exit(EXIT_FAILURE); -} - - -void -write_line(const string& name, unsigned int status) -{ - fprintf(file, "%s %s\n", statusToString(status).c_str(), name.c_str()); -} - - -int -main(int argc, char** argv) -{ - if (argc != 4) - { - fprintf(stderr, "usage: compare-dirs path1 path2 output\n"); - exit(EXIT_FAILURE); - } - - daemon(0, 0); - - initDefaultLogger(); - - string path1 = argv[1]; - string path2 = argv[2]; - string output = argv[3]; - - y2mil("compare-dirs path:" << path1 << " path2:" << path2 << " output:" << output); - - struct sigaction act; - act.sa_handler = terminate; - sigemptyset(&act.sa_mask); - act.sa_flags = 0; - - sigaction(SIGINT, &act, NULL); - sigaction(SIGTERM, &act, NULL); - - tmp_name = output + ".tmp-XXXXXX"; - - file = mkstemp(tmp_name); - - cmpDirs(SDir(path1), SDir(path2), write_line); - - fclose(file); - - rename(tmp_name.c_str(), output.c_str()); - - exit(EXIT_SUCCESS); -}