--- cvsps-2.1.orig/debian/control +++ cvsps-2.1/debian/control @@ -0,0 +1,18 @@ +Source: cvsps +Section: devel +Priority: optional +Maintainer: Michael Casadevall +Build-Depends: debhelper (>> 4.0.0), zlib1g-dev, dpatch +Standards-Version: 3.7.2 + +Package: cvsps +Architecture: any +Depends: ${shlibs:Depends}, cvs +Description: Tool to generate CVS patch set information + CVSps is a program for generating 'patch set' information from a CVS + repository. A patch set in this case is defined as a set of changes made + to a collection of files, all committed at the same time (using a single + 'cvs commit' command). This information is valuable for seeing the + big picture of the evolution of a CVS project. While CVS tracks revision + information, it is often difficult to see what changes were committed + 'atomically' to the repository. --- cvsps-2.1.orig/debian/compat +++ cvsps-2.1/debian/compat @@ -0,0 +1 @@ +4 --- cvsps-2.1.orig/debian/rules +++ cvsps-2.1/debian/rules @@ -0,0 +1,71 @@ +#!/usr/bin/make -f +# Sample debian/rules that uses debhelper. +# GNU copyright 1997 to 1999 by Joey Hess. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +configure: configure-stamp +configure-stamp: patch + dh_testdir + # Add here commands to configure the package. + + + touch configure-stamp + +build: configure-stamp build-stamp +build-stamp: + dh_testdir + + $(MAKE) + + touch build-stamp + +clean: clean-patched unpatch +clean-patched: + dh_testdir + dh_testroot + rm -f build-stamp configure-stamp + + [ ! -f Makefile ] || $(MAKE) clean + + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + + prefix=$(CURDIR)/debian/cvsps/usr $(MAKE) install + + +binary-indep: build install + +patch: patch-stamp +patch-stamp: + dpatch apply-all + touch patch-stamp + +unpatch: + dpatch deapply-all + rm -rf patch-stamp debian/patched + +binary-arch: build install + dh_testdir + dh_testroot + dh_installdocs + dh_installman + dh_installchangelogs CHANGELOG + dh_link + dh_strip + dh_compress + dh_fixperms + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install configure --- cvsps-2.1.orig/debian/patches/00list +++ cvsps-2.1/debian/patches/00list @@ -0,0 +1,3 @@ +01_ignoretrunk.dpatch +02_dynamicbufferalloc.dpatch +03_diffoptstypo.dpatch --- cvsps-2.1.orig/debian/patches/04_freebsdversionstring.dpatch +++ cvsps-2.1/debian/patches/04_freebsdversionstring.dpatch @@ -0,0 +1,32 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 04_freebsdversionstring.dpatch by Anand Kumria +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: cope with single quotes in FreeBSD cvs pserver version string + +@DPATCH@ +diff -urNad cvsps-2.1~/cap.c cvsps-2.1/cap.c +--- cvsps-2.1~/cap.c 2005-05-25 23:39:40.000000000 -0400 ++++ cvsps-2.1/cap.c 2007-06-11 13:38:01.939320951 -0400 +@@ -121,11 +121,19 @@ + return 0; + } + ++ /* We might have encountered a FreeBSD system which ++ * has a mucked up version string of: ++ * Concurrent Versions System (CVS) '1.11.17'-FreeBSD (client/server) ++ * so re-test just in case ++ */ + p += skip; + if (sscanf(p, "%d.%d.%d", &major, &minor, &extra) != 3) + { +- debug(DEBUG_APPMSG1, "WARNING: malformed CVS version: %s", str); +- return 0; ++ if (sscanf(p, "'%d.%d.%d'", &major, &minor, &extra) != 3) ++ { ++ debug(DEBUG_APPMSG1, "WARNING: malformed CVS version: %s", str); ++ return 0; ++ } + } + + return (major > req_major || --- cvsps-2.1.orig/debian/patches/02_dynamicbufferalloc.dpatch +++ cvsps-2.1/debian/patches/02_dynamicbufferalloc.dpatch @@ -0,0 +1,125 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 02_dynamicbufferalloc.dpatch by +## +## 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) ++ { ++ 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); --- cvsps-2.1.orig/debian/patches/03_diffoptstypo.dpatch +++ cvsps-2.1/debian/patches/03_diffoptstypo.dpatch @@ -0,0 +1,19 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 03_diffoptstypo.dpatch by +## +## 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