summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorponce <matteo.bernardini@gmail.com>2012-06-30 12:04:35 -0400
committerdsomero <xgizzmo@slackbuilds.org>2012-06-30 12:04:35 -0400
commitb5d9003dbe5ea4a605860099d27ea422620ceaab (patch)
treeb5683fcf7d369d9b9baf4c13b8189ba4467ba1e8
parent380fa5430ebc70c88c719f5b43f58927975e3d0b (diff)
downloadslackbuilds-b5d9003dbe5ea4a605860099d27ea422620ceaab.tar.gz
development/cgit: Updated for version 20120318_f50be7f.
Signed-off-by: dsomero <xgizzmo@slackbuilds.org>
-rw-r--r--development/cgit/cgit.SlackBuild11
-rw-r--r--development/cgit/cgit.info10
-rw-r--r--development/cgit/sort-summary-branches.patch82
3 files changed, 94 insertions, 9 deletions
diff --git a/development/cgit/cgit.SlackBuild b/development/cgit/cgit.SlackBuild
index 9953e1dd93..1c21ca6b64 100644
--- a/development/cgit/cgit.SlackBuild
+++ b/development/cgit/cgit.SlackBuild
@@ -4,8 +4,8 @@
# Written by ponce <matteo.bernardini@gmail.com>
PRGNAM=cgit
-VERSION=${VERSION:-0.9.0.1}
-CGIT_VERSION=${CGIT_VERSION:-v$VERSION}
+VERSION=${VERSION:-20120318_f50be7f}
+CGIT_VERSION=${CGIT_VERSION:-v0.9.0.3-4-gf50b}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
@@ -39,9 +39,9 @@ fi
DOCS="cgitrc.5.txt COPYING README $CWD/config/cgit-lighttpd.conf \
$CWD/config/cgit-httpd.conf $CWD/config/cgitrc.sample"
-GIT_TARBALL=$(grep \/git- $CWD/cgit.info | cut -d'/' -f8 | sed -e 's/\"//')
+GIT_TARBALL=$(grep \/git- $CWD/cgit.info | cut -d'/' -f7 | sed -e 's/\"//')
-set -e # Exit on most errors
+set -e
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
@@ -56,6 +56,9 @@ find . \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \;
+# add a patch to sort summary branches
+patch -p1 < $CWD/sort-summary-branches.patch
+
# prepare sources
sed -i -e "s|-g -Wall -Igit|-Wall ${SLKCFLAGS} -Igit|" Makefile
sed -i -e "s|\/lib$|/lib${LIBDIRSUFFIX}|" Makefile
diff --git a/development/cgit/cgit.info b/development/cgit/cgit.info
index 88379e18c8..89275a7960 100644
--- a/development/cgit/cgit.info
+++ b/development/cgit/cgit.info
@@ -1,10 +1,10 @@
PRGNAM="cgit"
-VERSION="0.9.0.1"
+VERSION="20120318_f50be7f"
HOMEPAGE="http://hjemli.net/git/cgit/"
-DOWNLOAD="http://ponce.cc/slackware/sources/repo/cgit-0.9.0.1.tar.bz2 \
- http://www.kernel.org/pub/software/scm/git/git-1.7.4.4.tar.bz2"
-MD5SUM="dddae5bcfc1eeb469fc2b95531a75c1c \
- 1313f71d62fa100b32fa313769a85f2a"
+DOWNLOAD="http://ponce.cc/slackware/sources/repo/cgit-20120318_f50be7f.tar.xz \
+ http://ponce.cc/slackware/sources/repo/git-1.7.4.4.tar.xz"
+MD5SUM="1aabbefa20502d85019d9bc62d12c16a \
+ 992da984346a475cf6334efad396e229"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
MAINTAINER="ponce"
diff --git a/development/cgit/sort-summary-branches.patch b/development/cgit/sort-summary-branches.patch
new file mode 100644
index 0000000000..2b1d96c693
--- /dev/null
+++ b/development/cgit/sort-summary-branches.patch
@@ -0,0 +1,82 @@
+When there are more than `summary-branches` in a repo, the summary page
+trimmed the list by age and then sorted them by name. Make sorting by
+name optional, though keep it as the default.
+
+Signed-off-by: Todd Zullinger <tmz at pobox.com>
+---
+This was requested by a friend for whom I setup cgit. I don't know if
+it's a worthwhile option or not. It's handy for me to avoid having to
+patch that install. Beware, my C is weak. If there are egregious
+errors in style or content, I won't be shocked or offended to hear
+about them.
+
+ cgit.c | 3 +++
+ cgit.h | 1 +
+ cgitrc.5.txt | 5 +++++
+ ui-refs.c | 4 +++-
+ 4 files changed, 12 insertions(+), 1 deletions(-)
+
+diff --git a/cgit.c b/cgit.c
+index e302a7c..ebbcad1 100644
+--- a/cgit.c
++++ b/cgit.c
+@@ -233,6 +233,8 @@ void config_cb(const char *name, const char *value)
+ ctx.cfg.local_time = atoi(value);
+ else if (!prefixcmp(name, "mimetype."))
+ add_mimetype(name + 9, value);
++ else if (!strcmp(name, "summary-branches-sort"))
++ ctx.cfg.summary_branches_sort = xstrdup(value);
+ else if (!strcmp(name, "include"))
+ parse_configfile(expand_macros(value), config_cb);
+ }
+@@ -331,6 +333,7 @@ static void prepare_context(struct cgit_context *ctx)
+ ctx->cfg.script_name = CGIT_SCRIPT_NAME;
+ ctx->cfg.section = "";
+ ctx->cfg.summary_branches = 10;
++ ctx->cfg.summary_branches_sort = "name";
+ ctx->cfg.summary_log = 10;
+ ctx->cfg.summary_tags = 10;
+ ctx->cfg.max_atom_items = 10;
+diff --git a/cgit.h b/cgit.h
+index b5f00fc..2f847a1 100644
+--- a/cgit.h
++++ b/cgit.h
+@@ -216,6 +216,7 @@ struct cgit_config {
+ int section_from_path;
+ int snapshots;
+ int summary_branches;
++ char *summary_branches_sort;
+ int summary_log;
+ int summary_tags;
+ int ssdiff;
+diff --git a/cgitrc.5.txt b/cgitrc.5.txt
+index 65b210f..1c8574b 100644
+--- a/cgitrc.5.txt
++++ b/cgitrc.5.txt
+@@ -324,6 +324,11 @@ summary-branches::
+ Specifies the number of branches to display in the repository "summary"
+ view. Default value: "10".
+
++summary-branches-sort::
++ Specifies the sort order to use for branches on the summary page, when
++ there are more than `summary-count` branches. Valid options are "name"
++ and "age". Default value: "name".
++
+ summary-log::
+ Specifies the number of log entries to display in the repository
+ "summary" view. Default value: "10".
+diff --git a/ui-refs.c b/ui-refs.c
+index caddfbc..188e63d 100644
+--- a/ui-refs.c
++++ b/ui-refs.c
+@@ -197,7 +197,9 @@ void cgit_print_branches(int maxcount)
+
+ if (maxcount < list.count) {
+ qsort(list.refs, list.count, sizeof(*list.refs), cmp_branch_age);
+- qsort(list.refs, maxcount, sizeof(*list.refs), cmp_ref_name);
++ if (ctx.cfg.summary_branches_sort &&
++ !strcmp(ctx.cfg.summary_branches_sort, "name"))
++ qsort(list.refs, maxcount, sizeof(*list.refs), cmp_ref_name);
+ }
+
+ for(i=0; i<maxcount; i++)