#!/bin/bash # # gentoo package unmask script by tilya starwing # version 0.1 # # last update: 3rd August 2006 # message of the day: # vysaj voko vysavacem vole! # # arguments # -k keyword # -h hardmasked # -p package to unmask # default output file writeto="/etc/portage/package.keywords" # if keyword not supplied by user, use default key="~x86" # parse the argumets while getopts p:hk: arg do case $arg in p) file=$(find /usr/portage/ -name "$OPTARG" -type d | cut -d / -f 4,5 );; h) writeto="/etc/portage/package.unmask"; key="";; k) key=$OPTARG;; *) echo "no arguments supplied";; esac done echo "$file $key" >> $writeto echo "$file $key added to $writeto" shift $(($OPTIND - 1))