summaryrefslogtreecommitdiff
path: root/functions/compatibility.sh
diff options
context:
space:
mode:
Diffstat (limited to 'functions/compatibility.sh')
-rwxr-xr-xfunctions/compatibility.sh30
1 files changed, 30 insertions, 0 deletions
diff --git a/functions/compatibility.sh b/functions/compatibility.sh
new file mode 100755
index 000000000..f0ae08346
--- /dev/null
+++ b/functions/compatibility.sh
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+## live-build(7) - System Build Scripts
+## Copyright (C) 2016-2020 The Debian Live team
+## Copyright (C) 2006-2015 Daniel Baumann <mail@daniel-baumann.ch>
+##
+## This program comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
+## This is free software, and you are welcome to redistribute it
+## under certain conditions; see COPYING for details.
+
+# We've added the option to also include files before packages renamed the old directory.
+# This function auto detects which version should be used.
+select_includes_chroot(){
+ local OLD_DIR="includes.chroot"
+ local NEW_DIR="includes.chroot_after_packages"
+
+ if Find_files "config/${NEW_DIR}/" && Find_files "config/${OLD_DIR}/"
+ then
+ Echo_error "You have files in ${OLD_DIR} and ${NEW_DIR}. Only one directory is allowed."
+ exit 1
+ fi
+
+ if Find_files "config/${NEW_DIR}/"
+ then
+ echo -n "${NEW_DIR}"
+ elif Find_files "config/${OLD_DIR}/"
+ then
+ echo -n "${OLD_DIR}"
+ fi
+}