diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2018-07-31 14:41:36 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2018-07-31 14:41:36 -0400 |
commit | 12a6aad73c4d48a89e020899b643ea495143e298 (patch) | |
tree | dcce42b77a3f6ede208b30fd476ede7938124ed7 /src | |
parent | 64a2d1c9fb7900c2002ce3871444d06d93854538 (diff) |
Begone with XBS
Diffstat (limited to 'src')
-rw-r--r-- | src/Makefile | 3 | ||||
-rwxr-xr-x | src/abslibre-tools/createworkdir | 4 | ||||
-rwxr-xr-x | src/abslibre-tools/librerelease | 6 | ||||
-rw-r--r-- | src/lib/conf.sh.3.ronn | 4 | ||||
-rw-r--r-- | src/lib/conf.sh.in | 7 | ||||
-rw-r--r-- | src/libretools.conf | 5 | ||||
-rw-r--r-- | src/xbs-abs/.gitignore | 3 | ||||
l--------- | src/xbs-abs/GNUmakefile | 1 | ||||
-rw-r--r-- | src/xbs-abs/Makefile | 33 | ||||
-rwxr-xr-x | src/xbs-abs/helper-abs | 203 | ||||
-rw-r--r-- | src/xbs-abs/xbs-abs.conf | 16 | ||||
l--------- | src/xbs-abslibre/GNUmakefile | 1 | ||||
-rw-r--r-- | src/xbs-abslibre/Makefile | 10 | ||||
-rwxr-xr-x | src/xbs-abslibre/helper-abslibre | 203 | ||||
l--------- | src/xbs/GNUmakefile | 1 | ||||
-rw-r--r-- | src/xbs/Makefile | 7 | ||||
-rwxr-xr-x | src/xbs/xbs | 182 | ||||
-rw-r--r-- | src/xbs/xbs.conf | 4 |
18 files changed, 7 insertions, 686 deletions
diff --git a/src/Makefile b/src/Makefile index e148732..397a9bb 100644 --- a/src/Makefile +++ b/src/Makefile @@ -10,8 +10,5 @@ nested.subdirs += gitget nested.subdirs += lib nested.subdirs += librefetch nested.subdirs += toru -nested.subdirs += xbs -nested.subdirs += xbs-abs -nested.subdirs += xbs-abslibre include $(topsrcdir)/build-aux/Makefile.tail.mk diff --git a/src/abslibre-tools/createworkdir b/src/abslibre-tools/createworkdir index a3fae88..0cf4a7a 100755 --- a/src/abslibre-tools/createworkdir +++ b/src/abslibre-tools/createworkdir @@ -29,7 +29,7 @@ set -euE . "$(librelib conf)" main() { - load_conf libretools.conf WORKDIR ABSLIBRERECV ABSLIBRESEND || exit # these are asked for by `xbs download` + load_conf libretools.conf WORKDIR ABSLIBRERECV ABSLIBRESEND trap 'error "Aborting..."' EXIT @@ -39,7 +39,7 @@ main() { msg "Creating staging directory in WORKDIR..." mkdir -p "$WORKDIR/staging" - cmd=(xbs -b abslibre download) + cmd=(gitget -f -p "$ABSLIBRESEND" checkout "$ABSLIBRERECV" "$WORKDIR/abslibre") if ! "${cmd[@]}"; then error "Could not clone ABSLibre" plain "Try running this command:" diff --git a/src/abslibre-tools/librerelease b/src/abslibre-tools/librerelease index d7dbbe4..705efc5 100755 --- a/src/abslibre-tools/librerelease +++ b/src/abslibre-tools/librerelease @@ -84,9 +84,7 @@ create_signature() { sign_packages() { IFS=$'\n' - local files=($(find "${WORKDIR}/staging/" \ - \( -type d -name "${ABSLIBREDEST##*/}" \) -prune \ - -o \( -type f -not -iname '*.sig' \) -print)) + local files=($(find "${WORKDIR}/staging/" -type f -not -iname '*.sig' -print)) local file for file in "${files[@]}"; do if [[ -f "${file}.sig" ]]; then @@ -167,7 +165,7 @@ main() { declare -i ret=0 load_conf makepkg.conf GPGKEY || ret=$? - load_conf libretools.conf WORKDIR REPODEST ABSLIBREDEST || ret=$? # and HOOK{PRE,POST}RELEASE, which are optional + load_conf libretools.conf WORKDIR REPODEST || ret=$? # and HOOK{PRE,POST}RELEASE, which are optional [[ $ret = 0 ]] || exit $ret local re_url='^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$' diff --git a/src/lib/conf.sh.3.ronn b/src/lib/conf.sh.3.ronn index 92267fb..ad146da 100644 --- a/src/lib/conf.sh.3.ronn +++ b/src/lib/conf.sh.3.ronn @@ -105,8 +105,8 @@ These two routines deal with loading `PKGBUILD`(5) files. The differences in behavior for anything that takes a slug comes down to the differences in the output for `list_files` and `list_envvars`. -The "known" slugs are "abs", "makepkg", "libretools", and anything -beginning with "xbs". If anything else is given, then: +The "known" slugs are "abs", "makepkg", and "libretools". If anything +else is given, then: * `list_files` will give back "/etc/libretools.d/<SLUG>.conf" and "$<XDG_CONFIG_HOME>/libretools/<SLUG>.conf" diff --git a/src/lib/conf.sh.in b/src/lib/conf.sh.in index 36efe21..0cd0a03 100644 --- a/src/lib/conf.sh.in +++ b/src/lib/conf.sh.in @@ -66,10 +66,6 @@ list_files() { fi fi ;; - xbs*) - echo "${sysconfdir}/xbs/$slug.conf" - echo "$XDG_CONFIG_HOME/xbs/$slug.conf" - ;; libretools) echo "${sysconfdir}/$slug.conf" echo "$XDG_CONFIG_HOME/libretools/$slug.conf" @@ -98,9 +94,6 @@ list_envvars() { libretools) printf '%s\n' DIFFPROG ;; - xbs) - printf '%s\n' BUILDSYSTEM - ;; *) :;; esac } diff --git a/src/libretools.conf b/src/libretools.conf index 3ba13bf..e0789bb 100644 --- a/src/libretools.conf +++ b/src/libretools.conf @@ -17,12 +17,9 @@ BLACKLIST=https://git.parabola.nu/blacklist.git/plain/blacklist.txt DIFFPROG=$(which $([ -z "${DISPLAY:-}" ]||echo kdiff3 meld gvimdiff) vimdiff colordiff diff 2>/dev/null|sed 's/\s.*//;1q') ## ABSLibre -## Used by xbs-abslibre +## Used by: `createworkdir` ABSLIBRERECV=git://git.parabola.nu/abslibre/abslibre.git ABSLIBRESEND=ssh://git@git.parabola.nu:1863/~git/abslibre/abslibre.git -ABSLIBREDEST="$WORKDIR/staging/abslibre" -## ARCHES is the list of ARCHES to look for under ABSLIBREDEST -ARCHES=($(printf '%s\n' /usr/share/pacman/defaults/pacman.conf.*|sed 's|.*\.||')) ################################################################################ # librerelease # diff --git a/src/xbs-abs/.gitignore b/src/xbs-abs/.gitignore deleted file mode 100644 index 86e1bff..0000000 --- a/src/xbs-abs/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -commitpkg* -archrelease* -valid-tags.sh* diff --git a/src/xbs-abs/GNUmakefile b/src/xbs-abs/GNUmakefile deleted file mode 120000 index 54fdd42..0000000 --- a/src/xbs-abs/GNUmakefile +++ /dev/null @@ -1 +0,0 @@ -../../GNUmakefile
\ No newline at end of file diff --git a/src/xbs-abs/Makefile b/src/xbs-abs/Makefile deleted file mode 100644 index 907b3d0..0000000 --- a/src/xbs-abs/Makefile +++ /dev/null @@ -1,33 +0,0 @@ -include $(dir $(lastword $(MAKEFILE_LIST)))/../../config.mk -include $(topsrcdir)/build-aux/Makefile.head.mk - -libretools.pkg = xbs -pkgconfdir = $(sysconfdir)/xbs -pkglibexecdir = $(libexecdir)/xbs - -_helpers = archrelease commitpkg - -libretools.pots += $(_helpers) -libretools.src.devtools += $(addsuffix .in,$(_helpers)) valid-tags.sh - -libretools.out.bins = -libretools.out.libexecs = helper-abs -libretools.out.libs = valid-tags.sh - -files.out.xbs += $(_helpers) -files.sys.xbs += $(addprefix $(pkglibexecdir)/helper-abs.d/,$(_helpers)) - -$(outdir)/commitpkg: $(srcdir)/commitpkg.in - @echo "OUT $@" - @{ \ - echo '#!/usr/bin/env bash'; \ - echo '. "$$(librelib common)"'; \ - echo '. ./PKGBUILD'; \ - echo 'repo=$$1; arch=$$2;'; \ - sed -n "/== 'any'/,\$$p" $<; \ - } | install -Dm755 /dev/stdin $@ - -$(DESTDIR)$(pkglibexecdir)/helper-abs.d/%: $(srcdir)/% - install -Dm755 '$<' '$@' - -include $(topsrcdir)/build-aux/Makefile.tail.mk diff --git a/src/xbs-abs/helper-abs b/src/xbs-abs/helper-abs deleted file mode 100755 index b410559..0000000 --- a/src/xbs-abs/helper-abs +++ /dev/null @@ -1,203 +0,0 @@ -#!/usr/bin/env bash - -# Copyright (C) 2013-2014, 2017-2018 Luke Shumaker <lukeshu@parabola.nu> -# -# For code from db-functions (arch_svn): -# Copyright (C) 2012 Pierre Schmitz <pierre@archlinux.de> -# For code from db-move+db-remove (move+unrelease): -# Copyright (C) 2008-2009 Aaron Griffin <aaronmgriffin@gmail.com> -# Copyright (C) 2009 Abhishek Dasgupta <abhidg@gmail.com> -# Copyright (C) 2009, 2011 Dan McGee <dan@archlinux.org> -# Copyright (C) 2009-2012 Pierre Schmitz <pierre@archlinux.de> -# For code just from db-move (move): -# Copyright (C) 2011 Rémy Oudompheng <remyoudompheng@gmail.com> -# Copyright (C) 2012 Florian Pritz <bluewind@xinu.at> -# For code just from db-remove (unrelease): -# Copyright (C) 2009 Eric Bélanger <snowmaniscool@gmail.com> -# Copyright (C) 2011 Florian Pritz <bluewind@xinu.at> -# -# License: GNU GPLv2+ -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. - -. "$(librelib common)" - -load_config() { - . "$(librelib conf)" - # SVNUSER is optional - load_conf xbs-abs.conf SVNDIR SVNREPOS ARCHES || exit -} - -# This is taken from dbscripts:db-fuctions -arch_svn() { - if [[ -z "${SVNUSER}" ]]; then - /usr/bin/svn "${@}" - else - sudo -u "${SVNUSER}" -- /usr/bin/svn --username "${USER}" "${@}" - fi -} - -pac2svn() { - local pacrepo=$1 - - # Figure out which svn repo we need - local repo_spec repo_name repo_svnurl repo_pacrepos - for repo_spec in "${SVNREPOS[@]}"; do - read -r repo_name repo_svnurl repo_pacrepos <<<"$repo_spec" - read -ra repo_pacrepos <<<"$repo_pacrepos" - - if in_array "$pacrepo" "${repo_pacrepos[@]}"; then - echo "$repo_name" - return 0 # $EXIT_SUCCESS - fi - done - return 1 # $EXIT_FAILURE -} - -status() { - load_config - [[ -z $(arch_svn status -q) ]] -} - -download() { - load_config - - local svnrepoStr - for svnrepoStr in "${SVNREPOS[@]}"; do - local svnrepoAry=($svnrepoStr) - local svnrepo=${svnrepoAry[0]} - local svnurl=${svnrepoAry[1]} - local pacrepos=("${svnrepoAry[@]:2}") - - if [[ -d "$SVNDIR/$svnrepo/.svn" ]]; then - arch_svn -q up "$SVNDIR/$svnrepo"/* - else - # checkout non-recursive, then lazy load - # necessary because: - # > DO NOT CHECK OUT THE ENTIRE SVN REPO. Your address - # > may be blocked. - arch_svn -q checkout -N "$svnurl" "$SVNDIR/$svnrepo" - fi - done -} - -release-client() { - local repo=$1 - local arch=$2 - - # Hack to use arch_svn as 'svn' in external scripts - local tmpdir; tmpdir="$(mktemp -dt "xbs-abs-release.XXXXXXXXXX")" - trap "$(printf 'rm -rf -- %q' "$tmpdir")" EXIT - printf '%s\n' \ - '#!/bin/bash' \ - "$(declare -p SVNUSER 2>/dev/null)" \ - "$(declare -f arch_svn)" \ - 'arch_svn "$@"' \ - > "$tmpdir/svn" - chmod 755 "$tmpdir/svn" - export PATH="$tmpdir:$PATH" - - "${0}.d/archrelease" -f "${repo}-${arch}" - "${0}.d/commitpkg" "${repo}" "${arch}" -} - -release-server() { - # Do nothing - : -} - -unrelease() { - local pkgbase=$1 - local repo=$2 - local arch=$3 - - local tag="$repo-$arch" - - load_config - local svndir - svndir="${SVNDIR}/$(pac2svn "$repo")/${pkgbase}" - arch_svn up -q "$svndir" - - # This is based off code from dbscripts:db-remove - arch_svn rm --force -q "${svndir}/repos/${tag}" - arch_svn commit -q "${svndir}" -m "${0##*/}: $pkgbase removed by $(id -un)" -} - -move() { - local repo_from=$1 - local repo_to=$2 - local pkgbase=$3 - - load_config - local svndir - svndir="${SVNDIR}/$(pac2svn "$repo_from")/${pkgbase}" - arch_svn up -q "$svndir" - - local tag_list="" - local pkgarch - local arches=() - # this is based off code from dbscripts:db-move - for pkgarch in "${ARCHES[@]}" 'any'; do - local dir_from="${svndir}/repos/${repo_from}-${pkgarch}" - local dir_to="${svndir}/repos/${repo_to}-${pkgarch}" - - if [ -f "${dir_from}/PKGBUILD" ]; then - if [ -d "${dir_to}" ]; then - for file in $(arch_svn ls "${dir_to}"); do - arch_svn rm -q "${dir_to}/$file@" - done - else - mkdir "${dir_to}" - arch_svn add -q "${dir_to}" - fi - - local file - for file in $(arch_svn ls "${dir_from}"); do - arch_svn mv -q -r HEAD "${dir_from}/$file@" "${dir_to}/" - done - arch_svn rm --force -q "${dir_from}" - tag_list="$tag_list, $pkgarch" - arches+=("$pkgarch") - fi - done - tag_list="${tag_list#, }" - arch_svn commit -q "${svndir}" -m "${0##*/}: moved ${pkgbase} from [${repo_from}] to [${repo_to}] (${tag_list})" - echo "${arches[*]}" -} - -releasepath() { - local pkgbase=$1 - local repo=$2 - local arch=$3 - - load_config - local svndir releasepath - svndir="${SVNDIR}/$(pac2svn "$repo")/${pkgbase}" - arch_svn up -q "${svndir}" - releasepath="${svndir}/repos/${repo}-${arch}" - if [[ -f "${releasepath}/PKGBUILD" ]]; then - printf '%s\n' "$releasepath" - return 0 # $EXIT_SUCCESS - fi - return 1 # $EXIT_FAILURE -} - -name() { - echo SVN -} - -case "$1" in - status|download|release-client|release-server|unrelease|move|releasepath|name) "$@";; - *) exit 127;; -esac diff --git a/src/xbs-abs/xbs-abs.conf b/src/xbs-abs/xbs-abs.conf deleted file mode 100644 index f8a5bf9..0000000 --- a/src/xbs-abs/xbs-abs.conf +++ /dev/null @@ -1,16 +0,0 @@ -#!/hint/bash -# shellcheck disable=2034 - -SVNDIR=/var/lib/xbs-abs -#SVNUSER= - -_packages_repos=(core extra testing staging {gnome,kde}-unstable) -_community_repos=({community,multilib}{,-testing,-staging}) - -# name url repos... -SVNREPOS=( - "packages svn://svn.archlinux.org/packages ${_packages_repos[*]}" - "community svn://svn.archlinux.org/community ${_community_repos[*]}" -) - -ARCHES=(i686 x86_64) diff --git a/src/xbs-abslibre/GNUmakefile b/src/xbs-abslibre/GNUmakefile deleted file mode 120000 index 54fdd42..0000000 --- a/src/xbs-abslibre/GNUmakefile +++ /dev/null @@ -1 +0,0 @@ -../../GNUmakefile
\ No newline at end of file diff --git a/src/xbs-abslibre/Makefile b/src/xbs-abslibre/Makefile deleted file mode 100644 index 068e6e4..0000000 --- a/src/xbs-abslibre/Makefile +++ /dev/null @@ -1,10 +0,0 @@ -include $(dir $(lastword $(MAKEFILE_LIST)))/../../config.mk -include $(topsrcdir)/build-aux/Makefile.head.mk - -libretools.pkg = xbs -pkglibexecdir = $(libexecdir)/xbs - -libretools.out.bins = -libretools.out.libexecs = helper-abslibre - -include $(topsrcdir)/build-aux/Makefile.tail.mk diff --git a/src/xbs-abslibre/helper-abslibre b/src/xbs-abslibre/helper-abslibre deleted file mode 100755 index eeef4bf..0000000 --- a/src/xbs-abslibre/helper-abslibre +++ /dev/null @@ -1,203 +0,0 @@ -#!/usr/bin/env bash - -# Copyright (C) 2012-2017 Luke Shumaker <lukeshu@parabola.nu> -# -# License: GNU GPLv2+ -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. - -. "$(librelib messages)" -setup_traps -set -u - -lockarch() { - local arch=$1 - lock 9 "${ABSLIBREDEST}/${arch}.lock" \ - "Waiting for a lock on the ABSLibre release directory for %s" "${arch}" -} - -unlockarch() { - lock_close 9 -} - -checkgit() { - if [[ ! -d "${ABSLIBREDEST}/${arch}/.git" ]]; then - error 'Not a git repository: %s' "${ABSLIBREDEST}/${arch}" - exit $EXIT_FAILURE - fi -} - -conf() { - . "$(librelib conf)" - load_conf libretools.conf || exit -} - -################################################################################ - -# Operates on the `abslibre` format[0]. On the client/developer side, -# release-client *copies* files from the `abslibre` tree to an -# `abstree`[1] tree located at `devbox:${ABSLIBREDEST}/${arch}`. On -# the server side, after those `abstree`s have been uploaded -# (ssh/rsync), release-server *copies* them out of the `abstree` into -# a different `abslibre` on the server, similarly located at -# `repobox:${ABSLIBREDEST}/${arch}`. -# -# [0]: https://projects.parabola.nu/packages/pbs-tools.git/tree/docs/format-abslibre.md -# [1]: https://projects.parabola.nu/packages/pbs-tools.git/tree/docs/format-abstree.md - -# The number of arguments and CWD constraints are enforced by the main -# XBS program, no need to check those things here! - -# Args: none -# CWD: a directory with a PKGBUILD, in an 'abslibre' tree. -status() { - [[ -z $(git status -s .) ]] -} - -# Args: none -# CWD: anywhere -# Host: developer box -download() { - conf WORKDIR ABSLIBRERECV ABSLIBRESEND - - gitget -f -p "$ABSLIBRESEND" checkout "$ABSLIBRERECV" "$WORKDIR/abslibre" -} - -# Args: REPO ARCH -# CWD: a directory with a PKGBUILD, in an 'abslibre' tree. -# Host: developer box -release-client() { - local repo=$1 - local arch=$2 - - conf ABSLIBREDEST - local pkgbase pkgdir - pkgbase="$(load_PKGBUILD >/dev/null; printf '%s\n' "${pkgbase:-${pkgname}}")" - pkgdir="${ABSLIBREDEST}/${arch}/${repo}/${pkgbase}" - lockarch "$arch" - - if [[ -e $pkgdir ]]; then - rm -rf -- "$pkgdir" - fi - - mkdir -p -- "$pkgdir" - git ls-files -z | xargs -0 -I{} cp -- {} "$pkgdir" -} - -# Args: REPO ARCH -# CWD: a directory with a PKGBUILD, outside of ${ABSLIBREDEST} -# Host: repo -release-server() { - local repo=$1 - local arch=$2 - - conf ABSLIBREDEST - local pkgbase pkgdir - pkgbase="$(load_PKGBUILD >/dev/null; printf '%s\n' "${pkgbase:-${pkgname}}")" - pkgdir="${ABSLIBREDEST}/${arch}/${repo}/${pkgbase}" - lockarch "$arch" - checkgit - - if [[ -e $pkgdir ]]; then - rm -rf -- "$pkgdir" - fi - - mkdir -p -- "$pkgdir" - cp -- * "$pkgdir" - - cd "$pkgdir" - git add . - git commit -q -m "xbs-abslibre: Release ${repo}/${pkgbase} for ${arch} (by $(id -un))" -} - -# Args: PKGBASE REPO ARCH -# CWD: anywhere -# Host: repo -unrelease() { - local pkgbase=$1 - local repo=$2 - local arch=$3 - - conf ABSLIBREDEST - local pkgdir="${ABSLIBREDEST}/${arch}/${repo}/${pkgbase}" - lockarch "$arch" - checkgit - - if [[ -f "${pkgdir}/PKGBUILD" ]]; then - git rm -qrf -- "$pkgdir" - git commit -q -m "xbs-abslibre: Remove ${repo}/${pkgbase} from ${arch} (by $(id -un))" - fi -} - -# Args: FROMREPO TOREPO PKGBASE -# CWD: anywhere -# Host: repo -move() { - local repo_from=$1 - local repo_to=$2 - local pkgbase=$3 - - conf ABSLIBREDEST ARCHES - - # Execute each iteration in a subshell so that 'checkgit' - # bailing for an architecture doesn't abort the entire thing. - local arch - for arch in "${ARCHES[@]}" any; do ( - lockarch "$arch" - checkgit - - local dir_from="${ABSLIBREDEST}/${arch}/${repo_from}/${pkgbase}" - local dir_to="${ABSLIBREDEST}/${arch}/${repo_to}/${pkgbase}" - - if [[ -f "${dir_from}/PKGBUILD" ]]; then - if [[ -e "${dir_to}" ]]; then - git rm -qrf -- "$dir_to" - fi - mkdir -p -- "${dir_to%/*}" - git mv -- "$dir_from" "$dir_to" - git commit -q -m "xbs-abslibre: Move ${pkgbase} from ${repo_from} to ${repo_to} on ${arch} (by $(id -un))" - fi - unlock arch - ) done -} - -# Args: PKGBASE REPO ARCH -# CWD: anywhere -# Host: repo -releasepath() { - local pkgbase=$1 - local repo=$2 - local arch=$3 - - conf ABSLIBREDEST - local pkgdir="${ABSLIBREDEST}/${arch}/${repo}/${pkgbase}" - - lockarch "$arch" - - if [[ -f "${pkgdir}/PKGBUILD" ]]; then - printf '%s\n' "$pkgdir" - return $EXIT_SUCCESS - fi - - return $EXIT_FAILURE -} - -name() { - echo ABSLibre -} - -case "$1" in - status|download|release-client|release-server|unrelease|move|releasepath|name) "$@" || exit;; - *) exit 127;; -esac diff --git a/src/xbs/GNUmakefile b/src/xbs/GNUmakefile deleted file mode 120000 index 54fdd42..0000000 --- a/src/xbs/GNUmakefile +++ /dev/null @@ -1 +0,0 @@ -../../GNUmakefile
\ No newline at end of file diff --git a/src/xbs/Makefile b/src/xbs/Makefile deleted file mode 100644 index 6a39658..0000000 --- a/src/xbs/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -include $(dir $(lastword $(MAKEFILE_LIST)))/../../config.mk -include $(topsrcdir)/build-aux/Makefile.head.mk - -libretools.pkg = xbs -pkgconfdir = $(sysconfdir)/xbs - -include $(topsrcdir)/build-aux/Makefile.tail.mk diff --git a/src/xbs/xbs b/src/xbs/xbs deleted file mode 100755 index cb02a99..0000000 --- a/src/xbs/xbs +++ /dev/null @@ -1,182 +0,0 @@ -#!/usr/bin/env bash - -# Copyright (C) 2013-2015, 2017-2018 Luke Shumaker <lukeshu@parabola.nu> -# -# License: GNU GPLv2+ -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. - -default_libdir=/usr/lib/xbs - -. "$(librelib messages)" -. "$(librelib conf)" - -errusage() { - if [[ $# -gt 0 ]]; then - error "$@" - fi - usage >&2 - exit $EXIT_INVALIDARGUMENT -} - -usage() { - print 'Usage: %s [-b BUILDSYSTEM|-h] COMMAND [ARGUMENTS]' "${0##*/}" - print 'Tool for working with arbitrary ABS-like build systems' - echo - prose 'This is a pluggable tool. The BUILDSYSTEM it uses is - configured in:' - bullet '%s' '/etc/xbs/xbs.conf' - bullet '%s' '${XDG_CONFIG_HOME}/xbs/xbs.conf' - bullet 'with the `-b` flag' - prose 'Later items take precedence over earlier ones.' - echo - prose 'It looks for a helper programs named helper-${BUILDSYSTEM}, in - the directory `%q` by default, but this directory can be changed - with the environmental variable XBS_LIBDIR.' "$default_libdir" - echo - print 'Options:' - flag "-b $(_ BUILDSYSTEM)" 'Use BUILDSYSTEM instead of the one - configured in xbs.conf' \ - '-h' 'Show this message' - echo - prose "Whether a command is intended for use on a developer's box or on - the server is indicated by (dev), (srv), or (any) before the - command" - echo - print 'Commands:' - flag "$(_ '(dev) status')" \ - 'Are there uncommitted changes in `.`?' \ - "$(_ '(dev) download')" \ - 'Download or update the tree' \ - "$(_ '(dev) release-client REPO ARCH')" \ - 'Release `.` (for developer boxes)' \ - "$(_ '(srv) release-server REPO ARCH')" \ - 'Release `.` (for server boxes)' \ - "$(_ '(srv) unrelease PKGBASE REPO ARCH')" \ - 'Unrelease a pkgbase' \ - "$(_ '(srv) move FROMREPO TOREPO PKGBASE')" \ - 'Move a pkgbase from one repo to another' \ - "$(_ '(srv) releasepath PKGBASE REPO ARCH')" \ - 'Print the path to the staged version of pkgbase, or exit with - non-zero if not released' \ - "$(_ '(any) name')" \ - 'Print a human-friendly version of the BUILDSYSTEM name' \ - "$(_ '(any) help')" \ - 'Show this message' -} - -status() { - if [[ ! -f PKGBUILD ]]; then - error 'PKGBUILD not found' - # Though in this file in general it doesn't matter, in - # this case it does: Using "exit" instead of "return" - # is imporant because it prevents flow returning to - # release-client. - exit $EXIT_FAILURE - fi - "$HELPER" status "$@" -} - -download() { - "$HELPER" download "$@" -} - -release-client() { - if ! status; then - error 'You have not committed your changes yet!' - exit $EXIT_FAILURE - fi - "$HELPER" release-client "$@" -} - -release-server() { - if [[ ! -f PKGBUILD ]]; then - error 'PKGBUILD not found' - exit $EXIT_FAILURE - fi - "$HELPER" release-server "$@" -} - -unrelease() { - "$HELPER" unrelease "$@" -} - -move() { - "$HELPER" move "$@" -} - -releasepath() { - "$HELPER" releasepath "$@" -} - -help() { - usage -} - -name() { - "$HELPER" name "$@" -} - -main() { - BUILDSYSTEM='' - while getopts 'b:h' arg; do - case $arg in - b) BUILDSYSTEM=$OPTARG;; - h) usage; return $EXIT_SUCCESS;; - *) errusage;; - esac - done - shift $((OPTIND - 1)) - - if [[ -z $BUILDSYSTEM ]]; then - load_conf xbs.conf BUILDSYSTEM || exit - fi - - if [[ -z $XBS_LIBDIR ]]; then - export XBS_LIBDIR=$default_libdir - fi - - HELPER="${XBS_LIBDIR}/helper-${BUILDSYSTEM}" - if [[ ! -x "$HELPER" ]]; then - error 'No helper for build system found: %s' "$BUILDSYSTEM" - return $EXIT_NOTCONFIGURED; - fi - - if [[ $# -lt 1 ]]; then - errusage "Must specify a command" - fi - - if [[ -w / ]]; then - error 'Run as a normal user' - fi - - local cmd=$1; shift - case "$cmd" in - status|download|name|help) - [[ $# -eq 0 ]] || errusage 'bad number of argments' - "$cmd" "$@" - ;; - release-client|release-server) - [[ $# -eq 2 ]] || errusage 'bad number of argments' - "$cmd" "$@" - ;; - move|unrelease|releasepath) - [[ $# -eq 3 ]] || errusage 'bad number of argments' - "$cmd" "$@" - ;; - *) errusage 'unknown command: %s' "$cmd";; - esac -} - -main "$@" diff --git a/src/xbs/xbs.conf b/src/xbs/xbs.conf deleted file mode 100644 index 2c94ca8..0000000 --- a/src/xbs/xbs.conf +++ /dev/null @@ -1,4 +0,0 @@ -#!/hint/bash -# shellcheck disable=2034 - -BUILDSYSTEM=abslibre |