diff options
author | Alexis La Goutte <alexis.lagoutte@gmail.com> | 2013-05-21 16:57:55 +0000 |
---|---|---|
committer | Alexis La Goutte <alexis.lagoutte@gmail.com> | 2013-05-21 16:57:55 +0000 |
commit | c97865c1794a4205e67be3e59116cc4b458b04a1 (patch) | |
tree | 5c2e499f4b2d15faef42badc884258f0abb361f2 /tools | |
parent | aaa1f1bef946e626fcb3395b241a49280b04fb59 (diff) |
Enhance backport-rev script
pbcopy is not available in Linux (only in Mac OS)
Add check if pbcopy is available or xsel (a linux variante)
svn path=/trunk/; revision=49483
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/backport-rev | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/tools/backport-rev b/tools/backport-rev index d37f5d0af1..344c0d3699 100755 --- a/tools/backport-rev +++ b/tools/backport-rev @@ -28,12 +28,25 @@ if [ -z "$VISUAL" ] ; then VISUAL=$EDITOR fi +#Check if pbcopy (or similar) is available... +if [ `builtin type -p pbcopy` ] ; then + PBCOPY="pbcopy" +fi + +if [ `builtin type -p xsel` ] ; then + PBCOPY="xsel --clipboard --input" +fi + +if [ -z "$PBCOPY" ] ; then + echo "Can't find an clipboard copy. Check if pbcopy or xsel is installed in your system" + exit 1 +fi function exit_err { if [ -n "$*" ] ; then echo "$*" fi - echo -n $patchfile | pbcopy + echo -n $patchfile | $PBCOPY echo "Patch saved to $patchfile and copied to pasteboard" if [ -n "$VISUAL" ] ; then "$VISUAL" $patchfile $logfile |