git.iko.soy/typeable/nixpkgs
on master help sign in
cvsps: fetch patches from debian 2.1-7 sources
commit25164720501d143fc27c2cea921c1ea92f14584d authorJoachim Fasting <joachifm@fastmail.fm> dateFri 30 Dec 2016, 20:05 (10 years ago) parentb4c5916
4 files changed+34−172
pkgs/applications/version-management/cvsps/01_ignoretrunk.dpatch−23 pkgs/applications/version-management/cvsps/02_dynamicbufferalloc.dpatch−125 pkgs/applications/version-management/cvsps/03_diffoptstypo.dpatch−19 pkgs/applications/version-management/cvsps/default.nix+34−5
pkgs/applications/version-management/cvsps/01_ignoretrunk.dpatchdeleted−23
@@ -1,23 +0,0 @@
1−#! /bin/sh /usr/share/dpatch/dpatch-run
2−## 01_ignoretrunk.dpatch by <crafterm@debian.org>
3−##
4−## All lines beginning with `## DP:' are a description of the patch.
5−## DP: Ignore TRUNK branch name patch
6−
7−@DPATCH@
8−
9−diff -urN cvsps-2.1.orig/cvsps.c cvsps-2.1/cvsps.c
10−--- cvsps-2.1.orig/cvsps.c 2005-05-25 22:39:40.000000000 -0500
11−+++ cvsps-2.1/cvsps.c 2005-06-19 23:07:20.000000000 -0500
12−@@ -2104,6 +2109,11 @@
13−
14− if (!get_branch_ext(rev, eot, &leaf))
15− {
16−+ if (strcmp(tag, "TRUNK") == 0)
17−+ {
18−+ debug(DEBUG_STATUS, "ignoring the TRUNK branch/tag");
19−+ return;
20−+ }
21− debug(DEBUG_APPERROR, "malformed revision");
22− exit(1);
23− }
pkgs/applications/version-management/cvsps/02_dynamicbufferalloc.dpatchdeleted−125
@@ -1,125 +0,0 @@
1−#! /bin/sh /usr/share/dpatch/dpatch-run
2−## 02_dynamicbufferalloc.dpatch by <crafterm@debian.org>
3−##
4−## All lines beginning with `## DP:' are a description of the patch.
5−## DP: Dynamic buffer allocation
6−
7−@DPATCH@
8−
9−diff -urN cvsps-2.1-orig/cache.c cvsps-2.1/cache.c
10−--- cvsps-2.1-orig/cache.c 2005-05-25 22:39:40.000000000 -0500
11−+++ cvsps-2.1/cache.c 2005-07-26 15:21:29.716569500 -0500
12−@@ -108,10 +108,19 @@
13− int tag_flags = 0;
14− char branchbuff[LOG_STR_MAX] = "";
15− int branch_add = 0;
16−- char logbuff[LOG_STR_MAX] = "";
17−+ int logbufflen = LOG_STR_MAX + 1;
18−+ char * logbuff = malloc(logbufflen);
19− time_t cache_date = -1;
20− int read_version;
21−
22−+ if (logbuff == NULL)
23−+ {
24−+ debug(DEBUG_SYSERROR, "could not malloc %d bytes for logbuff in read_cache", logbufflen);
25−+ exit(1);
26−+ }
27−+
28−+ logbuff[0] = 0;
29−+
30− if (!(fp = cache_open("r")))
31− goto out;
32−
33−@@ -299,8 +308,19 @@
34− else
35− {
36− /* Make sure we have enough in the buffer */
37−- if (strlen(logbuff)+strlen(buff)<LOG_STR_MAX)
38−- strcat(logbuff, buff);
39−+ int len = strlen(buff);
40−+ if (strlen(logbuff) + len >= LOG_STR_MAX)
41−+ {
42−+ logbufflen += (len >= LOG_STR_MAX ? (len+1) : LOG_STR_MAX);
43−+ char * newlogbuff = realloc(logbuff, logbufflen);
44−+ if (newlogbuff == NULL)
45−+ {
46−+ debug(DEBUG_SYSERROR, "could not realloc %d bytes for logbuff in read_cache", logbufflen);
47−+ exit(1);
48−+ }
49−+ logbuff = newlogbuff;
50−+ }
51−+ strcat(logbuff, buff);
52− }
53− break;
54− case CACHE_NEED_PS_MEMBERS:
55−@@ -332,6 +352,7 @@
56− out_close:
57− fclose(fp);
58− out:
59−+ free(logbuff);
60− return cache_date;
61− }
62−
63−diff -urN cvsps-2.1-orig/cvsps.c cvsps-2.1/cvsps.c
64−--- cvsps-2.1-orig/cvsps.c 2005-05-25 22:39:40.000000000 -0500
65−+++ cvsps-2.1/cvsps.c 2005-07-26 15:22:02.558230700 -0500
66−@@ -265,7 +265,8 @@
67− PatchSetMember * psm = NULL;
68− char datebuff[20];
69− char authbuff[AUTH_STR_MAX];
70−- char logbuff[LOG_STR_MAX + 1];
71−+ int logbufflen = LOG_STR_MAX + 1;
72−+ char * logbuff = malloc(logbufflen);
73− int loglen = 0;
74− int have_log = 0;
75− char cmd[BUFSIZ];
76−@@ -273,6 +274,12 @@
77− char use_rep_buff[PATH_MAX];
78− char * ltype;
79−
80−+ if (logbuff == NULL)
81−+ {
82−+ debug(DEBUG_SYSERROR, "could not malloc %d bytes for logbuff in load_from_cvs", logbufflen);
83−+ exit(1);
84−+ }
85−+
86− if (!no_rlog && !test_log_file && cvs_check_cap(CAP_HAVE_RLOG))
87− {
88− ltype = "rlog";
89−@@ -480,24 +487,22 @@
90− */
91− if (have_log || !is_revision_metadata(buff))
92− {
93−- /* if the log buffer is full, that's it.
94−- *
95−- * Also, read lines (fgets) always have \n in them
96−- * which we count on. So if truncation happens,
97−- * be careful to put a \n on.
98−- *
99−- * Buffer has LOG_STR_MAX + 1 for room for \0 if
100−- * necessary
101−- */
102−- if (loglen < LOG_STR_MAX)
103−+ /* If the log buffer is full, try to reallocate more. */
104−+ if (loglen < logbufflen)
105− {
106− int len = strlen(buff);
107−
108−- if (len >= LOG_STR_MAX - loglen)
109−+ if (len >= logbufflen - loglen)
110− {
111−- debug(DEBUG_APPMSG1, "WARNING: maximum log length exceeded, truncating log");
112−- len = LOG_STR_MAX - loglen;
113−- buff[len - 1] = '\n';
114−+ debug(DEBUG_STATUS, "reallocating logbufflen to %d bytes for file %s", logbufflen, file->filename);
115−+ logbufflen += (len >= LOG_STR_MAX ? (len+1) : LOG_STR_MAX);
116−+ char * newlogbuff = realloc(logbuff, logbufflen);
117−+ if (newlogbuff == NULL)
118−+ {
119−+ debug(DEBUG_SYSERROR, "could not realloc %d bytes for logbuff in load_from_cvs", logbufflen);
120−+ exit(1);
121−+ }
122−+ logbuff = newlogbuff;
123− }
124−
125− debug(DEBUG_STATUS, "appending %s to log", buff);
pkgs/applications/version-management/cvsps/03_diffoptstypo.dpatchdeleted−19
@@ -1,19 +0,0 @@
1−#! /bin/sh /usr/share/dpatch/dpatch-run
2−## 03_diffoptstypo.dpatch by <crafterm@debian.org>
3−##
4−## All lines beginning with `## DP:' are a description of the patch.
5−## DP: Diff opts typo fix
6−
7−@DPATCH@
8−
9−--- cvsps-2.1-orig/cvsps.1 2005-05-26 05:39:40.000000000 +0200
10−+++ cvsps-2.1/cvsps.1 2005-07-28 15:17:48.885112048 +0200
11−@@ -83,7 +83,7 @@
12− disable the use of rlog internally. Note: rlog is
13− required for stable PatchSet numbering. Use with care.
14− .TP
15−-.B \-\-diffs\-opts <option string>
16−+.B \-\-diff\-opts <option string>
17− send a custom set of options to diff, for example to increase
18− the number of context lines, or change the diff format.
19− .TP
pkgs/applications/version-management/cvsps/default.nix+34−5
@@ -1,17 +1,46 @@
1−{ fetchurl, stdenv, cvs, zlib }:
1+{ stdenv, fetchurl, fetchpatch, cvs, zlib }:
22
33stdenv.mkDerivation rec {
44 name = "cvsps-${version}";
55 version = "2.1";
6+
67 src = fetchurl {
78 url = "mirror://debian/pool/main/c/cvsps/cvsps_${version}.orig.tar.gz";
89 sha256 = "0nh7q7zcmagx0i63h6fqqkkq9i55k77myvb8h6jn2f266f5iklwi";
910 };
1011
11− # Patches from Debian's `cvsps-2.1-4'.
12− patches = [ ./01_ignoretrunk.dpatch
13− ./02_dynamicbufferalloc.dpatch
14− ./03_diffoptstypo.dpatch ];
12+ # Patches from https://sources.debian.net/src/cvsps/2.1-7/debian/patches
13+ patches =
14+ [ (fetchpatch {
15+ url = "https://sources.debian.net/data/main/c/cvsps/2.1-7/debian/patches/01_ignoretrunk.patch";
16+ sha256 = "1gzb97dw2a6bm0bmim7p7wvsn0r82y3a8n22ln6rbbkkd8vlnzcb";
17+ })
18+
19+ (fetchpatch {
20+ url = "https://sources.debian.net/data/main/c/cvsps/2.1-7/debian/patches/02_dynamicbufferalloc.patch";
21+ sha256 = "0dm7azxnw0g9pdqkb3y4y2h047zgrclbh40av6c868wfp2j6l9sc";
22+ })
23+
24+ (fetchpatch {
25+ url = "https://sources.debian.net/data/main/c/cvsps/2.1-7/debian/patches/03_diffoptstypo.patch";
26+ sha256 = "06n8652g7inpv8cgqir7ijq00qw1fr0v44m2pbmgx7ilmna2vrcw";
27+ })
28+
29+ (fetchpatch {
30+ url = "https://sources.debian.net/data/main/c/cvsps/2.1-7/debian/patches/05-inet_addr_fix.patch";
31+ sha256 = "10w6px96dz8bb69asjzshvp787ccazmqnjsggqc4gwdal95q3cn7";
32+ })
33+
34+ (fetchpatch {
35+ url = "https://sources.debian.net/data/main/c/cvsps/2.1-7/debian/patches/fix-makefile";
36+ sha256 = "0m92b55hgldwg6lwdaybbj0n3lw1b3wj2xkk1cz1ywq073bpf3jm";
37+ })
38+
39+ (fetchpatch {
40+ url = "https://sources.debian.net/data/main/c/cvsps/2.1-7/debian/patches/fix-manpage";
41+ sha256 = "0gky14rhx82wv0gj8bkc74ki5xilhv5i3k1jc7khklr4lb6mmhpx";
42+ })
43+ ];
1544
1645 buildInputs = [ cvs zlib ];
1746