aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Timothy Redaelli <drizzt@gentoo.org> 2006-12-30 17:56:15 +0000
committerAvatar Timothy Redaelli <drizzt@gentoo.org> 2006-12-30 17:56:15 +0000
commitbe6a82f5614b82b15c9a064608e38d79db01b65f (patch)
treebfba7bb7703c4d45fe27f243b4bfe2faed6a949c
parent3eaeb9d5a621f0bc464fecc6d71ac64bc8a98b98 (diff)
downloadpaludis-be6a82f5614b82b15c9a064608e38d79db01b65f.tar.gz
paludis-be6a82f5614b82b15c9a064608e38d79db01b65f.tar.xz
Preliminary flags support.
-rw-r--r--configure.ac9
-rw-r--r--ebuild/Makefile.am4
-rw-r--r--ebuild/build_functions.bash4
-rw-r--r--ebuild/builtin_init.bash3
-rw-r--r--ebuild/builtin_tidyup.bash4
-rwxr-xr-xebuild/ebuild.bash4
-rw-r--r--ebuild/fetchers/Makefile.am2
-rw-r--r--ebuild/work_around_broken_utilities.bash.in (renamed from ebuild/portability.bash.in)0
-rw-r--r--paludis/util/fs_entry.cc10
9 files changed, 32 insertions, 8 deletions
diff --git a/configure.ac b/configure.ac
index 0a1047c..d27b9ba 100644
--- a/configure.ac
+++ b/configure.ac
@@ -258,8 +258,13 @@ AC_CHECK_FUNCS([grantpt], [], [AC_MSG_ERROR([I need grantpt])])
AC_CHECK_FUNCS([unlockpt], [], [AC_MSG_ERROR([I need unlockpt])])
dnl }}}
+dnl {{{ check for chflags function
+AC_CHECK_FUNCS([chflags])
+AM_CONDITIONAL(HAVE_CHFLAGS, test x$ac_cv_func_chflags = xyes)
+dnl }}}
+
dnl {{{ check for cxxflags
-if test x == x"$LET_ME_RICE"
+if test x = x"$LET_ME_RICE"
then
AC_MSG_CHECKING([for go faster stripes])
for x in "as-needed" "visibility" "enforce-eh" "fast-math" "rtti"
@@ -831,7 +836,7 @@ AC_OUTPUT(
ebuild/fetchers/Makefile
ebuild/utils/Makefile
ebuild/echo_functions.bash
- ebuild/portability.bash
+ ebuild/work_around_broken_utilities.bash
eselect/Makefile
hooks/Makefile
hooks/demos/Makefile
diff --git a/ebuild/Makefile.am b/ebuild/Makefile.am
index 674a561..7779ecd 100644
--- a/ebuild/Makefile.am
+++ b/ebuild/Makefile.am
@@ -32,13 +32,13 @@ libexecprog_SCRIPTS = \
pkg_prerm.bash \
pkg_setup.bash \
portage_stubs.bash \
- portability.bash \
sandbox.bash \
src_compile.bash \
src_install.bash \
src_test.bash \
src_unpack.bash \
- usage_error.bash
+ usage_error.bash \
+ work_around_broken_utilities.bash
TESTS_ENVIRONMENT = env \
PALUDIS_EBUILD_DIR="$(top_srcdir)/ebuild/" \
diff --git a/ebuild/build_functions.bash b/ebuild/build_functions.bash
index d4abaa9..aa0daf2 100644
--- a/ebuild/build_functions.bash
+++ b/ebuild/build_functions.bash
@@ -87,7 +87,9 @@ econf()
einstall()
{
if [[ -f Makefile ]] || [[ -f makefile ]] || [[ -f GNUmakefile ]] ; then
- local cmd="${EINSTALL_WRAPPER} make prefix=${D}/usr"
+ local makecmd=""
+ type -p gmake &>/dev/null && makecmd="gmake" || makecmd="make"
+ local cmd="${EINSTALL_WRAPPER} ${makecmd} prefix=${D}/usr"
cmd="${cmd} mandir=${D}/usr/share/man"
cmd="${cmd} infodir=${D}/usr/share/info"
cmd="${cmd} datadir=${D}/usr/share"
diff --git a/ebuild/builtin_init.bash b/ebuild/builtin_init.bash
index 128f1b9..07e9290 100644
--- a/ebuild/builtin_init.bash
+++ b/ebuild/builtin_init.bash
@@ -34,6 +34,9 @@ builtin_init()
done
if [[ -e "${PALUDIS_TMPDIR}/${CATEGORY}/${PF}" ]] ; then
+ if type -p chflags &>/dev/null; then
+ chflags -R 0 "${PALUDIS_TMPDIR}/${CATEGORY}/${PF}" || die "Couldn't remove flags from workdir"
+ fi
rm -fr "${PALUDIS_TMPDIR}/${CATEGORY}/${PF}" || die "Couldn't remove previous work"
fi
diff --git a/ebuild/builtin_tidyup.bash b/ebuild/builtin_tidyup.bash
index 4223581..145f426 100644
--- a/ebuild/builtin_tidyup.bash
+++ b/ebuild/builtin_tidyup.bash
@@ -20,6 +20,10 @@
builtin_tidyup()
{
if [[ -e "${PALUDIS_TMPDIR}/${CATEGORY}/${PF}" ]] ; then
+ if type -p chflags &>/dev/null; then
+ echo chflags -R 0 "${PALUDIS_TMPDIR}/${CATEGORY}/${PF}" 1>&2
+ chflags -R 0 "${PALUDIS_TMPDIR}/${CATEGORY}/${PF}" || die "Couldn't remove flags from workdir"
+ fi
echo rm -fr "${PALUDIS_TMPDIR}/${CATEGORY}/${PF}" 1>&2
rm -fr "${PALUDIS_TMPDIR}/${CATEGORY}/${PF}" || die "Couldn't remove work"
fi
diff --git a/ebuild/ebuild.bash b/ebuild/ebuild.bash
index 4d4f372..b8d7368 100755
--- a/ebuild/ebuild.bash
+++ b/ebuild/ebuild.bash
@@ -96,7 +96,7 @@ ebuild_load_module multilib_functions
ebuild_load_module install_functions
ebuild_load_module build_functions
ebuild_load_module eclass_functions
-ebuild_load_module portability
+ebuild_load_module work_around_broken_utilities
export PALUDIS_HOME="$(canonicalise ${PALUDIS_HOME:-${HOME}} )"
@@ -267,7 +267,7 @@ perform_hook()
ebuild_main()
{
- if ! [[ -e /proc/self ]] ; then
+ if ! [[ -e /proc/self ]] && [[ "$(uname -s)" == Linux ]] ; then
ebuild_notice "warning" "/proc appears to be unmounted or unreadable."
ebuild_notice "warning" "This will cause problems."
fi
diff --git a/ebuild/fetchers/Makefile.am b/ebuild/fetchers/Makefile.am
index 74da068..37e6463 100644
--- a/ebuild/fetchers/Makefile.am
+++ b/ebuild/fetchers/Makefile.am
@@ -30,7 +30,7 @@ check_PROGRAMS = $(TESTS)
AM_CXXFLAGS = -I$(top_srcdir) @PALUDIS_CXXFLAGS@
dohttp dohttps doftp : dowget.in
- cat $< > $@
+ cat $? > $@
built-sources : $(BUILT_SOURCES)
for s in `echo $(SUBDIRS) | tr -d .` ; do $(MAKE) -C $$s built-sources || exit 1 ; done
diff --git a/ebuild/portability.bash.in b/ebuild/work_around_broken_utilities.bash.in
index 246f387..246f387 100644
--- a/ebuild/portability.bash.in
+++ b/ebuild/work_around_broken_utilities.bash.in
diff --git a/paludis/util/fs_entry.cc b/paludis/util/fs_entry.cc
index 117bddb..1d6c8d8 100644
--- a/paludis/util/fs_entry.cc
+++ b/paludis/util/fs_entry.cc
@@ -29,6 +29,7 @@
#include <limits.h>
#include <cstring>
#include <cstdlib>
+#include "config.h"
/** \file
* Implementation of paludis::FSEntry.
@@ -368,6 +369,15 @@ FSEntry::mkdir(mode_t mode)
bool
FSEntry::unlink()
{
+#ifdef HAVE_CHFLAGS
+ if (0 != ::chflags(_path.c_str(), 0))
+ {
+ int e(errno);
+ if (e != ENOENT)
+ throw FSError("chflags for unlink '" + _path + "' failed: " + ::strerror(e));
+ }
+#endif
+
if (0 == ::unlink(_path.c_str()))
return true;