#!/bin/sh # # Copyright (c) 2010-2013 Dream Multimedia GmbH, Germany # http://www.dream-multimedia-tv.de/ # Authors: # Andreas Oberritter # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. # CMD=$1 shift if [ -z "$LESS" ]; then LESS="FRSX" export LESS fi if [ -z "$PAGER" ]; then PAGER="pager" fi case "$CMD" in diff) ( git diff $@; git submodule --quiet foreach "git diff $@ || true" ) | $PAGER ;; find) ( find bitbake meta-* openembedded-core $@ ) | $PAGER ;; grep) ( find conf/ -name "*.conf" | xargs grep -H $@; git grep $@; for d in */.git */*/.git; do d=`dirname $d`; [ -d "$d" ] && cd $d && git grep $@ | sed -e "s,^,$d/,"; cd $OLDPWD; done ) | $PAGER ;; *) echo "Usage: source ${BASH_SOURCE[0]:-drepo} [...]" ;; esac