[aur-dev] [PATCH/RFC 5/5] Add public clone URLs to package details

Lukas Fleischer archlinux at cryptocrack.de
Tue Jun 17 14:22:53 EDT 2014


Signed-off-by: Lukas Fleischer <archlinux at cryptocrack.de>
---
 web/lib/config.inc.php.proto     | 1 +
 web/template/pkg_details.php     | 4 ++++
 web/template/pkgbase_details.php | 4 ++++
 3 files changed, 9 insertions(+)

diff --git a/web/lib/config.inc.php.proto b/web/lib/config.inc.php.proto
index cff3924..ee639eb 100644
--- a/web/lib/config.inc.php.proto
+++ b/web/lib/config.inc.php.proto
@@ -10,6 +10,7 @@ define( "AUR_db_pass", "aur" );
 
 # Configuration of directories where things live
 define( "CGIT_URI", "https://git.aur.archlinux.org/" );
+define( "GIT_CLONE_URL", "git://git.aur.archlinux.org/pub/git/%s.git/" );
 
 define( "USERNAME_MIN_LEN", 3 );
 define( "USERNAME_MAX_LEN", 16 );
diff --git a/web/template/pkg_details.php b/web/template/pkg_details.php
index 4fa6da9..31102bf 100644
--- a/web/template/pkg_details.php
+++ b/web/template/pkg_details.php
@@ -132,6 +132,10 @@ $sources = pkg_sources($row["ID"]);
 
 	<table id="pkginfo">
 		<tr>
+			<th><?= __('Git Clone URL') . ': ' ?></th>
+			<td><?= sprintf(GIT_CLONE_URL, htmlspecialchars($row['BaseName'])) ?></td>
+		</tr>
+		<tr>
 			<th><?= __('Package Base') . ': ' ?></th>
 			<td class="wrap"><a href="<?= htmlspecialchars(get_pkgbase_uri($row['BaseName']), ENT_QUOTES); ?>"><?= htmlspecialchars($row['BaseName']); ?></a></td>
 		</tr>
diff --git a/web/template/pkgbase_details.php b/web/template/pkgbase_details.php
index b9a35f5..2ad5cb5 100644
--- a/web/template/pkgbase_details.php
+++ b/web/template/pkgbase_details.php
@@ -107,6 +107,10 @@ $pkgs = pkgbase_get_pkgnames($base_id);
 
 	<table id="pkginfo">
 		<tr>
+			<th><?= __('Git Clone URL') . ': ' ?></th>
+			<td><?= sprintf(GIT_CLONE_URL, htmlspecialchars($row['Name'])) ?></td>
+		</tr>
+		<tr>
 			<th><?= __('Category') . ': ' ?></th>
 <?php
 if ($SID && ($uid == $row["MaintainerUID"] ||
-- 
2.0.0



More information about the aur-dev mailing list