summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc-Antoine Perennou <Marc-Antoine@Perennou.com>2010-03-09 12:12:21 +0100
committerMarc-Antoine Perennou <Marc-Antoine@Perennou.com>2010-03-09 12:12:21 +0100
commit48456f9891eea5afbe5a8f5c943e82d88a6367cc (patch)
tree1d8bc9f13e1f7da612087fc557a09eb87c919688
parentproblem came from gwibber ... damnit (diff)
downloadkeruspe-48456f9891eea5afbe5a8f5c943e82d88a6367cc.tar.gz
keruspe-48456f9891eea5afbe5a8f5c943e82d88a6367cc.tar.bz2
keruspe-48456f9891eea5afbe5a8f5c943e82d88a6367cc.zip
add paludis
-rw-r--r--eclass/scm-git.eclass186
-rw-r--r--eclass/scm.eclass349
-rw-r--r--profiles/package.mask1
-rw-r--r--profiles/paludis/virtuals1
-rw-r--r--profiles/use.local.desc2
-rw-r--r--sys-apps/paludis/Manifest2
-rw-r--r--sys-apps/paludis/files/paludis-ask.patch297
-rw-r--r--sys-apps/paludis/paludis-9999.ebuild155
8 files changed, 993 insertions, 0 deletions
diff --git a/eclass/scm-git.eclass b/eclass/scm-git.eclass
new file mode 100644
index 00000000..5c2fa206
--- /dev/null
+++ b/eclass/scm-git.eclass
@@ -0,0 +1,186 @@
+# Copyright 2008 David Leverton <dleverton@exherbo.org>
+# Distributed under the terms of the GNU General Public License v2
+# Based in part upon git.exlib, which is:
+# Copyright 2008 Fernando J. Pereda
+# Based upon 'git.eclass' which is:
+# Copyright 1999-2007 Gentoo Foundation
+
+if [[ -z ${SCM_TYPE} ]]; then
+ SCM_TYPE=git
+ inherit scm
+fi
+
+scm-git_do_dependencies() {
+ local git='>=dev-util/git-1.6.0'
+ if [[ $(scm_get_var REPOSITORY) == https://* ]]; then
+ echo "${git}$(scm_usedeps curl) net-misc/curl$(scm_usedeps ssl)"
+ elif [[ $(scm_get_var REPOSITORY) == http://* || $(scm_get_var REPOSITORY) == ftp://* ]]; then
+ echo "${git}$(scm_usedeps curl)"
+ elif [[ $(scm_get_var REPOSITORY) == rsync://* ]]; then
+ echo "${git} net-misc/rsync"
+ elif [[ $(scm_get_var REPOSITORY) == ssh://* ]] ||
+ [[ $(scm_get_var REPOSITORY) != *://* && $(scm_get_var REPOSITORY) == *:* ]]; then
+ echo "${git} net-misc/openssh"
+ else
+ echo "${git}"
+ fi
+
+ if [[ -n $(scm_get_var TAG) ]]; then
+ local keys
+ scm_get_array GIT_TAG_SIGNING_KEYS keys
+ [[ ${#keys[@]} -gt 0 ]] && echo app-crypt/gnupg
+ fi
+}
+
+scm-git_do_check_vars() {
+ [[ -n $(scm_get_var TAG) && -n $(scm_get_var REVISION) ]] \
+ && die "for git, $(scm_var_name TAG) must not be set at the same time as $(scm_var_name REVISION)"
+ [[ -z $(scm_get_var BRANCH) && -z $(scm_get_var REVISION) &&
+ -z $(scm_get_var TAG) ]] && scm_set_var BRANCH master
+ local rev=$(scm_get_var REVISION)
+ [[ -n ${rev} ]] && [[ ${rev} == *[^0123456789abcdef]* || ${#rev} -ne 40 ]] \
+ && die "for git, $(scm_var_name REVISION) must be a 40-character lowercase hexadecimal SHA-1 sum"
+ [[ -n $(scm_get_var SUBPATH) ]] && die "for git, $(scm_var_name SUBPATH) must not be set"
+
+ scm_modify_var REPOSITORY scm_trim_slashes -scheme -trailing
+}
+
+scm-git_git() {
+ local echo=echo
+ if [[ ${1} == -q ]]; then
+ shift
+ echo=:
+ fi
+
+ local need_git_dir=yes global=( )
+ while [[ ${#} -gt 0 && ${1} == -* ]]; do
+ global=( "${global[@]}" "${1}" )
+ [[ ${1} == --git-dir=* ]] && need_git_dir=
+ shift
+ done
+ [[ ${1} != clone && -n ${need_git_dir} ]] && global=( "${global[@]}" --git-dir="$(scm_get_var CHECKOUT_TO)" )
+
+ ${echo} git "${global[@]}" "${@}"
+ GIT_PAGER=cat git "${global[@]}" "${@}" || scm_die_unless_nonfatal "git ${1} failed"
+}
+
+scm-git_do_appraise() {
+ local dir=$(scm_get_var CHECKOUT_TO)
+
+ if ! scm_nonfatal scm-git_git -q rev-parse 2>/dev/null; then
+ echo "${dir} is not a git checkout"
+ return 3
+ fi
+
+ if [[ -n $(scm_get_var REVISION) ]]; then
+ if [[ -z $(scm_nonfatal scm-git_git -q cat-file -t $(scm_get_var REVISION) 2>/dev/null) ]]; then
+ echo "$(scm_get_var REVISION) is not present in ${dir}"
+ return 1
+ elif [[ $(scm-git_git -q cat-file -t $(scm_get_var REVISION)) == commit ]]; then
+ if [[ -n $(scm_get_var BRANCH) ]] && ! scm-git_git -q rev-list "refs/heads/$(scm_get_var BRANCH)" \
+ | grep -Fx $(scm_get_var REVISION) >/dev/null; then
+ echo "revision $(scm_get_var REVISION) is not part of branch $(scm_get_var BRANCH) of ${dir}"
+ return 1
+ fi
+ return 2
+ else
+ die "$(scm_get_var REVISION) is not a commit in ${dir}"
+ fi
+ fi
+
+ local origin=$(scm-git_git -q config remote.origin.url)
+ [[ -n ${origin} ]] || die "could not determine origin URL for ${dir}"
+ if [[ ${origin} != $(scm_get_var REPOSITORY) ]]; then
+ echo "${dir} is a clone of ${origin}, but wanted $(scm_get_var REPOSITORY)"
+ return 1
+ fi
+
+ if [[ -n $(scm_get_var TAG) ]]; then
+ if [[ -n $(scm-git_git -q for-each-ref "refs/tags/$(scm_get_var TAG)") ]]; then
+ if [[ -n $(scm_get_var BRANCH) ]] && ! scm-git_git -q rev-list "refs/heads/$(scm_get_var BRANCH)" \
+ | grep -Fx $(scm-git_git -q rev-parse "refs/tags/$(scm_get_var TAG)") >/dev/null; then
+ echo "tag $(scm_get_var TAG) is not part of branch $(scm_get_var BRANCH) of ${dir}"
+ return 1
+ fi
+
+ local keys
+ scm_get_array GIT_TAG_SIGNING_KEYS keys
+ if [[ ${#keys[@]} -gt 0 ]]; then
+ local gpghome=$(mktemp -d -p "${T}" gpg-XXXXXX)
+ [[ -n ${gpghome} ]] || die "mktemp failed"
+
+ cat >"${gpghome}/gpg" <<-EOF
+ #! /usr/bin/env bash
+ $(HOME=${gpghome} declare -p HOME)
+ $(gpg=$(type -P gpg); declare -p gpg)
+ errors=\$("\${gpg}" --keyserver-options no-auto-key-retrieve "\${@}" 2>&1 >/dev/null) && exit
+ status=\${?}
+ echo "\${errors}" >&2
+ exit \${status}
+ EOF
+ [[ ${?} -eq 0 ]] || die "create gpg wrapper failed"
+ chmod +x "${gpghome}/gpg" || die "chmod +x gpg wrapper failed"
+
+ PATH=${gpghome}:${PATH} gpg --import "${keys[@]}" || die "gpg --import ${keys[*]} failed"
+ PATH=${gpghome}:${PATH} scm-git_git -q verify-tag "$(scm_get_var TAG)" >/dev/null
+ fi
+
+ return 2
+ else
+ echo "${dir} does not contain the tag $(scm_get_var TAG)"
+ return 1
+ fi
+ fi
+
+ if [[ -n $(scm_get_var BRANCH) && -z $(scm-git_git -q for-each-ref "refs/heads/$(scm_get_var BRANCH)") ]]; then
+ echo "${dir} does not contain the branch $(scm_get_var BRANCH)"
+ return 1
+ fi
+
+ return 0
+}
+
+scm-git_do_checkout() {
+ scm-git_git clone --bare "$(scm_get_var REPOSITORY)" "$(scm_get_var CHECKOUT_TO)"
+ scm-git_git config remote.origin.url "$(scm_get_var REPOSITORY)"
+ scm-git_git gc --auto
+}
+
+scm-git_do_update() {
+ local old_origin=$(scm-git_git -q config remote.origin.url)
+ [[ -n ${old_origin} ]] || die "could not determine origin URL for $(scm_get_var CHECKOUT_TO)"
+ if [[ ${old_origin} != $(scm_get_var REPOSITORY) ]]; then
+ scm-git_git config remote.origin.url "$(scm_get_var REPOSITORY)"
+ eval "$(scm-git_git -q for-each-ref --shell --format "scm-git_git update-ref -d %(refname)" refs/{heads,tags}/\*)"
+ fi
+
+ local branch=$(scm_get_var BRANCH)
+ scm-git_git fetch -f -u origin "refs/heads/${branch:-*}:refs/heads/${branch:-*}"
+ scm-git_git gc --auto
+ [[ -n ${branch} ]] && scm_set_array FETCHED_BRANCHES "${branch}"
+}
+
+scm-git_do_revision() {
+ scm-git_git -q rev-parse $(
+ if [[ -n $(scm_get_var TAG) ]]; then
+ echo refs/tags/$(scm_get_var TAG)
+ elif [[ -n $(scm_get_var REVISION) ]]; then
+ scm_get_var REVISION
+ else
+ echo refs/heads/$(scm_get_var BRANCH)
+ fi)
+}
+
+scm-git_do_unpack() {
+ scm-git_git clone -s -n "$(scm_get_var CHECKOUT_TO)" "$(scm_get_var UNPACK_TO)"
+ scm-git_git --git-dir="$(scm_get_var UNPACK_TO)"/.git --work-tree="$(scm_get_var UNPACK_TO)" checkout -f $(
+ if [[ -n $(scm_get_var TAG) ]]; then
+ echo refs/tags/$(scm_get_var TAG)
+ elif [[ -n $(scm_get_var REVISION) ]]; then
+ scm_get_var REVISION
+ else
+ [[ -n $(scm-git_git -q --git-dir="$(scm_get_var UNPACK_TO)"/.git for-each-ref "refs/heads/$(scm_get_var BRANCH)") ]] \
+ || echo -b $(scm_get_var BRANCH) refs/remotes/origin/$(scm_get_var BRANCH)
+ fi) --
+}
+
diff --git a/eclass/scm.eclass b/eclass/scm.eclass
new file mode 100644
index 00000000..67d54985
--- /dev/null
+++ b/eclass/scm.eclass
@@ -0,0 +1,349 @@
+# Copyright 2008 David Leverton <dleverton@exherbo.org>
+# Distributed under the terms of the GNU General Public License v2
+# Based in part upon subversion.eclass, which is:
+# Copyright 1999-2008 Gentoo Foundation
+
+scm_need_extglob() {
+ [[ ${#} -eq 1 ]] || die "scm_need_extglob needs exactly one argument"
+ [[ -n $(declare -F ${1}) ]] || die "${1} is not a function"
+ eval "_scm_need_extglob_$(declare -f ${1})"
+ eval "${1}() {
+ local oldextglob=\$(shopt -p extglob)
+ shopt -s extglob
+ _scm_need_extglob_${1} \"\${@}\"
+ local status=\${?}
+ \${oldextglob}
+ return \${status}
+ }"
+}
+
+scm_usedeps() {
+ [[ ${#} -ge 1 ]] || die "scm_usedeps needs at least one argument"
+ local myeapi=$(echo ${EAPI/prefix})
+ has ${myeapi:-0} 0 1 && return
+ local IFS=,
+ local deps="[${*}]"
+ [[ ${myeapi:-0} == kdebuild-* ]] && deps=${deps//,/][}
+ echo "${deps}"
+}
+
+scm_nonfatal() {
+ SCM_NONFATAL=1 "${@}"
+}
+
+scm_die_unless_nonfatal() {
+ [[ -z ${SCM_NONFATAL} ]] && die "${@}"
+}
+
+scm_for_each() {
+ [[ ${#} -ge 1 ]] || die "scm_for_each needs at least one argument"
+ local SCM_THIS
+ for SCM_THIS in "" ${SCM_SECONDARY_REPOSITORIES}; do
+ "${@}"
+ done
+}
+
+scm_var_name() {
+ [[ ${#} -eq 1 ]] || die "scm_var_name needs exactly one argument"
+ echo SCM${SCM_THIS:+_${SCM_THIS}}_${1}
+}
+
+scm_get_var() {
+ [[ ${#} -eq 1 ]] || die "scm_get_var needs exactly one argument"
+ local var=$(scm_var_name ${1})
+ echo "${!var}"
+}
+
+scm_set_var() {
+ [[ ${#} -eq 2 ]] || die "scm_set_var needs exactly two arguments"
+ eval "$(scm_var_name ${1})=\${2}"
+}
+
+scm_modify_var() {
+ [[ ${#} -ge 2 ]] || die "scm_modify_var needs at least two arguments"
+ local var=${1}
+ shift
+ scm_set_var ${var} "$("${@}" "$(scm_get_var ${var})")"
+}
+
+scm_get_array() {
+ [[ ${#} -eq 2 ]] || die "scm_get_array needs exactly two arguments"
+ eval "${2}=( \"\${$(scm_var_name ${1})[@]}\" )"
+}
+
+scm_set_array() {
+ [[ ${#} -ge 1 ]] || die "scm_set_array needs at least one argument"
+ local name=${1}
+ shift
+ eval "$(scm_var_name ${name})=( \"\${@}\" )"
+}
+
+scm_call() {
+ [[ ${#} -ge 1 ]] || die "scm_call needs at least one argument"
+ local func=${1} type=$(scm_get_var TYPE)
+ shift
+ if [[ -n $(declare -F scm-${type}_do_${func}) ]]; then
+ scm-${type}_do_${func} "${@}"
+ elif [[ -n $(declare -F scm_do_${func}) ]]; then
+ scm_do_${func} "${@}"
+ else
+ die "bug in scm-${type}.eclass: scm-${type}_do_${func} not defined"
+ fi
+}
+
+scm_access_checkout() {
+ [[ ${#} -ge 1 ]] || die "scm_access_checkout needs at least one argument"
+ local dir=$(scm_get_var CHECKOUT_TO)
+ local lock=${dir%/*}/.lock-${dir##*/}
+
+ local dir_base=${dir%/*}
+ if [[ ! -d ${dir_base} ]]; then
+ local dir_addwrite=${dir_base}
+ local dir_search=${dir_addwrite%/*}
+ while [[ ! -d ${dir_search} ]]; do
+ dir_addwrite=${dir_search}
+ dir_search=${dir_search%/*}
+ done
+ (
+ addwrite "${dir_addwrite}"
+ mkdir -p "${dir_base}"
+ ) || die "mkdir failed"
+ fi
+
+ local SANDBOX_WRITE=${SANDBOX_WRITE}
+ addwrite "${dir}"
+ addwrite "${lock}"
+
+ local fd
+ for fd in {3..9}; do
+ [[ -e /dev/fd/${fd} ]] || break
+ done
+ [[ -e /dev/fd/${fd} ]] && die "can't find free file descriptor"
+
+ eval "
+ {
+ flock -x \${fd} || die \"flock failed\"
+ \"\${@}\"
+ local status=\${?}
+ :
+ } ${fd}>\"\${lock}\" || die \"opening lock file failed\"
+ "
+
+ return ${status}
+}
+
+scm_do_resolve_externals() {
+ :
+}
+
+scm_check_timestamp() {
+ [[ -e ${1}/${2} && -n $(find "${1}" -maxdepth 1 -name "${2}" \
+ -mmin -$((${SCM_MIN_UPDATE_DELAY} * 60)) -print) ]]
+}
+
+scm_perform_fetch() {
+ local dir=$(scm_get_var CHECKOUT_TO)
+
+ local whynot status
+ if [[ -d ${dir} ]]; then
+ whynot=$(scm_call appraise)
+ status=${?}
+ if [[ ${status} -eq 2 ]]; then
+ einfo "Not fetching ${SCM_THIS:-primary repository} because the existing checkout is perfect"
+ return
+ fi
+ else
+ whynot="${dir} does not exist"
+ status=1
+ fi
+
+ if [[ -n ${SCM_OFFLINE} ]]; then
+ [[ ${status} -ne 0 ]] && die "can't use SCM_OFFLINE for ${SCM_THIS:-primary repository} because ${whynot}"
+ einfo "Not fetching ${SCM_THIS:-primary repository} because SCM_OFFLINE is set"
+ return
+ fi
+
+ if [[ -n ${SCM_MIN_UPDATE_DELAY} ]]; then
+ [[ ${SCM_MIN_UPDATE_DELAY} == *[^0123456789]* || ${SCM_MIN_UPDATE_DELAY} -eq 0 ]] \
+ && die "SCM_MIN_UPDATE_DELAY must be a positive integer"
+ local branch=$(scm_get_var BRANCH)
+ if scm_check_timestamp "${dir}" .scm.eclass.timestamp ||
+ { [[ -n ${branch} ]] && scm_check_timestamp "${dir}" .scm.eclass.timestamp."${branch//\//--}"; }; then
+ if [[ ${status} -eq 0 ]]; then
+ einfo "Not fetching ${SCM_THIS:-primary repository} because SCM_MIN_UPDATE_DELAY (${SCM_MIN_UPDATE_DELAY}) hours have not passed"
+ return
+ else
+ einfo "Ignoring SCM_MIN_UPDATE_DELAY for ${SCM_THIS:-primary repository} because ${whynot}"
+ fi
+ fi
+ fi
+
+ if [[ ${status} -eq 3 ]]; then
+ echo rm -rf "${dir}"
+ rm -rf "${dir}"
+ [[ -d ${dir} ]] && die "rm failed"
+ fi
+
+ if [[ -d ${dir} ]]; then
+ scm_call update
+ else
+ scm_call checkout
+ fi
+
+ if [[ -d ${dir} ]]; then
+ whynot=$(scm_call appraise)
+ [[ ${?} -eq 1 || ${?} -eq 3 ]] && die "${whynot}"
+ else
+ die "${dir} does not exist"
+ fi
+
+ local fetched
+ scm_get_array FETCHED_BRANCHES fetched
+ if [[ ${#fetched[@]} -gt 0 ]]; then
+ fetched=( "${fetched[@]//\//--}" )
+ touch "${fetched[@]/#/${dir}/.scm.eclass.timestamp.}" || die "touch failed"
+ else
+ touch "${dir}/.scm.eclass.timestamp" || die "touch failed"
+ fi
+}
+
+scm_fetch_one() {
+ scm_perform_fetch
+ scm_call resolve_externals
+}
+
+scm_src_fetch_extra() {
+ scm_{for_each,access_checkout,fetch_one}
+}
+
+scm_scmrevision_one() {
+ local rev=$(scm_call revision)
+ [[ -n ${rev} ]] || die "could not determine revision for ${SCM_THIS:-primary repository}"
+ SCM_PKG_SCM_REVISION_RESULT=${SCM_PKG_SCM_REVISION_RESULT},${SCM_THIS}=${rev}
+}
+
+scm_pkg_scm_revision() {
+ local SCM_PKG_SCM_REVISION_RESULT=
+ scm_{for_each,access_checkout,scmrevision_one}
+ echo ${SCM_PKG_SCM_REVISION_RESULT#,=}
+}
+
+scm_do_unpack() {
+ echo cp -pPR "$(scm_get_var CHECKOUT_TO)" "$(scm_get_var UNPACK_TO)"
+ cp -pPR "$(scm_get_var CHECKOUT_TO)" "$(scm_get_var UNPACK_TO)" || die "cp failed"
+}
+
+scm_do_set_actual_vars() {
+ local rev=$(scm_call revision)
+ [[ -n ${rev} ]] || die "could not determine revision for ${SCM_THIS:-primary repository}"
+ scm_set_var ACTUAL_REVISION "${rev}"
+}
+
+scm_unpack_one() {
+ scm_call resolve_externals
+
+ local whynot
+ if [[ -d $(scm_get_var CHECKOUT_TO) ]]; then
+ whynot=$(scm_call appraise)
+ [[ ${?} -eq 1 || ${?} -eq 3 ]] && die "${whynot}"
+ else
+ die "$(scm_get_var CHECKOUT_TO) does not exist"
+ fi
+
+ local dir=$(scm_get_var UNPACK_TO)
+ if [[ -d ${dir} ]]; then
+ rmdir "${dir}" || die "rmdir failed"
+ else
+ mkdir -p "${dir%/*}" || die mkdir "failed"
+ fi
+
+ scm_call unpack
+ rm -f "${dir}/.scm.eclass.timestamp"{,.*}
+ scm_call set_actual_vars
+}
+
+scm_src_unpack() {
+ scm_src_fetch_extra
+
+ scm_{for_each,access_checkout,unpack_one}
+ SCM_IS_BUILT=1
+}
+
+scm_do_info() {
+ :
+}
+
+scm_pkg_info() {
+ [[ -n ${SCM_IS_BUILT} ]] && scm_{for_each,call} info
+}
+
+scm_trim_slashes() {
+ local scheme= leading= trailing=
+ while [[ ${#} -gt 0 && ${1} == -* ]]; do
+ case ${1} in
+ -scheme) scheme=1 ;;
+ -leading) leading=1 ;;
+ -trailing) trailing=1 ;;
+ *) die "scm_trim_slashes: unrecognised switch ${1}"
+ esac
+ shift
+ done
+
+ [[ ${#} -eq 1 ]] || die "scm_trim_slashes needs exactly one argument besides switches"
+ local value=${1}
+
+ local myscheme=
+ if [[ -n ${scheme} && ${value} == *://* ]]; then
+ myscheme=${value%%://*}://
+ value=${value#*://}
+ fi
+
+ value=${value//+(\/)/\/}
+ [[ -n ${leading} ]] && value=${value#/}
+ [[ -n ${trailing} ]] && value=${value%/}
+
+ echo "${myscheme}${value}"
+}
+scm_need_extglob scm_trim_slashes
+
+scm_do_check_vars() {
+ :
+}
+
+scm_global_stuff() {
+ if [[ -z $(scm_get_var TYPE) ]]; then
+ if [[ -n ${SCM_THIS} ]]; then
+ scm_set_var TYPE ${SCM_TYPE}
+ else
+ die "$(scm_var_name TYPE) must be set"
+ fi
+ fi
+ inherit scm-$(scm_get_var TYPE)
+
+ [[ -z $(scm_get_var REPOSITORY) ]] \
+ && die "$(scm_var_name REPOSITORY) must be set"
+
+ local checkout_to=$(scm_get_var CHECKOUT_TO)
+ [[ -z ${checkout_to} ]] && checkout_to=${SCM_THIS:-${PN}}
+ [[ ${checkout_to} == /* ]] || checkout_to=${SCM_HOME}/${checkout_to}
+ scm_set_var CHECKOUT_TO "$(scm_trim_slashes -trailing "${checkout_to}")"
+
+ local unpack_to=$(scm_get_var UNPACK_TO)
+ [[ -z ${unpack_to} ]] && unpack_to=${WORKDIR}/${SCM_THIS:-${P}}
+ scm_set_var UNPACK_TO "$(scm_trim_slashes -trailing "${unpack_to}")"
+
+ scm_call check_vars
+
+ DEPEND="${DEPEND} $(scm_call dependencies)"
+}
+
+SCM_HOME=${PORTAGE_ACTUAL_DISTDIR-${DISTDIR}}/scm
+scm_finalise() {
+ DEPEND="${DEPEND} >=sys-apps/util-linux-2.13_pre2"
+ scm_{for_each,global_stuff}
+}
+[[ -n ${SCM_REPOSITORY} ]] && scm_finalise
+
+#EXPORT_FUNCTIONS src_fetch_extra pkg_scm_revision src_unpack pkg_info
+EXPORT_FUNCTIONS src_unpack pkg_info
+
diff --git a/profiles/package.mask b/profiles/package.mask
index 626cb7d4..0e09da7a 100644
--- a/profiles/package.mask
+++ b/profiles/package.mask
@@ -24,6 +24,7 @@ media-libs/memphis
=media-libs/libgpod-9999
=net-misc/gwibber-9999
=sys-apps/gnome-disk-utility-9999
+=sys-apps/paludis-9999
=sys-apps/udisks-9999
=x11-wm/mutter-9999
diff --git a/profiles/paludis/virtuals b/profiles/paludis/virtuals
new file mode 100644
index 00000000..55f9aec0
--- /dev/null
+++ b/profiles/paludis/virtuals
@@ -0,0 +1 @@
+virtual/portage sys-apps/paludis
diff --git a/profiles/use.local.desc b/profiles/use.local.desc
index 8b540e70..64cf6208 100644
--- a/profiles/use.local.desc
+++ b/profiles/use.local.desc
@@ -11,4 +11,6 @@ gnome-base/gnome-shell:seconds - Show seconds in clock
gnome-extra/gnome-games:clutter - Enable clutter-based games
gnome-extra/gnome-utils:applet - Enable Gdict applet
net-libs/webkit-gtk:geoclue - Enable geoclue support (geolocation)
+sys-apps/paludis:ask - Enable ask option (not supported upstream)
+sys-apps/paludis:cave - Enable cave client (experimental)
sys-boot/grub:efi - Build grub for EFI
diff --git a/sys-apps/paludis/Manifest b/sys-apps/paludis/Manifest
new file mode 100644
index 00000000..14189755
--- /dev/null
+++ b/sys-apps/paludis/Manifest
@@ -0,0 +1,2 @@
+AUX paludis-ask.patch 11258 RMD160 4bee18cb4b53f2e28194532748e5eb2a37067262 SHA1 2c73b77c080a8ced927a6b7ad252d408177c6812 SHA256 f9418cdcb8c0d9a7b30a78c29b299fece4b78a103a2905633664d998619c90cd
+EBUILD paludis-9999.ebuild 4550 RMD160 375d0758d57106bf95f3bfec4df123ca01f08986 SHA1 7e5822d3e1abd4dcaf8d1339b0f4981e60d85a52 SHA256 8feb61cfbe2ead0e44ab26a3a105c646aa893f243b8b036a2d27507f1f1acf4b
diff --git a/sys-apps/paludis/files/paludis-ask.patch b/sys-apps/paludis/files/paludis-ask.patch
new file mode 100644
index 00000000..5ee555af
--- /dev/null
+++ b/sys-apps/paludis/files/paludis-ask.patch
@@ -0,0 +1,297 @@
+diff --git a/bash-completion/paludis b/bash-completion/paludis
+index 832bac7..09cc5e8 100644
+--- a/bash-completion/paludis
++++ b/bash-completion/paludis
+@@ -98,6 +98,7 @@ _paludis() {
+ --compact \
+ --no-compact"
+ install_opts="--pretend -p \
++ --ask -a \
+ --destinations -d \
+ --preserve-world -1 \
+ --add-to-world-spec \
+@@ -114,6 +115,7 @@ _paludis() {
+ --compact \
+ ${deplist_opts}"
+ uninstall_opts="--pretend -p \
++ --ask -a \
+ --destinations -d \
+ --preserve-world -1 \
+ --show-reasons \
+diff --git a/doc/faq/misfunctionality.html.part b/doc/faq/misfunctionality.html.part
+index a43287f..6416974 100644
+--- a/doc/faq/misfunctionality.html.part
++++ b/doc/faq/misfunctionality.html.part
+@@ -63,14 +63,6 @@ elegant.</p>
+ <p>Rationale: Learn how to use <code>nice</code>. There's no
+ <code>GCC_NICENESS</code> or <code>VIM_NICENESS</code> either.</p>
+
+-<h2 id="ask">No Ask Support</h2>
+-
+-<p>Non-Problem: There's nothing like <code>emerge --ask</code>.</p>
+-
+-<p>Rationale: the <code>paludis</code> client is non-interactive. If someone is
+-making an interactive client, there are much better ways of doing it than
+-the limited functionality that <code>emerge --ask</code> provides.</p>
+-
+ <h2 id="xtermtitles">Restoring XTerm Titles</h2>
+
+ <p>Non-Problem: Paludis doesn't restore the xterm title on exit.</p>
+diff --git a/paludis/args/install_args_group.cc b/paludis/args/install_args_group.cc
+index afb8533..e135c4a 100644
+--- a/paludis/args/install_args_group.cc
++++ b/paludis/args/install_args_group.cc
+@@ -33,6 +33,7 @@ InstallArgsGroup::InstallArgsGroup(ArgsSection * h, const std::string & our_name
+ ArgsGroup(h, our_name, our_description),
+
+ a_pretend(this, "pretend", 'p', "Pretend only", false),
++ a_ask(this, "ask", 'a', "Ask before executing", false),
+ a_destinations(this, "destinations", 'd', "Use specified destinations instead of defaults"),
+ a_preserve_world(this, "preserve-world", '1', "Don't modify the world file", true),
+ a_add_to_world_spec(this, "add-to-world-spec", '\0',
+@@ -121,6 +122,7 @@ InstallArgsGroup::populate_install_task(const Environment *, InstallTask & task)
+ {
+ task.set_fetch_only(a_fetch.specified());
+ task.set_pretend(a_pretend.specified());
++ task.set_ask(a_ask.specified());
+ task.set_preserve_world(a_preserve_world.specified());
+ task.set_safe_resume(! a_no_safe_resume.specified());
+
+diff --git a/paludis/args/install_args_group.hh b/paludis/args/install_args_group.hh
+index 4f392f8..9ce79ba 100644
+--- a/paludis/args/install_args_group.hh
++++ b/paludis/args/install_args_group.hh
+@@ -64,6 +64,9 @@ namespace paludis
+ /// --pretend
+ paludis::args::SwitchArg a_pretend;
+
++ /// --ask
++ paludis::args::SwitchArg a_ask;
++
+ /// --destinations
+ paludis::args::StringSetArg a_destinations;
+
+diff --git a/paludis/install_task.cc b/paludis/install_task.cc
+index 8862669..e68b299 100644
+--- a/paludis/install_task.cc
++++ b/paludis/install_task.cc
+@@ -130,6 +130,7 @@ namespace paludis
+ std::tr1::shared_ptr<const DestinationsSet> destinations;
+
+ bool pretend;
++ bool ask;
+ bool fetch_only;
+ bool preserve_world;
+ bool safe_resume;
+@@ -157,6 +158,7 @@ namespace paludis
+ targets(new SetSpecTree(make_shared_ptr(new AllDepSpec))),
+ destinations(d),
+ pretend(false),
++ ask(false),
+ fetch_only(false),
+ preserve_world(false),
+ safe_resume(false),
+@@ -799,6 +801,9 @@ InstallTask::_pretend()
+
+ on_pretend_all_post();
+
++ if (! _imp->pretend && _imp->ask && ! on_ask())
++ set_pretend(true);
++
+ if (_imp->pretend)
+ {
+ if (0 != perform_hook(Hook("install_pretend_post")
+@@ -1333,6 +1338,12 @@ InstallTask::set_pretend(const bool value)
+ }
+
+ void
++InstallTask::set_ask(const bool value)
++{
++ _imp->ask = value;
++}
++
++void
+ InstallTask::set_preserve_world(const bool value)
+ {
+ _imp->preserve_world = value;
+diff --git a/paludis/install_task.hh b/paludis/install_task.hh
+index f0d0287..68eda56 100644
+--- a/paludis/install_task.hh
++++ b/paludis/install_task.hh
+@@ -110,6 +110,7 @@ namespace paludis
+
+ void set_fetch_only(const bool value);
+ void set_pretend(const bool value);
++ void set_ask(const bool value);
+ void set_preserve_world(const bool value);
+ void set_add_to_world_spec(const std::string &);
+ void set_safe_resume(const bool);
+@@ -165,6 +166,8 @@ namespace paludis
+ virtual void on_pretend_post(const DepListEntry &) = 0;
+ virtual void on_pretend_all_post() = 0;
+
++ virtual bool on_ask() = 0;
++
+ virtual void on_fetch_all_pre() = 0;
+ virtual void on_fetch_pre(const DepListEntry &, const int x, const int y, const int s, const int f) = 0;
+ virtual void on_fetch_post(const DepListEntry &, const int x, const int y, const int s, const int f) = 0;
+diff --git a/paludis/uninstall_task.cc b/paludis/uninstall_task.cc
+index d60371e..c1bb388 100644
+--- a/paludis/uninstall_task.cc
++++ b/paludis/uninstall_task.cc
+@@ -92,6 +92,7 @@ namespace paludis
+ std::list<std::tr1::shared_ptr<const PackageDepSpec> > targets;
+
+ bool pretend;
++ bool ask;
+ bool preserve_world;
+ bool all_versions;
+ bool with_unused_dependencies;
+@@ -105,6 +106,7 @@ namespace paludis
+ Implementation<UninstallTask>(Environment * const e) :
+ env(e),
+ pretend(false),
++ ask(false),
+ preserve_world(false),
+ all_versions(false),
+ with_unused_dependencies(false),
+@@ -140,6 +142,12 @@ UninstallTask::set_pretend(const bool v)
+ }
+
+ void
++UninstallTask::set_ask(const bool v)
++{
++ _imp->ask = v;
++}
++
++void
+ UninstallTask::set_preserve_world(const bool v)
+ {
+ _imp->preserve_world = v;
+@@ -310,6 +318,9 @@ UninstallTask::execute()
+ return;
+ }
+
++ if (_imp->ask && ! on_ask())
++ return;
++
+ if (_imp->preserve_world)
+ on_preserve_world();
+ else
+diff --git a/paludis/uninstall_task.hh b/paludis/uninstall_task.hh
+index b2af2f9..6ec2576 100644
+--- a/paludis/uninstall_task.hh
++++ b/paludis/uninstall_task.hh
+@@ -112,6 +112,7 @@ namespace paludis
+ ///\{
+
+ void set_pretend(const bool value);
++ void set_ask(const bool value);
+ void set_preserve_world(const bool value);
+ void set_all_versions(const bool value);
+ void set_with_unused_dependencies(const bool value);
+@@ -138,6 +139,8 @@ namespace paludis
+ virtual void on_display_unmerge_list_post() = 0;
+ virtual void on_display_unmerge_list_entry(const UninstallListEntry &) = 0;
+
++ virtual bool on_ask() = 0;
++
+ virtual void on_uninstall_all_pre() = 0;
+ virtual void on_uninstall_pre(const UninstallListEntry &) = 0;
+ virtual void on_uninstall_post(const UninstallListEntry &) = 0;
+diff --git a/src/clients/paludis/uninstall.cc b/src/clients/paludis/uninstall.cc
+index 60f9ff3..9896af6 100644
+--- a/src/clients/paludis/uninstall.cc
++++ b/src/clients/paludis/uninstall.cc
+@@ -163,6 +163,25 @@ namespace
+ cout << endl;
+ }
+
++ virtual bool on_ask()
++ {
++ if (_count == 0)
++ return true;
++ std::string answer;
++ cout << endl << "* Do you really want to do this ? [Yes/No] ... ";
++ while (true)
++ {
++ getline(std::cin, answer);
++ for (int i(0) ; i < answer.length() ; ++i)
++ answer[i] = tolower(answer[i]);
++ if (answer == "no" || answer == "n")
++ return false;
++ else if (answer == "yes" || answer == "ye" || answer == "y" || answer == "")
++ return true;
++ cout << endl << "Unknown answer : " + answer + " [Yes/no] ... ";
++ }
++ }
++
+ virtual void on_uninstall_all_pre()
+ {
+ }
+@@ -230,6 +249,7 @@ namespace
+ OurUninstallTask task(env);
+
+ task.set_pretend(CommandLine::get_instance()->install_args.a_pretend.specified());
++ task.set_ask(CommandLine::get_instance()->install_args.a_ask.specified());
+ task.set_preserve_world(CommandLine::get_instance()->install_args.a_preserve_world.specified());
+ task.set_with_unused_dependencies(CommandLine::get_instance()->a_with_unused_dependencies.specified());
+ task.set_with_dependencies(CommandLine::get_instance()->a_with_dependencies.specified());
+diff --git a/src/output/console_install_task.cc b/src/output/console_install_task.cc
+index ce93409..e07613d 100644
+--- a/src/output/console_install_task.cc
++++ b/src/output/console_install_task.cc
+@@ -570,6 +570,28 @@ ConsoleInstallTask::on_pretend_all_post()
+ {
+ }
+
++bool
++ConsoleInstallTask::on_ask()
++{
++ if (count<max_count>() == 0)
++ return true;
++ std::string answer;
++ output_endl();
++ output_starred_item_no_endl("Do you really want to do this ? [Yes/No] ... ");
++ while (true)
++ {
++ getline(std::cin, answer);
++ for (int i(0) ; i < answer.length() ; ++i)
++ answer[i] = tolower(answer[i]);
++ if (answer == "no" || answer == "n")
++ return false;
++ else if (answer == "yes" || answer == "ye" || answer == "y" || answer == "")
++ return true;
++ output_endl();
++ output_no_endl("Unknown answer : " + answer + " [Yes/no] ... ");
++ }
++}
++
+ void
+ ConsoleInstallTask::on_fetch_all_pre()
+ {
+diff --git a/src/output/console_install_task.hh b/src/output/console_install_task.hh
+index beadfdc..9cf5dfe 100644
+--- a/src/output/console_install_task.hh
++++ b/src/output/console_install_task.hh
+@@ -143,6 +143,8 @@ namespace paludis
+ virtual void on_pretend_post(const DepListEntry &);
+ virtual void on_pretend_all_post();
+
++ virtual bool on_ask();
++
+ virtual void on_fetch_all_pre();
+ virtual void on_fetch_pre(const DepListEntry &, const int x, const int y, const int s, const int f);
+ virtual void on_fetch_post(const DepListEntry &, const int x, const int y, const int s, const int f);
+diff --git a/zsh-completion/_paludis b/zsh-completion/_paludis
+index f3fb939..8049d1f 100644
+--- a/zsh-completion/_paludis
++++ b/zsh-completion/_paludis
+@@ -19,6 +19,7 @@ _paludis() {
+
+ install_uninstall_args=(
+ "(--pretend -p)"{--pretend,-p}"[Pretend only]"
++ "(--ask -a)"{--ask,-a}"[Ask before executing]"
+ "(--destinations -d)"{--destinations,-d}"[Use specified destinations instead of defaults]:Destinations:_paludis_packages repositories"
+ "(--preserve-world -1)"{--preserve-world,-1}"[Don't modify the world file]"
+ "--add-to-world-spec[Use this atom, rather than all targets, for updating world (for resume commands)]"
diff --git a/sys-apps/paludis/paludis-9999.ebuild b/sys-apps/paludis/paludis-9999.ebuild
new file mode 100644
index 00000000..f88eb760
--- /dev/null
+++ b/sys-apps/paludis/paludis-9999.ebuild
@@ -0,0 +1,155 @@
+# Copyright 1999-2010 Ciaran McCreesh
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI="paludis-1"
+
+SCM_REPOSITORY="git://git.pioto.org/paludis.git"
+SCM_CHECKOUT_TO="${DISTDIR}/git-src/paludis"
+inherit scm-git bash-completion eutils flag-o-matic
+
+DESCRIPTION="paludis, the other package mangler"
+HOMEPAGE="http://paludis.pioto.org/"
+SRC_URI=""
+
+IUSE="ask cave cran doc gems inquisitio portage pink python-bindings ruby-bindings vim-syntax visibility xml zsh-completion"
+LICENSE="GPL-2 vim-syntax? ( vim )"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+COMMON_DEPEND="
+ >=app-admin/eselect-1.2_rc1
+ >=app-shells/bash-3.2
+ inquisitio? ( dev-libs/libpcre[cxx] )
+ ruby-bindings? ( >=dev-lang/ruby-1.8 )
+ python-bindings? ( >=dev-lang/python-2.6:= >=dev-libs/boost-1.41.0 )
+ gems? ( >=dev-libs/syck-0.55 virtual/rubygems )
+ xml? ( >=dev-libs/libxml2-2.6 )"
+
+DEPEND="${COMMON_DEPEND}
+ sys-devel/autoconf:2.5
+ sys-devel/automake:1.11
+ doc? (
+ || ( >=app-doc/doxygen-1.5.3 <=app-doc/doxygen-1.5.1 )
+ media-gfx/imagemagick
+ python-bindings? ( dev-python/epydoc dev-python/pygments )
+ ruby-bindings? ( dev-ruby/syntax dev-ruby/allison )
+ )
+ dev-util/pkgconfig"
+
+RDEPEND="${COMMON_DEPEND}
+ sys-apps/sandbox"
+
+# Keep syntax as a PDEPEND. It avoids issues when Paludis is used as the
+# default virtual/portage provider.
+PDEPEND="
+ vim-syntax? ( >=app-editors/vim-core-7 )
+ suggested:
+ dev-util/git
+ dev-util/subversion
+ dev-util/cvs
+ dev-util/darcs
+ net-misc/rsync
+ net-misc/wget"
+
+PROVIDE="virtual/portage"
+
+create-paludis-user() {
+ enewgroup "paludisbuild"
+ enewuser "paludisbuild" -1 -1 "/var/tmp/paludis" "paludisbuild"
+}
+
+pkg_setup() {
+ create-paludis-user
+ replace-flags -Os -O2
+}
+
+src_unpack() {
+ scm_src_unpack
+ cd "${S}"
+ use ask && epatch ${FILESDIR}/paludis-ask.patch
+ ./autogen.bash || die "autogen.bash failed"
+}
+
+src_compile() {
+ local repositories=`echo default unavailable unpackaged $(usev cran ) $(usev gems ) | tr -s \ ,`
+ local clients=`echo default accerso appareo adjutrix importare \
+ $(usev inquisitio ) instruo paludis reconcilio $(usev cave) | tr -s \ ,`
+ local environments=`echo default $(usev portage ) | tr -s \ ,`
+ econf \
+ $(use_enable doc doxygen ) \
+ $(use_enable pink ) \
+ $(use_enable ruby-bindings ruby ) \
+ $(useq ruby-bindings && useq doc && echo --enable-ruby-doc ) \
+ $(use_enable python-bindings python ) \
+ $(useq python-bindings && useq doc && echo --enable-python-doc ) \
+ $(use_enable vim-syntax vim ) \
+ $(use_enable visibility ) \
+ $(use_enable xml ) \
+ --with-vim-install-dir=/usr/share/vim/vimfiles \
+ --with-repositories=${repositories} \
+ --with-clients=${clients} \
+ --with-environments=${environments} \
+ --with-git-head="$(git rev-parse HEAD)" \
+ || die "econf failed"
+
+ emake || die "emake failed"
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die "install failed"
+ dodoc AUTHORS README NEWS
+
+ BASH_COMPLETION_NAME="adjutrix" dobashcompletion bash-completion/adjutrix
+ BASH_COMPLETION_NAME="paludis" dobashcompletion bash-completion/paludis
+ BASH_COMPLETION_NAME="accerso" dobashcompletion bash-completion/accerso
+ BASH_COMPLETION_NAME="importare" dobashcompletion bash-completion/importare
+ BASH_COMPLETION_NAME="instruo" dobashcompletion bash-completion/instruo
+ BASH_COMPLETION_NAME="reconcilio" dobashcompletion bash-completion/reconcilio
+ use inquisitio && \
+ BASH_COMPLETION_NAME="inquisitio" \
+ dobashcompletion bash-completion/inquisitio
+ use cave && \
+ BASH_COMPLETION_NAME="cave" \
+ dobashcompletion bash-completion/cave
+
+ if use zsh-completion ; then
+ insinto /usr/share/zsh/site-functions
+ doins zsh-completion/_paludis
+ doins zsh-completion/_adjutrix
+ doins zsh-completion/_cave
+ doins zsh-completion/_importare
+ doins zsh-completion/_reconcilio
+ use inquisitio && doins zsh-completion/_inquisitio
+ doins zsh-completion/_paludis_packages
+ use cave && doins zsh-completion/_cave
+ fi
+}
+
+src_test() {
+ # Work around Portage bugs
+ export PALUDIS_DO_NOTHING_SANDBOXY="portage sucks"
+ export BASH_ENV=/dev/null
+
+ if [[ `id -u` == 0 ]] ; then
+ # hate
+ export PALUDIS_REDUCED_UID=0
+ export PALUDIS_REDUCED_GID=0
+ fi
+
+ if ! emake check ; then
+ eerror "Tests failed. Looking for files for you to add to your bug report..."
+ find "${S}" -type f -name '*.epicfail' -or -name '*.log' | while read a ; do
+ eerror " $a"
+ done
+ die "Make check failed"
+ fi
+}
+
+pkg_postinst() {
+ # Remove the symlink created by app-admin/eselect-news
+ if [[ -L "${ROOT}/var/lib/paludis/news" ]] ; then
+ rm "${ROOT}/var/lib/paludis/news"
+ fi
+}
+