summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjörn Bidar2023-09-09 01:52:05 +0300
committerBjörn Bidar2023-09-09 01:54:36 +0300
commit8618c14d4f54cc5aeffee74f2a3dc4cf418ff4cb (patch)
tree939847b4a3e343b940ef450b921c626b2e6cabb2
parentff6689a17de9a4ce72bf310f961ada64b39ce44c (diff)
downloadaur-8618c14d4f54cc5aeffee74f2a3dc4cf418ff4cb.tar.gz
Update to 1.3.1
- New upstream release - Rebase sb2 patches - Add improved zsh completition from: https://github.com/openSUSE/osc/pull/1357 Signed-off-by: Björn Bidar <bjorn.bidar@thaodan.de>
-rw-r--r--.SRCINFO52
-rw-r--r--0001-Import-zsh-completition-made-by-Holger-Macht.patch179
-rw-r--r--0002-Fetch-project-list-in-zsh-completition-at-runtime.patch155
-rw-r--r--0003-Parse-pwd-s-apiurl-in-zsh-completion.patch47
-rw-r--r--0004-Fetch-project-repositories-list-for-zsh-completion.patch74
-rw-r--r--0005-Match-more-command-aliases-in-the-zsh-completion.patch42
-rw-r--r--0006-Refactor-help-text-generation-in-zsh-completition-so.patch88
-rw-r--r--0007-Complete-help-text-for-options-that-have-separate-ha.patch67
-rw-r--r--0008-Fetch-repository-architectures-in-zsh-completition.patch69
-rw-r--r--0009-Add-zsh-completion-for-build-command.patch48
-rw-r--r--0010-Add-sb2install-support-to-osc.patch (renamed from 0001-Add-sb2install-support-to-osc.patch)21
-rw-r--r--0011-Support-osc-copyprj-in-api-by-Islam-Amer-usage-osc-c.patch (renamed from 0002-Support-osc-copyprj-in-api-by-Islam-Amer-usage-osc-c.patch)20
-rw-r--r--0012-Support-synchronous-copyproj.patch (renamed from 0003-Support-synchronous-copyproj.patch)18
-rw-r--r--0013-Add-p-to-copyprj-to-enable-copying-of-prjconf.patch (renamed from 0004-Add-p-to-copyprj-to-enable-copying-of-prjconf.patch)21
-rw-r--r--0014-Add-support-for-rebuild-and-chroot-only-in-build.-re.patch (renamed from 0005-Add-support-for-rebuild-and-chroot-only-in-build.-re.patch)8
-rw-r--r--0015-Add-architecture-and-scheduler-maps.patch (renamed from 0006-Add-architecture-and-scheduler-maps.patch)0
-rw-r--r--0016-Trap-any-kind-of-exception-during-plugin-parsing-eg-.patch23
-rw-r--r--0017-Fix-hdrmd5-check-of-downloaded-packages-from-DoD-rep.patch46
-rw-r--r--PKGBUILD56
-rw-r--r--_osc147
20 files changed, 951 insertions, 230 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 2b408904cd87..d2787b2f954f 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,6 +1,6 @@
pkgbase = osc
pkgdesc = Command line client for the openSUSE Build Service
- pkgver = 1.1.2
+ pkgver = 1.3.1
pkgrel = 1
url = https://github.com/openSUSE/osc
arch = any
@@ -19,21 +19,41 @@ pkgbase = osc
conflicts = zsh-completion-osc
replaces = osc-bash-completion
replaces = zsh-completion-osc
- source = https://github.com/openSUSE/osc/archive/1.1.2.tar.gz
- source = _osc
- source = 0001-Add-sb2install-support-to-osc.patch
- source = 0002-Support-osc-copyprj-in-api-by-Islam-Amer-usage-osc-c.patch
- source = 0003-Support-synchronous-copyproj.patch
- source = 0004-Add-p-to-copyprj-to-enable-copying-of-prjconf.patch
- source = 0005-Add-support-for-rebuild-and-chroot-only-in-build.-re.patch
- source = 0006-Add-architecture-and-scheduler-maps.patch
- sha256sums = b2df7f9514175428a82e636365fa10c5dfed7497d742aff380e22c517064ee6a
- sha256sums = 2b045e03d2fdce12683ceb9792d491a32f00b256045456412e7bc18c8726218a
- sha256sums = 270e4998d3499ff42992cc9866025bb9d3976fcd922d3428d0bdaa066be52d59
- sha256sums = 8176ec12b8f9e14ac655241d38aff1ed6797a3f684ba48a2f6dbea4ce988422c
- sha256sums = 90072ef14c4b7d31ac79a6005f5b06d51d0a4051274ad2b70b7e7d6b6d13080f
- sha256sums = 11318594468e017cee00ebbc5c0148808740557106279a4be6868851aebb2606
- sha256sums = 68a9ff708c067b89430e894df941b76e6dcb499eef0b384afb762cd72bd7f721
+ source = https://github.com/openSUSE/osc/archive/1.3.1.tar.gz
+ source = 0001-Import-zsh-completition-made-by-Holger-Macht.patch
+ source = 0002-Fetch-project-list-in-zsh-completition-at-runtime.patch
+ source = 0003-Parse-pwd-s-apiurl-in-zsh-completion.patch
+ source = 0004-Fetch-project-repositories-list-for-zsh-completion.patch
+ source = 0005-Match-more-command-aliases-in-the-zsh-completion.patch
+ source = 0006-Refactor-help-text-generation-in-zsh-completition-so.patch
+ source = 0007-Complete-help-text-for-options-that-have-separate-ha.patch
+ source = 0008-Fetch-repository-architectures-in-zsh-completition.patch
+ source = 0009-Add-zsh-completion-for-build-command.patch
+ source = 0010-Add-sb2install-support-to-osc.patch
+ source = 0011-Support-osc-copyprj-in-api-by-Islam-Amer-usage-osc-c.patch
+ source = 0012-Support-synchronous-copyproj.patch
+ source = 0013-Add-p-to-copyprj-to-enable-copying-of-prjconf.patch
+ source = 0014-Add-support-for-rebuild-and-chroot-only-in-build.-re.patch
+ source = 0015-Add-architecture-and-scheduler-maps.patch
+ source = 0016-Trap-any-kind-of-exception-during-plugin-parsing-eg-.patch
+ source = 0017-Fix-hdrmd5-check-of-downloaded-packages-from-DoD-rep.patch
+ sha256sums = 6fb9fee8dfd86276632d6a7a25169f34bec1bc251c79161b5f096a9ebde51cd8
+ sha256sums = 6d0343bd5254bebf4feb972b198953f7faa977411d007f7d432ed8b969ef20dd
+ sha256sums = 60e861db1a13b3a0dce8d9630bc77f023773c550558a2f2f5d144f56bcb01f49
+ sha256sums = 89d7acdb5dd2ad996f438681d16fca7d8a7fcccc0c9947647a24a93ff0820295
+ sha256sums = 278e8da8f3010de09e031d90cf759d24d68bd44eba9dbbef9aa78abb11e13f31
+ sha256sums = f3871ab614898a9a71ccb5545211aefa8bbacebf9500126c2a1d07c2c939b29c
+ sha256sums = 794b07b4edc5a0a53f6780a3c9b8442264d960ceae525b7ca9407b1b853c009c
+ sha256sums = 88ad2c7135f972e69b0188f3f10f4907a0e5dda3bf06a80656f4772339cbfb4d
+ sha256sums = 33fc7b90ca2b14b66622816a895f60051f6c4dce6d843504ff4d125728043a56
+ sha256sums = 5fab7671bd4e4aa52930f9e52a0b1fbb6187df1ca6a8d3e975beeccc3016938e
+ sha256sums = 19829c5586774b65321a0c27539ce6c3d5de041faeb77efff38c00c952e36b67
+ sha256sums = 705395902faf621929d921e414551d14998b6daf22f0732253a648b655d448e2
+ sha256sums = 8ca69c2797f933e7fe7c6b4452d4ce848dbb26a35d1b143fd8017cd91f5061b8
+ sha256sums = 4b079b31fe946c7bf595494fab2f84cc3c094354daf8d1df4d9d5615fb0f06a9
+ sha256sums = 8c05cda87e16283af460d56113666b9f7896f1e77b9055da00d9f45d971bcd7c
sha256sums = eae5f978b8385db3acae46df96fc4973f306c4a640389165a8ac54469d370e5b
+ sha256sums = e690cc2396b42e2f85e961595526e056f86dd850d2b2c74178381d89d33afb6a
+ sha256sums = 67c916cd7ba9dcd4899477c223c79f7087c0a0077d33f95ccb465b790e052547
pkgname = osc
diff --git a/0001-Import-zsh-completition-made-by-Holger-Macht.patch b/0001-Import-zsh-completition-made-by-Holger-Macht.patch
new file mode 100644
index 000000000000..5338ac4b70ce
--- /dev/null
+++ b/0001-Import-zsh-completition-made-by-Holger-Macht.patch
@@ -0,0 +1,179 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Bj=C3=B6rn=20Bidar?= <bjorn.bidar@jolla.com>
+Date: Sun, 16 Jul 2023 03:24:47 +0300
+Subject: [PATCH] Import zsh completition made by Holger Macht
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Right now the zsh completition is packaged inside the zsh package on
+OpenSUSE.
+Several distributions either package it or the user has to import it
+themselves.
+
+It is better if it is stored here so any can pick it up in there zsh
+package and put fixes in here.
+
+The file was imported from the OpenSUSE zsh package plus a few spelling fixes.
+
+Signed-off-by: Björn Bidar <bjorn.bidar@jolla.com>
+---
+ contrib/osc.zsh | 149 ++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 149 insertions(+)
+ create mode 100644 contrib/osc.zsh
+
+diff --git a/contrib/osc.zsh b/contrib/osc.zsh
+new file mode 100644
+index 0000000000000000000000000000000000000000..d043d2f33562807a9e284e88aebb4be1551ae119
+--- /dev/null
++++ b/contrib/osc.zsh
+@@ -0,0 +1,149 @@
++#compdef osc
++#
++# Copyright (C) 2009,2010 Holger Macht <holger@homac.de>
++#
++# This file is released under the GPLv2.
++#
++# Based on 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_13.1 openSUSE_13.2 openSUSE_Tumbleweed openSUSE_Factory SLE_11_SP3 SLE_12"
++OSC_PROJECTS="openSUSE:Factory openSUSE:Tumbleweed openSUSE:13.2 openSUSE:13.1"
++
++# 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 there's 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 "$@"
++
++
diff --git a/0002-Fetch-project-list-in-zsh-completition-at-runtime.patch b/0002-Fetch-project-list-in-zsh-completition-at-runtime.patch
new file mode 100644
index 000000000000..7f9db73b194f
--- /dev/null
+++ b/0002-Fetch-project-list-in-zsh-completition-at-runtime.patch
@@ -0,0 +1,155 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Bj=C3=B6rn=20Bidar?= <bjorn.bidar@jolla.com>
+Date: Thu, 20 Jul 2023 15:17:06 +0300
+Subject: [PATCH] Fetch project list in zsh completition at runtime
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Similar to the bash/tcsh completition fetch the project list at
+runtime.
+Includes basic completion for alias/api-url as project list
+cache is separated per instance.
+
+Signed-off-by: Björn Bidar <bjorn.bidar@jolla.com>
+---
+ contrib/osc.zsh | 88 ++++++++++++++++++++++++++++++++++++++++++++++---
+ 1 file changed, 84 insertions(+), 4 deletions(-)
+
+diff --git a/contrib/osc.zsh b/contrib/osc.zsh
+index d043d2f33562807a9e284e88aebb4be1551ae119..1d7c43e00c1f8f372b719c623fc20b09512f7a71 100644
+--- a/contrib/osc.zsh
++++ b/contrib/osc.zsh
+@@ -1,6 +1,7 @@
+ #compdef osc
+ #
+ # Copyright (C) 2009,2010 Holger Macht <holger@homac.de>
++# Copyright (C) 2023 Björn Bidar <bjorn.bidar@jolla.com>
+ #
+ # This file is released under the GPLv2.
+ #
+@@ -17,16 +18,25 @@
+ #
+
+ OSC_BUILD_TARGETS="openSUSE_13.1 openSUSE_13.2 openSUSE_Tumbleweed openSUSE_Factory SLE_11_SP3 SLE_12"
+-OSC_PROJECTS="openSUSE:Factory openSUSE:Tumbleweed openSUSE:13.2 openSUSE:13.1"
+
+ # 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() {
++ # Variables shared by all internal functions
++ local osc_projects osc_rc osc_cmd osc_alias
++ _osc_complete_prepare
++ osc_projects="${XDG_CACHE_HOME}/osc.projects"
++ osc_rc="${XDG_CONFIG_HOME}/osc/oscrc"
++ osc_cmd=osc
++
++ if [[ "${words[0]}" = "isc" ]] ; then
++ osc_alias=internal
++ fi
++
+ if (( CURRENT > 2 )) && [[ ${words[2]} != "help" ]]; then
+ # Remember the subcommand name
+ local cmd=${words[2]}
+@@ -36,6 +46,40 @@ _osc() {
+ (( CURRENT-- ))
+ shift words
+ # Run the completion for the subcommand
++ if [ $cmd = -A -o $cmd = --apiurl ] ; then
++ if [[ -s "${osc_rc}" ]] ; then
++ local hints=($(sed -rn '/^(aliases=|\[http)/{s/,/ /g;s/(aliases=|\[|\])//gp}' < "${osc_rc}" 2> /dev/null))
++ if [[ -n "${words[2]}" ]]; then
++ for h in ${hints[@]} ; do
++ case "$h" in
++ http*)
++ local tmp=$(sed -rn '\@^\['${h}'@,\@=@{\@^aliases=@{s@[^=]+=([^,]+),.*@\1@p};}' < "${osc_rc}" 2> /dev/null)
++ if [[ "${words[2]}" = "$h" ]]; then
++ osc_alias=$tmp
++ break
++ fi
++ ;;
++ *)
++ if [[ "${words[2]}" = "$h" ]]; then
++ osc_alias=$h
++ break
++ fi
++ esac
++ done
++ else
++ _arguments '1:ALIAS:( `echo $hints`)'
++ return
++ fi
++ fi
++ fi
++
++ if [[ -n "$osc_alias" ]] ; then
++ osc_projects="${osc_projects}.${osc_alias}"
++ osc_command="$osc_command -A $osc_alias"
++ fi
++
++ _osc_update_project_list
++
+ if [ "$cmd" = "submitreq" -o "$cmd" = "sr" ]; then
+ _osc_cmd_submitreq
+ elif [ "$cmd" = "getbinaries" ]; then
+@@ -68,9 +112,45 @@ _osc() {
+ fi
+ }
+
++_osc_call_me_maybe()
++{
++ typeset -i ctime=$(command date -d "$(command stat -c '%z' ${1})" +'%s')
++ typeset -i now=$(command date -d now +'%s')
++ if ((now - ctime < 86400)) ; then
++ return 1
++ fi
++ return 0
++}
++
++_osc_complete_prepare() {
++ local xdg_dir
++ for xdg_dir in "${XDG_CACHE_HOME:=$HOME/.cache}" "${XDG_CONFIG_HOME:=$HOME/.config}"; do
++ if [[ ! -d "${xdg_dir}" ]]; then
++ mkdir -p "${xdg_dir}"
++ fi
++ done
++
++ if [[ -f ~/.osc.projects ]]; then
++ rm ~/.osc.projects -f
++ fi
++}
++
++_osc_update_project_list() {
++ if [[ -s "${osc_projects}" ]] ; then
++ if _osc_call_me_maybe "$osc_projects" ; then
++ if tmp=$(mktemp ${osc_projects}.XXXXXX) ; then
++ command ${osc_cmd} ls / >| $tmp
++ mv -uf $tmp ${osc_projects}
++ fi
++ fi
++ else
++ command ${osc_cmd} ls / >| "${osc_projects}"
++ fi
++}
++
+ _osc_cmd_getbinaries() {
+ _arguments \
+- '1:PROJECT:( `echo $OSC_PROJECTS` )' \
++ '1:PROJECT:( `cat $osc_projects` )' \
+ '2:PACKAGE:(PACKAGE)' \
+ '3:REPOSITORY:( `echo $OSC_BUILD_TARGETS` )' \
+ '4:ARCHITECTURE:(i586 x86_64)'
+@@ -78,7 +158,7 @@ _osc_cmd_getbinaries() {
+
+ _osc_cmd_checkout() {
+ _arguments \
+- '1:PROJECT:( `echo $OSC_PROJECTS` )' \
++ '1:PROJECT:( `cat $osc_projects` )' \
+ '2:PACKAGE:(PACKAGE)'
+ }
+
diff --git a/0003-Parse-pwd-s-apiurl-in-zsh-completion.patch b/0003-Parse-pwd-s-apiurl-in-zsh-completion.patch
new file mode 100644
index 000000000000..dc45ecf2e2c5
--- /dev/null
+++ b/0003-Parse-pwd-s-apiurl-in-zsh-completion.patch
@@ -0,0 +1,47 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Bj=C3=B6rn=20Bidar?= <bjorn.bidar@jolla.com>
+Date: Thu, 20 Jul 2023 15:34:43 +0300
+Subject: [PATCH] Parse pwd's apiurl in zsh completion
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Björn Bidar <bjorn.bidar@jolla.com>
+---
+ contrib/osc.zsh | 16 ++++++++++++++--
+ 1 file changed, 14 insertions(+), 2 deletions(-)
+
+diff --git a/contrib/osc.zsh b/contrib/osc.zsh
+index 1d7c43e00c1f8f372b719c623fc20b09512f7a71..8c1148ffacdbe09e0ec127ef949e78f75c1fbd26 100644
+--- a/contrib/osc.zsh
++++ b/contrib/osc.zsh
+@@ -37,6 +37,18 @@ _osc() {
+ osc_alias=internal
+ fi
+
++ if [ -s "${PWD}/.osc/_apiurl" -a -s "${osc_rc}" ]; then
++ local osc_apiurl
++ read osc_apiurl < "${PWD}/.osc/_apiurl"
++ # We prefer to match an apiurl with an alias so that the project list
++ # cache would match also when -A was passed with said alias.
++ # If there's no alias for that api url match to use the plain apiurl instead.
++ osc_alias=$(sed -rn '\@^\['${apiurl}'@,\@=@{\@^aliases=@{s@[^=]+=([^,]+),.*@\1@p};}' < "${osc_rc}" 2> /dev/null)
++ if [ -z $osc_alias ] ; then
++ osc_alias=${osc_apiurl}
++ fi
++ fi
++
+ if (( CURRENT > 2 )) && [[ ${words[2]} != "help" ]]; then
+ # Remember the subcommand name
+ local cmd=${words[2]}
+@@ -74,8 +86,8 @@ _osc() {
+ fi
+
+ if [[ -n "$osc_alias" ]] ; then
+- osc_projects="${osc_projects}.${osc_alias}"
+- osc_command="$osc_command -A $osc_alias"
++ osc_projects="${osc_projects}.${osc_alias//\//_}"
++ osc_command="$osc_command -A ${osc_alias}"
+ fi
+
+ _osc_update_project_list
diff --git a/0004-Fetch-project-repositories-list-for-zsh-completion.patch b/0004-Fetch-project-repositories-list-for-zsh-completion.patch
new file mode 100644
index 000000000000..f93e3596d057
--- /dev/null
+++ b/0004-Fetch-project-repositories-list-for-zsh-completion.patch
@@ -0,0 +1,74 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Bj=C3=B6rn=20Bidar?= <bjorn.bidar@jolla.com>
+Date: Fri, 21 Jul 2023 17:57:18 +0300
+Subject: [PATCH] Fetch project repositories list for zsh completion
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Björn Bidar <bjorn.bidar@jolla.com>
+---
+ contrib/osc.zsh | 28 ++++++++++++++++------------
+ 1 file changed, 16 insertions(+), 12 deletions(-)
+
+diff --git a/contrib/osc.zsh b/contrib/osc.zsh
+index 8c1148ffacdbe09e0ec127ef949e78f75c1fbd26..67afbc2f89cc6520365ce77702207be11b679ab6 100644
+--- a/contrib/osc.zsh
++++ b/contrib/osc.zsh
+@@ -9,20 +9,10 @@
+ #
+ # 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_13.1 openSUSE_13.2 openSUSE_Tumbleweed openSUSE_Factory SLE_11_SP3 SLE_12"
+-
+-# 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"
+-
+ # Main dispatcher
+
+ _osc() {
+@@ -160,11 +150,25 @@ _osc_update_project_list() {
+ fi
+ }
+
++_osc_project_repositories() {
++ if [ ! -s $PWD/.osc/_build_repositories ] || \
++ _osc_call_me_maybe $PWD/.osc/_build_repositories ; then
++ osc repositories > /dev/null
++ fi
++ # Just check if file exist in case the call to the api failed
++ if [ -s $PWD/.osc/_build_repositories ] ; then
++ cat $PWD/.osc/_build_repositories | while read build_repository ; do
++ # Only output first word of each line
++ echo ${build_repository%\ *}
++ done | sort -u
++ fi
++}
++
+ _osc_cmd_getbinaries() {
+ _arguments \
+ '1:PROJECT:( `cat $osc_projects` )' \
+ '2:PACKAGE:(PACKAGE)' \
+- '3:REPOSITORY:( `echo $OSC_BUILD_TARGETS` )' \
++ '3:REPOSITORY:( `_osc_project_repositories`' \
+ '4:ARCHITECTURE:(i586 x86_64)'
+ }
+
+@@ -176,7 +180,7 @@ _osc_cmd_checkout() {
+
+ _osc_cmd_buildlog() {
+ _arguments \
+- '1:REPOSITORY:( `echo $OSC_BUILD_TARGETS` )' \
++ '1:REPOSITORY:( `_osc_project_repositories` )' \
+ '2:ARCHITECTURE:(i586 x86_64)'
+ }
+
diff --git a/0005-Match-more-command-aliases-in-the-zsh-completion.patch b/0005-Match-more-command-aliases-in-the-zsh-completion.patch
new file mode 100644
index 000000000000..2d3f4c848c0d
--- /dev/null
+++ b/0005-Match-more-command-aliases-in-the-zsh-completion.patch
@@ -0,0 +1,42 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Bj=C3=B6rn=20Bidar?= <bjorn.bidar@jolla.com>
+Date: Fri, 21 Jul 2023 21:50:05 +0300
+Subject: [PATCH] Match more command aliases in the zsh completion
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Björn Bidar <bjorn.bidar@jolla.com>
+---
+ contrib/osc.zsh | 18 +++++++-----------
+ 1 file changed, 7 insertions(+), 11 deletions(-)
+
+diff --git a/contrib/osc.zsh b/contrib/osc.zsh
+index 67afbc2f89cc6520365ce77702207be11b679ab6..244a23556e9b8179c8de711ad6a00a866759ed42 100644
+--- a/contrib/osc.zsh
++++ b/contrib/osc.zsh
+@@ -82,17 +82,13 @@ _osc() {
+
+ _osc_update_project_list
+
+- 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
++ case $cmd in
++ submitrequest|submitreq|sr) _osc_cmd_submitreq ;;
++ getbinaries) _osc_cmd_getbinaries ;;
++ checkout|co|branch|getpac|bco|branchco) _osc_cmd_checkout ;;
++ buildlog|buildinfo|bl|blt|buildlogtail) _osc_cmd_buildlog ;;
++ *) _osc_cmd_do $cmd
++ esac
+ else
+ local hline
+ local -a cmdlist
diff --git a/0006-Refactor-help-text-generation-in-zsh-completition-so.patch b/0006-Refactor-help-text-generation-in-zsh-completition-so.patch
new file mode 100644
index 000000000000..9e9d3af784c9
--- /dev/null
+++ b/0006-Refactor-help-text-generation-in-zsh-completition-so.patch
@@ -0,0 +1,88 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Bj=C3=B6rn=20Bidar?= <bjorn.bidar@jolla.com>
+Date: Fri, 21 Jul 2023 23:09:51 +0300
+Subject: [PATCH] Refactor help text generation in zsh completition so it can
+ be reused
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Björn Bidar <bjorn.bidar@jolla.com>
+---
+ contrib/osc.zsh | 42 ++++++++++++++++--------------------------
+ 1 file changed, 16 insertions(+), 26 deletions(-)
+
+diff --git a/contrib/osc.zsh b/contrib/osc.zsh
+index 244a23556e9b8179c8de711ad6a00a866759ed42..f6e1978c2abaf5dde5ec3e8ee598290bab476046 100644
+--- a/contrib/osc.zsh
++++ b/contrib/osc.zsh
+@@ -181,12 +181,16 @@ _osc_cmd_buildlog() {
+ }
+
+ _osc_cmd_submitreq() {
++ _osc_complete_help_commands 'options' 'option'
++}
++
++_osc_complete_help_commands() {
+ 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
++ [[ $hline[1] = "${1}:" ]] && tag=1
+ [[ $tag = 0 ]] && continue
+
+ if [[ $hline[1] =~ ^osc ]]; then
+@@ -198,40 +202,26 @@ _osc_cmd_submitreq() {
+
+ (( ${#hline} < 2 )) && continue
+
+- cmdlist=($cmdlist "${hline[1]%,}:${hline[2,-1]}")
++ cmdlist=($cmdlist "${hline[1]%,}:${hline[2,-1]}")
+
+ done
+-
+- _describe -t osc-commands 'osc command' cmdlist
+-}
+
++ if [ -n "$cmdlist" ] ; then
++ _describe -t osc-commands "osc $2" cmdlist
++ else
++ return 1
++ fi
++}
+
+ _osc_cmd_do() {
+- local hline
+- local -a cmdlist
+- local tag=0
+-
+ # only start completion if there's some '-' on the line
+ if ! [ "$words[2]" = "-" ]; then
+- _complete
+- return
++ _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
++ if ! _osc_complete_help_commands 'options' 'option'; then
++ _complete
+ fi
+ }
+
diff --git a/0007-Complete-help-text-for-options-that-have-separate-ha.patch b/0007-Complete-help-text-for-options-that-have-separate-ha.patch
new file mode 100644
index 000000000000..b824e758cbbc
--- /dev/null
+++ b/0007-Complete-help-text-for-options-that-have-separate-ha.patch
@@ -0,0 +1,67 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Bj=C3=B6rn=20Bidar?= <bjorn.bidar@jolla.com>
+Date: Fri, 21 Jul 2023 23:20:23 +0300
+Subject: [PATCH] Complete help text for options that have separate handlers
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Björn Bidar <bjorn.bidar@jolla.com>
+---
+ contrib/osc.zsh | 37 ++++++++++++++++++++++++++-----------
+ 1 file changed, 26 insertions(+), 11 deletions(-)
+
+diff --git a/contrib/osc.zsh b/contrib/osc.zsh
+index f6e1978c2abaf5dde5ec3e8ee598290bab476046..8ac714c88a82aa251591b3e52d9cd3dcf28d838d 100644
+--- a/contrib/osc.zsh
++++ b/contrib/osc.zsh
+@@ -161,23 +161,38 @@ _osc_project_repositories() {
+ }
+
+ _osc_cmd_getbinaries() {
+- _arguments \
+- '1:PROJECT:( `cat $osc_projects` )' \
+- '2:PACKAGE:(PACKAGE)' \
+- '3:REPOSITORY:( `_osc_project_repositories`' \
+- '4:ARCHITECTURE:(i586 x86_64)'
++ if [ "$words[2]" = "-" ]; then
++ _osc_complete_help_commands 'options' 'option'
++ return
++ else
++ _arguments \
++ '1:PROJECT:( `cat $osc_projects` )' \
++ '2:PACKAGE:(PACKAGE)' \
++ '3:REPOSITORY:( `_osc_project_repositories`' \
++ '4:ARCHITECTURE:(i586 x86_64)'
++ fi
+ }
+
+ _osc_cmd_checkout() {
+- _arguments \
+- '1:PROJECT:( `cat $osc_projects` )' \
+- '2:PACKAGE:(PACKAGE)'
++ if [ "$words[2]" = "-" ]; then
++ _osc_complete_help_commands 'options' 'option'
++ return
++ else
++ _arguments \
++ '1:PROJECT:( `cat $osc_projects` )' \
++ '2:PACKAGE:(PACKAGE)'
++ fi
+ }
+
+ _osc_cmd_buildlog() {
+- _arguments \
+- '1:REPOSITORY:( `_osc_project_repositories` )' \
+- '2:ARCHITECTURE:(i586 x86_64)'
++ if [ "$words[2]" = "-" ]; then
++ _osc_complete_help_commands 'options' 'option'
++ return
++ else
++ _arguments \
++ '1:REPOSITORY:( `_osc_project_repositories` )' \
++ '2:ARCHITECTURE:(i586 x86_64)'
++ fi
+ }
+
+ _osc_cmd_submitreq() {
diff --git a/0008-Fetch-repository-architectures-in-zsh-completition.patch b/0008-Fetch-repository-architectures-in-zsh-completition.patch
new file mode 100644
index 000000000000..056aa167d948
--- /dev/null
+++ b/0008-Fetch-repository-architectures-in-zsh-completition.patch
@@ -0,0 +1,69 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Bj=C3=B6rn=20Bidar?= <bjorn.bidar@jolla.com>
+Date: Fri, 21 Jul 2023 23:45:45 +0300
+Subject: [PATCH] Fetch repository architectures in zsh completition
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Björn Bidar <bjorn.bidar@jolla.com>
+---
+ contrib/osc.zsh | 27 +++++++++++++++++++++++++--
+ 1 file changed, 25 insertions(+), 2 deletions(-)
+
+diff --git a/contrib/osc.zsh b/contrib/osc.zsh
+index 8ac714c88a82aa251591b3e52d9cd3dcf28d838d..7d495a1c37dffdbc3c644b82b4092397a4037454 100644
+--- a/contrib/osc.zsh
++++ b/contrib/osc.zsh
+@@ -160,16 +160,35 @@ _osc_project_repositories() {
+ fi
+ }
+
++_osc_project_repositories_arches() {
++ if [ ! -s $PWD/.osc/_build_repositories ] || \
++ _osc_call_me_maybe $PWD/.osc/_build_repositories ; then
++ osc repositories > /dev/null
++ fi
++ # Just check if file exist in case the call to the api failed
++ if [ -s $PWD/.osc/_build_repositories ] ; then
++ grep -- $1 $PWD/.osc/_build_repositories | while read build_repository ; do
++ # Only output second word of each line
++ echo ${build_repository#*\ }
++ done | sort -u
++ fi
++}
++
++
+ _osc_cmd_getbinaries() {
+ if [ "$words[2]" = "-" ]; then
+ _osc_complete_help_commands 'options' 'option'
+ return
+ else
++ if [ -n "$words[2]" ] ; then
++ local osc_project_repository_arch=$(_osc_project_repositories_arches \
++ "${words[2]}")
++ fi
+ _arguments \
+ '1:PROJECT:( `cat $osc_projects` )' \
+ '2:PACKAGE:(PACKAGE)' \
+ '3:REPOSITORY:( `_osc_project_repositories`' \
+- '4:ARCHITECTURE:(i586 x86_64)'
++ '4:ARCHITECTURE:(`echo $osc_project_repository_arch`)'
+ fi
+ }
+
+@@ -189,9 +208,13 @@ _osc_cmd_buildlog() {
+ _osc_complete_help_commands 'options' 'option'
+ return
+ else
++ if [ -n "$words[2]" ] ; then
++ local osc_project_repository_arch=$(_osc_project_repositories_arches \
++ "${words[2]}")
++ fi
+ _arguments \
+ '1:REPOSITORY:( `_osc_project_repositories` )' \
+- '2:ARCHITECTURE:(i586 x86_64)'
++ '2:ARCHITECTURE:(`echo $osc_project_repository_arch`)'
+ fi
+ }
+
diff --git a/0009-Add-zsh-completion-for-build-command.patch b/0009-Add-zsh-completion-for-build-command.patch
new file mode 100644
index 000000000000..08c5551d0959
--- /dev/null
+++ b/0009-Add-zsh-completion-for-build-command.patch
@@ -0,0 +1,48 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Bj=C3=B6rn=20Bidar?= <bjorn.bidar@jolla.com>
+Date: Sat, 22 Jul 2023 00:54:39 +0300
+Subject: [PATCH] Add zsh completion for build command
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Björn Bidar <bjorn.bidar@jolla.com>
+---
+ contrib/osc.zsh | 17 +++++++++++++++++
+ 1 file changed, 17 insertions(+)
+
+diff --git a/contrib/osc.zsh b/contrib/osc.zsh
+index 7d495a1c37dffdbc3c644b82b4092397a4037454..10bfc32e89b6ae486d54d2a519db346074d9b5f5 100644
+--- a/contrib/osc.zsh
++++ b/contrib/osc.zsh
+@@ -85,6 +85,7 @@ _osc() {
+ case $cmd in
+ submitrequest|submitreq|sr) _osc_cmd_submitreq ;;
+ getbinaries) _osc_cmd_getbinaries ;;
++ build) _osc_cmd_build ;;
+ checkout|co|branch|getpac|bco|branchco) _osc_cmd_checkout ;;
+ buildlog|buildinfo|bl|blt|buildlogtail) _osc_cmd_buildlog ;;
+ *) _osc_cmd_do $cmd
+@@ -218,6 +219,22 @@ _osc_cmd_buildlog() {
+ fi
+ }
+
++_osc_cmd_build() {
++ if [ "$words[2]" = "-" ]; then
++ _osc_complete_help_commands 'options' 'option'
++ return
++ else
++ if [ -n "$words[2]" ] ; then
++ local osc_project_repository_arch=$(_osc_project_repositories_arches \
++ "${words[2]}")
++ fi
++ _arguments \
++ '1:REPOSITORY:( `_osc_project_repositories` )' \
++ '2:ARCHITECTURE:(`echo $osc_project_repository_arch`)' \
++ '3:Build Description:_files'
++ fi
++}
++
+ _osc_cmd_submitreq() {
+ _osc_complete_help_commands 'options' 'option'
+ }
diff --git a/0001-Add-sb2install-support-to-osc.patch b/0010-Add-sb2install-support-to-osc.patch
index 2e44fb3b816e..af55f09e72d7 100644
--- a/0001-Add-sb2install-support-to-osc.patch
+++ b/0010-Add-sb2install-support-to-osc.patch
@@ -4,29 +4,22 @@ Date: Fri, 15 May 2020 13:46:20 +0300
Subject: [PATCH] Add sb2install support to osc
---
- osc/build.py | 7 +++++--
- 1 file changed, 5 insertions(+), 2 deletions(-)
+ osc/build.py | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/osc/build.py b/osc/build.py
-index 556bfddeccc34f3cbc776e6f24fbad00e43b28cb..b783b9c6d7e594f99abeb8e8b0308db82f1f0e18 100644
+index f59bb6520649fe1388165388e46982413029d3ac..429217916e4673cd67a954e57be04adb62b105ce 100644
--- a/osc/build.py
+++ b/osc/build.py
-@@ -190,12 +190,13 @@ class Buildinfo:
+@@ -191,6 +191,7 @@ class Buildinfo:
self.urls[node.get('project') + "/" + node.get('repository')] = baseurl + '/%(arch)s/%(filename)s'
self.vminstall_list = [dep.name for dep in self.deps if dep.vminstall]
-+ self.sb2install_list = [ dep.name for dep in self.deps if dep.sb2install ]
++ self.sb2install_list = [dep.name for dep in self.deps if dep.sb2install]
self.preinstall_list = [dep.name for dep in self.deps if dep.preinstall]
self.runscripts_list = [dep.name for dep in self.deps if dep.runscripts]
self.noinstall_list = [dep.name for dep in self.deps if dep.noinstall]
- self.installonly_list = [dep.name for dep in self.deps if dep.installonly]
-
-- if root.find('preinstallimage') is not None:
-+ if root.find('preinstallimage') != None:
- self.preinstallimage = root.find('preinstallimage')
- else:
- self.preinstallimage = None
-@@ -235,7 +236,8 @@ class Pac:
+@@ -236,7 +237,8 @@ class Pac:
'project', 'repository', 'sysroot',
'preinstall', 'vminstall', 'runscripts',
'noinstall', 'installonly', 'notmeta',
@@ -36,7 +29,7 @@ index 556bfddeccc34f3cbc776e6f24fbad00e43b28cb..b783b9c6d7e594f99abeb8e8b0308db8
self.mp[i] = node.get(i)
self.mp['buildarch'] = buildarch
-@@ -1395,6 +1397,7 @@ def main(apiurl, opts, argv):
+@@ -1421,6 +1423,7 @@ def main(apiurl, store, opts, argv):
rpmlist.append('preinstall: ' + ' '.join(bi.preinstall_list) + '\n')
rpmlist.append('vminstall: ' + ' '.join(bi.vminstall_list) + '\n')
diff --git a/0002-Support-osc-copyprj-in-api-by-Islam-Amer-usage-osc-c.patch b/0011-Support-osc-copyprj-in-api-by-Islam-Amer-usage-osc-c.patch
index 79c7cce025c5..91283509b65d 100644
--- a/0002-Support-osc-copyprj-in-api-by-Islam-Amer-usage-osc-c.patch
+++ b/0011-Support-osc-copyprj-in-api-by-Islam-Amer-usage-osc-c.patch
@@ -13,13 +13,13 @@ Subject: [PATCH] Support 'osc copyprj' in api by Islam Amer usage: osc copyprj
2 files changed, 80 insertions(+)
diff --git a/osc/commandline.py b/osc/commandline.py
-index 522c26eadd0ffab5b7858f2dd9fe211b7d1de9b1..d7a6cc5d776b739a68f4c62fb15604795afba7f4 100644
+index eb5fc9a706204b14dc9245dd9e73e2eb7c871133..7ad18e584ead6347ef67eb670ad53a6952d4e459 100644
--- a/osc/commandline.py
+++ b/osc/commandline.py
-@@ -3898,6 +3898,58 @@ Please submit there instead, or use --nodevelproject to force direct submission.
- delayed=not opts.no_delay,
- print_to="stdout",
- )
+@@ -2098,6 +2098,58 @@ class Osc(cmdln.Cmdln):
+ else:
+ raise oscerr.WrongOptions('The --delete switch is only for pattern metadata or attributes.')
+
+ @cmdln.option('-b', '--with-binaries', action='store_true',
+ help='copy the built binaries over to avoid a rebuild')
+ @cmdln.option('-x', '--with-history', action='store_true',
@@ -31,7 +31,8 @@ index 522c26eadd0ffab5b7858f2dd9fe211b7d1de9b1..d7a6cc5d776b739a68f4c62fb1560479
+ @cmdln.option('-m', '--message', metavar='TEXT',
+ help='specify message TEXT')
+ def do_copyprj(self, subcmd, opts, *args):
-+ """${cmd_name}: Copy a project
++ """
++ Copy a project
+
+ A way to copy a project and all packages in it
+
@@ -41,7 +42,6 @@ index 522c26eadd0ffab5b7858f2dd9fe211b7d1de9b1..d7a6cc5d776b739a68f4c62fb1560479
+
+ usage:
+ osc copyprj SOURCEPRJ DESTPRJ
-+ ${cmd_option_list}
+ """
+
+ args = slash_split(args)
@@ -72,14 +72,14 @@ index 522c26eadd0ffab5b7858f2dd9fe211b7d1de9b1..d7a6cc5d776b739a68f4c62fb1560479
+ print("done cp")
+ print(r)
+
+ # TODO: rewrite and consolidate the current submitrequest/createrequest "mess"
@cmdln.option('-m', '--message', metavar='TEXT',
- help='specify message TEXT')
diff --git a/osc/core.py b/osc/core.py
-index 78cdb66d20d3b1bbfc3c4b2527465c2920dcf279..1eb1262150c0bb1e37814148eeae2436aa7e2484 100644
+index 862b8ee3140f4ab9b78a90b520eb0c6c3b3912a1..a0ab1ddff152332749e192414c83a61a045d3988 100644
--- a/osc/core.py
+++ b/osc/core.py
-@@ -6179,6 +6179,34 @@ def copy_pac(
+@@ -6245,6 +6245,34 @@ def copy_pac(
raise oscerr.APIError('failed to copy: %s' % ', '.join(todo))
return 'Done.'
diff --git a/0003-Support-synchronous-copyproj.patch b/0012-Support-synchronous-copyproj.patch
index 4c142b83f59d..fe15d5a1a32d 100644
--- a/0003-Support-synchronous-copyproj.patch
+++ b/0012-Support-synchronous-copyproj.patch
@@ -9,19 +9,19 @@ Subject: [PATCH] Support synchronous copyproj
2 files changed, 7 insertions(+)
diff --git a/osc/commandline.py b/osc/commandline.py
-index d7a6cc5d776b739a68f4c62fb15604795afba7f4..b43852914273326748a772b48402480952e28eab 100644
+index 7ad18e584ead6347ef67eb670ad53a6952d4e459..d1d95e6ea060a76c672ef30278ba5c75f46ad849 100644
--- a/osc/commandline.py
+++ b/osc/commandline.py
-@@ -3900,6 +3900,8 @@ Please submit there instead, or use --nodevelproject to force direct submission.
- )
+@@ -2100,6 +2100,8 @@ class Osc(cmdln.Cmdln):
+
@cmdln.option('-b', '--with-binaries', action='store_true',
help='copy the built binaries over to avoid a rebuild')
+ @cmdln.option('-n', '--now', action='store_true',
-+ help='copy synchronously (may take some time to complete)')
++ help='copy synchronously (may take some time to complete)')
@cmdln.option('-x', '--with-history', action='store_true',
help='replicate the history of each package.')
@cmdln.option('-o', '--make-older', action='store_true',
-@@ -3917,6 +3919,8 @@ Please submit there instead, or use --nodevelproject to force direct submission.
+@@ -2118,6 +2120,8 @@ class Osc(cmdln.Cmdln):
The user must be able to create DESTPRJ
@@ -29,8 +29,8 @@ index d7a6cc5d776b739a68f4c62fb15604795afba7f4..b43852914273326748a772b484024809
+
usage:
osc copyprj SOURCEPRJ DESTPRJ
- ${cmd_option_list}
-@@ -3946,6 +3950,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
+ """
+@@ -2146,6 +2150,7 @@ class Osc(cmdln.Cmdln):
withhistory = opts.with_history,
makeolder = opts.make_older,
resign = opts.re_sign,
@@ -39,10 +39,10 @@ index d7a6cc5d776b739a68f4c62fb15604795afba7f4..b43852914273326748a772b484024809
print("done cp")
print(r)
diff --git a/osc/core.py b/osc/core.py
-index 1eb1262150c0bb1e37814148eeae2436aa7e2484..72ffb62b06670c2f27cd87f80f783c47e993537e 100644
+index a0ab1ddff152332749e192414c83a61a045d3988..a0672d3338b777acda32fb02ac49ae02a3295c26 100644
--- a/osc/core.py
+++ b/osc/core.py
-@@ -6203,6 +6203,8 @@ def copy_prj(src_apiurl, src_project, dst_project,
+@@ -6269,6 +6269,8 @@ def copy_prj(src_apiurl, src_project, dst_project,
query['resign'] = '1'
if comment:
query['comment'] = comment
diff --git a/0004-Add-p-to-copyprj-to-enable-copying-of-prjconf.patch b/0013-Add-p-to-copyprj-to-enable-copying-of-prjconf.patch
index b6f38f9c0cca..8c8978d79cd3 100644
--- a/0004-Add-p-to-copyprj-to-enable-copying-of-prjconf.patch
+++ b/0013-Add-p-to-copyprj-to-enable-copying-of-prjconf.patch
@@ -4,15 +4,15 @@ Date: Fri, 15 May 2020 14:47:19 +0300
Subject: [PATCH] Add -p to copyprj to enable copying of prjconf
---
- osc/commandline.py | 4 +++-
+ osc/commandline.py | 3 +++
osc/core.py | 5 +++++
- 2 files changed, 8 insertions(+), 1 deletion(-)
+ 2 files changed, 8 insertions(+)
diff --git a/osc/commandline.py b/osc/commandline.py
-index b43852914273326748a772b48402480952e28eab..81ca666b6a59fb69a872ecf5c00eabd6d545fd79 100644
+index d1d95e6ea060a76c672ef30278ba5c75f46ad849..92eddde45027feb6d9730263c84a4dcdecdf47d5 100644
--- a/osc/commandline.py
+++ b/osc/commandline.py
-@@ -3906,6 +3906,8 @@ Please submit there instead, or use --nodevelproject to force direct submission.
+@@ -2106,6 +2106,8 @@ class Osc(cmdln.Cmdln):
help='replicate the history of each package.')
@cmdln.option('-o', '--make-older', action='store_true',
help='No idea')
@@ -21,20 +21,19 @@ index b43852914273326748a772b48402480952e28eab..81ca666b6a59fb69a872ecf5c00eabd6
@cmdln.option('-r', '--re-sign', action='store_true',
help='re-sign the binaries')
@cmdln.option('-m', '--message', metavar='TEXT',
-@@ -3950,7 +3952,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
- withhistory = opts.with_history,
+@@ -2151,6 +2153,7 @@ class Osc(cmdln.Cmdln):
makeolder = opts.make_older,
resign = opts.re_sign,
-- now = opts.now,
-+ now = opts.now, prjconf = opts.prjconf,
+ now = opts.now,
++ prjconf = opts.prjconf,
comment = comment)
print("done cp")
print(r)
diff --git a/osc/core.py b/osc/core.py
-index 72ffb62b06670c2f27cd87f80f783c47e993537e..52a59a51bd35625d4d64ab8581d41448c8604273 100644
+index a0672d3338b777acda32fb02ac49ae02a3295c26..b7a09c85b71bb403b0334dd51ca9c8754b7c0842 100644
--- a/osc/core.py
+++ b/osc/core.py
-@@ -6184,6 +6184,8 @@ def copy_prj(src_apiurl, src_project, dst_project,
+@@ -6250,6 +6250,8 @@ def copy_prj(src_apiurl, src_project, dst_project,
withhistory = False,
makeolder = False,
resign = False,
@@ -43,7 +42,7 @@ index 72ffb62b06670c2f27cd87f80f783c47e993537e..52a59a51bd35625d4d64ab8581d41448
comment = None):
"""
Create a copy of a project.
-@@ -6205,6 +6207,9 @@ def copy_prj(src_apiurl, src_project, dst_project,
+@@ -6271,6 +6273,9 @@ def copy_prj(src_apiurl, src_project, dst_project,
query['comment'] = comment
if now:
query['nodelay'] = '1'
diff --git a/0005-Add-support-for-rebuild-and-chroot-only-in-build.-re.patch b/0014-Add-support-for-rebuild-and-chroot-only-in-build.-re.patch
index 972417de7ba4..0864e854ff96 100644
--- a/0005-Add-support-for-rebuild-and-chroot-only-in-build.-re.patch
+++ b/0014-Add-support-for-rebuild-and-chroot-only-in-build.-re.patch
@@ -14,10 +14,10 @@ Subject: [PATCH] Add support for --rebuild and --chroot-only in build.
2 files changed, 10 insertions(+)
diff --git a/osc/build.py b/osc/build.py
-index b783b9c6d7e594f99abeb8e8b0308db82f1f0e18..6218d3f01d89ad54a0267433b59996b9ddd8ff92 100644
+index 429217916e4673cd67a954e57be04adb62b105ce..1afc2e76862793d3e0e2811b4aa86206ca352374 100644
--- a/osc/build.py
+++ b/osc/build.py
-@@ -687,6 +687,12 @@ def main(apiurl, opts, argv):
+@@ -699,6 +699,12 @@ def main(apiurl, store, opts, argv):
buildargs.append('--norootforbuild')
if opts.clean:
buildargs.append('--clean')
@@ -31,10 +31,10 @@ index b783b9c6d7e594f99abeb8e8b0308db82f1f0e18..6218d3f01d89ad54a0267433b59996b9
buildargs.append('--no-checks')
if not opts.no_changelog:
diff --git a/osc/commandline.py b/osc/commandline.py
-index 81ca666b6a59fb69a872ecf5c00eabd6d545fd79..ad8d0aaf1656f98883651e1341e7f3c2a6073ace 100644
+index 92eddde45027feb6d9730263c84a4dcdecdf47d5..90fc4aa23023883049949ec7cf54d311c69f94ea 100644
--- a/osc/commandline.py
+++ b/osc/commandline.py
-@@ -7034,6 +7034,10 @@ Please submit there instead, or use --nodevelproject to force direct submission.
+@@ -7100,6 +7100,10 @@ Please submit there instead, or use --nodevelproject to force direct submission.
help='Copy overlay filesystem to buildroot after installing all RPMs .')
@cmdln.option('--noinit', '--no-init', action='store_true',
help='Skip initialization of build root and start with build immediately.')
diff --git a/0006-Add-architecture-and-scheduler-maps.patch b/0015-Add-architecture-and-scheduler-maps.patch
index e38914d086bb..e38914d086bb 100644
--- a/0006-Add-architecture-and-scheduler-maps.patch
+++ b/0015-Add-architecture-and-scheduler-maps.patch
diff --git a/0016-Trap-any-kind-of-exception-during-plugin-parsing-eg-.patch b/0016-Trap-any-kind-of-exception-during-plugin-parsing-eg-.patch
new file mode 100644
index 000000000000..37c9c8b1a3a9
--- /dev/null
+++ b/0016-Trap-any-kind-of-exception-during-plugin-parsing-eg-.patch
@@ -0,0 +1,23 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Marko Lemmetty <marko.lemmetty@jollamobile.com>
+Date: Fri, 15 May 2020 15:44:22 +0300
+Subject: [PATCH] Trap any kind of exception during plugin parsing (eg IOError
+ for a dangling symlink)
+
+---
+ osc/commandline.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/osc/commandline.py b/osc/commandline.py
+index 90fc4aa23023883049949ec7cf54d311c69f94ea..d0d74d4f68a1a970cbc4b799ccd5da2f29bc6726 100644
+--- a/osc/commandline.py
++++ b/osc/commandline.py
+@@ -10121,7 +10121,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
+ if (inspect.isfunction(data) and inspect.getmodule(data) == mod
+ or inspect.ismodule(data)):
+ setattr(self.__class__, name, data)
+- except (SyntaxError, NameError, ImportError) as e:
++ except (SyntaxError, NameError, ImportError, IOError) as e:
+ if os.environ.get('OSC_PLUGIN_FAIL_IGNORE'):
+ print("%s: %s\n" % (os.path.join(plugin_dir, extfile), e), file=sys.stderr)
+ else:
diff --git a/0017-Fix-hdrmd5-check-of-downloaded-packages-from-DoD-rep.patch b/0017-Fix-hdrmd5-check-of-downloaded-packages-from-DoD-rep.patch
new file mode 100644
index 000000000000..b30d58e38006
--- /dev/null
+++ b/0017-Fix-hdrmd5-check-of-downloaded-packages-from-DoD-rep.patch
@@ -0,0 +1,46 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Daniel Mach <daniel.mach@suse.com>
+Date: Tue, 29 Mar 2022 09:59:08 +0200
+Subject: [PATCH] Fix hdrmd5 check of downloaded packages from DoD repos
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+(cherry picked from commit 8384a1fdff980590244c211024127542d08a9716)
+
+Re:
+openSUSE/osc#1016
+
+Signed-off-by: Björn Bidar <bjorn.bidar@jolla.com>
+---
+ osc/fetch.py | 16 +++++++++-------
+ 1 file changed, 9 insertions(+), 7 deletions(-)
+
+diff --git a/osc/fetch.py b/osc/fetch.py
+index bcee5dde4d975b314d98978673fe41726092215f..fd79979001fa709c74e47919692a0dbd8d98c0e2 100644
+--- a/osc/fetch.py
++++ b/osc/fetch.py
+@@ -271,14 +271,16 @@ class Fetcher:
+ # mark it for downloading from the API
+ self.__add_cpio(i)
+ else:
++ # if the checksum of the downloaded package doesn't match,
++ # delete it and mark it for downloading from the API
+ hdrmd5 = packagequery.PackageQuery.queryhdrmd5(i.fullfilename)
+- if hdrmd5 != i.hdrmd5:
+- if conf.config["api_host_options"][apiurl]["disable_hdrmd5_check"]:
+- print(f"Warning: Ignoring a hdrmd5 mismatch for {i.fullfilename}: {hdrmd5} (actual) != {i.hdrmd5} (expected)")
+- else:
+- print(f"The file will be redownloaded from the API due to a hdrmd5 mismatch for {i.fullfilename}: {hdrmd5} (actual) != {i.hdrmd5} (expected)")
+- os.unlink(i.fullfilename)
+- self.__add_cpio(i)
++
++ # packages with hdrmd5 == 'd0d...' come from 'download on demand' repos
++ # and their checksum is not known to the server yet, so we skip their checksum check
++ if hdrmd5 != i.hdrmd5 and i.hdrmd5 != 'd0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0':
++ print(f"The file will be redownloaded from the API due to a hdrmd5 mismatch for {i.fullfilename}: {hdrmd5} (actual) != {i.hdrmd5} (expected)")
++ os.unlink(i.fullfilename)
++ self.__add_cpio(i)
+
+ except KeyboardInterrupt:
+ print('Cancelled by user (ctrl-c)')
diff --git a/PKGBUILD b/PKGBUILD
index d1703848ac57..2dcea92ede82 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -6,7 +6,7 @@
# Contributor : Patrick McCarty <pnorcks at gmail dot com>
pkgname=osc
-pkgver=1.1.2
+pkgver=1.3.1
pkgrel=1
pkgdesc="Command line client for the openSUSE Build Service"
arch=(any)
@@ -25,26 +25,45 @@ 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"
- 0001-Add-sb2install-support-to-osc.patch
- 0002-Support-osc-copyprj-in-api-by-Islam-Amer-usage-osc-c.patch
- 0003-Support-synchronous-copyproj.patch
- 0004-Add-p-to-copyprj-to-enable-copying-of-prjconf.patch
- 0005-Add-support-for-rebuild-and-chroot-only-in-build.-re.patch
- 0006-Add-architecture-and-scheduler-maps.patch
+ 0001-Import-zsh-completition-made-by-Holger-Macht.patch
+ 0002-Fetch-project-list-in-zsh-completition-at-runtime.patch
+ 0003-Parse-pwd-s-apiurl-in-zsh-completion.patch
+ 0004-Fetch-project-repositories-list-for-zsh-completion.patch
+ 0005-Match-more-command-aliases-in-the-zsh-completion.patch
+ 0006-Refactor-help-text-generation-in-zsh-completition-so.patch
+ 0007-Complete-help-text-for-options-that-have-separate-ha.patch
+ 0008-Fetch-repository-architectures-in-zsh-completition.patch
+ 0009-Add-zsh-completion-for-build-command.patch
+ 0010-Add-sb2install-support-to-osc.patch
+ 0011-Support-osc-copyprj-in-api-by-Islam-Amer-usage-osc-c.patch
+ 0012-Support-synchronous-copyproj.patch
+ 0013-Add-p-to-copyprj-to-enable-copying-of-prjconf.patch
+ 0014-Add-support-for-rebuild-and-chroot-only-in-build.-re.patch
+ 0015-Add-architecture-and-scheduler-maps.patch
+ 0016-Trap-any-kind-of-exception-during-plugin-parsing-eg-.patch
+ 0017-Fix-hdrmd5-check-of-downloaded-packages-from-DoD-rep.patch
)
-sha256sums=('b2df7f9514175428a82e636365fa10c5dfed7497d742aff380e22c517064ee6a'
- '2b045e03d2fdce12683ceb9792d491a32f00b256045456412e7bc18c8726218a'
- '270e4998d3499ff42992cc9866025bb9d3976fcd922d3428d0bdaa066be52d59'
- '8176ec12b8f9e14ac655241d38aff1ed6797a3f684ba48a2f6dbea4ce988422c'
- '90072ef14c4b7d31ac79a6005f5b06d51d0a4051274ad2b70b7e7d6b6d13080f'
- '11318594468e017cee00ebbc5c0148808740557106279a4be6868851aebb2606'
- '68a9ff708c067b89430e894df941b76e6dcb499eef0b384afb762cd72bd7f721'
- 'eae5f978b8385db3acae46df96fc4973f306c4a640389165a8ac54469d370e5b')
+sha256sums=('6fb9fee8dfd86276632d6a7a25169f34bec1bc251c79161b5f096a9ebde51cd8'
+ '6d0343bd5254bebf4feb972b198953f7faa977411d007f7d432ed8b969ef20dd'
+ '60e861db1a13b3a0dce8d9630bc77f023773c550558a2f2f5d144f56bcb01f49'
+ '89d7acdb5dd2ad996f438681d16fca7d8a7fcccc0c9947647a24a93ff0820295'
+ '278e8da8f3010de09e031d90cf759d24d68bd44eba9dbbef9aa78abb11e13f31'
+ 'f3871ab614898a9a71ccb5545211aefa8bbacebf9500126c2a1d07c2c939b29c'
+ '794b07b4edc5a0a53f6780a3c9b8442264d960ceae525b7ca9407b1b853c009c'
+ '88ad2c7135f972e69b0188f3f10f4907a0e5dda3bf06a80656f4772339cbfb4d'
+ '33fc7b90ca2b14b66622816a895f60051f6c4dce6d843504ff4d125728043a56'
+ '5fab7671bd4e4aa52930f9e52a0b1fbb6187df1ca6a8d3e975beeccc3016938e'
+ '19829c5586774b65321a0c27539ce6c3d5de041faeb77efff38c00c952e36b67'
+ '705395902faf621929d921e414551d14998b6daf22f0732253a648b655d448e2'
+ '8ca69c2797f933e7fe7c6b4452d4ce848dbb26a35d1b143fd8017cd91f5061b8'
+ '4b079b31fe946c7bf595494fab2f84cc3c094354daf8d1df4d9d5615fb0f06a9'
+ '8c05cda87e16283af460d56113666b9f7896f1e77b9055da00d9f45d971bcd7c'
+ 'eae5f978b8385db3acae46df96fc4973f306c4a640389165a8ac54469d370e5b'
+ 'e690cc2396b42e2f85e961595526e056f86dd850d2b2c74178381d89d33afb6a'
+ '67c916cd7ba9dcd4899477c223c79f7087c0a0077d33f95ccb465b790e052547')
prepare() {
# Add 'Arch_Core' and 'Arch_Extra' as osc build targets
- sed -i "s|SLE_11_SP2|SLE_11_SP2 Arch_Core Arch_Extra|" _osc
cd "${srcdir}/${pkgname}-${pkgver}"
for patch in "$srcdir"/*.patch; do
@@ -66,8 +85,7 @@ package() {
python setup.py install --root="${pkgdir}/" --optimize=1 --prefix=/usr
install -Dm644 contrib/complete.sh "${pkgdir}/usr/share/bash-completion/completions/osc"
- install -Dm755 contrib/osc.complete "${pkgdir}/usr/lib/osc/complete"
- install -Dm644 ../_osc "${pkgdir}/usr/share/zsh/site-functions/_osc"
+ install -Dm755 contrib/osc.zsh "${pkgdir}/usr/share/zsh/site-functions/_osc"
}
# vim:set sts=2 ts=2 sw=2 et:
diff --git a/_osc b/_osc
deleted file mode 100644
index 74f2432b803a..000000000000
--- a/_osc
+++ /dev/null
@@ -1,147 +0,0 @@
-#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 "$@"