aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-06-27 23:19:30 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-06-27 23:19:30 +0000
commit9d1f97796dc000eedd2abd032c55639413e65c6c (patch)
tree8d85609b35824ff99ed21e7e48ce678626d5945f
parent0c4596c4df2aab658cb90c45f103850e3f97b805 (diff)
downloadpaludis-9d1f97796dc000eedd2abd032c55639413e65c6c.tar.gz
paludis-9d1f97796dc000eedd2abd032c55639413e65c6c.tar.xz
Replace the icky bash merge with a slightly less icky C++ merge
-rw-r--r--ebuild/utils/Makefile.am13
-rwxr-xr-xebuild/utils/merge167
-rw-r--r--ebuild/utils/merge.cc374
-rw-r--r--ebuild/utils/merge_TEST.bash14
-rw-r--r--ebuild/utils/unmerge_TEST.bash4
5 files changed, 395 insertions, 177 deletions
diff --git a/ebuild/utils/Makefile.am b/ebuild/utils/Makefile.am
index ea6a102..b40802c 100644
--- a/ebuild/utils/Makefile.am
+++ b/ebuild/utils/Makefile.am
@@ -33,7 +33,6 @@ libexecprog_SCRIPTS = \
fowners \
fperms \
getmtime \
- merge \
newbin \
newconfd \
newdoc \
@@ -48,8 +47,20 @@ libexecprog_SCRIPTS = \
unmerge \
$(libexecprog_SCRIPTS_extra)
+libexecprog_PROGRAMS = merge
+AM_CXXFLAGS = -I$(top_srcdir)
+merge_SOURCES = merge.cc
+merge_DEFS= \
+ -DSYSCONFDIR=\"$(sysconfdir)\" \
+ -DLIBEXECDIR=\"$(libexecdir)\"
+merge_LDADD = \
+ $(top_builddir)/paludis/libpaludis.a \
+ $(top_builddir)/paludis/args/libpaludisargs.a \
+ $(top_builddir)/paludis/util/libpaludisutil.a
+
TESTS_ENVIRONMENT = env \
PALUDIS_EBUILD_DIR="`$(top_srcdir)/ebuild/utils/canonicalise $(top_srcdir)/ebuild/`" \
+ TOP_BUILD_DIR="`$(top_srcdir)/ebuild/utils/canonicalise $(top_builddir)/`" \
PALUDIS_EBUILD_LOG_LEVEL="silent" \
TEST_SCRIPT_DIR="$(srcdir)/" \
bash $(top_srcdir)/ebuild/utils/run_test.bash
diff --git a/ebuild/utils/merge b/ebuild/utils/merge
deleted file mode 100755
index d1d06d7..0000000
--- a/ebuild/utils/merge
+++ /dev/null
@@ -1,167 +0,0 @@
-#!/bin/bash
-# vim: set sw=4 sts=4 et :
-
-# Copyright (c) 2006 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
-#
-# 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 as published by the Free Software Foundation; either version
-# 2 of the License, or (at your option) any later version.
-#
-# 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
-
-source ${PALUDIS_EBUILD_DIR}/echo_functions.bash
-export PATH="$(${PALUDIS_EBUILD_DIR}/utils/canonicalise ${PALUDIS_EBUILD_DIR}/utils/ ):${PATH}"
-
-if [[ -z "${1}" ]] || [[ -z "${2}" ]] ; then
- echo "usage: ${0} from to contents"
- exit 247
-fi
-
-shopt -s dotglob
-shopt -s nullglob
-
-src=$(canonicalise "${1%/}/" )
-src="${src//+(\/)/\/}"
-export top_src="${src}"
-dst=$(canonicalise "${2%/}/" )
-dst="${dst//+(\/)/\/}"
-export top_dst="${dst}"
-export contents=${3}
-
-if [[ ! -d ${src} ]] ; then
- echo "${src}: not a directory; aborting" >&2
- exit 247
-fi
-
-if [[ ! -d ${dst} ]] ; then
- echo "${dst}: not a directory; aborting" >&2
- exit 247
-fi
-
-if ! > "${contents}" ; then
- echo "${contents}: can't create; aborting" >&2
- exit 247
-fi
-
-make_cfgpro_filename()
-{
- local fn="$(basename ${1})" i=0
- while [[ -e "${2}/${fn}" &&
- "$(md5sum "${2}/${fn}" |cut -d\ -f 1)" != "$(md5sum "${1}" |cut -d\ -f 1)" ]]; do
- fn="._cfg$(printf '%.4i' ${i})_$(basename ${1})"
- (( ++i ))
- done
- echo ${fn}
-}
-
-merge_this()
-{
- if [[ ! -d "${1}" ]] || [[ ! -d "${2}" ]] ; then
- echo "merge_this called with bad parameters '${1}' '${2}'" >&2
- exit 247
- fi
-
- local f ff r=0
- for f in "${1}/"* ; do
-
- ff=$(basename -- "${f}" )
- echo ">>> ${2#${top_dst}}/${ff}"
-
- if [[ -e "${f}" ]] || [[ -h "${f}" ]] ; then
- if [[ -L "${2}/${ff}" ]] ; then
- if ! [[ -L "${f}" ]] ; then
- ebuild_notice "qa" "ROOT has '${2}/${ff}' as a non-symlink, " \
- "but IMAGE '${f}' is a symlink"
- fi
- elif [[ -L "${f}" ]] ; then
- ebuild_notice "qa" "ROOT has '${2}/${ff}' as a symlink, " \
- "but IMAGE '${f}' is a non-symlink"
- fi
- fi
-
- if [[ -L "${f}" ]] ; then
- if ( [[ -e "${2}/${ff}" ]] || [[ -h "${2}/${ff}" ]] ) && \
- [[ $(readlink -- "${2}/${ff}" ) != $(readlink -- "${f}" ) ]] && \
- [[ -d "${2}/${ff%+(/)}" ]] && \
- ! rm -f -- "${2}/${ff}" ; then
- echo "error removing ${2}/${ff} for link ${f}"
- r=1
- elif ! ln -sf -- "$(readlink -- ${f} )" "${2}/${ff}" ; then
- echo "error installing link ${f}"
- r=1
- else
- echo -n "sym ${2#${top_dst}}/${ff} -> " >> ${contents}
- echo -n "$(readlink -- ${2}/${ff} ) " >> ${contents}
- echo -n "$(getmtime -- ${2}/${ff} )" >> ${contents}
- echo >> ${contents}
- fi
- hash -r
- elif [[ -d ${f} ]] ; then
- local ok=
- if [[ -d "${2}/${ff}"/ ]] ; then
- :
- elif ! mkdir -- "${2}/${ff}" ; then
- echo "error installing directory ${f}"
- ok=no
- fi
-
- if [[ -z "${ok}" ]] ; then
- echo "dir ${2#${top_dst}}/${ff}" >> ${contents}
- if ! merge_this "${1}/${ff}" "${2}/${ff}" ; then
- echo "error installing directory contents ${f}"
- r=1
- fi
- else
- r=1
- fi
- else
- local cfgpro=
- for c in ${CONFIG_PROTECT}; do
- if [[ ${2#${top_dst}} == "${c%/}/"* ]]; then
- cfgpro=yes
- for cm in ${CONFIG_PROTECT_MASK}; do
- if [[ ${2#${top_dst}} == "${cm%/}/"* ]]; then
- cfgpro=
- fi
- done
- fi
- done
- local fn=${f}
- if [[ -n ${cfgpro} &&
- -e ${2}/${ff} &&
- "$(md5sum ${f} |cut -d\ -f 1)" != "$(md5sum ${2}/${ff} |cut -d\ -f 1)" ]]; then
- fn="${1}/$(make_cfgpro_filename ${f} ${2})"
- if [[ ${fn} != ${f} ]]; then
- mv "${f}" "${fn}"
- fi
- fi
- if ! cp -pR --remove-destination --no-preserve=timestamps \
- -- "${fn}" "${2}"/ ; then
- echo "error installing file ${fn}"
- r=1
- else
- if [[ -f "${fn}" ]] ; then
- echo -n "obj ${2#${top_dst}}/${ff} " >> ${contents}
- echo -n "$(md5sum -- ${2}/${ff} | cut -d' ' -f1 ) " >> ${contents}
- echo -n "$(getmtime -- ${2}/${ff} )" >> ${contents}
- echo >> ${contents}
- else
- echo "misc ${2#${top_dst}}/${ff}" >> ${contents}
- fi
- fi
- fi
- done
-
- return $r
-}
-
-merge_this "${src}" "${dst}"
-
diff --git a/ebuild/utils/merge.cc b/ebuild/utils/merge.cc
new file mode 100644
index 0000000..c3d07d0
--- /dev/null
+++ b/ebuild/utils/merge.cc
@@ -0,0 +1,374 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2006 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+ *
+ * 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
+ */
+
+#include <paludis/util/dir_iterator.hh>
+#include <paludis/util/fs_entry.hh>
+#include <paludis/util/log.hh>
+#include <paludis/util/pstream.hh>
+#include <paludis/util/stringify.hh>
+#include <paludis/util/strip.hh>
+#include <paludis/util/system.hh>
+
+#include <algorithm>
+#include <fstream>
+#include <iomanip>
+#include <iostream>
+#include <iterator>
+#include <string>
+
+#include <cstdlib>
+#include <errno.h>
+#include <fcntl.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+
+using namespace paludis;
+using std::cout;
+using std::cerr;
+using std::endl;
+using std::ifstream;
+using std::ofstream;
+
+namespace
+{
+ int exit_status;
+
+ /**
+ * Output stream buffer class that's opened via an FD, so that we can avoid race
+ * conditions that would be present on the non-Unix-specific standard file
+ * stream classes.
+ *
+ * See \ref TCppSL Ch. 13.13 for what we're doing here. The buffer code is
+ * based upon the "io/outbuf2.hpp" example in section 13.13.3.
+ */
+ class FDOutputStreamBuf :
+ public std::streambuf
+ {
+ protected:
+ int fd;
+
+ virtual int_type
+ overflow(int_type c)
+ {
+ if (c != EOF)
+ {
+ char z = c;
+ if (1 != write(fd, &z, 1))
+ return EOF;
+ }
+ return c;
+ }
+
+ virtual std::streamsize
+ xsputn(const char * s, std::streamsize num)
+ {
+ return write(fd, s, num);
+ }
+
+ public:
+ FDOutputStreamBuf(const int f) :
+ fd(f)
+ {
+ }
+ };
+
+ /**
+ * Member from base initialisation for FDOutputStream.
+ */
+ class FDOutputStreamBase
+ {
+ protected:
+ FDOutputStreamBuf buf;
+
+ public:
+ FDOutputStreamBase(const int fd) :
+ buf(fd)
+ {
+ }
+ };
+ /**
+ * Output stream buffer class that's opened via an FD, so that we can avoid race
+ * conditions that would be present on the non-Unix-specific standard file
+ * stream classes.
+ */
+ class FDOutputStream :
+ protected FDOutputStreamBase,
+ public std::ostream
+ {
+ public:
+ FDOutputStream(const int fd) :
+ FDOutputStreamBase(fd),
+ std::ostream(&buf)
+ {
+ }
+ };
+
+ /**
+ * RAII holder for a file descriptor.
+ */
+ class FDHolder
+ {
+ private:
+ const int _fd;
+
+ public:
+ FDHolder(const int fd) :
+ _fd(fd)
+ {
+ }
+
+ ~FDHolder()
+ {
+ if (-1 != _fd)
+ {
+ ::fsync(_fd);
+ ::close(_fd);
+ }
+ }
+
+ operator int () const
+ {
+ return _fd;
+ }
+ };
+
+ struct Failure
+ {
+ std::string message;
+
+ Failure(const std::string & m) :
+ message(m)
+ {
+ };
+ };
+
+ void
+ do_dir(const FSEntry & root, const FSEntry & src_dir,
+ const FSEntry & dst_dir, ofstream * const contents)
+ {
+ Context context("Installing directory in root '" + stringify(root) + "' from '"
+ + stringify(src_dir) + "' to '" + stringify(dst_dir) + "':");
+
+ std::string root_str(stringify(root)), dst_dir_str(stringify(dst_dir.dirname()));
+ if (0 != dst_dir_str.compare(0, root_str.length(), root_str))
+ throw Failure("do_dir confused: '" + root_str + "' '" + dst_dir_str + "'");
+
+ cout << ">>> " << std::setw(5) << std::left << "[dir]" << " " <<
+ dst_dir_str.substr(root_str.length()) << "/" << dst_dir.basename() << endl;
+
+ if (dst_dir.is_directory())
+ /* nothing */;
+ else if (dst_dir.is_symbolic_link() && dst_dir.realpath().is_directory())
+ Log::get_instance()->message(ll_qa, "Expected '" + stringify(dst_dir) +
+ "' to be a directory or non-existent, but found a symlink to a directory");
+ else if (dst_dir.exists())
+ throw Failure("Expected '" + stringify(dst_dir) +
+ "' to be a directory or non-existent, but found a file");
+ else
+ {
+ mode_t mode(src_dir.permissions());
+ FSEntry(dst_dir).mkdir(mode);
+ FSEntry(stringify(dst_dir)).chown(src_dir.owner(), src_dir.group());
+ }
+
+ *contents << "dir " << dst_dir_str.substr(root_str.length()) << "/" <<
+ dst_dir.basename() << endl;
+ }
+
+ void
+ do_obj(const FSEntry & root, const FSEntry & src,
+ const FSEntry & dst, ofstream * const contents)
+ {
+ Context context("Installing object in root '" + stringify(root) + "' from '"
+ + stringify(src) + "' to '" + stringify(dst) + "':");
+
+ using std::istreambuf_iterator;
+ using std::ostreambuf_iterator;
+
+ std::string root_str(stringify(root)), dst_dir_str(stringify(dst.dirname()));
+ if (0 != dst_dir_str.compare(0, root_str.length(), root_str))
+ throw Failure("do_obj confused: '" + root_str + "' '" + dst_dir_str + "'");
+
+ cout << ">>> " << std::setw(5) << std::left << "[obj]" << " " <<
+ dst_dir_str.substr(root_str.length()) << "/" << dst.basename() << endl;
+
+ if (dst.is_directory())
+ throw Failure("Cannot overwrite directory '" + stringify(dst) + "' with a file");
+ else
+ {
+ ifstream input_file(stringify(src).c_str());
+ if (! input_file)
+ throw Failure("Cannot read '" + stringify(src) + "'");
+
+ if (dst.exists())
+ FSEntry(dst).unlink();
+
+ /* FDHolder must be destroyed before we do the md5 thing, or the
+ * disk write may not have synced. */
+ {
+ FDHolder fd(::open(stringify(dst).c_str(), O_WRONLY | O_CREAT, src.permissions()));
+ if (-1 == fd)
+ throw Failure("Cannot open '" + stringify(dst) + "' for write");
+
+ if (0 != ::fchown(fd, src.owner(), src.group()))
+ throw Failure("Cannot fchown '" + stringify(dst) + "': " + stringify(::strerror(errno)));
+
+ FDOutputStream output_file(fd);
+ if (! output_file)
+ throw Failure("Cannot write '" + stringify(dst) + "'");
+
+ std::copy((istreambuf_iterator<char>(input_file)), istreambuf_iterator<char>(),
+ ostreambuf_iterator<char>(output_file));
+ }
+
+ PStream md5command(getenv_or_error("PALUDIS_EBUILD_DIR") +
+ "/digests/domd5 '" + stringify(dst) + "'");
+ std::string md5((istreambuf_iterator<char>(md5command)), istreambuf_iterator<char>());
+ if (0 != md5command.exit_status())
+ throw Failure("Could not md5sum '" + stringify(dst) + "'");
+ *contents << "obj " << dst_dir_str.substr(root_str.length()) << "/" <<
+ dst.basename() << " " << strip_trailing(md5, "\n") << " " <<
+ FSEntry(stringify(dst)).mtime() << endl;
+ }
+ }
+
+ void
+ do_sym(const FSEntry & root, const FSEntry & src,
+ const FSEntry & dst, ofstream * const contents)
+ {
+ Context context("Installing symlink in root '" + stringify(root) + "' from '"
+ + stringify(src) + "' to '" + stringify(dst) + "':");
+
+ std::string root_str(stringify(root)), dst_dir_str(stringify(dst.dirname()));
+ if (0 != dst_dir_str.compare(0, root_str.length(), root_str))
+ throw Failure("do_sym confused: '" + root_str + "' '" + dst_dir_str + "'");
+
+ cout << ">>> " << std::setw(5) << std::left << "[sym]" << " " <<
+ dst_dir_str.substr(root_str.length()) << "/" << dst.basename() << endl;
+
+ if (dst.exists())
+ {
+ if (dst.is_directory())
+ throw Failure("Can't overwrite directory '" + stringify(dst) +
+ "' with symlink to '" + src.readlink() + "'");
+ else
+ FSEntry(dst).unlink();
+ }
+
+ if (0 != ::symlink(src.readlink().c_str(), stringify(dst).c_str()))
+ {
+ Log::get_instance()->message(ll_warning, "Couldn't create symlink '"
+ + src.readlink() + "' at '" + stringify(dst) + "'");
+ exit_status |= 2;
+ }
+
+ *contents << "sym " << dst_dir_str.substr(root_str.length()) << "/" <<
+ dst.basename() << " -> " << dst.readlink() << " " <<
+ FSEntry(stringify(dst)).mtime() << endl;
+ }
+
+ void
+ merge_this(const FSEntry & root, const FSEntry & src_dir, const FSEntry & dst_dir,
+ ofstream * const contents)
+ {
+ Context context("Merging under root '" + stringify(root) + "' from '"
+ + stringify(src_dir) + "' to '" + stringify(dst_dir) + "':");
+
+ if (! root.is_directory())
+ throw Failure("merge_this called with bad root '" + stringify(root) + "'");
+ if (! src_dir.is_directory())
+ throw Failure("merge_this called with bad src_dir '" + stringify(src_dir) + "'");
+ if (! dst_dir.is_directory())
+ throw Failure("merge_this called with bad dst_dir '" + stringify(dst_dir) + "'");
+
+ for (DirIterator d(src_dir, false), d_end ; d != d_end ; ++d)
+ {
+ if (d->is_regular_file())
+ do_obj(root, src_dir / d->basename(), dst_dir / d->basename(), contents);
+ else if (d->is_symbolic_link())
+ do_sym(root, src_dir / d->basename(), dst_dir / d->basename(), contents);
+ else if (d->is_directory())
+ {
+ do_dir(root, src_dir / d->basename(), dst_dir / d->basename(), contents);
+ merge_this(root, src_dir / d->basename(), dst_dir / d->basename(), contents);
+ }
+ else
+ throw Failure("Don't know how to merge '" + stringify(*d) + "'");
+ }
+ }
+}
+
+int
+main(int argc, char * argv[])
+{
+ Context context("In main program:");
+ exit_status = 0;
+ try
+ {
+ if (argc != 4)
+ throw Failure("Usage: " + stringify(argv[0]) + " src dst contents");
+
+ Log::get_instance()->set_program_name(argv[0]);
+ std::string log_level(getenv_with_default("PALUDIS_EBUILD_LOG_LEVEL", "qa"));
+
+ if (log_level == "debug")
+ Log::get_instance()->set_log_level(ll_debug);
+ else if (log_level == "qa")
+ Log::get_instance()->set_log_level(ll_qa);
+ else if (log_level == "warning")
+ Log::get_instance()->set_log_level(ll_warning);
+ else if (log_level == "silent")
+ Log::get_instance()->set_log_level(ll_silent);
+ else
+ throw Failure("bad value for log level");
+
+ FSEntry src(argv[1]), dst(argv[2]), contents(argv[3]);
+
+ if (! ((src = src.realpath())).is_directory())
+ throw Failure(stringify(argv[1]) + ": not a directory");
+ if (! ((dst = dst.realpath())).is_directory())
+ throw Failure(stringify(argv[2]) + ": not a directory");
+
+ ofstream contents_file(stringify(contents).c_str());
+ if (! contents_file)
+ throw Failure(stringify(contents) + ": not writeable");
+
+ ::umask(0000);
+ merge_this(dst, src, dst, &contents_file);
+ return exit_status;
+ }
+ catch (const Failure & f)
+ {
+ cerr << argv[0] << ": fatal error: " << f.message << endl;
+ return EXIT_FAILURE;
+ }
+ catch (const Exception & e)
+ {
+ cerr << argv[0] << ": fatal error:" << endl
+ << " * " << e.backtrace("\n * ") << e.message()
+ << " (" << e.what() << ")" << endl;
+ return EXIT_FAILURE;
+ }
+ catch (const std::exception & e)
+ {
+ cerr << argv[0] << ": fatal error: " << e.what() << endl;
+ return EXIT_FAILURE;
+ }
+}
+
diff --git a/ebuild/utils/merge_TEST.bash b/ebuild/utils/merge_TEST.bash
index 88b070f..ac1cb4d 100644
--- a/ebuild/utils/merge_TEST.bash
+++ b/ebuild/utils/merge_TEST.bash
@@ -18,7 +18,7 @@
merge_empty_TEST()
{
- ${PALUDIS_EBUILD_DIR}/utils/merge "merge_TEST_dir/empty_src" \
+ ${TOP_BUILD_DIR}/ebuild/utils/merge "merge_TEST_dir/empty_src" \
"merge_TEST_dir/empty_dst" \
"merge_TEST_dir/empty_contents" 1>/dev/null
test_return_code
@@ -26,7 +26,7 @@ merge_empty_TEST()
merge_files_TEST()
{
- ${PALUDIS_EBUILD_DIR}/utils/merge "merge_TEST_dir/files_src" \
+ ${TOP_BUILD_DIR}/ebuild/utils/merge "merge_TEST_dir/files_src" \
"merge_TEST_dir/files_dst" \
"merge_TEST_dir/files_contents" 1>/dev/null
test_return_code
@@ -40,7 +40,7 @@ merge_files_TEST()
merge_dirs_TEST()
{
- ${PALUDIS_EBUILD_DIR}/utils/merge "merge_TEST_dir/dirs_src" \
+ ${TOP_BUILD_DIR}/ebuild/utils/merge "merge_TEST_dir/dirs_src" \
"merge_TEST_dir/dirs_dst" \
"merge_TEST_dir/dirs_contents" 1>/dev/null
test_return_code
@@ -61,7 +61,7 @@ merge_dirs_TEST()
merge_dirs_over_TEST()
{
- ${PALUDIS_EBUILD_DIR}/utils/merge "merge_TEST_dir/dirs_over_src" \
+ ${TOP_BUILD_DIR}/ebuild/utils/merge "merge_TEST_dir/dirs_over_src" \
"merge_TEST_dir/dirs_over_dst" \
"merge_TEST_dir/dirs_over_contents" 1>/dev/null
test_return_code
@@ -82,7 +82,7 @@ merge_dirs_over_TEST()
merge_links_TEST()
{
- ${PALUDIS_EBUILD_DIR}/utils/merge "merge_TEST_dir/links_src" \
+ ${TOP_BUILD_DIR}/ebuild/utils/merge "merge_TEST_dir/links_src" \
"merge_TEST_dir/links_dst" \
"merge_TEST_dir/links_contents" 1>/dev/null
test_return_code
@@ -100,7 +100,7 @@ merge_links_TEST()
merge_links_over_TEST()
{
- ${PALUDIS_EBUILD_DIR}/utils/merge "merge_TEST_dir/links_over_src" \
+ ${TOP_BUILD_DIR}/ebuild/utils/merge "merge_TEST_dir/links_over_src" \
"merge_TEST_dir/links_over_dst" \
"merge_TEST_dir/links_over_contents" 1>/dev/null
test_return_code
@@ -121,7 +121,7 @@ merge_links_over_TEST()
}
merge_links_over_dir_TEST()
{
- ! ${PALUDIS_EBUILD_DIR}/utils/merge "merge_TEST_dir/links_over_dir_src" \
+ ! ${TOP_BUILD_DIR}/ebuild/utils/merge "merge_TEST_dir/links_over_dir_src" \
"merge_TEST_dir/links_over_dir_dst" \
"merge_TEST_dir/links_over_dir_contents" &>/dev/null
test_return_code
diff --git a/ebuild/utils/unmerge_TEST.bash b/ebuild/utils/unmerge_TEST.bash
index a9d75d6..31b8f82 100644
--- a/ebuild/utils/unmerge_TEST.bash
+++ b/ebuild/utils/unmerge_TEST.bash
@@ -18,7 +18,7 @@
unmerge_empty_TEST()
{
- ${PALUDIS_EBUILD_DIR}/utils/merge "unmerge_TEST_dir/empty_src" \
+ ${TOP_BUILD_DIR}/ebuild/utils/merge "unmerge_TEST_dir/empty_src" \
"unmerge_TEST_dir/empty_dst" \
"unmerge_TEST_dir/empty_contents" 1>/dev/null
test_return_code
@@ -38,7 +38,7 @@ unmerge_empty_TEST()
unmerge_files_TEST()
{
- ${PALUDIS_EBUILD_DIR}/utils/merge "unmerge_TEST_dir/files_src" \
+ ${TOP_BUILD_DIR}/ebuild/utils/merge "unmerge_TEST_dir/files_src" \
"unmerge_TEST_dir/files_dst" \
"unmerge_TEST_dir/files_contents" 1>/dev/null
test_return_code