diff options
author | Björn Bidar | 2016-07-13 10:04:46 +0200 |
---|---|---|
committer | Björn Bidar | 2016-07-13 10:05:39 +0200 |
commit | 933651cc4795a8a4efa7b181f5aa5977170ea00a (patch) | |
tree | 370c4bfaf5114834a09a5ebf7685d343039b455b | |
parent | 41e8f585f7c05aa276adf6fccad82b9df00bb2d1 (diff) | |
download | aur-933651cc4795a8a4efa7b181f5aa5977170ea00a.tar.gz |
upkg
-rw-r--r-- | .SRCINFO | 12 | ||||
-rw-r--r-- | PKGBUILD | 10 | ||||
-rw-r--r-- | _osc | 147 |
3 files changed, 159 insertions, 10 deletions
@@ -1,6 +1,8 @@ +# Generated by mksrcinfo v8 +# Wed Jul 13 08:04:36 UTC 2016 pkgbase = osc pkgdesc = Command line client for the openSUSE Build Service - pkgver = 0.152.0 + pkgver = 0.154.0 pkgrel = 1 url = https://github.com/openSUSE/osc arch = any @@ -17,10 +19,10 @@ pkgbase = osc conflicts = zsh-completion-osc replaces = osc-bash-completion replaces = zsh-completion-osc - source = https://github.com/openSUSE/osc/archive/0.152.0.tar.gz - source = _osc::http://sourceforge.net/p/zsh/code/ci/master/tree/Completion/openSUSE/Command/_osc?format=raw - sha256sums = 2aa347e64e6c3f6c57e5b375a43b92ada06a5606d135c7015e4f9422f7dae8f9 - sha256sums = 7b048c4af5fc21130912322f7e905fa17fc2a0f8db76a981d440664eef34fb09 + source = https://github.com/openSUSE/osc/archive/0.154.0.tar.gz + source = _osc + sha256sums = 88daae5b94354e9bcab03523aa7e3d270f69ffeaef8e4a1493bce19757d4699d + sha256sums = 2b045e03d2fdce12683ceb9792d491a32f00b256045456412e7bc18c8726218a pkgname = osc @@ -6,7 +6,7 @@ # Contributor : Patrick McCarty <pnorcks at gmail dot com> pkgname=osc -pkgver=0.152.0 +pkgver=0.154.0 pkgrel=1 pkgdesc="Command line client for the openSUSE Build Service" arch=(any) @@ -23,9 +23,9 @@ optdepends=('obs-build: required to run local builds' conflicts=('osc-git' 'osc-bash-completion' 'zsh-completion-osc') replaces=('osc-bash-completion' 'zsh-completion-osc') source=("https://github.com/openSUSE/${pkgname}/archive/${pkgver}.tar.gz" - "_osc::http://sourceforge.net/p/zsh/code/ci/master/tree/Completion/openSUSE/Command/_osc?format=raw") -sha256sums=('2aa347e64e6c3f6c57e5b375a43b92ada06a5606d135c7015e4f9422f7dae8f9' - '7b048c4af5fc21130912322f7e905fa17fc2a0f8db76a981d440664eef34fb09') + "_osc") +sha256sums=('88daae5b94354e9bcab03523aa7e3d270f69ffeaef8e4a1493bce19757d4699d' + '2b045e03d2fdce12683ceb9792d491a32f00b256045456412e7bc18c8726218a') prepare() { # Add 'Arch_Core' and 'Arch_Extra' as osc build targets @@ -39,7 +39,7 @@ build() { package() { cd "${srcdir}/${pkgname}-${pkgver}" - python2 setup.py install --root="${pkgdir}/" --optimize=1 + python2 setup.py install --root="${pkgdir}/" --optimize=1 --prefix=/usr cd "${pkgdir}/usr/bin" ln -s osc-wrapper.py osc @@ -0,0 +1,147 @@ +#compdef osc +# +# Copyright (C) 2009,2010 Holger Macht <holger@homac.de> +# +# This file is released under the GPLv2. +# +# Based on the the zsh guide from http://zsh.dotsrc.org/Guide/zshguide06.html +# +# Toggle verbose completions: zstyle ':completion:*:osc:*' verbose no +# zstyle ':completion:*:osc-subcommand:*' verbose no +# +# Use the variables $ZSH_OSC_BUILD_TARGETS_EXTRA and $ZSH_OSC_PROJECTS_EXTRA to +# extend the list of possible completions in your ~/.zshrc like that: +# export OSC_PROJECTS_EXTRA="Base:System Base:shells" +# +# version 0.2 +# + +OSC_BUILD_TARGETS="openSUSE_10.2 openSUSE_10.3 openSUSE_11.0 openSUSE_11.1 openSUSE_11.2 openSUSE_11.3 openSUSE_Factory" +OSC_PROJECTS="openSUSE:Factory openSUSE:11.2 openSUSE:11.3 openSUSE:11.1 openSUSE:11.0 openSUSE:10.3" + +# user defined variables $OSC_BUILD_TARGETS_EXTRA and +# $OSC_PROJECTS_EXTRA can add to the project/build target list +OSC_BUILD_TARGETS="$OSC_BUILD_TARGETS $ZSH_OSC_BUILD_TARGETS_EXTRA" +OSC_PROJECTS="$OSC_PROJECTS $ZSH_OSC_PROJECTS_EXTRA" + +# Main dispatcher + +_osc() { + if (( CURRENT > 2 )) && [[ ${words[2]} != "help" ]]; then + # Remember the subcommand name + local cmd=${words[2]} + # Set the context for the subcommand. + curcontext="${curcontext%:*:*}:osc-subcommand" + # Narrow the range of words we are looking at to exclude `osc' + (( CURRENT-- )) + shift words + # Run the completion for the subcommand + if [ "$cmd" = "submitreq" -o "$cmd" = "sr" ]; then + _osc_cmd_submitreq + elif [ "$cmd" = "getbinaries" ]; then + _osc_cmd_getbinaries + elif [ "$cmd" = "checkout" -o "$cmd" = "co" -o "$cmd" = "branch" ]; then + _osc_cmd_checkout + elif [ "$cmd" = "buildlog" -o "$cmd" = "buildinfo" -o "$cmd" = "bl" ]; then + _osc_cmd_buildlog + else + _osc_cmd_do $cmd + fi + else + local hline + local -a cmdlist + local tag=0 + _call_program help-commands osc help | while read -A hline; do + # start parsing with "commands:" + [[ $hline[1] = "commands:" ]] && tag=1 + # stop parsing at the line starting with "For" + [[ $hline[1] = "For" ]] && tag=0 + [[ $tag = 0 ]] && continue + # all commands have to start with lower case letters + [[ $hline[1] =~ ^[A-Z] ]] && continue + (( ${#hline} < 2 )) && continue + + # ${hline[1]%,} truncates the last ',' + cmdlist=($cmdlist "${hline[1]%,}:${hline[2,-1]}") + done + _describe -t osc-commands 'osc command' cmdlist + fi +} + +_osc_cmd_getbinaries() { + _arguments \ + '1:PROJECT:( `echo $OSC_PROJECTS` )' \ + '2:PACKAGE:(PACKAGE)' \ + '3:REPOSITORY:( `echo $OSC_BUILD_TARGETS` )' \ + '4:ARCHITECTURE:(i586 x86_64)' +} + +_osc_cmd_checkout() { + _arguments \ + '1:PROJECT:( `echo $OSC_PROJECTS` )' \ + '2:PACKAGE:(PACKAGE)' +} + +_osc_cmd_buildlog() { + _arguments \ + '1:REPOSITORY:( `echo $OSC_BUILD_TARGETS` )' \ + '2:ARCHITECTURE:(i586 x86_64)' +} + +_osc_cmd_submitreq() { + local hline + local -a cmdlist + local tag=0 + _call_program help-commands osc help $cmd | while read -A hline; do + # start parsing from "usage:" + [[ $hline[1] = "usage:" ]] && tag=1 + [[ $tag = 0 ]] && continue + + if [[ $hline[1] =~ ^osc ]]; then + shift hline; shift hline + elif ! [[ $hline[1] =~ ^- ]]; then + # Option has to start with a '-' or 'osc submitrequest' + continue + fi + + (( ${#hline} < 2 )) && continue + + cmdlist=($cmdlist "${hline[1]%,}:${hline[2,-1]}") + + done + + _describe -t osc-commands 'osc command' cmdlist +} + + +_osc_cmd_do() { + local hline + local -a cmdlist + local tag=0 + + # only start completion if theres some '-' on the line + if ! [ "$words[2]" = "-" ]; then + _complete + return + fi + + _call_program help-commands osc help $cmd | while read -A hline; do + # start parsing from "Options:" + [[ $hline[1] = "Options:" ]] && tag=1 + [[ $tag = 0 ]] && continue + # Option has to start with a '-' + [[ $hline[1] =~ ^- ]] || continue + (( ${#hline} < 2 )) && continue + + cmdlist=($cmdlist "${hline[1]%,}:${hline[2,-1]}") + done + + if [ -n "$cmdlist" ]; then + _describe -t osc-commands 'osc command' cmdlist + else + _complete + fi +} + +# Code to make sure _osc is run when we load it +_osc "$@" |