Ticket #108 (closed enhancement: wontfix)

Opened 11 years ago

Last modified 9 years ago

Make an INSTALL_MASK hook

Reported by: pioto Owned by: pioto
Priority: Sometime Milestone:
Component: clients/paludis Version: 0.18.1
Keywords: Cc:
Blocked By: Blocking:
Distribution: Gentoo

Description (last modified by pioto) (diff)

A simple and not-complete version:

for m in ${INSTALL_MASK} ; do
  rm -f "${IMAGE}"/${m}
done

That works for things like INSTALL_MASK="/usr/share/vim/vim{70,files}/doc/*", but not for things like INSTALL_MASK="README.gz"...

Change History

comment:1 Changed 11 years ago by ciaranm

This is probably better done as a new style merger hook.

comment:2 Changed 10 years ago by pioto

Maybe use merger skip hooks, once peper finishes them.

comment:3 follow-up: ↓ 4 Changed 10 years ago by insecure

I use this one here. Are there any other ways to do this? I haven't done that much with hooks.

#!/bin/bash
# emulate portages INSTALL_MASK
# needs INSTALL_MASK="FOOBAR" entry in /etc/paludis/bashrc
# Link in merger_install_pre

# NOTE: this script uses grep regex, so TODO* matches {TOD,TODO,TODOO,TODOOO,...}
# but not TODO.bz2 or such

eval $(grep INSTALL_MASK /etc/paludis/bashrc)
pushd $INSTALL_SOURCE >/dev/null
#turn off globbing to prevent bash from eating wildcards
set -f

for i in $INSTALL_MASK;do
  find |grep --color=never $i|xargs -r rm -rf
done

set +f
popd >/dev/null

comment:4 in reply to: ↑ 3 Changed 9 years ago by pioto

  • Description modified (diff)

Replying to insecure:

I use this one here. Are there any other ways to do this? I haven't done that much with hooks.

Just a quick comment from taking a glance at this: you shouldn't have to grep for INSTALL_MASK from paludis' bashrc; it should already be set in the hook environment.

comment:5 Changed 9 years ago by pioto

  • Status changed from new to closed
  • Distribution set to Gentoo
  • Resolution set to wontfix

I've decided this is of negligible usefulness, and I won't bother doing it. If anyone writes such a hook, feel free to reopen this and I'll add it to the demo hooks, though.

Note: See TracTickets for help on using tickets.