svn commit: r398437 - in head: . textproc textproc/pootle textproc/pootle/files
Rene Ladan
rene at FreeBSD.org
Fri Oct 2 15:18:54 UTC 2015
Author: rene
Date: Fri Oct 2 15:18:48 2015
New Revision: 398437
URL: https://svnweb.freebsd.org/changeset/ports/398437
Log:
Resurrect textproc/pootle and update it to 2.5.1.3
There might be some rough edges with getting it running properly, but
time will tell.
Add UID/GID 158 for pootle.
Differential Revision: https://reviews.freebsd.org/D1234
Added:
head/textproc/pootle/
- copied from r366980, head/textproc/pootle/
head/textproc/pootle/files/patch-pootle_apps_djblets_util_fields.py (contents, props changed)
head/textproc/pootle/files/patch-pootle_apps_pootle__app_views_admin_dashboard.py (contents, props changed)
head/textproc/pootle/files/patch-pootle_apps_pootle__misc_forms.py (contents, props changed)
head/textproc/pootle/files/patch-pootle_apps_pootle__misc_util.py (contents, props changed)
head/textproc/pootle/files/patch-pootle_apps_pootle__store_models.py (contents, props changed)
head/textproc/pootle/files/patch-pootle_apps_pootle__store_views.py (contents, props changed)
head/textproc/pootle/files/patch-pootle_apps_pootle__terminology_views.py (contents, props changed)
head/textproc/pootle/files/patch-pootle_apps_registration_models.py (contents, props changed)
head/textproc/pootle/files/patch-pootle_middleware_captcha.py (contents, props changed)
head/textproc/pootle/files/patch-pootle_middleware_errorpages.py (contents, props changed)
Deleted:
head/textproc/pootle/files/patch-setup.py
head/textproc/pootle/files/pkg-install.in
head/textproc/pootle/pkg-plist
Modified:
head/GIDs
head/UIDs
head/textproc/Makefile
head/textproc/pootle/Makefile
head/textproc/pootle/distinfo
head/textproc/pootle/files/pootle.in
Modified: head/GIDs
==============================================================================
--- head/GIDs Fri Oct 2 15:11:36 2015 (r398436)
+++ head/GIDs Fri Oct 2 15:18:48 2015 (r398437)
@@ -95,6 +95,7 @@ trircd:*:154:
xorp:*:155:
monetdb:*:156:
barman:*:157:
+pootle:*:158:
nocat:*:159:
sfs:*:171:
agk:*:172:
Modified: head/UIDs
==============================================================================
--- head/UIDs Fri Oct 2 15:11:36 2015 (r398436)
+++ head/UIDs Fri Oct 2 15:18:48 2015 (r398437)
@@ -101,6 +101,7 @@ rbldns:*:153:153::0:0:rbldnsd pseudo-use
trircd:*:154:154::0:0:& user:/usr/local/etc/tr-ircd:/usr/sbin/nologin
monetdb:*:156:156::0:0:MonetDB user:/usr/local/monetdb5:/bin/sh
barman:*:157:157::0:0:Barman user:/var/barman:/bin/sh
+pootle:*:158:158::0:0:Pootle User:/var/db/pootle:/usr/sbin/nologin
nocat:*:159:159::0:0:NoCat Daemon:/libexec/nocat:/sbin/nologin
sfs:*:171:171::0:0:Self-Certifying File System:/nonexistent:/usr/sbin/nologin
agk:*:172:172::0:0:AquaGateKeeper:/nonexistent:/nonexistent
Modified: head/textproc/Makefile
==============================================================================
--- head/textproc/Makefile Fri Oct 2 15:11:36 2015 (r398436)
+++ head/textproc/Makefile Fri Oct 2 15:18:48 2015 (r398437)
@@ -1182,6 +1182,7 @@
SUBDIR += po4a
SUBDIR += pocketreader
SUBDIR += pod2mdoc
+ SUBDIR += pootle
SUBDIR += popup
SUBDIR += popup-stacks
SUBDIR += ppower4
Modified: head/textproc/pootle/Makefile
==============================================================================
--- head/textproc/pootle/Makefile Tue Sep 2 10:07:49 2014 (r366980)
+++ head/textproc/pootle/Makefile Fri Oct 2 15:18:48 2015 (r398437)
@@ -2,97 +2,74 @@
# $FreeBSD$
PORTNAME= pootle
-PORTVERSION= 2.1.6
-PORTREVISION= 2
+PORTVERSION= 2.5.1.3
CATEGORIES= textproc
-MASTER_SITES= SF/translate/Pootle/${PORTVERSION}/
+MASTER_SITES= CHEESESHOP
DISTNAME= Pootle-${PORTVERSION}
-MAINTAINER= ports at FreeBSD.org
-COMMENT= Pootle is a user-friendly web portal for simple translation process
+MAINTAINER= rene at FreeBSD.org
+COMMENT= User-friendly web portal for simple translation process
-BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}django>=1.2:${PORTSDIR}/www/py-django \
- translate-toolkit>=1.8.1:${PORTSDIR}/textproc/translate-toolkit \
- ${PYTHON_PKGNAMEPREFIX}south>=0.7:${PORTSDIR}/databases/py-south
-
-RUN_DEPENDS:= ${BUILD_DEPENDS}
-
-BROKEN= Does not install
-CONFLICTS= ${PYTHON_PKGNAMEPREFIX}django-profiles-[0-9]* \
- ${PYTHON_PKGNAMEPREFIX}django-registration-[0-9]*
-
-USES= gettext tar:bzip2
-USE_PYTHON= yes
-USE_PYDISTUTILS=yes
-PYDISTUTILS_PKGNAME= Pootle
-
-POOTLEUSER?= nobody
-POOTLEGROUP?= nobody
-
-POOTLEDBDIR?= /var/db/pootle
-POOTLELOGDIR?= /var/log/pootle
-POOTLERUNDIR?= /var/run/pootle
+LICENSE= GPLv2
+LICENSE_FILE= ${WRKSRC}/LICENSE
+
+RUN_DEPENDS= translate-toolkit>=1.11.0:${PORTSDIR}/textproc/translate-toolkit \
+ ${PYTHON_PKGNAMEPREFIX}south>=0.7.6:${PORTSDIR}/databases/py-south\
+ ${PYTHON_PKGNAMEPREFIX}cssmin>=0.1.4:${PORTSDIR}/www/py-cssmin \
+ ${PYTHON_PKGNAMEPREFIX}lxml>=2.1.4:${PORTSDIR}/devel/py-lxml \
+ ${PYTHON_PKGNAMEPREFIX}argparse>=0:${PORTSDIR}/devel/py-argparse \
+ ${PYTHON_PKGNAMEPREFIX}django-taggit>0.10:${PORTSDIR}/www/py-django-taggit \
+ ${PYTHON_PKGNAMEPREFIX}django-assets>=0.8:${PORTSDIR}/www/py-django-assets \
+ ${PYTHON_PKGNAMEPREFIX}south>=0.7.6:${PORTSDIR}/databases/py-south \
+ ${PYTHON_PKGNAMEPREFIX}django-voting>=0.1:${PORTSDIR}/www/py-django-voting \
+ ${PYTHON_PKGNAMEPREFIX}simplejson>=0:${PORTSDIR}/devel/py-simplejson \
+ ${PYTHON_PKGNAMEPREFIX}diff-match-patch>=0:${PORTSDIR}/textproc/py-diff-match-patch
+# actually diff-match-patch is a dependency of translate-toolkit,
+# but only this port uses it.
+
+USES= gettext python tar:bzip2
+USE_PYTHON= autoplist distutils
+
+USERS= pootle
+GROUPS= pootle
+
+PLIST_SUB+= POOTLEUSER="${USERS}" \
+ POOTLEGROUP="${GROUPS}"
USE_RC_SUBR= pootle
-SUB_LIST+= PYTHON_CMD="${PYTHON_CMD}" \
- POOTLEDBDIR="${POOTLEDBDIR}" \
- POOTLELOGDIR="${POOTLELOGDIR}" \
- POOTLERUNDIR="${POOTLERUNDIR}" \
- POOTLEUSER="${POOTLEUSER}" \
- POOTLEGROUP="${POOTLEGROUP}" \
- CHOWN="${CHOWN}" \
- CHMOD="${CHMOD}" \
- MKDIR="${MKDIR}"
-
-PLIST_SUB+= POOTLEDBDIR="${POOTLEDBDIR}" \
- POOTLELOGDIR="${POOTLELOGDIR}"
-
-SUB_FILES+= pkg-install
-PKGINSTALL= ${WRKDIR}/pkg-install
-
-PORTDOCS= ChangeLog COPYING INSTALL README wsgi.py
-
-OPTIONS_DEFINE= MYSQL SUBVERSION MEMCACHED
-OPTIONS_DEFAULT= MYSQL SUBVERSION MEMCACHED
-SUBVERSION_DESC= ${SVN_DESC}
-MEMCACHED_DESC= Enable memcached support
-
-NO_STAGE= yes
-.include <bsd.port.pre.mk>
-
-.if ${PORT_OPTIONS:MMYSQL}
-USE_MYSQL= yes
-.endif
-
-.if ${PORT_OPTIONS:MSUBVERSION}
-RUN_DEPENDS+= svn:${PORTSDIR}/devel/subversion
-.endif
-
-.if ${PORT_OPTIONS:MMEMCACHED}
-LIB_DEPENDS+= libmemcached.so:${PORTSDIR}/databases/libmemcached
-RUN_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}memcached>=1.45:${PORTSDIR}/databases/py-memcached
-.endif
-
-post-patch:
- @${MV} ${WRKSRC}/localsettings.py ${WRKSRC}/localsettings.py.sample
- @${REINPLACE_CMD} -e "s|^CONFIG_DIR.*=.*|CONFIG_DIR = \'${PREFIX}/etc/pootle\'|g" \
- -e "s|^DATA_DIR.*=.*|DATA_DIR = \\'${DATADIR}\\'|g" \
- -e "s|^WORKING_DIR.*=.*|WORKING_DIR = \\'${POOTLEDBDIR}\\'|g" \
- ${WRKSRC}/pootle/install_dirs.py
- @${REINPLACE_CMD} -e "s|^INSTALL_CONFIG_DIR.*=.*|INSTALL_CONFIG_DIR = \'${PREFIX}/etc/pootle\'|g" \
- -e "s|^INSTALL_WORKING_DIR.*=.*|INSTALL_WORKING_DIR = \'${POOTLEDBDIR}\'|g" \
- ${WRKSRC}/setup.py
+SUB_LIST+= PYTHON_CMD="${PYTHON_CMD}"
-post-install:
- @PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
- @${CP} -n ${PREFIX}/etc/pootle/localsettings.py.sample \
- ${PREFIX}/etc/pootle/localsettings.py || ${TRUE}
+PORTDOCS= CREDITS INSTALL LICENSE
+
+OPTIONS_DEFINE= LDAP MEMCACHED MYSQL PGSQL
+OPTIONS_DEFAULT=MEMCACHED MYSQL
+
+MEMCACHED_DESC= Use memcached to improve performance
+
+MYSQL_USE= MYSQL=yes
-.if ${PORT_OPTIONS:MDOCS}
- ${MKDIR} ${DOCSDIR}
+LDAP_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}ldap2>0:${PORTSDIR}/devel/py-ldap2
+
+MEMCACHED_LIB_DEPENDS= libmemcached.so:${PORTSDIR}/databases/libmemcached
+MEMCACHED_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}memcached>=1.45:${PORTSDIR}/databases/py-memcached
+
+MYSQL_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}MySQLdb>0:${PORTSDIR}/databases/py-MySQLdb
+
+PGSQL_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}psycopg2>0:${PORTSDIR}/databases/py-pyscopg2
+
+SUBVERSION_RUN_DEPENDS= svn:${PORTSDIR}/devel/subversion
+
+pre-configure:
+ @${REINPLACE_CMD} -e "s/,<0.11.2//g" \
+ -e "s/,<0.8//g" \
+ -e "s/==0.1//g" \
+ -e "s/,<1.5//g" \
+ ${WRKSRC}/requirements/base.txt
+
+post-install:
+ ${MKDIR} ${STAGEDIR}/${DOCSDIR}
.for docs in ${PORTDOCS}
- ${INSTALL_DATA} ${WRKSRC}/${docs} ${DOCSDIR}
+ ${INSTALL_DATA} ${WRKSRC}/${docs} ${STAGEDIR}/${DOCSDIR}
.endfor
-.endif
-.include <bsd.port.post.mk>
+.include <bsd.port.mk>
Modified: head/textproc/pootle/distinfo
==============================================================================
--- head/textproc/pootle/distinfo Tue Sep 2 10:07:49 2014 (r366980)
+++ head/textproc/pootle/distinfo Fri Oct 2 15:18:48 2015 (r398437)
@@ -1,2 +1,2 @@
-SHA256 (Pootle-2.1.6.tar.bz2) = 1f3b492b76914596b01ebe040a59d9df10ffdf29a58ab9a4600f2f49dccd298e
-SIZE (Pootle-2.1.6.tar.bz2) = 2921970
+SHA256 (Pootle-2.5.1.3.tar.bz2) = f0303896af702f6bc6cbd7f28fae9478f3f11e804c6f0194c1fb34d2557f4243
+SIZE (Pootle-2.5.1.3.tar.bz2) = 6387947
Added: head/textproc/pootle/files/patch-pootle_apps_djblets_util_fields.py
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/textproc/pootle/files/patch-pootle_apps_djblets_util_fields.py Fri Oct 2 15:18:48 2015 (r398437)
@@ -0,0 +1,11 @@
+--- pootle/apps/djblets/util/fields.py.orig 2015-06-03 13:30:23 UTC
++++ pootle/apps/djblets/util/fields.py
+@@ -30,7 +30,7 @@ from datetime import datetime
+ from django.conf import settings
+ from django.core.serializers.json import DjangoJSONEncoder
+ from django.db import models
+-from django.utils import simplejson
++import simplejson
+ from django.utils.encoding import smart_unicode
+
+
Added: head/textproc/pootle/files/patch-pootle_apps_pootle__app_views_admin_dashboard.py
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/textproc/pootle/files/patch-pootle_apps_pootle__app_views_admin_dashboard.py Fri Oct 2 15:18:48 2015 (r398437)
@@ -0,0 +1,11 @@
+--- pootle/apps/pootle_app/views/admin/dashboard.py.orig 2015-06-03 13:30:23 UTC
++++ pootle/apps/pootle_app/views/admin/dashboard.py
+@@ -26,7 +26,7 @@ from django.core.cache import cache
+ from django.http import HttpResponse
+ from django.shortcuts import render_to_response
+ from django.template import RequestContext
+-from django.utils import simplejson
++import simplejson
+ from django.utils.translation import ugettext as _
+
+ from pootle import depcheck
Added: head/textproc/pootle/files/patch-pootle_apps_pootle__misc_forms.py
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/textproc/pootle/files/patch-pootle_apps_pootle__misc_forms.py Fri Oct 2 15:18:48 2015 (r398437)
@@ -0,0 +1,11 @@
+--- pootle/apps/pootle_misc/forms.py.orig 2015-06-03 13:30:23 UTC
++++ pootle/apps/pootle_misc/forms.py
+@@ -79,7 +79,7 @@ def make_search_form(*args, **kwargs):
+
+ if sparams_cookie:
+ import urllib
+- from django.utils import simplejson
++ import simplejson
+
+ initial_sparams = simplejson.loads(urllib.unquote(sparams_cookie))
+ if isinstance(initial_sparams, dict):
Added: head/textproc/pootle/files/patch-pootle_apps_pootle__misc_util.py
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/textproc/pootle/files/patch-pootle_apps_pootle__misc_util.py Fri Oct 2 15:18:48 2015 (r398437)
@@ -0,0 +1,12 @@
+--- pootle/apps/pootle_misc/util.py.orig 2015-06-03 13:30:23 UTC
++++ pootle/apps/pootle_misc/util.py
+@@ -25,7 +25,8 @@ from django.conf import settings
+ from django.core.cache import cache
+ from django.core.paginator import Paginator
+ from django.http import HttpResponseBadRequest
+-from django.utils import simplejson, timezone
++from django.utils import timezone
++import simplejson
+ from django.utils.encoding import force_unicode, iri_to_uri
+ from django.utils.functional import Promise
+
Added: head/textproc/pootle/files/patch-pootle_apps_pootle__store_models.py
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/textproc/pootle/files/patch-pootle_apps_pootle__store_models.py Fri Oct 2 15:18:48 2015 (r398437)
@@ -0,0 +1,58 @@
+--- pootle/apps/pootle_store/models.py.orig 2015-06-03 13:30:23 UTC
++++ pootle/apps/pootle_store/models.py
+@@ -32,9 +32,8 @@ from django.conf import settings
+ from django.core.exceptions import ObjectDoesNotExist
+ from django.core.files.storage import FileSystemStorage
+ from django.core.urlresolvers import reverse
+-from django.db import models, DatabaseError, IntegrityError
++from django.db import models, transaction, DatabaseError, IntegrityError
+ from django.db.models.signals import post_delete, post_save, pre_delete
+-from django.db.transaction import commit_on_success
+ from django.utils import timezone, tzinfo
+ from django.utils.translation import ugettext_lazy as _
+
+@@ -1102,7 +1101,7 @@ class Store(models.Model, base.Translati
+
+ return False
+
+- @commit_on_success
++ @transaction.atomic
+ def parse(self, store=None):
+ self.clean_stale_lock()
+
+@@ -1154,7 +1153,7 @@ class Store(models.Model, base.Translati
+ if obsolete_unit:
+ obsolete_unit.delete()
+
+- @commit_on_success
++ @transaction.atomic
+ def update(self, update_structure=False, update_translation=False,
+ store=None, fuzzy=False, only_newer=False, modified_since=0):
+ """Update DB with units from file.
+@@ -1320,7 +1319,7 @@ class Store(models.Model, base.Translati
+ # new qualitychecks, let's flush cache
+ deletefromcache(self, ["getcompletestats"])
+
+- @commit_on_success
++ @transaction.atomic
+ def update_qualitychecks(self):
+ logging.debug(u"Updating quality checks for %s", self.pootle_path)
+ for unit in self.units.iterator():
+@@ -1583,7 +1582,7 @@ class Store(models.Model, base.Translati
+ """Returns a single unit based on the item number."""
+ return self.units[item]
+
+- @commit_on_success
++ @transaction.atomic
+ def mergefile(self, newfile, profile, allownewstrings, suggestions,
+ notranslate, obsoletemissing):
+ """Merges :param:`newfile` with the current store.
+@@ -1778,7 +1777,7 @@ class Store(models.Model, base.Translati
+ self.pending = pending_name
+ self.save()
+
+- @commit_on_success
++ @transaction.atomic
+ def import_pending(self):
+ """import suggestions from legacy .pending files, into database"""
+ self.init_pending()
Added: head/textproc/pootle/files/patch-pootle_apps_pootle__store_views.py
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/textproc/pootle/files/patch-pootle_apps_pootle__store_views.py Fri Oct 2 15:18:48 2015 (r398437)
@@ -0,0 +1,12 @@
+--- pootle/apps/pootle_store/views.py.orig 2015-06-03 13:30:23 UTC
++++ pootle/apps/pootle_store/views.py
+@@ -35,7 +35,8 @@ from django.shortcuts import get_object_
+ from django.template import loader, RequestContext
+ from django.utils.translation import to_locale, ugettext as _
+ from django.utils.translation.trans_real import parse_accept_lang_header
+-from django.utils import simplejson, timezone
++from django.utils import timezone
++import simplejson
+ from django.utils.encoding import iri_to_uri
+ from django.views.decorators.cache import never_cache
+ from django.views.decorators.http import require_POST
Added: head/textproc/pootle/files/patch-pootle_apps_pootle__terminology_views.py
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/textproc/pootle/files/patch-pootle_apps_pootle__terminology_views.py Fri Oct 2 15:18:48 2015 (r398437)
@@ -0,0 +1,20 @@
+--- pootle/apps/pootle_terminology/views.py.orig 2015-06-03 13:30:23 UTC
++++ pootle/apps/pootle_terminology/views.py
+@@ -19,7 +19,7 @@
+ # Pootle; if not, see <http://www.gnu.org/licenses/>.
+
+ from django.conf import settings
+-from django.db.transaction import commit_on_success
++from django.db import transaction
+ from django.shortcuts import render_to_response
+ from django.template import RequestContext
+ from django.utils.translation import ugettext as _
+@@ -63,7 +63,7 @@ def get_terminology_filename(translation
+ return 'pootle-terminology.' + translation_project.project.localfiletype
+
+
+- at commit_on_success
++ at transaction.atomic
+ @get_path_obj
+ @permission_required('administrate')
+ def extract(request, translation_project):
Added: head/textproc/pootle/files/patch-pootle_apps_registration_models.py
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/textproc/pootle/files/patch-pootle_apps_registration_models.py Fri Oct 2 15:18:48 2015 (r398437)
@@ -0,0 +1,36 @@
+--- pootle/apps/registration/models.py.orig 2015-06-03 13:30:23 UTC
++++ pootle/apps/registration/models.py
+@@ -1,4 +1,5 @@
+ import datetime
++import hashlib
+ import random
+ import re
+
+@@ -8,7 +9,6 @@ from django.contrib.sites.models import
+ from django.db import models
+ from django.db import transaction
+ from django.template.loader import render_to_string
+-from django.utils.hashcompat import sha_constructor
+ from django.utils.translation import ugettext_lazy as _
+
+
+@@ -146,7 +146,7 @@ class RegistrationManager(models.Manager
+ msg.send()
+ user_registered.send(sender=self.model, user=new_user)
+ return new_user
+- create_inactive_user = transaction.commit_on_success(create_inactive_user)
++ create_inactive_user = transaction.atomic(create_inactive_user)
+
+ def create_profile(self, user):
+ """
+@@ -158,8 +158,8 @@ class RegistrationManager(models.Manager
+ username and a random salt.
+
+ """
+- salt = sha_constructor(str(random.random())).hexdigest()[:5]
+- activation_key = sha_constructor(salt+user.email).hexdigest()
++ salt = hashlib.sha1(str(random.random())).hexdigest()[:5]
++ activation_key = hashlib.sha1(salt+user.email).hexdigest()
+ return self.create(user=user,
+ activation_key=activation_key)
+
Added: head/textproc/pootle/files/patch-pootle_middleware_captcha.py
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/textproc/pootle/files/patch-pootle_middleware_captcha.py Fri Oct 2 15:18:48 2015 (r398437)
@@ -0,0 +1,11 @@
+--- pootle/middleware/captcha.py.orig 2015-06-03 13:30:24 UTC
++++ pootle/middleware/captcha.py
+@@ -29,7 +29,7 @@ from django.conf import settings
+ from django.http import HttpResponse
+ from django.shortcuts import render_to_response
+ from django.template import loader, RequestContext
+-from django.utils import simplejson
++import simplejson
+ from django.utils.translation import ugettext as _
+
+
Added: head/textproc/pootle/files/patch-pootle_middleware_errorpages.py
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/textproc/pootle/files/patch-pootle_middleware_errorpages.py Fri Oct 2 15:18:48 2015 (r398437)
@@ -0,0 +1,11 @@
+--- pootle/middleware/errorpages.py.orig 2015-06-03 13:30:24 UTC
++++ pootle/middleware/errorpages.py
+@@ -28,7 +28,7 @@ from django.http import (Http404, HttpRe
+ HttpResponseServerError)
+ from django.template import RequestContext
+ from django.template.loader import render_to_string
+-from django.utils import simplejson
++import simplejson
+ from django.utils.encoding import force_unicode
+ from django.utils.translation import ugettext as _
+
Modified: head/textproc/pootle/files/pootle.in
==============================================================================
--- head/textproc/pootle/files/pootle.in Tue Sep 2 10:07:49 2014 (r366980)
+++ head/textproc/pootle/files/pootle.in Fri Oct 2 15:18:48 2015 (r398437)
@@ -4,6 +4,7 @@
#
# PROVIDE: pootle
# REQUIRE: DAEMON
+# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf to run pootle:
#
@@ -12,7 +13,7 @@
# pootle_flags (flags): Set extra flags here. More options in pootle(1)
# Default is empty "".
# pootle_logdir (path): Path to pootle log directory.
-# Default is "%%POOTLELOGDIR%%".
+# Default is /var/log/pootle
# Empty is log to /dev/null.
# pootle_user (user): Set user to run pootle.
# Default is "%%POOTLEUSER%%".
@@ -22,6 +23,13 @@
name=pootle
rcvar=pootle_enable
+load_rc_config $name
+
+: ${pootle_enable:=NO}
+: ${pootle_user="%%POOTLEUSER%%"}
+: ${pootle_group="%%POOTLEGROUP%%"}
+: ${pootle_logdir=/var/log/pootle}
+
pidfile="%%POOTLERUNDIR%%/pootle.pid"
command_interpreter="%%PYTHON_CMD%%"
@@ -29,25 +37,29 @@ required_files="%%PREFIX%%/etc/pootle/lo
command="%%PREFIX%%/bin/PootleServer"
-load_rc_config $name
-: ${pootle_enable="NO"}
-: ${pootle_user="%%POOTLEUSER%%"}
-: ${pootle_logdir="%%POOTLELOGDIR%%"}
-
-if [ -n "${pootle_logdir}" ]; then
- pootle_stdout="${pootle_logdir}/access.log"
- pootle_stderr="${pootle_logdir}/error.log"
-else
- pootle_stdout="/dev/null"
- pootle_stderr="/dev/null"
-fi
-
-start_cmd="pootle_start_cmd"
+start_command=pootle_start_cmd
+start_precmd=pootle_start_precmd
-pootle_start_cmd () {
+pootle_start_cmd()
+{
[ -z "${rc_quiet}" ] && echo "Starting ${name}."
/usr/sbin/daemon -p ${pidfile} -u ${pootle_user} ${command} ${pootle_flags} \
>>${pootle_stdout} 2>>${pootle_stderr}
}
+pootle_start_precmd()
+{
+ for i in db log run ; do
+ install -d -o ${pootle_user} -g ${pootle_group} -m 770 /var/${i}/pootle
+ done
+
+ if [ -n "${pootle_logdir}" ] ; then
+ pootle_stdout="${pootle_logdir}/access.log"
+ pootle_stderr="${pootle_logdir}/error.log"
+ else
+ pootle_stdout="/dev/null"
+ pootle_stderr="/dev/null"
+ fi
+}
+
run_rc_command "$1"
More information about the svn-ports-all
mailing list