/
githubmirror
/
cmssw
Обзор
Документация
Войти
/
githubmirror
/
cmssw
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
Utilities/ReleaseScripts/scripts/cmsglimpse
71 строка
2 KB
Shahzad Malik Muzaffar
use release/glimpse is exists otherwise fallback to release/src/glimps
03 фев 2015, 18:27
03 фев 2015, 18:27
7561486
Код
Авторство
О чём код?
#!/bin/bash CURRENT_SCRAM_PROJECT=$(echo $SCRAMRT_SET | cut -d: -f2) CURRENT_SRC_AREA=$(echo $CMSSW_RELEASE_BASE) args= action= while [ $# -gt 0 ] do case $1 in --full ) action=full; shift;; --help ) echo "cmsglimpse [-H <CMSSW_TAG>] [--full] [--help] [glimpse-options] <search term>" echo "" echo " -H <CMSSW_TAG> - specify the CMSSW tag for the release you " echo " would like to search (e.g. 'CMSSW_1_0_0'). " echo " If you do not specify the -H option it will " echo " default to the release corresponding to " echo " your current scram runtime environment. " echo "" echo " --full - Print the full path to the source files. The " echo " default is to print the relative path " echo " beginning with the CMSSW subsystem. " echo "" echo " --help - This help information " echo "" echo " [glimpse-options] - any of the glimpse options can also be " echo " specified, except for -H and --help, which" echo " are used as described above. " echo " See 'glimpse --help' for the full list. " exit ;; -H )[ $# -gt 1 ] || { echo "Option \`$1' requires an argument" 1>&2; exit 1; } CURRENT_SCRAM_PROJECT=$2; shift; shift CURRENT_SRC_AREA=$(scram --arch $SCRAM_ARCH list -c $CURRENT_SCRAM_PROJECT | awk '{print $3}') ;; * ) args="$args $1"; shift;; esac done if [ "$CURRENT_SCRAM_PROJECT" == "" ] then echo "No project specified. " echo "Please eval some scram runtime or use -H option." exit 1 fi if [ ! -e $CURRENT_SRC_AREA/.glimpse_full ] then CURRENT_SRC_AREA=$CURRENT_SRC_AREA/src fi case $action in full ) if [ ! -e $CURRENT_SRC_AREA/.glimpse_full/.glimpse_index ] then echo "Glimpse index not found. Expected it in directory:" echo " $CURRENT_SRC_AREA/.glimpse_full/" exit 1 fi glimpse -H $CURRENT_SRC_AREA/.glimpse_full/ $args ;; * ) if [ ! -e $CURRENT_SRC_AREA/.glimpse_index ] then echo "Glimpse index not found. Expected it in directory:" echo " $CURRENT_SRC_AREA" exit 1 fi glimpse -H $CURRENT_SRC_AREA $args ;; esac