From d37c04f83d10654885acd3833f1a07ae55e9e4f9 Mon Sep 17 00:00:00 2001 From: Konrad Rosenbaum Date: Tue, 10 Jan 2017 23:13:24 +0100 Subject: [PATCH] add installer merge tool Change-Id: I014e81e28d55858f496e56b41ce4ef2b0c2f850b --- aurora/aurora.pro | 2 +- aurora/instmerge/instmerge.pro | 38 ++++++++++++++++ aurora/instmerge/main.cpp | 92 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 131 insertions(+), 1 deletions(-) create mode 100644 aurora/instmerge/instmerge.pro create mode 100644 aurora/instmerge/main.cpp diff --git a/aurora/aurora.pro b/aurora/aurora.pro index 4ee5c4c..19050f0 100644 --- a/aurora/aurora.pro +++ b/aurora/aurora.pro @@ -1,3 +1,3 @@ TEMPLATE = subdirs -SUBDIRS = dloader instgen \ No newline at end of file +SUBDIRS = dloader instgen instmerge diff --git a/aurora/instmerge/instmerge.pro b/aurora/instmerge/instmerge.pro new file mode 100644 index 0000000..16af618 --- /dev/null +++ b/aurora/instmerge/instmerge.pro @@ -0,0 +1,38 @@ +TEMPLATE = app + +TARGET = instmerge +DESTDIR = $$PWD/../../bin +QT -= gui +QT += xml +CONFIG += release hide_symbols separate_debug_info console c++11 + +OBJECTS_DIR = .ctmp +MOC_DIR = .ctmp +RCC_DIR = .ctmp + +DEFINES += AURORA_INSTGEN_BUILD=1 + +INCLUDEPATH += . $$PWD/../common +DEPENDPATH += $$INCLUDEPATH + +SOURCES += main.cpp \ + ../common/metafile.cpp + +HEADERS += \ + ../common/metafile.h + + +linux { + QMAKE_CFLAGS += -fPIE + QMAKE_CXXFLAGS += -fPIE + QMAKE_LFLAGS += -pie + #make sure we find our libs + QMAKE_LFLAGS += -Wl,-rpath,\'\$$ORIGIN/../lib\' +} +QMAKE_CFLAGS += -fstack-protector-all -Wstack-protector +QMAKE_CXXFLAGS += -fstack-protector-all -Wstack-protector + +win32 { + QMAKE_LFLAGS += -Wl,--nxcompat -Wl,--dynamicbase + LIBS += -lssp +} diff --git a/aurora/instmerge/main.cpp b/aurora/instmerge/main.cpp new file mode 100644 index 0000000..13c21d1 --- /dev/null +++ b/aurora/instmerge/main.cpp @@ -0,0 +1,92 @@ +// Copyright (C) 2017 by Konrad Rosenbaum +// protected under the GNU LGPL version 3 or at your option any newer. +// See COPYING.LGPL file that comes with this distribution. +// + +#include +#include +#include +#include +#include +#include + +#include "metafile.h" +#include "fhelp.h" + +MetaFile targetmetafile; +bool isinitialized=false; + +bool mergeDirectory(QString targetdirname,QString metafilename,QString sourcedirname) +{ + //get source meta file + MetaFile mf(sourcedirname+"/"+metafilename); + if(!mf.isValid()){ + qDebug()<<"Error: cannot open meta file"<