cvsps: fetch patches from debian 2.1-7 sources
This commit is contained in:
parent
b4c5916e85
commit
2516472050
@ -1,23 +0,0 @@
|
|||||||
#! /bin/sh /usr/share/dpatch/dpatch-run
|
|
||||||
## 01_ignoretrunk.dpatch by <crafterm@debian.org>
|
|
||||||
##
|
|
||||||
## All lines beginning with `## DP:' are a description of the patch.
|
|
||||||
## DP: Ignore TRUNK branch name patch
|
|
||||||
|
|
||||||
@DPATCH@
|
|
||||||
|
|
||||||
diff -urN cvsps-2.1.orig/cvsps.c cvsps-2.1/cvsps.c
|
|
||||||
--- cvsps-2.1.orig/cvsps.c 2005-05-25 22:39:40.000000000 -0500
|
|
||||||
+++ cvsps-2.1/cvsps.c 2005-06-19 23:07:20.000000000 -0500
|
|
||||||
@@ -2104,6 +2109,11 @@
|
|
||||||
|
|
||||||
if (!get_branch_ext(rev, eot, &leaf))
|
|
||||||
{
|
|
||||||
+ if (strcmp(tag, "TRUNK") == 0)
|
|
||||||
+ {
|
|
||||||
+ debug(DEBUG_STATUS, "ignoring the TRUNK branch/tag");
|
|
||||||
+ return;
|
|
||||||
+ }
|
|
||||||
debug(DEBUG_APPERROR, "malformed revision");
|
|
||||||
exit(1);
|
|
||||||
}
|
|
@ -1,125 +0,0 @@
|
|||||||
#! /bin/sh /usr/share/dpatch/dpatch-run
|
|
||||||
## 02_dynamicbufferalloc.dpatch by <crafterm@debian.org>
|
|
||||||
##
|
|
||||||
## All lines beginning with `## DP:' are a description of the patch.
|
|
||||||
## DP: Dynamic buffer allocation
|
|
||||||
|
|
||||||
@DPATCH@
|
|
||||||
|
|
||||||
diff -urN cvsps-2.1-orig/cache.c cvsps-2.1/cache.c
|
|
||||||
--- cvsps-2.1-orig/cache.c 2005-05-25 22:39:40.000000000 -0500
|
|
||||||
+++ cvsps-2.1/cache.c 2005-07-26 15:21:29.716569500 -0500
|
|
||||||
@@ -108,10 +108,19 @@
|
|
||||||
int tag_flags = 0;
|
|
||||||
char branchbuff[LOG_STR_MAX] = "";
|
|
||||||
int branch_add = 0;
|
|
||||||
- char logbuff[LOG_STR_MAX] = "";
|
|
||||||
+ int logbufflen = LOG_STR_MAX + 1;
|
|
||||||
+ char * logbuff = malloc(logbufflen);
|
|
||||||
time_t cache_date = -1;
|
|
||||||
int read_version;
|
|
||||||
|
|
||||||
+ if (logbuff == NULL)
|
|
||||||
+ {
|
|
||||||
+ debug(DEBUG_SYSERROR, "could not malloc %d bytes for logbuff in read_cache", logbufflen);
|
|
||||||
+ exit(1);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ logbuff[0] = 0;
|
|
||||||
+
|
|
||||||
if (!(fp = cache_open("r")))
|
|
||||||
goto out;
|
|
||||||
|
|
||||||
@@ -299,8 +308,19 @@
|
|
||||||
else
|
|
||||||
{
|
|
||||||
/* Make sure we have enough in the buffer */
|
|
||||||
- if (strlen(logbuff)+strlen(buff)<LOG_STR_MAX)
|
|
||||||
- strcat(logbuff, buff);
|
|
||||||
+ int len = strlen(buff);
|
|
||||||
+ if (strlen(logbuff) + len >= LOG_STR_MAX)
|
|
||||||
+ {
|
|
||||||
+ logbufflen += (len >= LOG_STR_MAX ? (len+1) : LOG_STR_MAX);
|
|
||||||
+ char * newlogbuff = realloc(logbuff, logbufflen);
|
|
||||||
+ if (newlogbuff == NULL)
|
|
||||||
+ {
|
|
||||||
+ debug(DEBUG_SYSERROR, "could not realloc %d bytes for logbuff in read_cache", logbufflen);
|
|
||||||
+ exit(1);
|
|
||||||
+ }
|
|
||||||
+ logbuff = newlogbuff;
|
|
||||||
+ }
|
|
||||||
+ strcat(logbuff, buff);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case CACHE_NEED_PS_MEMBERS:
|
|
||||||
@@ -332,6 +352,7 @@
|
|
||||||
out_close:
|
|
||||||
fclose(fp);
|
|
||||||
out:
|
|
||||||
+ free(logbuff);
|
|
||||||
return cache_date;
|
|
||||||
}
|
|
||||||
|
|
||||||
diff -urN cvsps-2.1-orig/cvsps.c cvsps-2.1/cvsps.c
|
|
||||||
--- cvsps-2.1-orig/cvsps.c 2005-05-25 22:39:40.000000000 -0500
|
|
||||||
+++ cvsps-2.1/cvsps.c 2005-07-26 15:22:02.558230700 -0500
|
|
||||||
@@ -265,7 +265,8 @@
|
|
||||||
PatchSetMember * psm = NULL;
|
|
||||||
char datebuff[20];
|
|
||||||
char authbuff[AUTH_STR_MAX];
|
|
||||||
- char logbuff[LOG_STR_MAX + 1];
|
|
||||||
+ int logbufflen = LOG_STR_MAX + 1;
|
|
||||||
+ char * logbuff = malloc(logbufflen);
|
|
||||||
int loglen = 0;
|
|
||||||
int have_log = 0;
|
|
||||||
char cmd[BUFSIZ];
|
|
||||||
@@ -273,6 +274,12 @@
|
|
||||||
char use_rep_buff[PATH_MAX];
|
|
||||||
char * ltype;
|
|
||||||
|
|
||||||
+ if (logbuff == NULL)
|
|
||||||
+ {
|
|
||||||
+ debug(DEBUG_SYSERROR, "could not malloc %d bytes for logbuff in load_from_cvs", logbufflen);
|
|
||||||
+ exit(1);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
if (!no_rlog && !test_log_file && cvs_check_cap(CAP_HAVE_RLOG))
|
|
||||||
{
|
|
||||||
ltype = "rlog";
|
|
||||||
@@ -480,24 +487,22 @@
|
|
||||||
*/
|
|
||||||
if (have_log || !is_revision_metadata(buff))
|
|
||||||
{
|
|
||||||
- /* if the log buffer is full, that's it.
|
|
||||||
- *
|
|
||||||
- * Also, read lines (fgets) always have \n in them
|
|
||||||
- * which we count on. So if truncation happens,
|
|
||||||
- * be careful to put a \n on.
|
|
||||||
- *
|
|
||||||
- * Buffer has LOG_STR_MAX + 1 for room for \0 if
|
|
||||||
- * necessary
|
|
||||||
- */
|
|
||||||
- if (loglen < LOG_STR_MAX)
|
|
||||||
+ /* If the log buffer is full, try to reallocate more. */
|
|
||||||
+ if (loglen < logbufflen)
|
|
||||||
{
|
|
||||||
int len = strlen(buff);
|
|
||||||
|
|
||||||
- if (len >= LOG_STR_MAX - loglen)
|
|
||||||
+ if (len >= logbufflen - loglen)
|
|
||||||
{
|
|
||||||
- debug(DEBUG_APPMSG1, "WARNING: maximum log length exceeded, truncating log");
|
|
||||||
- len = LOG_STR_MAX - loglen;
|
|
||||||
- buff[len - 1] = '\n';
|
|
||||||
+ debug(DEBUG_STATUS, "reallocating logbufflen to %d bytes for file %s", logbufflen, file->filename);
|
|
||||||
+ logbufflen += (len >= LOG_STR_MAX ? (len+1) : LOG_STR_MAX);
|
|
||||||
+ char * newlogbuff = realloc(logbuff, logbufflen);
|
|
||||||
+ if (newlogbuff == NULL)
|
|
||||||
+ {
|
|
||||||
+ debug(DEBUG_SYSERROR, "could not realloc %d bytes for logbuff in load_from_cvs", logbufflen);
|
|
||||||
+ exit(1);
|
|
||||||
+ }
|
|
||||||
+ logbuff = newlogbuff;
|
|
||||||
}
|
|
||||||
|
|
||||||
debug(DEBUG_STATUS, "appending %s to log", buff);
|
|
@ -1,19 +0,0 @@
|
|||||||
#! /bin/sh /usr/share/dpatch/dpatch-run
|
|
||||||
## 03_diffoptstypo.dpatch by <crafterm@debian.org>
|
|
||||||
##
|
|
||||||
## All lines beginning with `## DP:' are a description of the patch.
|
|
||||||
## DP: Diff opts typo fix
|
|
||||||
|
|
||||||
@DPATCH@
|
|
||||||
|
|
||||||
--- cvsps-2.1-orig/cvsps.1 2005-05-26 05:39:40.000000000 +0200
|
|
||||||
+++ cvsps-2.1/cvsps.1 2005-07-28 15:17:48.885112048 +0200
|
|
||||||
@@ -83,7 +83,7 @@
|
|
||||||
disable the use of rlog internally. Note: rlog is
|
|
||||||
required for stable PatchSet numbering. Use with care.
|
|
||||||
.TP
|
|
||||||
-.B \-\-diffs\-opts <option string>
|
|
||||||
+.B \-\-diff\-opts <option string>
|
|
||||||
send a custom set of options to diff, for example to increase
|
|
||||||
the number of context lines, or change the diff format.
|
|
||||||
.TP
|
|
@ -1,17 +1,46 @@
|
|||||||
{ fetchurl, stdenv, cvs, zlib }:
|
{ stdenv, fetchurl, fetchpatch, cvs, zlib }:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
name = "cvsps-${version}";
|
name = "cvsps-${version}";
|
||||||
version = "2.1";
|
version = "2.1";
|
||||||
|
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url = "mirror://debian/pool/main/c/cvsps/cvsps_${version}.orig.tar.gz";
|
url = "mirror://debian/pool/main/c/cvsps/cvsps_${version}.orig.tar.gz";
|
||||||
sha256 = "0nh7q7zcmagx0i63h6fqqkkq9i55k77myvb8h6jn2f266f5iklwi";
|
sha256 = "0nh7q7zcmagx0i63h6fqqkkq9i55k77myvb8h6jn2f266f5iklwi";
|
||||||
};
|
};
|
||||||
|
|
||||||
# Patches from Debian's `cvsps-2.1-4'.
|
# Patches from https://sources.debian.net/src/cvsps/2.1-7/debian/patches
|
||||||
patches = [ ./01_ignoretrunk.dpatch
|
patches =
|
||||||
./02_dynamicbufferalloc.dpatch
|
[ (fetchpatch {
|
||||||
./03_diffoptstypo.dpatch ];
|
url = "https://sources.debian.net/data/main/c/cvsps/2.1-7/debian/patches/01_ignoretrunk.patch";
|
||||||
|
sha256 = "1gzb97dw2a6bm0bmim7p7wvsn0r82y3a8n22ln6rbbkkd8vlnzcb";
|
||||||
|
})
|
||||||
|
|
||||||
|
(fetchpatch {
|
||||||
|
url = "https://sources.debian.net/data/main/c/cvsps/2.1-7/debian/patches/02_dynamicbufferalloc.patch";
|
||||||
|
sha256 = "0dm7azxnw0g9pdqkb3y4y2h047zgrclbh40av6c868wfp2j6l9sc";
|
||||||
|
})
|
||||||
|
|
||||||
|
(fetchpatch {
|
||||||
|
url = "https://sources.debian.net/data/main/c/cvsps/2.1-7/debian/patches/03_diffoptstypo.patch";
|
||||||
|
sha256 = "06n8652g7inpv8cgqir7ijq00qw1fr0v44m2pbmgx7ilmna2vrcw";
|
||||||
|
})
|
||||||
|
|
||||||
|
(fetchpatch {
|
||||||
|
url = "https://sources.debian.net/data/main/c/cvsps/2.1-7/debian/patches/05-inet_addr_fix.patch";
|
||||||
|
sha256 = "10w6px96dz8bb69asjzshvp787ccazmqnjsggqc4gwdal95q3cn7";
|
||||||
|
})
|
||||||
|
|
||||||
|
(fetchpatch {
|
||||||
|
url = "https://sources.debian.net/data/main/c/cvsps/2.1-7/debian/patches/fix-makefile";
|
||||||
|
sha256 = "0m92b55hgldwg6lwdaybbj0n3lw1b3wj2xkk1cz1ywq073bpf3jm";
|
||||||
|
})
|
||||||
|
|
||||||
|
(fetchpatch {
|
||||||
|
url = "https://sources.debian.net/data/main/c/cvsps/2.1-7/debian/patches/fix-manpage";
|
||||||
|
sha256 = "0gky14rhx82wv0gj8bkc74ki5xilhv5i3k1jc7khklr4lb6mmhpx";
|
||||||
|
})
|
||||||
|
];
|
||||||
|
|
||||||
buildInputs = [ cvs zlib ];
|
buildInputs = [ cvs zlib ];
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user