summaryrefslogtreecommitdiffstats
path: root/sbin/keyword_package
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander@sulfrian.net>2009-01-08 11:37:23 +0100
committerAlexander Sulfrian <alexander@sulfrian.net>2009-01-08 11:37:23 +0100
commitb5593ec19bf693c55e35f88bbce7b45a1381d986 (patch)
tree35e067becdedc71a10b70656bc6c9dac3f2d20e6 /sbin/keyword_package
downloadhelper-scripts-b5593ec19bf693c55e35f88bbce7b45a1381d986.tar.gz
helper-scripts-b5593ec19bf693c55e35f88bbce7b45a1381d986.tar.xz
helper-scripts-b5593ec19bf693c55e35f88bbce7b45a1381d986.zip
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
Diffstat (limited to 'sbin/keyword_package')
-rwxr-xr-xsbin/keyword_package26
1 files changed, 26 insertions, 0 deletions
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