diff options
author | André Fabian Silva Delgado <emulatorman@lavabit.com> | 2012-12-14 15:17:05 -0200 |
---|---|---|
committer | André Fabian Silva Delgado <emulatorman@lavabit.com> | 2012-12-14 15:17:05 -0200 |
commit | 7e70a6b31620d6d8cee25f83740af3e37a5efd94 (patch) | |
tree | 75eedebc296a802a2d1cc63669c93c2fea02cb91 /libre/parabolaweb-utils/helper.sh | |
parent | 549da93280e61dbd33da7c4328866ff7f937dc96 (diff) | |
parent | 9fb2ded7e238dd889baac2d24d60095ff85edc18 (diff) |
Merge branch 'master' of ssh://parabolagnulinux.org:1863/srv/git/abslibre
Diffstat (limited to 'libre/parabolaweb-utils/helper.sh')
-rw-r--r-- | libre/parabolaweb-utils/helper.sh | 34 |
1 files changed, 10 insertions, 24 deletions
diff --git a/libre/parabolaweb-utils/helper.sh b/libre/parabolaweb-utils/helper.sh index 5ce4182b3..ce8638e7e 100644 --- a/libre/parabolaweb-utils/helper.sh +++ b/libre/parabolaweb-utils/helper.sh @@ -1,35 +1,21 @@ _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 + pushd "${startdir:-.}" >/dev/null + if [[ -z $_DO_NOT_RUN_MKSOURCE && $0 =~ ^makepkg ]]; then + local flags=(-o) + (( EUID )) || flags+=(--asroot) + _DO_NOT_RUN_MKSOURCE=true "${0}" "${flags[@]}" fi + popd >/dev/null } _get_depends() { _mksource 1>&2 - if [[ -f "${srcdir:-src}/parabolaweb/requirements_prod.txt" ]]; then + if [[ -f "${srcdir:-${startdir:-.}/src}/parabolaweb/requirements_prod.txt" ]]; then 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-&/" + -e 's/.*/\L&/' -e 's/==/>=/' \ + -e 's/^(python2?-)?/python2-/' \ + -e 's/python2-django/django/' popd >/dev/null fi } |