MatN work for versatile appimage creation for all types of os
[goodguy/cinelerra.git] / cinelerra-5.1 / tools / makeappimagetool / copyright.cpp
diff --git a/cinelerra-5.1/tools/makeappimagetool/copyright.cpp b/cinelerra-5.1/tools/makeappimagetool/copyright.cpp
new file mode 100644 (file)
index 0000000..ed254a4
--- /dev/null
@@ -0,0 +1,25 @@
+// local includes
+#include "includes/log.h"
+#include "includes/util.h"
+#include "includes/copyright.h"
+
+// specializations
+#include "includes/copyright_dpkgquery.h"
+
+namespace linuxdeploy {
+    namespace core {
+        namespace copyright {
+            using namespace log;
+
+            std::shared_ptr<ICopyrightFilesManager> ICopyrightFilesManager::getInstance() {
+                if (!util::which("dpkg-query").empty()) {
+                    ldLog() << LD_DEBUG << "Using dpkg-query to search for copyright files" << std::endl;
+                    return std::make_shared<DpkgQueryCopyrightFilesManager>();
+                }
+
+                ldLog() << LD_DEBUG << "No usable copyright files manager implementation found" << std::endl;
+                return nullptr;
+            }
+        }
+    }
+}