commit: 6b7d32701845ce0167fc31b09f613677b481ae03 Author: Samuel Bernardo <samuelbernardo.mail <AT> gmail <DOT> com> AuthorDate: Thu Jul 9 23:58:04 2020 +0000 Commit: Samuel Bernardo <samuelbernardo.mail <AT> gmail <DOT> com> CommitDate: Thu Jul 9 23:58:04 2020 +0000 URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=6b7d3270
dev-util/osc: Add this package again to Gentoo that lost maintainer Package-Manager: Portage-2.3.99, Repoman-2.3.23 Signed-off-by: Samuel Bernardo <samuelbernardo.mail <AT> gmail.com> dev-util/osc/Manifest | 1 + dev-util/osc/files/osc.zsh_completion | 147 ++++++++++++++++++++++++++++++++++ dev-util/osc/metadata.xml | 13 +++ dev-util/osc/osc-0.169.1.ebuild | 70 ++++++++++++++++ dev-util/osc/osc-9999.ebuild | 1 + 5 files changed, 232 insertions(+) diff --git a/dev-util/osc/Manifest b/dev-util/osc/Manifest new file mode 100644 index 0000000..43866cf --- /dev/null +++ b/dev-util/osc/Manifest @@ -0,0 +1 @@ +DIST 0.169.1.tar.gz 357179 BLAKE2B d65b6b238aff7cd9c4e5e1509318bfcb4bccdb00c363485c4ae106fab40051f9e5f5b4b76baca3ac25b0cf64d66d0003b3580fcd930511aa6ea7c8d36d7f50e7 SHA512 9429864bcc61c47505c8924cdf35164289f55adf890bc6f28e3fb6063438a53722384594512e3c12662dffc1d31b84f2b292af873d72b3de552a27aa4403ab16 diff --git a/dev-util/osc/files/osc.zsh_completion b/dev-util/osc/files/osc.zsh_completion new file mode 100644 index 0000000..74f2432 --- /dev/null +++ b/dev-util/osc/files/osc.zsh_completion @@ -0,0 +1,147 @@ +#compdef osc +# +# Copyright (C) 2009,2010 Holger Macht <hol...@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 "$@" diff --git a/dev-util/osc/metadata.xml b/dev-util/osc/metadata.xml new file mode 100644 index 0000000..0bcb748 --- /dev/null +++ b/dev-util/osc/metadata.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person"> + <email>samuelbernardo.m...@gmail.com</email> + <name>Samuel Bernardo</name> + </maintainer> + <longdescription lang="en"> + Subversion-like client for Open Build Service - http://open-build-service.org/ It serves as client for the source code repository part of the build service, and it is used to edit metadata or query about build results. + </longdescription> +</pkgmetadata> + +<!-- vim:set sts=2 ts=2 sw=2 et: --> diff --git a/dev-util/osc/osc-0.169.1.ebuild b/dev-util/osc/osc-0.169.1.ebuild new file mode 100644 index 0000000..cac3c5d --- /dev/null +++ b/dev-util/osc/osc-0.169.1.ebuild @@ -0,0 +1,70 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PYTHON_COMPAT=( python3_{6,7,8} ) +PYTHON_REQ_USE="xml" + +if [[ "${PV}" == "9999" ]]; then + EGIT_REPO_URI="https://github.com/openSUSE/${PN}.git" + EXTRA_ECLASS="git-r3" +else + SRC_URI="https://github.com/openSUSE/${PN}/archive/${PV}.tar.gz" + OBS_PROJECT="openSUSE:Tools" +fi + +DISTUTILS_SINGLE_IMPL=1 +inherit distutils-r1 ${EXTRA_ECLASS} +unset EXTRA_ECLASS + +DESCRIPTION="Command line tool for Open Build Service" +HOMEPAGE="https://en.opensuse.org/openSUSE:OSC" + +LICENSE="GPL-2" +SLOT="0" +IUSE="" + +# Don't move KEYWORDS on the previous line or ekeyword won't work # 399061 +[[ "${PV}" == "9999" ]] || \ +KEYWORDS="~amd64 ~x86" + +RDEPEND=" + app-arch/rpm[python,${PYTHON_SINGLE_USEDEP}] + $(python_gen_cond_dep ' + dev-python/m2crypto[${PYTHON_USEDEP}] + ') + ${PYTHON_SINGLE_DEPS} +" + +BDEPEND=" + $(python_gen_cond_dep ' + >=dev-python/setuptools_scm-1.15.0[${PYTHON_USEDEP}] + ') + test? ( + ${RDEPEND} + $(python_gen_cond_dep ' + dev-python/path-py[${PYTHON_USEDEP}] + ') + ) +" + +distutils_enable_tests pytest + +src_prepare() { + distutils-r1_src_prepare +} + +src_install() { + distutils-r1_src_install + dosym osc-wrapper.py /usr/bin/osc + rm -f "${ED}"/usr/share/doc/${PN}*/TODO* + insinto /usr/share/bash-completion/completions + newins dist/complete.sh osc + insinto /usr/lib/osc + newins dist/osc.complete complete + insinto /usr/share/zsh/site-functions + newins ${FILESDIR}/osc.zsh_completion _osc +} + +# vim:set sts=2 ts=2 sw=2 et: diff --git a/dev-util/osc/osc-9999.ebuild b/dev-util/osc/osc-9999.ebuild new file mode 120000 index 0000000..bbd5538 --- /dev/null +++ b/dev-util/osc/osc-9999.ebuild @@ -0,0 +1 @@ +osc-0.169.1.ebuild \ No newline at end of file