From f7f89bc6ad82ad0ce83a0bf35edcc05957dfbc63 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 20 Oct 2012 17:49:49 -0400 Subject: redo libre/parabolaweb-git into libre/parabolaweb-utils --- libre/parabolaweb-utils/helper.sh | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 libre/parabolaweb-utils/helper.sh (limited to 'libre/parabolaweb-utils/helper.sh') diff --git a/libre/parabolaweb-utils/helper.sh b/libre/parabolaweb-utils/helper.sh new file mode 100644 index 000000000..d00f83f7f --- /dev/null +++ b/libre/parabolaweb-utils/helper.sh @@ -0,0 +1,37 @@ +_mksource() { + if [[ -z _DO_NOT_RUN_MKSOURCE ]]; then + _DO_NOT_RUN_MKSOURCE=true makepkg -o + fi +} + +_get_pkgver() { + if [[ -n $pkgver ]] && [[ $pkgver != 0.bogus ]]; then + echo $pkgver + else + _mksource 1>&2 + if [[ -f "${srcdir:-src}/parabolaweb/requirements_prod.txt" ]]; then + pushd "${srcdir:-src}/parabolaweb" >/dev/null + # get the date requirements_prod.txt was last modified + gitdate="$(git log -n1 --date=iso --format=format:'%cd' ./requirements_prod.txt)" + date -u +%Y%m%d.%H%M -d "$gitdate" + popd >/dev/null + else + echo 0.bogus + fi + fi +} + +_get_depends() { + _mksource 1>&2 + pushd "${srcdir:-src}" >/dev/null + python2_packages='markdown|psycopg2|pyinotify|pytz|south' + < parabolaweb/requirements_prod.txt sed -r \ + -e 's/.*/\L&/' -e 's/==/=/' \ + -e 's/^python-memcached/python2-memcached/' \ + -e "s/^(${python2_packages})/python2-&/" + popd >/dev/null +} + +_get_depends_nover() { + _get_depends | sed 's/[<>=].*//' +} -- cgit v1.2.3