aboutsummaryrefslogtreecommitdiff
path: root/paludis/merger_TEST_setup.sh
diff options
context:
space:
mode:
authorAvatar David Leverton <levertond@googlemail.com> 2007-10-05 18:18:21 +0000
committerAvatar David Leverton <levertond@googlemail.com> 2007-10-05 18:18:21 +0000
commitf354f4f17804a1b48b549646d5fdf0f9cf99ea9f (patch)
treea0f1e914be656688742c45dbb594529b0abb25e0 /paludis/merger_TEST_setup.sh
parentf6be6c9c44cdc3f531c9f419e3bd3460c4964dc6 (diff)
downloadpaludis-f354f4f17804a1b48b549646d5fdf0f9cf99ea9f.tar.gz
paludis-f354f4f17804a1b48b549646d5fdf0f9cf99ea9f.tar.xz
Merge libpaludisdeplist, -digests, -environments, -merger, -repositories, -tasks into libpaludis.
Diffstat (limited to 'paludis/merger_TEST_setup.sh')
-rwxr-xr-xpaludis/merger_TEST_setup.sh117
1 files changed, 117 insertions, 0 deletions
diff --git a/paludis/merger_TEST_setup.sh b/paludis/merger_TEST_setup.sh
new file mode 100755
index 000000000..9d9dd1858
--- /dev/null
+++ b/paludis/merger_TEST_setup.sh
@@ -0,0 +1,117 @@
+#!/bin/bash
+# vim: set ft=sh sw=4 sts=4 et :
+
+mkdir merger_TEST_dir || exit 2
+cd merger_TEST_dir || exit 3
+
+
+mkdir -p sym_over_nothing_dir/{image,root}
+ln -s image_dst sym_over_nothing_dir/image/sym
+
+mkdir -p sym_over_sym_dir/{image,root}
+ln -s image_dst sym_over_sym_dir/image/sym
+ln -s root_dst sym_over_sym_dir/root/sym
+
+mkdir -p sym_over_file_dir/{image,root}
+ln -s image_dst sym_over_file_dir/image/sym
+> sym_over_file_dir/root/sym
+
+mkdir -p sym_over_dir_dir/{image,root}
+ln -s image_dst sym_over_dir_dir/image/sym
+mkdir sym_over_dir_dir/root/sym
+
+
+mkdir -p dir_over_nothing_dir/{image,root}
+mkdir dir_over_nothing_dir/image/dir
+
+mkdir -p dir_over_dir_dir/{image,root}
+mkdir dir_over_dir_dir/image/dir
+mkdir dir_over_dir_dir/root/dir
+
+mkdir -p dir_over_file_dir/{image,root}
+mkdir dir_over_file_dir/image/dir
+> dir_over_file_dir/root/dir
+
+mkdir -p dir_over_sym_1_dir/{image,root}
+mkdir dir_over_sym_1_dir/image/dir
+> dir_over_sym_1_dir/image/dir/file
+mkdir dir_over_sym_1_dir/root/realdir
+ln -s realdir dir_over_sym_1_dir/root/dir
+
+mkdir -p dir_over_sym_2_dir/{image,root}
+mkdir dir_over_sym_2_dir/image/dir
+> dir_over_sym_2_dir/image/dir/file
+> dir_over_sym_2_dir/root/file
+ln -s file dir_over_sym_2_dir/root/dir
+
+mkdir -p dir_over_sym_3_dir/{image,root}
+mkdir dir_over_sym_3_dir/image/dir
+> dir_over_sym_3_dir/image/dir/file
+ln -s nowhere dir_over_sym_3_dir/root/dir
+
+
+mkdir -p file_over_nothing_dir/{image,root}
+echo "image contents" > file_over_nothing_dir/image/file
+
+mkdir -p file_over_file_dir/{image,root}
+echo "image contents" > file_over_file_dir/image/file
+echo "root contents" > file_over_file_dir/root/file
+
+mkdir -p file_over_sym_dir/{image,root}
+echo "image 1 contents" > file_over_sym_dir/image/file1
+echo "image 2 contents" > file_over_sym_dir/image/file2
+echo "image 3 contents" > file_over_sym_dir/image/file3
+ln -s nowhere file_over_sym_dir/root/file1
+ln -s file file_over_sym_dir/root/file2
+ln -s dir file_over_sym_dir/root/file3
+> file_over_sym_dir/root/file
+mkdir file_over_sym_dir/root/dir
+
+mkdir -p file_over_dir_dir/{image,root}
+> file_over_dir_dir/image/file
+mkdir file_over_dir_dir/root/file
+
+mkdir -p override_dir/{image,root}
+mkdir override_dir/image/dir_skip_me/
+mkdir override_dir/image/dir_install_me/
+> override_dir/image/file_skip_me
+> override_dir/image/file_install_me
+ln -s override_dir/image/file_skip_me override_dir/image/sym_skip_me
+ln -s override_dir/image/file_install_me override_dir/image/sym_install_me
+
+
+for d in *_dir; do
+ ln -s ${d} ${d%_dir}
+done
+
+
+mkdir hooks
+cd hooks
+mkdir \
+merger_install_file_override \
+merger_install_sym_override \
+merger_install_dir_override
+
+cat <<"END" > universal_override.hook
+hook_run_merger_install_file_override() {
+ if [[ "${INSTALL_DESTINATION}" == *"/file_skip_me" ]]; then
+ echo "skip"
+ fi
+}
+
+hook_run_merger_install_sym_override() {
+ if [[ "${INSTALL_DESTINATION}" == *"/sym_skip_me" ]]; then
+ echo "skip"
+ fi
+}
+
+hook_run_merger_install_dir_override() {
+ if [[ "${INSTALL_DESTINATION}" == *"/dir_skip_me" ]]; then
+ echo "skip"
+ fi
+}
+END
+chmod +x universal_override.hook
+for dir in merger_install_*_override; do
+ ln -s ../universal_override.hook ${dir}
+done