cvsps: Add Debian patches.

svn path=/nixpkgs/trunk/; revision=11472

+172
+23
pkgs/applications/version-management/cvsps/01_ignoretrunk.dpatch
···
··· 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 + }
+125
pkgs/applications/version-management/cvsps/02_dynamicbufferalloc.dpatch
···
··· 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);
+19
pkgs/applications/version-management/cvsps/03_diffoptstypo.dpatch
···
··· 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
+5
pkgs/applications/version-management/cvsps/default.nix
··· 7 sha256 = "0nh7q7zcmagx0i63h6fqqkkq9i55k77myvb8h6jn2f266f5iklwi"; 8 }; 9 10 buildInputs = [ cvs zlib ]; 11 12 installPhase = "make install prefix=$out";
··· 7 sha256 = "0nh7q7zcmagx0i63h6fqqkkq9i55k77myvb8h6jn2f266f5iklwi"; 8 }; 9 10 + # Patches from Debian's `cvsps-2.1-4'. 11 + patches = [ ./01_ignoretrunk.dpatch 12 + ./02_dynamicbufferalloc.dpatch 13 + ./03_diffoptstypo.dpatch ]; 14 + 15 buildInputs = [ cvs zlib ]; 16 17 installPhase = "make install prefix=$out";