summaryrefslogtreecommitdiff
path: root/main/models.py
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2010-01-31 17:28:50 -0600
committerDan McGee <dan@archlinux.org>2010-01-31 17:28:50 -0600
commita32eb2dce6e19445492528f0b93bf3850389c41a (patch)
tree30fb1dc5b64bbcc0f2fb11fd92396bc5977ed24c /main/models.py
parentbe3591d95748c4477c3f7b8334e4a690ad111d8a (diff)
Provide SVN links to trunk/ for each package
This is, at least for me, more useful than the link to a specific build of a package. We provide both so no one should lose here. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'main/models.py')
-rw-r--r--main/models.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/main/models.py b/main/models.py
index 570221bf..16fe73e4 100644
--- a/main/models.py
+++ b/main/models.py
@@ -247,8 +247,8 @@ class Package(models.Model):
self.deps_cache = deps
return deps
- def get_svn_link(self):
- linkbase = "http://repos.archlinux.org/wsvn/%s/%s/repos/%s-%s/"
+ def get_svn_link(self, svnpath):
+ linkbase = "http://repos.archlinux.org/wsvn/%s/%s/%s/"
if self.pkgbase:
dirname = self.pkgbase
else:
@@ -258,7 +258,14 @@ class Package(models.Model):
root = 'community'
else:
root = 'packages'
- return linkbase % (root, dirname, repo, self.arch.name)
+ return linkbase % (root, dirname, svnpath)
+
+ def get_arch_svn_link(self):
+ repo = self.repo.name.lower()
+ return self.get_svn_link("repos/%s-%s" % (repo, self.arch.name))
+
+ def get_trunk_svn_link(self):
+ return self.get_svn_link("trunk")
def get_bugs_link(self):
repo = self.repo.name.lower()