aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-01-31 14:54:45 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-01-31 14:54:45 +0000
commit45adf1b76c10fb6ec9b65e53c638eaf9505a0879 (patch)
tree24315b4f4706867ef74a411203dcf5a6fd5900f5
parentc7278e7a8f8cf25b0ef1113cc1a6a9536debebd8 (diff)
downloadpaludis-45adf1b76c10fb6ec9b65e53c638eaf9505a0879.tar.gz
paludis-45adf1b76c10fb6ec9b65e53c638eaf9505a0879.tar.xz
Don't have two lots of unpack
-rw-r--r--paludis/repositories/e/eapi.cc5
-rw-r--r--paludis/repositories/e/eapi.sr1
-rw-r--r--paludis/repositories/e/eapis/0.conf1
-rw-r--r--paludis/repositories/e/eapis/exheres-0.conf1
-rw-r--r--paludis/repositories/e/eapis/paludis-1.conf2
-rw-r--r--paludis/repositories/e/ebuild.cc4
-rw-r--r--paludis/repositories/e/ebuild/exheres-0/src_compile.bash1
-rw-r--r--paludis/repositories/e/ebuild/utils/exheres-0/Makefile.am1
-rwxr-xr-xpaludis/repositories/e/ebuild/utils/exheres-0/unpack134
-rwxr-xr-xpaludis/repositories/e/ebuild/utils/unpack6
10 files changed, 18 insertions, 138 deletions
diff --git a/paludis/repositories/e/eapi.cc b/paludis/repositories/e/eapi.cc
index 5cea2f5..ea8f83c 100644
--- a/paludis/repositories/e/eapi.cc
+++ b/paludis/repositories/e/eapi.cc
@@ -218,7 +218,10 @@ namespace paludis
.tools_options(make_shared_ptr(new EAPIToolsOptions(
EAPIToolsOptions::create()
.unpack_unrecognised_is_fatal(destringify<bool>(
- k.get("unpack_unrecognised_is_fatal"))))))
+ k.get("unpack_unrecognised_is_fatal")))
+ .unpack_fix_permissions(destringify<bool>(
+ k.get("unpack_fix_permissions")))
+ )))
))));
diff --git a/paludis/repositories/e/eapi.sr b/paludis/repositories/e/eapi.sr
index e3a4c26..21c3346 100644
--- a/paludis/repositories/e/eapi.sr
+++ b/paludis/repositories/e/eapi.sr
@@ -114,6 +114,7 @@ make_class_EAPIToolsOptions()
allow_named_args cc
key unpack_unrecognised_is_fatal bool
+ key unpack_fix_permissions bool
doxygen_comment << "END"
/**
diff --git a/paludis/repositories/e/eapis/0.conf b/paludis/repositories/e/eapis/0.conf
index b289533..cb4fe52 100644
--- a/paludis/repositories/e/eapis/0.conf
+++ b/paludis/repositories/e/eapis/0.conf
@@ -169,4 +169,5 @@ pipe_commands_rewrite_virtuals = true
pipe_commands_no_slot_or_repo = true
unpack_unrecognised_is_fatal = false
+unpack_fix_permissions = true
diff --git a/paludis/repositories/e/eapis/exheres-0.conf b/paludis/repositories/e/eapis/exheres-0.conf
index d3b2fd2..79cbc7f 100644
--- a/paludis/repositories/e/eapis/exheres-0.conf
+++ b/paludis/repositories/e/eapis/exheres-0.conf
@@ -194,4 +194,5 @@ pipe_commands_rewrite_virtuals = false
pipe_commands_no_slot_or_repo = false
unpack_unrecognised_is_fatal = true
+unpack_fix_permissions = false
diff --git a/paludis/repositories/e/eapis/paludis-1.conf b/paludis/repositories/e/eapis/paludis-1.conf
index 9ea3592..11131d6 100644
--- a/paludis/repositories/e/eapis/paludis-1.conf
+++ b/paludis/repositories/e/eapis/paludis-1.conf
@@ -186,3 +186,5 @@ pipe_commands_rewrite_virtuals = true
pipe_commands_no_slot_or_repo = false
unpack_unrecognised_is_fatal = false
+unpack_fix_permissions = false
+
diff --git a/paludis/repositories/e/ebuild.cc b/paludis/repositories/e/ebuild.cc
index 86987a8..e458a9b 100644
--- a/paludis/repositories/e/ebuild.cc
+++ b/paludis/repositories/e/ebuild.cc
@@ -178,6 +178,10 @@ EbuildCommand::operator() ()
params.package_id->eapi()->supported->ebuild_environment_variables->env_distdir)
.with_setenv("PALUDIS_UNPACK_UNRECOGNISED_IS_FATAL",
params.package_id->eapi()->supported->tools_options->unpack_unrecognised_is_fatal ? "yes" : "")
+ .with_setenv("PALUDIS_UNPACK_FIX_PERMISSIONS",
+ params.package_id->eapi()->supported->tools_options->unpack_fix_permissions ? "yes" : "")
+ .with_setenv("PALUDIS_UNPACK_FROM_VAR",
+ params.package_id->eapi()->supported->ebuild_environment_variables->env_distdir)
.with_setenv("PALUDIS_PIPE_COMMANDS_SUPPORTED", "yes")
)
.with_setenv("SLOT", "")
diff --git a/paludis/repositories/e/ebuild/exheres-0/src_compile.bash b/paludis/repositories/e/ebuild/exheres-0/src_compile.bash
index b293f00..aaff3ed 100644
--- a/paludis/repositories/e/ebuild/exheres-0/src_compile.bash
+++ b/paludis/repositories/e/ebuild/exheres-0/src_compile.bash
@@ -51,3 +51,4 @@ exheres_internal_compile()
ebuild_section "Done src_compile"
fi
}
+
diff --git a/paludis/repositories/e/ebuild/utils/exheres-0/Makefile.am b/paludis/repositories/e/ebuild/utils/exheres-0/Makefile.am
index 23505f6..50da7ba 100644
--- a/paludis/repositories/e/ebuild/utils/exheres-0/Makefile.am
+++ b/paludis/repositories/e/ebuild/utils/exheres-0/Makefile.am
@@ -20,7 +20,6 @@ libexecprog_SCRIPTS = \
prepalldocs \
ecompress \
ecompressdir \
- unpack \
emake \
banned_in_eapi_exheres-0
diff --git a/paludis/repositories/e/ebuild/utils/exheres-0/unpack b/paludis/repositories/e/ebuild/utils/exheres-0/unpack
deleted file mode 100755
index a71efd1..0000000
--- a/paludis/repositories/e/ebuild/utils/exheres-0/unpack
+++ /dev/null
@@ -1,134 +0,0 @@
-#!/bin/bash
-# vim: set sw=4 sts=4 et :
-
-# Copyright (c) 2006, 2007 Ciaran McCreesh
-#
-# Based in part upon ebuild.sh from Portage, which is Copyright 1995-2005
-# Gentoo Foundation and distributed under the terms of the GNU General
-# Public License v2.
-#
-# 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
-
-die()
-{
- echo "unpack: error: $@" 1>&2
- echo "unpack: making ebuild PID ${EBUILD_KILL_PID} exit with error" 1>&2
- kill -s SIGUSR1 "${EBUILD_KILL_PID}"
- exit 123
-}
-
-unpack_one()
-{
- [[ -z "$1" ]] && die "Bad argument for unpack_one"
- [[ -e "$1" ]] || die "${1} doesn't exist"
-
- if [[ -n "${UNPACKONLY}" ]] ; then
- case "${x}" in
- *.tar.bz2|*.tbz2)
- ;;
-
- *)
- die "Can't use --only with ${x}"
- ;;
- esac
- fi
-
- case "${x}" in
- *.tar)
- echo tar xf "${1}" --no-same-owner "${TAR_OPTIONS[@]}" 1>&2
- tar xf "${1}" --no-same-owner "${TAR_OPTIONS[@]}" || die "Couldn't unpack ${1}"
- ;;
-
- *.tar.gz|*.tgz|*.tar.Z)
- echo tar zxf "${1}" --no-same-owner "${TAR_OPTIONS[@]}" 1>&2
- tar zxf "${1}" --no-same-owner "${TAR_OPTIONS[@]}" || die "Couldn't unpack ${1}"
- ;;
-
- *.tar.bz2|*.tbz2)
- echo tar jxf "${1}" --no-same-owner "${TAR_OPTIONS[@]}" ${UNPACKONLY} 1>&2
- tar jxf "${1}" --no-same-owner "${TAR_OPTIONS[@]}" ${UNPACKONLY} || die "Couldn't unpack ${1}"
- ;;
-
- *.zip|*.ZIP|*.jar)
- echo unzip -qo "${1}" 1>&2
- unzip -qo "${1}" || die "Couldn't unpack ${1}"
- ;;
-
- *.gz|*.Z|*.z)
- echo gzip -dc "${1}" > ${UNPACKTODIR}/$(basename "${1%.*}" ) 1>&2
- gzip -dc "${1}" > ${UNPACKTODIR}/$(basename "${1%.*}" ) || die "Couldn't unpack ${1}"
- ;;
-
- *.bz2)
- echo bzip2 -dc "${1}" > ${UNPACKTODIR}/$(basename "${1%.*}" ) 1>&2
- bzip2 -dc "${1}" > ${UNPACKTODIR}/$(basename "${1%.*}" ) || die "Couldn't unpack ${1}"
- ;;
-
- *.rar|*.RAR)
- echo unrar x -idq "${1}" 1>&2
- unrar x -idq "${1}" || die "Couldn't unpack ${1}"
- ;;
-
- *.LHa|*.LHA|*.lha|*.lzh)
- echo lha xqf "${1}" 1>&2
- lha xqf "${1}" || die "Couldn't unpack ${1}"
- ;;
-
- *.a|*.deb)
- echo ar x "${1}" 1>&2
- ar x "${1}" 1>&2
- ;;
-
- *)
- echo "Skipping unpack for ${1}"
- ;;
- esac
-
-}
-
-export UNPACKFROMDIR="${FETCHEDDIR}"
-export UNPACKTODIR="${PWD}"
-
-if [[ "${1}" == "--binary" ]] ; then
- export UNPACKFROMDIR="${PKGDIR}"
- export UNPACKTODIR="${IMAGE}"
- shift
-fi
-
-unset UNPACKONLY
-if [[ "${1}" == "--only" ]] ; then
- shift
- export UNPACKONLY="${1}"
- shift
-fi
-
-TAR_OPTIONS=( )
-while [[ "${1}" == --tar-option=* ]] ; do
- TAR_OPTIONS[${#TAR_OPTIONS[@]}]="${1#*=}"
- shift
-done
-
-[[ -z "$@" ]] && die "No arguments given to unpack"
-
-for x in "$@" ; do
- x=$(echo $x )
- echo ">>> Unpacking ${x} to ${UNPACKTODIR}"
- [[ "${x:0:2}" == "./" ]] || x="${UNPACKFROMDIR}/${x}"
- mkdir -p ${UNPACKTODIR}
- cd ${UNPACKTODIR}
- unpack_one "${x}"
-done
-
-
diff --git a/paludis/repositories/e/ebuild/utils/unpack b/paludis/repositories/e/ebuild/utils/unpack
index deff16f..a9dd705 100755
--- a/paludis/repositories/e/ebuild/utils/unpack
+++ b/paludis/repositories/e/ebuild/utils/unpack
@@ -116,7 +116,7 @@ unpack_one()
esac
}
-export UNPACKFROMDIR="${DISTDIR}"
+export UNPACKFROMDIR="${!PALUDIS_UNPACK_FROM_VAR}"
export UNPACKTODIR="${PWD}"
unset UNPACKONLY
TAR_OPTIONS=( )
@@ -146,5 +146,7 @@ for x in "$@" ; do
unpack_one "${x}"
done
-find ${UNPACKTODIR} -mindepth 1 ! -type l -print0 | xargs -0 chmod a+rX,u+w,go-w
+if [[ -n "${PALUDIS_UNPACK_FIX_PERMISSIONS}" ]] ; then
+ find ${UNPACKTODIR} -mindepth 1 ! -type l -print0 | xargs -0 chmod a+rX,u+w,go-w
+fi