Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #37 from mariux64/add-issue
bee: add issue management
  • Loading branch information
wwwutz committed Sep 12, 2019
2 parents 34cbaae + 4d401f5 commit 30911fe
Show file tree
Hide file tree
Showing 4 changed files with 111 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Makefile
@@ -1,4 +1,4 @@
BEE_VERSION = 1.2.21
BEE_VERSION = 1.2.22

CC=gcc
CFLAGS=-Wall -g
Expand Down Expand Up @@ -54,6 +54,7 @@ PROGRAMS_C+=beeversion

PROGRAMS_SHELL+=bee
PROGRAMS_SHELL+=beefind
PROGRAMS_SHELL+=beeissue
PROGRAMS_SHELL+=beesh

HELPER_BEE_SHELL+=bee-cache
Expand Down
88 changes: 88 additions & 0 deletions src/beeissue.sh.in
@@ -0,0 +1,88 @@
#!/bin/bash
#
#
# Copyright (C) 2009-2016
# Tobias Dreyer <dreyer@molgen.mpg.de>
# Marius Tolzmann <m@rius.berlin>
# and other bee developers
#
# This file is part of bee.
#
# bee 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 3 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/>.

BEE_VERSION="@BEE_VERSION@"

: ${BEE_SYSCONFDIR:=@SYSCONFDIR@}
: ${BEE_DEFCONFDIR:=@DEFCONFDIR@}
: ${BEE_DATADIR:=@DATADIR@}
: ${BEE_LIBDIR:=@LIBDIR@}
: ${BEE_LIBEXECDIR:=@LIBEXECDIR@}
: ${BEE_BINDIR:=@BINDIR@}

. ${BEE_LIBEXECDIR}/bee/beelib.config.sh

: ${BEEGETOPT:=${BEE_BINDIR}/beegetopt}

function usage() {
cat <<EOF
beeissue v${BEE_VERSION} 2019
Usage: beeissue [options] pkgname
Options:
-h, --help display this help
EOF
}


###############################################################################
###############################################################################
###############################################################################

options=$(${BEEGETOPT} \
--name beeissue \
--option help/h \
-- "${@}")

if [ $? != 0 ] ; then
usage
exit 1
fi

eval set -- "${options}"

while true ; do
case "${1}" in
--help)
usage
exit 0
;;
--)
shift
break
;;
esac
done

if [ -z "${1}" ] ; then
print_error "beeissue: need pkgname"
exit 1
fi

config_init

pkgname="${1}"
grep -P "^${pkgname}\s" ${BEE_ISSUES}
exit 0
2 changes: 2 additions & 0 deletions src/beelib.config.sh.in
Expand Up @@ -298,6 +298,7 @@ function config_verify_builtin_config() {
: ${BEE_TMP_BUILDROOT:=${BEE_TMP_TMPDIR}/bee-${user}}

: ${BEE_BEEDIR:=${BEE_REPOSITORY_PREFIX}/bee-files}
: ${BEE_ISSUES:=${BEE_REPOSITORY_PREFIX}/bee-files.issues}
: ${BEE_PKGDIR:=${BEE_REPOSITORY_PREFIX}/packages}
: ${BEE_BUILDARCHIVEDIR:=${BEE_REPOSITORY_PREFIX}/build-archives}

Expand Down Expand Up @@ -375,6 +376,7 @@ function config_export() {
export BEE_PKGDIR
export BEE_BUILDARCHIVEDIR
export BEE_DOWNLOADDIR
export BEE_ISSUES
export BEE_METADIR
export BEE_CACHEDIR
export BEE_TMP_TMPDIR
Expand Down
19 changes: 19 additions & 0 deletions src/beesh.sh.in
Expand Up @@ -872,6 +872,7 @@ OPTIONS=$("${BEE_BINDIR}/beegetopt" --name beesh \
--option debug= \
--option archive-build \
--option no-archive-build \
--option ignore-issue \
--option check \
-- "$@")

Expand All @@ -886,6 +887,7 @@ eval set -- "${OPTIONS}"
: ${OPT_CLEANUP:="no"}
: ${OPT_CHECK:="no"}
: ${OPT_ARCHIVE_BUILD:="yes"}
: ${OPT_IGNORE_ISSUE:="no"}

while true ; do
case "$1" in
Expand Down Expand Up @@ -919,6 +921,10 @@ while true ; do
OPT_ARCHIVE_BUILD="yes"
shift
;;
--ignore-issue)
OPT_IGNORE_ISSUE="yes"
shift
;;
--check)
OPT_CHECK="yes"
shift
Expand Down Expand Up @@ -980,6 +986,19 @@ if [ -z "${PKGNAME}" -o -z "${PKGVERSION}" -o -z "${PKGREVISION}" ] ; then
exit 1
fi

# issue management
if [ $OPT_IGNORE_ISSUE = "no" -a -e ${BEE_ISSUES} ]; then

r=$(beeissue "${PKGNAME}")

if [ -n "$r" ]; then
print_error "issue: $r"
print_info "check for '${PKGNAME}' in ${BEE_ISSUES}"
print_info "use --ignore-issue to build anyway"
exit 1
fi
fi

BEEPKGROOT="${BEE_TMP_BUILDROOT}/${PKGNAME}"
BEEWORKDIR="${BEEPKGROOT}/${PKGFULLPKG}"

Expand Down

0 comments on commit 30911fe

Please sign in to comment.