diff options
author | John Mylchreest <johnm@gentoo.org> | 2005-06-30 20:27:31 +0000 |
---|---|---|
committer | John Mylchreest <johnm@gentoo.org> | 2005-06-30 20:27:31 +0000 |
commit | bffa724ff6bdc079be1958315ba91cc06eff5c9b (patch) | |
tree | 4955487ad7dab88d211fbf49a639a12ae7c37bf1 /sys-kernel/module-rebuild | |
parent | bump (diff) | |
download | gentoo-2-bffa724ff6bdc079be1958315ba91cc06eff5c9b.tar.gz gentoo-2-bffa724ff6bdc079be1958315ba91cc06eff5c9b.tar.bz2 gentoo-2-bffa724ff6bdc079be1958315ba91cc06eff5c9b.zip |
adding support for -X (package-names) for brix. Adding support for -C (no colour).
(Portage version: 2.0.51.22-r1)
Diffstat (limited to 'sys-kernel/module-rebuild')
-rw-r--r-- | sys-kernel/module-rebuild/ChangeLog | 10 | ||||
-rw-r--r-- | sys-kernel/module-rebuild/files/digest-module-rebuild-0.4 (renamed from sys-kernel/module-rebuild/files/digest-module-rebuild-0.3) | 0 | ||||
-rw-r--r--[-rwxr-xr-x] | sys-kernel/module-rebuild/files/module-rebuild-0.4 (renamed from sys-kernel/module-rebuild/files/module-rebuild-0.3) | 65 | ||||
-rw-r--r-- | sys-kernel/module-rebuild/module-rebuild-0.4.ebuild (renamed from sys-kernel/module-rebuild/module-rebuild-0.3.ebuild) | 2 |
4 files changed, 60 insertions, 17 deletions
diff --git a/sys-kernel/module-rebuild/ChangeLog b/sys-kernel/module-rebuild/ChangeLog index b4acaf5a9548..2cf527a4ff0b 100644 --- a/sys-kernel/module-rebuild/ChangeLog +++ b/sys-kernel/module-rebuild/ChangeLog @@ -1,6 +1,14 @@ # ChangeLog for sys-kernel/module-rebuild # Copyright 1999-2005 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-kernel/module-rebuild/ChangeLog,v 1.4 2005/06/30 17:27:02 johnm Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-kernel/module-rebuild/ChangeLog,v 1.5 2005/06/30 20:27:31 johnm Exp $ + +*module-rebuild-0.4 (30 Jun 2005) + + 30 Jun 2005; John Mylchreest <johnm@gentoo.org> -files/module-rebuild-0.3, + +files/module-rebuild-0.4, -module-rebuild-0.3.ebuild, + +module-rebuild-0.4.ebuild: + adding support for -X (package-names) for brix. Adding support for -C (no + colour). *module-rebuild-0.3 (30 Jun 2005) diff --git a/sys-kernel/module-rebuild/files/digest-module-rebuild-0.3 b/sys-kernel/module-rebuild/files/digest-module-rebuild-0.4 index e69de29bb2d1..e69de29bb2d1 100644 --- a/sys-kernel/module-rebuild/files/digest-module-rebuild-0.3 +++ b/sys-kernel/module-rebuild/files/digest-module-rebuild-0.4 diff --git a/sys-kernel/module-rebuild/files/module-rebuild-0.3 b/sys-kernel/module-rebuild/files/module-rebuild-0.4 index d70d29966e1c..3977adf69188 100755..100644 --- a/sys-kernel/module-rebuild/files/module-rebuild-0.3 +++ b/sys-kernel/module-rebuild/files/module-rebuild-0.4 @@ -12,7 +12,7 @@ if [[ `id -u` != 0 ]]; then exit 1 fi -R_VERSION="0.3" +R_VERSION="0.4" R_MODULES="${ROOT}/usr/share/module-rebuild/moduledb" R_PORTAGEQ="`which portageq 2>/dev/null`" if [[ -z ${R_PORTAGEQ} ]]; then @@ -21,12 +21,8 @@ if [[ -z ${R_PORTAGEQ} ]]; then fi R_PORTDIR=`${R_PORTAGEQ} portdir` R_VDBPATH=`${R_PORTAGEQ} vdb_path` - - -C_BOLD='\e[1m' -C_NORM='\e[0m' -C_GREEN='\e[32m' -C_RED='\e[31m' +R_OPTION_X=0; +R_OPTION_C=0; package_valid() { local package=${1} @@ -118,7 +114,13 @@ db_module_list() { auto=${pkg/:*} pkg=${pkg/*:} - package_valid_strict ${pkg} && pkg="=${pkg}" + if [[ ${R_OPTION_X} == 1 ]]; then + pkg=${pkg%-[0-9]*} + package_valid ${pkg} + else + package_valid_strict ${pkg} && pkg="=${pkg}" + fi + if [[ ${auto} = 1 ]]; then tomerge[${a}]=${pkg} a=$((${a} + 1)) @@ -201,9 +203,14 @@ db_module_merge() { phelp() { cat << EOF -module-rebuild action [category/package] +module-rebuild [options] action [category/package] Version: ${R_VERSION} +Where options are: + -X - Emerge based on package names, + not exact versions. + -C - Disable all coloured output. + Where action is one of: add - Add package to moduledb. del - Delete a package from moduledb. @@ -236,13 +243,41 @@ check_validity() { fi } -method="${1}" -case ${method} in - add) check_validity ${2} 1; db_module_add ${2};; - del) check_validity ${2}; db_module_del ${2};; - toggle) check_validity ${2}; db_module_toggle ${2};; +while getopts "XC" options; do + case ${options} in + X) R_OPTION_X='1';; + C) R_OPTION_C='1';; + *) phelp; exit 1;; + esac +done + +if [[ ${R_OPTION_C} == 0 ]]; then + C_BOLD='\e[1m' + C_NORM='\e[0m' + C_GREEN='\e[32m' + C_RED='\e[31m' +else + C_BOLD='' + C_NORM='' + C_GREEN='' + C_RED='' +fi + +x=0 +for i in ${@:${OPTIND}}; do + if [[ ${i:0:1} != - ]]; then + R_PARAMS[${x}]=${i} + x=$((${x} + 1)) + fi +done +unset i x + +case ${R_PARAMS[0]} in + add) check_validity ${R_PARAMS[1]} 1; db_module_add ${R_PARAMS[1]};; + del) check_validity ${R_PARAMS[1]}; db_module_del ${R_PARAMS[1]};; + toggle) check_validity ${R_PARAMS[1]}; db_module_toggle ${R_PARAMS[1]};; list) db_module_list;; rebuild) db_module_merge;; populate) db_module_populate;; - *) phelp;; + *) phelp; exit 1;; esac diff --git a/sys-kernel/module-rebuild/module-rebuild-0.3.ebuild b/sys-kernel/module-rebuild/module-rebuild-0.4.ebuild index c0d0d56c39c4..c1ab6aa493f3 100644 --- a/sys-kernel/module-rebuild/module-rebuild-0.3.ebuild +++ b/sys-kernel/module-rebuild/module-rebuild-0.4.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-kernel/module-rebuild/module-rebuild-0.3.ebuild,v 1.1 2005/06/30 17:27:02 johnm Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-kernel/module-rebuild/module-rebuild-0.4.ebuild,v 1.1 2005/06/30 20:27:31 johnm Exp $ DESCRIPTION="A utility to rebuild any kernel modules which you have installed." HOMEPAGE="http://www.gentoo.org/" |