diff options
author | Heinrich Wendel <lanius@gentoo.org> | 2005-02-14 20:13:34 +0000 |
---|---|---|
committer | Heinrich Wendel <lanius@gentoo.org> | 2005-02-14 20:13:34 +0000 |
commit | 250b8982d25615d66db05c10cde63bc9caeb7d27 (patch) | |
tree | 2427b77f25c706ab145ec11af551c77c5d312bad /x11-libs | |
parent | buffer overflows in fliccd of kstars, #79585 (diff) | |
download | historical-250b8982d25615d66db05c10cde63bc9caeb7d27.tar.gz historical-250b8982d25615d66db05c10cde63bc9caeb7d27.tar.bz2 historical-250b8982d25615d66db05c10cde63bc9caeb7d27.zip |
update
Package-Manager: portage-2.0.51-r15
Diffstat (limited to 'x11-libs')
-rw-r--r-- | x11-libs/motif-config/Manifest | 2 | ||||
-rwxr-xr-x | x11-libs/motif-config/files/motif-config-0.1 | 85 |
2 files changed, 72 insertions, 15 deletions
diff --git a/x11-libs/motif-config/Manifest b/x11-libs/motif-config/Manifest index a28287227ab4..42dcd970c47b 100644 --- a/x11-libs/motif-config/Manifest +++ b/x11-libs/motif-config/Manifest @@ -1,5 +1,5 @@ MD5 8e8719acd2a777294914e060d4f86976 motif-config-0.1.ebuild 1006 MD5 7d70d9fe42eb317221f10ba1d8a9a06e ChangeLog 386 MD5 503ccb1138f9c49f0855884d830988a6 metadata.xml 253 -MD5 ed9621216780b495b5647df84c76430d files/motif-config-0.1 1949 +MD5 e8fa0a0c0613fd48f095245563062b1b files/motif-config-0.1 3051 MD5 d41d8cd98f00b204e9800998ecf8427e files/digest-motif-config-0.1 0 diff --git a/x11-libs/motif-config/files/motif-config-0.1 b/x11-libs/motif-config/files/motif-config-0.1 index 79ee65a4fae3..fc2b4e553203 100755 --- a/x11-libs/motif-config/files/motif-config-0.1 +++ b/x11-libs/motif-config/files/motif-config-0.1 @@ -15,7 +15,7 @@ CONFIG_FILE=${PROFILE_PATH}/current usage() { cat << "USAGE_END" -Usage: motif-config [options] [Profile] +Usage: motif-config [option] [profile] Change the current motif profile, or give info about profiles. Options: @@ -38,24 +38,36 @@ Options: --install Install the given profile. - --uninstall Uninstall the given profile. + --uninstall Uninstall the given profile. USAGE_END exit $1 } [[ $# -lt 1 ]] && usage 1 +[[ $# -gt 2 ]] && usage 1 - -get_current_profile() { +switch_profile() { exit 0 } -switch_profile() { - exit 0 +get_current_profile() { + cat ${CONFIG_FILE} 2> /dev/null } list_profiles() { - exit 0 + i=1 + for x in `ls ${PROFILE_PATH}`; do + current=`ls -l --full-time ${CONFIG_FILE} 2> /dev/null | awk '{ print $11 }' | sed -e "s:${PROFILE_PATH}/::"` + if [ "${x}" != "current" ]; then + output=`cat ${PROFILE_PATH}/${x}`; + output="[${i}] $output"; + if [ "${x}" = "${current}" ]; then + output="${output} *" + fi + echo "$output" + i=$((i + 1)) + fi + done } get_lib_path() { @@ -66,9 +78,50 @@ get_inc_path() { exit 0 } +get_cflags() { + exit 0 +} + +get_ldflags() { + exit 0 +} + +install_profile() { + if [[ "$(id -u)" -ne 0 ]] ; then + eerror "$0: Must be root." + exit 1 + fi + + # create profile + echo ${1} > ${PROFILE_PATH}/${1} + + # make it default if no profile is activated + switch_profile +} + +uninstall_profile() { + if [[ "$(id -u)" -ne 0 ]] ; then + eerror "$0: Must be root." + exit 1 + fi + + # remove profile + rm -f ${PROFILE_PATH}/${1} 2> /dev/null + + # activate next profile if non is activated + switch_profile +} + for x in "$@"; do case "${x}" in + -c|--get-current-profile) + [[ $# -ne 1 ]] && usage 1 + get_current_profile + ;; + -l|--list-profiles) + [[ $# -ne 1 ]] && usage 1 + list_profiles ;; -L|--get-lib-path) @@ -78,16 +131,20 @@ for x in "$@"; do ;; --clfags) - ;; + ;; - --ldflags) - ;; + --ldflags) + ;; --install) - ;; + [[ $# -ne 2 ]] && usage 1 + install_profile $2 + ;; - --uninstall) - ;; + --uninstall) + [[ $# -ne 2 ]] && usage 1 + uninstall_profile $2 + ;; -h|--help) usage 0 @@ -95,7 +152,7 @@ for x in "$@"; do ;; -v|--version) - echo "motif-config-1.0" + echo "motif-config-0.1" exit 0 ;; |