aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Fernando J. Pereda <ferdy@ferdyx.org> 2008-01-03 23:35:03 +0000
committerAvatar Fernando J. Pereda <ferdy@ferdyx.org> 2008-01-03 23:35:03 +0000
commitb3cdccec1405d42c6dea03573fc37f97aaa58e1a (patch)
tree259511f53552506c8457b56acaaa420e43ba78df
parent3102f3c540e1cdac69ffdcf8f9ad37fe60ab312c (diff)
downloadpaludis-b3cdccec1405d42c6dea03573fc37f97aaa58e1a.tar.gz
paludis-b3cdccec1405d42c6dea03573fc37f97aaa58e1a.tar.xz
Make symlink rewriting part of the merger and EAPI-configurable. Fixes ticket:351
-rw-r--r--NEWS3
-rw-r--r--hooks/Makefile.am.m46
-rwxr-xr-xhooks/fix_symlinks.bash56
-rw-r--r--paludis/merger.cc47
-rw-r--r--paludis/merger.hh2
-rw-r--r--paludis/merger.sr1
-rw-r--r--paludis/merger_TEST.cc16
-rwxr-xr-xpaludis/merger_TEST_setup.sh5
-rw-r--r--paludis/repositories/e/eapi.cc1
-rw-r--r--paludis/repositories/e/eapi.sr2
-rw-r--r--paludis/repositories/e/eapis/0.conf1
-rw-r--r--paludis/repositories/e/eapis/1.conf1
-rw-r--r--paludis/repositories/e/eapis/exheres-0.conf1
-rw-r--r--paludis/repositories/e/eapis/paludis-1.conf1
-rw-r--r--paludis/repositories/e/ebin_entries.cc1
-rw-r--r--paludis/repositories/e/ebuild_entries.cc1
-rw-r--r--paludis/repositories/e/vdb_merger.cc3
-rw-r--r--paludis/repositories/e/vdb_merger.sr1
-rw-r--r--paludis/repositories/e/vdb_merger_TEST.cc3
-rw-r--r--paludis/repositories/e/vdb_repository.cc3
-rw-r--r--paludis/repositories/unpackaged/ndbam_merger.cc3
-rw-r--r--paludis/repositories/unpackaged/unpackaged_id.cc1
-rw-r--r--paludis/repository.sr1
23 files changed, 88 insertions, 72 deletions
diff --git a/NEWS b/NEWS
index 381845e..e5ea93f 100644
--- a/NEWS
+++ b/NEWS
@@ -20,6 +20,9 @@ trunk/:
parent directory or merging each file separately. If a copy is needed,
merge to a temporary file and then rename to the real destination.
+ * Symlink rewriting is now part of the merger and is EAPI-configurable. All
+ EAPIs known to paludis allow symlink rewriting except exheres-0.
+
0.26.0_alpha4:
* STILL BROKEN, wait for 0.26.0 if you use these: CRAN, Ruby bindings for
dep specs.
diff --git a/hooks/Makefile.am.m4 b/hooks/Makefile.am.m4
index a32565a..a5c44b0 100644
--- a/hooks/Makefile.am.m4
+++ b/hooks/Makefile.am.m4
@@ -20,8 +20,7 @@ installhookcommonprog_SCRIPTS = \
news.hook \
installable_cache_regen.bash \
installed_cache_regen.bash \
- write_cache_clean.bash \
- fix_symlinks.bash
+ write_cache_clean.bash
installhookinstallallpost_SCRIPTS = \
find_config_updates.hook
@@ -254,8 +253,6 @@ install-data-local :
ln -sf ../common/installed_cache_regen.bash $(DESTDIR)/$(libexecdir)/paludis/hooks/install_post/
ln -sf ../common/installed_cache_regen.bash $(DESTDIR)/$(libexecdir)/paludis/hooks/uninstall_post/
ln -sf ../common/installed_cache_regen.bash $(DESTDIR)/$(libexecdir)/paludis/hooks/clean_post/
- ln -sf ../common/fix_symlinks.bash $(DESTDIR)/$(libexecdir)/paludis/hooks/merger_check_sym_post/
- ln -sf ../common/fix_symlinks.bash $(DESTDIR)/$(libexecdir)/paludis/hooks/merger_install_sym_post/
uninstall-local :
rm -f $(DESTDIR)/$(libexecdir)/paludis/hooks/*/gnu_info_index.bash
@@ -263,7 +260,6 @@ uninstall-local :
rm -f $(DESTDIR)/$(libexecdir)/paludis/hooks/*/log.bash
rm -f $(DESTDIR)/$(libexecdir)/paludis/hooks/*/news.hook
rm -f $(DESTDIR)/$(libexecdir)/paludis/hooks/*/write_cache_clean.bash
- rm -f $(DESTDIR)/$(libexecdir)/paludis/hooks/*/fix_symlinks.bash
Makefile.am : Makefile.am.m4
$(top_srcdir)/misc/do_m4.bash Makefile.am
diff --git a/hooks/fix_symlinks.bash b/hooks/fix_symlinks.bash
deleted file mode 100755
index 2c78212..0000000
--- a/hooks/fix_symlinks.bash
+++ /dev/null
@@ -1,56 +0,0 @@
-#!/bin/bash
-# vim: set et sw=4 sts=4 :
-
-# Copyright (c) 2007 Ciaran McCreesh
-#
-# This file is part of the Paludis package manager. Paludis is free software;
-# you can redistribute it and/or modify it under the terms of the GNU General
-# Public License, version 2, as published by the Free Software Foundation.
-#
-# Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
-# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
-# details.
-#
-# You should have received a copy of the GNU General Public License along with
-# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
-# Place, Suite 330, Boston, MA 02111-1307 USA
-
-export PATH="$(${PALUDIS_EBUILD_DIR}/utils/canonicalise ${PALUDIS_EBUILD_DIR}/utils/ ):${PATH}"
-source ${PALUDIS_EBUILD_DIR}/echo_functions.bash
-
-shopt -s extglob
-
-image=$(tr -s / <<<"${IMAGE}" )
-
-case "${HOOK}" in
-
- merger_check_sym_post)
- target=$(readlink "${INSTALL_SOURCE}" | tr -s / )
- [[ "${target#${image}}" == "${target}" ]] && exit 0
-
- ewarn "Bad symlink ${INSTALL_SOURCE} -> $(readlink "${INSTALL_SOURCE}" ) will be rewritten"
- ;;
-
- merger_install_sym_post)
- target=$(readlink "${INSTALL_DESTINATION}" | tr -s / )
- [[ "${target#${image}}" == "${target}" ]] && exit 0
-
- new_target=${target#${image}}
- new_target=/${new_target##+(/)}
- ewarn "Relinking bad symlink ${INSTALL_DESTINATION} -> $(readlink \
- "${INSTALL_DESTINATION}" ) to ${new_target}"
- echo rm -f "${INSTALL_DESTINATION}" 1>&2
- rm -f "${INSTALL_DESTINATION}"
- echo ln -s "${new_target}" "${INSTALL_DESTINATION}" 1>&2
- ln -s "${new_target}" "${INSTALL_DESTINATION}"
- ;;
-
- *)
- ewarn "$0: Don't know how to respond to HOOK ${HOOK}"
- ;;
-
-esac
-
-true
-
diff --git a/paludis/merger.cc b/paludis/merger.cc
index 59ecebb..8b19119 100644
--- a/paludis/merger.cc
+++ b/paludis/merger.cc
@@ -377,6 +377,11 @@ Merger::on_sym(bool is_check, const FSEntry & src, const FSEntry & dst)
return;
}
}
+ else
+ {
+ if (symlink_needs_rewriting(src) && ! _options.rewrite_symlinks)
+ throw MergerError("Symlink to image detected at: " + stringify(src) + " (" + src.readlink() + ")");
+ }
do
{
@@ -679,6 +684,35 @@ Merger::install_file(const FSEntry & src, const FSEntry & dst_dir, const std::st
"Merge of '" + stringify(src) + "' to '" + stringify(dst_dir) + "' post hooks returned non-zero");
}
+bool
+Merger::symlink_needs_rewriting(const FSEntry & sym)
+{
+ std::string target(sym.readlink());
+ std::string real_image(stringify(_options.image.realpath()));
+
+ return (0 == target.compare(0, real_image.length(), real_image));
+}
+
+void
+Merger::rewrite_symlink_as_needed(const FSEntry & src, const FSEntry & dst_dir)
+{
+ if (! symlink_needs_rewriting(src))
+ return;
+
+ FSCreateCon createcon(MatchPathCon::get_instance()->match(stringify(dst_dir / src.basename()), S_IFLNK));
+
+ FSEntry real_image(_options.image.realpath());
+ FSEntry dst(src.readlink());
+ std::string fixed_dst(stringify(dst.strip_leading(real_image)));
+
+ Log::get_instance()->message(ll_qa, lc_context, "Rewriting bad symlink: "
+ + stringify(src) + " -> " + stringify(dst) + " to " + fixed_dst);
+
+ FSEntry s(dst_dir / src.basename());
+ s.unlink();
+ s.symlink(fixed_dst);
+}
+
void
Merger::record_renamed_dir_recursive(const FSEntry & dst)
{
@@ -689,6 +723,7 @@ Merger::record_renamed_dir_recursive(const FSEntry & dst)
switch (m)
{
case et_sym:
+ rewrite_symlink_as_needed(*d, dst);
record_install_sym(*d, dst);
continue;
@@ -789,9 +824,15 @@ Merger::install_sym(const FSEntry & src, const FSEntry & dst_dir)
Log::get_instance()->message(ll_warning, lc_context,
"Merge of '" + stringify(src) + "' to '" + stringify(dst_dir) + "' pre hooks returned non-zero");
- FSCreateCon createcon(MatchPathCon::get_instance()->match(stringify(dst_dir / src.basename()), S_IFLNK));
- if (0 != ::symlink(stringify(src.readlink()).c_str(), stringify(dst_dir / src.basename()).c_str()))
- throw MergerError("Couldn't create symlink at '" + stringify(dst_dir / src.basename()) + "': " + stringify(::strerror(errno)));
+ if (symlink_needs_rewriting(src))
+ rewrite_symlink_as_needed(src, dst_dir);
+ else
+ {
+ FSCreateCon createcon(MatchPathCon::get_instance()->match(stringify(dst_dir / src.basename()), S_IFLNK));
+ if (0 != ::symlink(stringify(src.readlink()).c_str(), stringify(dst_dir / src.basename()).c_str()))
+ throw MergerError("Couldn't create symlink at '" + stringify(dst_dir / src.basename()) + "': "
+ + stringify(::strerror(errno)));
+ }
if (0 != _options.environment->perform_hook(extend_hook(
Hook("merger_install_sym_post")
diff --git a/paludis/merger.hh b/paludis/merger.hh
index c396dc1..a98d289 100644
--- a/paludis/merger.hh
+++ b/paludis/merger.hh
@@ -78,6 +78,8 @@ namespace paludis
bool _skip_dir;
void record_renamed_dir_recursive(const FSEntry &);
void relabel_dir_recursive(const FSEntry &, const FSEntry &);
+ void rewrite_symlink_as_needed(const FSEntry &, const FSEntry &);
+ bool symlink_needs_rewriting(const FSEntry & sym);
protected:
///\name Basic operations
diff --git a/paludis/merger.sr b/paludis/merger.sr
index 78f6a26..9554bdd 100644
--- a/paludis/merger.sr
+++ b/paludis/merger.sr
@@ -9,6 +9,7 @@ make_class_MergerOptions()
key image "FSEntry"
key root "FSEntry"
key no_chown bool
+ key rewrite_symlinks bool
allow_named_args
diff --git a/paludis/merger_TEST.cc b/paludis/merger_TEST.cc
index 1385614..3120949 100644
--- a/paludis/merger_TEST.cc
+++ b/paludis/merger_TEST.cc
@@ -143,15 +143,16 @@ namespace
TestCase("merge " + stringify(src_type) + " over " + stringify(dst_type) + (0 == n ? "" : " "
+ stringify(n))),
image_dir("merger_TEST_dir/" + stringify(src_type) + "_over_" + stringify(dst_type)
- + (0 == n ? "" : "_" + stringify(n)) + "/image"),
+ + (0 == n ? "" : "_" + stringify(n)) + "_dir/image"),
root_dir("merger_TEST_dir/" + stringify(src_type) + "_over_" + stringify(dst_type)
- + (0 == n ? "" : "_" + stringify(n)) + "/root"),
+ + (0 == n ? "" : "_" + stringify(n)) + "_dir/root"),
env(FSEntry("merger_TEST_dir/hooks")),
merger(MergerOptions::create()
.image(image_dir)
.root(root_dir)
.environment(&env)
- .no_chown(true))
+ .no_chown(true)
+ .rewrite_symlinks(true))
{
}
@@ -164,7 +165,8 @@ namespace
.image(image_dir)
.root(root_dir)
.environment(&env)
- .no_chown(true))
+ .no_chown(true)
+ .rewrite_symlinks(true))
{
}
@@ -185,7 +187,9 @@ namespace test_cases
merger.merge();
TEST_CHECK((root_dir / "sym").is_symbolic_link());
+ TEST_CHECK((root_dir / "rewrite_me").is_symbolic_link());
TEST_CHECK_EQUAL((root_dir / "sym").readlink(), "image_dst");
+ TEST_CHECK_EQUAL((root_dir / "rewrite_me").readlink(), "/rewrite_target");
}
} test_merger_sym_nothing;
@@ -202,7 +206,9 @@ namespace test_cases
merger.merge();
TEST_CHECK((root_dir / "sym").is_symbolic_link());
+ TEST_CHECK((root_dir / "rewrite_me").is_symbolic_link());
TEST_CHECK_EQUAL((root_dir / "sym").readlink(), "image_dst");
+ TEST_CHECK_EQUAL((root_dir / "rewrite_me").readlink(), "/rewrite_target");
}
} test_merger_sym_sym;
@@ -218,7 +224,9 @@ namespace test_cases
merger.merge();
TEST_CHECK((root_dir / "sym").is_symbolic_link());
+ TEST_CHECK((root_dir / "rewrite_me").is_symbolic_link());
TEST_CHECK_EQUAL((root_dir / "sym").readlink(), "image_dst");
+ TEST_CHECK_EQUAL((root_dir / "rewrite_me").readlink(), "/rewrite_target");
}
} test_merger_sym_file;
diff --git a/paludis/merger_TEST_setup.sh b/paludis/merger_TEST_setup.sh
index 9d9dd18..954aa5c 100755
--- a/paludis/merger_TEST_setup.sh
+++ b/paludis/merger_TEST_setup.sh
@@ -7,14 +7,19 @@ cd merger_TEST_dir || exit 3
mkdir -p sym_over_nothing_dir/{image,root}
ln -s image_dst sym_over_nothing_dir/image/sym
+ln -s ${PWD}/sym_over_nothing_dir/image/rewrite_target sym_over_nothing_dir/image/rewrite_me
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
+ln -s ${PWD}/sym_over_sym_dir/image/rewrite_target sym_over_sym_dir/image/rewrite_me
+ln -s rewrite_target sym_over_sym_dir/root/rewrite_me
mkdir -p sym_over_file_dir/{image,root}
ln -s image_dst sym_over_file_dir/image/sym
> sym_over_file_dir/root/sym
+ln -s ${PWD}/sym_over_file_dir/image/rewrite_target sym_over_file_dir/image/rewrite_me
+> sym_over_file_dir/root/rewrite_target
mkdir -p sym_over_dir_dir/{image,root}
ln -s image_dst sym_over_dir_dir/image/sym
diff --git a/paludis/repositories/e/eapi.cc b/paludis/repositories/e/eapi.cc
index 1ae3eca..56e4a0f 100644
--- a/paludis/repositories/e/eapi.cc
+++ b/paludis/repositories/e/eapi.cc
@@ -128,6 +128,7 @@ namespace paludis
.restrict_fetch(make_shared_ptr(new Set<std::string>))
.restrict_mirror(make_shared_ptr(new Set<std::string>))
.restrict_primaryuri(make_shared_ptr(new Set<std::string>))
+ .merge_rewrite_symlinks(destringify<bool>(k.get("merge_rewrite_symlinks")))
)))
.pipe_commands(make_shared_ptr(new EAPIPipeCommands(
diff --git a/paludis/repositories/e/eapi.sr b/paludis/repositories/e/eapi.sr
index ea8916c..14ae511 100644
--- a/paludis/repositories/e/eapi.sr
+++ b/paludis/repositories/e/eapi.sr
@@ -134,6 +134,8 @@ make_class_EAPIEbuildOptions()
key vdb_from_env_variables std::string
key vdb_from_env_unless_empty_variables std::string
+ key merge_rewrite_symlinks bool
+
key restrict_fetch "tr1::shared_ptr<Set<std::string> >"
key restrict_mirror "tr1::shared_ptr<Set<std::string> >"
key restrict_primaryuri "tr1::shared_ptr<Set<std::string> >"
diff --git a/paludis/repositories/e/eapis/0.conf b/paludis/repositories/e/eapis/0.conf
index a3289b9..709d555 100644
--- a/paludis/repositories/e/eapis/0.conf
+++ b/paludis/repositories/e/eapis/0.conf
@@ -13,6 +13,7 @@ support_eclasses = true
support_exlibs = false
utility_path_suffixes =
ebuild_module_suffixes = 0
+merge_rewrite_symlinks = true
vdb_from_env_variables = \
CATEGORY CHOST COUNTER DEPEND DESCRIPTION EAPI FEATURES \
diff --git a/paludis/repositories/e/eapis/1.conf b/paludis/repositories/e/eapis/1.conf
index a491d28..7b334c0 100644
--- a/paludis/repositories/e/eapis/1.conf
+++ b/paludis/repositories/e/eapis/1.conf
@@ -13,6 +13,7 @@ support_eclasses = true
support_exlibs = false
utility_path_suffixes =
ebuild_module_suffixes = 1
+merge_rewrite_symlinks = true
vdb_from_env_variables = \
CATEGORY CHOST COUNTER DEPEND DESCRIPTION EAPI FEATURES \
diff --git a/paludis/repositories/e/eapis/exheres-0.conf b/paludis/repositories/e/eapis/exheres-0.conf
index d806f86..4c087c0 100644
--- a/paludis/repositories/e/eapis/exheres-0.conf
+++ b/paludis/repositories/e/eapis/exheres-0.conf
@@ -15,6 +15,7 @@ support_exlibs = true
utility_path_suffixes = exheres-0
ebuild_module_suffixes = exheres-0
use_expand_separator = :
+merge_rewrite_symlinks = false
vdb_from_env_variables = \
CATEGORY CHOST DEPENDENCIES DESCRIPTION EAPI \
diff --git a/paludis/repositories/e/eapis/paludis-1.conf b/paludis/repositories/e/eapis/paludis-1.conf
index aa97a10..502bfeb 100644
--- a/paludis/repositories/e/eapis/paludis-1.conf
+++ b/paludis/repositories/e/eapis/paludis-1.conf
@@ -15,6 +15,7 @@ support_exlibs = false
utility_path_suffixes =
ebuild_module_suffixes =
use_expand_separator = _
+merge_rewrite_symlinks = true
vdb_from_env_variables = \
CATEGORY CHOST COUNTER DEPEND DESCRIPTION EAPI FEATURES \
diff --git a/paludis/repositories/e/ebin_entries.cc b/paludis/repositories/e/ebin_entries.cc
index 7893c4f..9a9dd83 100644
--- a/paludis/repositories/e/ebin_entries.cc
+++ b/paludis/repositories/e/ebin_entries.cc
@@ -310,6 +310,7 @@ EbinEntries::install(const tr1::shared_ptr<const PackageID> & id,
+ stringify(id->version())) / "image")
.environment_file(_imp->params.buildroot / stringify(id->name().category) / (stringify(id->name().package) + "-"
+ stringify(id->version())) / "temp" / "loadsaveenv")
+ .rewrite_symlinks(true)
);
if (o.destination->destination_interface->want_pre_post_phases())
diff --git a/paludis/repositories/e/ebuild_entries.cc b/paludis/repositories/e/ebuild_entries.cc
index 13f0601..30bf258 100644
--- a/paludis/repositories/e/ebuild_entries.cc
+++ b/paludis/repositories/e/ebuild_entries.cc
@@ -546,6 +546,7 @@ EbuildEntries::install(const tr1::shared_ptr<const ERepositoryID> & id,
+ stringify(id->version())) / "image")
.environment_file(_imp->params.builddir / stringify(id->name().category) / (stringify(id->name().package) + "-"
+ stringify(id->version())) / "temp" / "loadsaveenv")
+ .rewrite_symlinks(id->eapi()->supported->ebuild_options->merge_rewrite_symlinks)
);
}
else if ((! phase->option("prepost")) ||
diff --git a/paludis/repositories/e/vdb_merger.cc b/paludis/repositories/e/vdb_merger.cc
index d6cdd19..796e9cf 100644
--- a/paludis/repositories/e/vdb_merger.cc
+++ b/paludis/repositories/e/vdb_merger.cc
@@ -68,7 +68,8 @@ VDBMerger::VDBMerger(const VDBMergerOptions & o) :
.environment(o.environment)
.image(o.image)
.root(o.root)
- .no_chown(! getenv_with_default("PALUDIS_NO_CHOWN", "").empty())),
+ .no_chown(! getenv_with_default("PALUDIS_NO_CHOWN", "").empty())
+ .rewrite_symlinks(o.rewrite_symlinks)),
PrivateImplementationPattern<VDBMerger>(new Implementation<VDBMerger>(o))
{
}
diff --git a/paludis/repositories/e/vdb_merger.sr b/paludis/repositories/e/vdb_merger.sr
index 3f9d6ee..a3fc410 100644
--- a/paludis/repositories/e/vdb_merger.sr
+++ b/paludis/repositories/e/vdb_merger.sr
@@ -12,6 +12,7 @@ make_class_VDBMergerOptions()
key config_protect std::string
key config_protect_mask std::string
key package_id "tr1::shared_ptr<const PackageID>"
+ key rewrite_symlinks bool
allow_named_args
diff --git a/paludis/repositories/e/vdb_merger_TEST.cc b/paludis/repositories/e/vdb_merger_TEST.cc
index ac10353..5c7eb78 100644
--- a/paludis/repositories/e/vdb_merger_TEST.cc
+++ b/paludis/repositories/e/vdb_merger_TEST.cc
@@ -82,7 +82,8 @@ namespace
.contents_file(FSEntry::cwd() / "vdb_merger_TEST_dir/CONTENTS" / what)
.config_protect("/protected_file /protected_dir")
.config_protect_mask("/protected_dir/unprotected_file /protected_dir/unprotected_dir")
- .package_id(tr1::shared_ptr<PackageID>()))
+ .package_id(tr1::shared_ptr<PackageID>())
+ .rewrite_symlinks(true))
{
}
};
diff --git a/paludis/repositories/e/vdb_repository.cc b/paludis/repositories/e/vdb_repository.cc
index bc01291..23cac2d 100644
--- a/paludis/repositories/e/vdb_repository.cc
+++ b/paludis/repositories/e/vdb_repository.cc
@@ -1128,7 +1128,8 @@ VDBRepository::merge(const MergeOptions & m)
.contents_file(vdb_dir / "CONTENTS")
.config_protect(config_protect)
.config_protect_mask(config_protect_mask)
- .package_id(m.package_id));
+ .package_id(m.package_id)
+ .rewrite_symlinks(m.rewrite_symlinks));
if (! merger.check())
{
diff --git a/paludis/repositories/unpackaged/ndbam_merger.cc b/paludis/repositories/unpackaged/ndbam_merger.cc
index d0a2ac3..a72e96c 100644
--- a/paludis/repositories/unpackaged/ndbam_merger.cc
+++ b/paludis/repositories/unpackaged/ndbam_merger.cc
@@ -69,7 +69,8 @@ NDBAMMerger::NDBAMMerger(const NDBAMMergerOptions & o) :
.environment(o.environment)
.image(o.image)
.root(o.root)
- .no_chown(! getenv_with_default("PALUDIS_NO_CHOWN", "").empty())),
+ .no_chown(! getenv_with_default("PALUDIS_NO_CHOWN", "").empty())
+ .rewrite_symlinks(true)),
PrivateImplementationPattern<NDBAMMerger>(new Implementation<NDBAMMerger>(o))
{
}
diff --git a/paludis/repositories/unpackaged/unpackaged_id.cc b/paludis/repositories/unpackaged/unpackaged_id.cc
index 38b3301..6dd7cbf 100644
--- a/paludis/repositories/unpackaged/unpackaged_id.cc
+++ b/paludis/repositories/unpackaged/unpackaged_id.cc
@@ -309,6 +309,7 @@ UnpackagedID::perform_action(Action & action) const
.package_id(shared_from_this())
.image_dir(fs_location_key()->value())
.environment_file(FSEntry("/dev/null"))
+ .rewrite_symlinks(true)
);
}
diff --git a/paludis/repository.sr b/paludis/repository.sr
index bc93ed4..5514e0b 100644
--- a/paludis/repository.sr
+++ b/paludis/repository.sr
@@ -104,6 +104,7 @@ make_class_MergeOptions()
key package_id "tr1::shared_ptr<const PackageID>"
key image_dir FSEntry
key environment_file FSEntry
+ key rewrite_symlinks bool
allow_named_args