aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-08-14 10:08:23 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-08-14 10:08:23 +0100
commit2bc2334aeb4f72942943512ba7d0e505242f4f65 (patch)
tree4bb7f9e761090be5ca74ac57f9ded938950e379d
parent0ff85e817a6d54828a24cd74718db6c5dceeeeaf (diff)
downloadpaludis-2bc2334aeb4f72942943512ba7d0e505242f4f65.tar.gz
paludis-2bc2334aeb4f72942943512ba7d0e505242f4f65.tar.xz
None of the demos are very useful
-rw-r--r--.gitignore4
-rw-r--r--configure.ac1
-rw-r--r--doc/configuration/hooks.html.part9
-rw-r--r--hooks/Makefile.am.m42
-rw-r--r--hooks/demos/Makefile.am37
-rw-r--r--hooks/demos/elog.bash.in120
-rw-r--r--hooks/demos/new_packages.bash.in45
-rwxr-xr-xhooks/demos/pretend_resume.hook.in45
-rwxr-xr-xhooks/demos/report.bash.in14
9 files changed, 2 insertions, 275 deletions
diff --git a/.gitignore b/.gitignore
index 35841b1..efbf438 100644
--- a/.gitignore
+++ b/.gitignore
@@ -221,10 +221,6 @@ paludis-*.*.*.tar.bz2
/doc/toplinks.html.part
/done-check
/hooks/Makefile.am
-/hooks/demos/elog.bash
-/hooks/demos/new_packages.bash
-/hooks/demos/pretend_resume.hook
-/hooks/demos/report.bash
/hooks/eselect_env_update.bash
/hooks/news.hook
/image
diff --git a/configure.ac b/configure.ac
index fac7862..d6b4ff0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1638,7 +1638,6 @@ AC_OUTPUT(
hooks/Makefile
hooks/eselect_env_update.bash
hooks/news.hook
- hooks/demos/Makefile
misc/Makefile
paludis/Makefile
paludis/about.hh
diff --git a/doc/configuration/hooks.html.part b/doc/configuration/hooks.html.part
index 1a78232..cb60d15 100644
--- a/doc/configuration/hooks.html.part
+++ b/doc/configuration/hooks.html.part
@@ -411,7 +411,7 @@ def hook_run_install_all_post(env, hook_env):
print "* Checking for monkeys..."
- if list(env.package_database.query(Query.Package("nice/monkey"), QueryOrder.WHATEVER)):
+ if list(env[Selection.SomeArbitraryVersion(Generator.Package("nice/monkey"))]):
print "Found a monkey!"
else:
print "No monkeys found"
@@ -472,13 +472,6 @@ used if the <code>Hook</code>'s <code>output_dest</code> member is <code>hod_gra
<code><em>LIBEXECDIR</em>/hooks/<em>hookname</em></code>. These directories are
not for end user use.</p>
-<h2>Example Hooks</h2>
-
-<p>Paludis ships certain example hooks that many users would find useful, but that
-are not suitably general to be enabled by default -- these live in
-<code>DATADIR/paludis/hooks/demos/</code>. You may also find the default
-hooks useful -- these live in various places in <code>LIBEXECDIR/paludis/hooks/</code>.</p>
-
<h2>The <code>PALUDIS_CMDLINE</code> Variables</h2>
<p>Sometimes hooks need access to the commandline used to invoke
diff --git a/hooks/Makefile.am.m4 b/hooks/Makefile.am.m4
index 4868e42..31164ff 100644
--- a/hooks/Makefile.am.m4
+++ b/hooks/Makefile.am.m4
@@ -7,7 +7,7 @@ include $(top_srcdir)/misc/common-makefile.am
CLEANFILES += .keep
MAINTAINERCLEANFILES += Makefile.am
-SUBDIRS = . demos
+SUBDIRS = .
installvarlibpaludisnewsdir = $(localstatedir)/gentoo/news
diff --git a/hooks/demos/Makefile.am b/hooks/demos/Makefile.am
deleted file mode 100644
index 9429905..0000000
--- a/hooks/demos/Makefile.am
+++ /dev/null
@@ -1,37 +0,0 @@
-SUBDIRS = .
-
-DEMOS = \
- report.bash \
- elog.bash \
- new_packages.bash \
- pretend_resume.hook
-
-AUTOMAKE_OPTIONS = 1.11 parallel-tests
-
-EXTRA_DIST = \
- report.bash.in \
- elog.bash.in \
- new_packages.bash.in \
- pretend_resume.hook.in
-
-MAINTAINERCLEANFILES = Makefile.in
-CLEANFILES = *~ gmon.out *.gcov *.gcno *.gcda *.loT *.o *.so $(DEMOS) *.epicfail
-
-hooksdemosdir = $(datadir)/paludis/hooks/demos/
-hooksdemos_SCRIPTS = $(DEMOS)
-
-new_packages.bash : $(srcdir)/new_packages.bash.in
- sed -e "s,@DATADIR@,$(datadir),g" < $(srcdir)/new_packages.bash.in > new_packages.bash
-
-report.bash : $(srcdir)/report.bash.in
- sed -e "s,@DATADIR@,$(datadir),g" < $(srcdir)/report.bash.in > report.bash
-
-elog.bash : $(srcdir)/elog.bash.in
- sed -e "s,@DATADIR@,$(datadir),g" < $(srcdir)/elog.bash.in > elog.bash
-
-pretend_resume.hook : $(srcdir)/pretend_resume.hook.in
- sed -e "s,@DATADIR@,$(datadir),g" < $(srcdir)/pretend_resume.hook.in > pretend_resume.hook
-
-built-sources : $(BUILT_SOURCES)
- for s in `echo $(SUBDIRS) | tr -d .` ; do $(MAKE) -C $$s built-sources || exit 1 ; done
-
diff --git a/hooks/demos/elog.bash.in b/hooks/demos/elog.bash.in
deleted file mode 100644
index 3819d78..0000000
--- a/hooks/demos/elog.bash.in
+++ /dev/null
@@ -1,120 +0,0 @@
-#!/usr/bin/env bash
-# vim: set et sw=4 sts=4 :
-
-# This hook makes Paludis store messages generated by an ebuild in a file.
-# These stored messages are then displayed to the user after a merge. To enable
-# this functionality, this script should be copied or symlinked into:
-#
-# @DATADIR@/paludis/hooks/elog/
-# @DATADIR@/paludis/hooks/install_task_execute_pre/
-# @DATADIR@/paludis/hooks/install_task_execute_post/
-# @DATADIR@/paludis/hooks/uninstall_all_pre/
-# @DATADIR@/paludis/hooks/uninstall_all_post/
-# @DATADIR@/paludis/hooks/uninstall_fail/
-#
-# And optionally:
-#
-# @DATADIR@/paludis/hooks/einfo/
-# @DATADIR@/paludis/hooks/ewarn/
-# @DATADIR@/paludis/hooks/eerror/
-#
-# You should ensure that it has execute permissions.
-
-case "${EBUILD_PHASE}" in
- config|pretend|metadata) return
-esac
-
-source ${PALUDIS_ECHO_FUNCTIONS_DIR:-${PALUDIS_EBUILD_DIR}}/echo_functions.bash
-
-logfile="${PALUDIS_HOOKS_TMPDIR:-${ROOT}/var/tmp/paludis}/elog.${PALUDIS_PID}"
-
-case "${HOOK}" in
- elog)
- echo "L ${CATEGORY}/${!PALUDIS_NAME_VERSION_REVISION_VAR} ${MESSAGE}" >> "${logfile}"
- ;;
-
- einfo)
- echo "I ${CATEGORY}/${!PALUDIS_NAME_VERSION_REVISION_VAR} ${MESSAGE}" >> "${logfile}"
- ;;
-
- ewarn)
- echo "W ${CATEGORY}/${!PALUDIS_NAME_VERSION_REVISION_VAR} ${MESSAGE}" >> "${logfile}"
- ;;
-
- eerror)
- echo "E ${CATEGORY}/${!PALUDIS_NAME_VERSION_REVISION_VAR} ${MESSAGE}" >> "${logfile}"
- ;;
-
- install_task_execute_pre|install_all_pre|uninstall_all_pre)
- if [[ ${HOOK} = install_all_pre ]]; then
- paludis_ecmd \
- "ewarn" \
- "" \
- "`echo -ne " ${COLOUR_WARN}*${COLOUR_NORMAL} "`" \
- "Use of elog.bash in phase \"${HOOK}\" is deprecated, see comments at beginning of file for updated instructions"
- fi
-
- ${PRETEND} && exit 0
-
- rm -f "${logfile}"
- touch "${logfile}" || die "Couldn't create '${logfile}' for elog hooks"
- if [[ -n "${PALUDIS_REDUCED_GID}" ]] ; then
- chgrp "${PALUDIS_REDUCED_GID}" "${logfile}" || die "Couldn't chgrp '${logfile}' for elog hooks"
- chmod g+rw "${logfile}" || die "Couldn't chmod '${logfile}' for elog hooks"
- fi
- ;;
-
- install_all_post|uninstall_all_post|install_fail|uninstall_fail|clean_fail|install_task_execute_post)
- if [[ ${HOOK} = install_all_post || ${HOOK} = install_fail || ${HOOK} = clean_fail ]]; then
- paludis_ecmd \
- "ewarn" \
- "" \
- "`echo -ne " ${COLOUR_WARN}*${COLOUR_NORMAL} "`" \
- "Use of elog.bash in phase \"${HOOK}\" is deprecated, see comments at beginning of file for updated instructions"
- fi
-
- ${PRETEND} && exit 0
-
- echo
- old_pf=""
- while read line ; do
- line_status=$(echo "${line}" | cut -d' ' -f1 )
- line_pf=$(echo "${line}" | cut -d' ' -f2 )
- line_message=$(echo "${line}" | cut -d' ' -f3- )
-
- if [[ "${old_pf}" != "${line_pf}" ]] ; then
- echo
- echo "${COLOUR_GOOD}Summary of messages from ${line_pf}:${COLOUR_NORMAL}"
- echo
- old_pf="${line_pf}"
- fi
-
- case "${line_status}" in
- L|I)
- echo -ne " ${COLOUR_GOOD}*${COLOUR_NORMAL} "
- ;;
-
- W)
- echo -ne " ${COLOUR_WARN}*${COLOUR_NORMAL} "
- ;;
-
- E)
- echo -ne " ${COLOUR_BAD}*${COLOUR_NORMAL} "
- ;;
- esac
- echo "${line_message}"
-
- done <"${logfile}"
-
- rm -f "${logfile}"
- ;;
-
- *)
- paludis_ecmd \
- "ewarn" \
- "" \
- "`echo -ne " ${COLOUR_WARN}*${COLOUR_NORMAL} "`" \
- "elog.bash doesn't know what to do for HOOK=\"${HOOK}\""
- ;;
-esac
-
diff --git a/hooks/demos/new_packages.bash.in b/hooks/demos/new_packages.bash.in
deleted file mode 100644
index 45d64f9..0000000
--- a/hooks/demos/new_packages.bash.in
+++ /dev/null
@@ -1,45 +0,0 @@
-#!/usr/bin/env bash
-# vim: set et sw=4 sts=4 :
-
-# This hook makes Paludis display a summary of new packages available after
-# a sync. To enable this functionality, this script should be copied or
-# symlinked into:
-#
-# @DATADIR@/paludis/hooks/sync_all_pre/
-# @DATADIR@/paludis/hooks/sync_all_post/
-#
-# You should ensure that it has execute permissions.
-
-source ${PALUDIS_ECHO_FUNCTIONS_DIR:-${PALUDIS_EBUILD_DIR}}/echo_functions.bash
-
-syncfile="${PALUDIS_HOOKS_TMPDIR:-${ROOT}/var/tmp/paludis}/sync.${PALUDIS_PID}"
-
-case "${HOOK}" in
- sync_all_pre)
- einfo "Building available packages list"
- ${PALUDIS_COMMAND} --list-packages | grep '^\*' | cut -d' ' -f2 \
- | sort -u >"${syncfile}"
- ;;
-
- sync_all_post)
- echo
- einfo "Newly available packages:"
- ${PALUDIS_COMMAND} --list-packages | grep '^\*' | cut -d' ' -f2 \
- | sort -u >"${syncfile}".new
-
- diff "${syncfile}" "${syncfile}.new" | grep '^>' | cut -d' ' -f2- \
- | while read line ; do
- einfo " ${line}:"
- einfo " $(${PALUDIS_COMMAND} -qM ${line} | sed -n -e 's/^ *DESCRIPTION: *//p' )"
- einfo " $(${PALUDIS_COMMAND} -qM ${line} | sed -n -e 's/^ *HOMEPAGE: *//p' )"
- done
- rm -f "${syncfile}" "${syncfile}".new
- echo
- ;;
-
- *)
- ewarn "new_packages.bash doesn't know what to do for HOOK=\"${HOOK}\""
- ;;
-esac
-
-
diff --git a/hooks/demos/pretend_resume.hook.in b/hooks/demos/pretend_resume.hook.in
deleted file mode 100755
index 5016959..0000000
--- a/hooks/demos/pretend_resume.hook.in
+++ /dev/null
@@ -1,45 +0,0 @@
-#!/usr/bin/env bash
-# vim: set et sw=4 sts=4 :
-
-# This hook makes Paludis display the resume command at the end of the
-# --install --pretend output, so the installation can be carried out
-# without recalculating dependencies, rescanning libraries, etc. To
-# enable this functionality, this script should be copied or symlinked
-# into:
-#
-# @DATADIR@/paludis/hooks/auto/
-#
-# You should ensure that it has execute permissions.
-
-hook_run_install_pretend_post() {
- [[ -n ${RESUME_COMMAND} ]] || exit 0
- ${DEPLIST_HAS_ERRORS} && exit 0
- echo
-
- local template_var=$(tr '[[:lower:]]' '[[:upper:]]' <<<"${PALUDIS_CLIENT}")_CMDLINE_resume_command_template
- local template=${!template_var}
- local file
-
- if [[ -n ${template} ]]; then
- if [[ ${template} = *XXXXXX* ]]; then
- file="$(mktemp "${template}")"
- else
- file=${template}
- fi
-
- if touch "${file}" && chmod 644 "${file}" && echo "${RESUME_COMMAND}" >"${file}"; then
- echo "Resume command saved to file: ${file}"
- else
- echo "Resume command NOT saved to file: ${file}"
- echo "Resume command: ${RESUME_COMMAND}"
- fi
-
- else
- echo "Resume command: ${RESUME_COMMAND}"
- fi
-}
-
-hook_auto_names() {
- echo install_pretend_post
-}
-
diff --git a/hooks/demos/report.bash.in b/hooks/demos/report.bash.in
deleted file mode 100755
index 23a6398..0000000
--- a/hooks/demos/report.bash.in
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/usr/bin/env bash
-# vim: set et sw=4 sts=4 :
-
-# This hook makes Paludis display a report about vulnerable, masked and unused
-# packages. If this functionality is desired, this script should be copied or
-# symlinked into:
-#
-# @DATADIR@/paludis/hooks/sync_all_post/
-#
-# You should ensure that it has execute permissions.
-
-${PALUDIS_COMMAND} --report
-echo
-