From b5593ec19bf693c55e35f88bbce7b45a1381d986 Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Thu, 8 Jan 2009 11:37:23 +0100 Subject: added some usefull scripts bin/Xshutdown.sh - graphical script for shutdown/reboot/standby sbin/set_governor - set the governor of both cpus sbin/keyword_package - adds a package to /etc/portage/packages.keywords sbin/asound_backup.sh - creates a backup of /etc/asound.conf sbin/asound_pulse_disable.sh - removes the default references to pulse sbin/asound_pulse_enable.sh - adds pcm.!default und ctl.!default references to pulse --- sbin/keyword_package | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 sbin/keyword_package (limited to 'sbin/keyword_package') diff --git a/sbin/keyword_package b/sbin/keyword_package new file mode 100755 index 0000000..93b93d9 --- /dev/null +++ b/sbin/keyword_package @@ -0,0 +1,26 @@ +#!/bin/sh +SPECIAL_LINE_COUNT=$(grep -nE "(/\*)|(\*/)" /etc/portage/package.keywords | tail -n 1 | awk -F: '{ print $1 }') +TMP_FILE=$(mktemp) + +head -n $SPECIAL_LINE_COUNT /etc/portage/package.keywords > $TMP_FILE + +( + while [ -n "${1}" ] ; do + LINE="${1} ~x86" + if [ -z "$(grep "^${LINE}$" /etc/portage/package.keywords)" ] + then + echo "${LINE}" + echo "adding \"${LINE}\" to /etc/portage/package.keywords" | logger -st $(basename $0) + else + echo "Don't adding \"${1}\". Already there." > /dev/stderr + fi + + shift 1 + done + + tail -n $(($(cat /etc/portage/package.keywords | wc -l)-$SPECIAL_LINE_COUNT)) /etc/portage/package.keywords +) | grep -v "^$" | sort | awk -F/ '{ if (OLD_PREFIX!=$1) print ""; OLD_PREFIX=$1 ; print }' >> $TMP_FILE + +mv /etc/portage/package.keywords /etc/portage/package.keywords.bak +mv $TMP_FILE /etc/portage/package.keywords +chmod +r /etc/portage/package.keywords -- cgit v1.2.3