From nobody@FreeBSD.org  Sun Mar  9 11:44:51 2008
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 523FD106566B
	for <freebsd-gnats-submit@FreeBSD.org>; Sun,  9 Mar 2008 11:44:51 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 3B2578FC16
	for <freebsd-gnats-submit@FreeBSD.org>; Sun,  9 Mar 2008 11:44:51 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.2/8.14.2) with ESMTP id m29BffnK017024
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 9 Mar 2008 11:41:41 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.2/8.14.1/Submit) id m29Bff34017022;
	Sun, 9 Mar 2008 11:41:41 GMT
	(envelope-from nobody)
Message-Id: <200803091141.m29Bff34017022@www.freebsd.org>
Date: Sun, 9 Mar 2008 11:41:41 GMT
From: Yarodin <yarodin@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [UPDATE] sysutils/deltup to 0.4.4
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         121517
>Category:       ports
>Synopsis:       [UPDATE] sysutils/deltup to 0.4.4
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    itetcu
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Sun Mar 09 11:50:00 UTC 2008
>Closed-Date:    Wed Mar 19 13:30:23 UTC 2008
>Last-Modified:  Wed Mar 19 13:50:01 UTC 2008
>Originator:     Yarodin
>Release:        6.3-RELEASE
>Organization:
>Environment:
>Description:
Update sysutils/deltup to 0.4.4
 
>How-To-Repeat:

>Fix:


Patch attached with submission follows:

--- Makefile.orig	2005-06-05 21:32:48.000000000 +0600
+++ Makefile		2008-03-09 16:08:59.000000000 +0500
@@ -6,10 +6,10 @@
 #
 
 PORTNAME=	deltup
-PORTVERSION=	0.4.2
-PORTREVISION=	1
+PORTVERSION=	0.4.4
 CATEGORIES=	sysutils
-MASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
+MASTER_SITES=	http://www.deltup.org/e107_files/downloads/ \
+		${MASTER_SITE_SOURCEFORGE}
 MASTER_SITE_SUBDIR=	${PORTNAME}
 
 MAINTAINER=	novel@FreeBSD.org
@@ -18,6 +18,8 @@
 RUN_DEPENDS=	bdelta:${PORTSDIR}/misc/bdelta
 
 USE_OPENSSL=	yes
+USE_GMAKE=	yes
+
 ALL_TARGET=	deltup
 PLIST_FILES=	bin/deltup \
 		bin/bzip2_old
--- distinfo.orig	2006-01-24 06:06:02.000000000 +0500
+++ distinfo		2008-03-09 16:07:51.000000000 +0500
@@ -1,3 +1,3 @@
-MD5 (deltup-0.4.2.tar.gz) = ac097b01b67719e51df8c6d677d28cd7
-SHA256 (deltup-0.4.2.tar.gz) = a4b20833130aa186b28fa6d936499513685f37888972e928778977187dbaa6a9
-SIZE (deltup-0.4.2.tar.gz) = 15714
+MD5 (deltup-0.4.4.tar.gz) = 3b8da493eec796bf4aa09f59f318a9cc
+SHA256 (deltup-0.4.4.tar.gz) = fba7f1a970a04b2b786402e55c017c667b065f1974154f2ba6a65c855357b744
+SIZE (deltup-0.4.4.tar.gz) = 14905
--- files/patch-Makefile.orig	2005-05-20 09:26:52.000000000 +0600
+++ files/patch-Makefile	2008-03-09 16:17:16.000000000 +0500
@@ -1,11 +1,22 @@
---- Makefile.orig	Sat Jul 19 22:25:26 2003
-+++ Makefile	Fri May 20 03:23:04 2005
-@@ -5,7 +5,7 @@
+--- Makefile.orig	2008-03-09 16:13:57.000000000 +0500
++++ Makefile	2008-03-09 16:16:06.000000000 +0500
+@@ -1,16 +1,16 @@
+ DESTDIR=
+-PREFIX=/usr
++PREFIX=/usr/local
+ BINDIR=$(PREFIX)/bin
+ 
+ CC = g++
+ 
+ objfiles=bpatch.o bzip2.o file.o system.o tmpstore.o deltup.o 
+-libs=-lstdc++ -lz -lbz2 -lssl
++libs=-lstdc++ -lz -lbz2 -lssl -lcrypt
+ 
  #edelta: edelta.cpp deltup
  #	gcc edelta.cpp ${CXXFLAGS} -o edelta
- deltup: deltup.cpp file.h linklist.h
--	gcc deltup.cpp ${CXXFLAGS} -o deltup -lstdc++ -lz -lbz2 -lssl
-+	${CXX} deltup.cpp ${CXXFLAGS} -o deltup -lstdc++ -lz -lbz2 -lssl -lcrypto
- install: deltup
- 	mkdir -p $(DESTDIR)$(BINDIR)
- 	install -m 755 mkdtu $(DESTDIR)$(BINDIR)
+ %.o : %.cpp
+-	${CC} -c $< -o $@ -g #-Wall -pedantic #-DFIXED_FRAMERATE
++	${CC} -c $< -o $@ ${CXXFLAGS} -g #-Wall -pedantic #-DFIXED_FRAMERATE
+ 
+ all: deltup
+ 
--- files/patch-bzip2.cpp.orig	1970-01-01 05:00:00.000000000 +0500
+++ files/patch-bzip2.cpp	2008-03-09 16:12:28.000000000 +0500
@@ -0,0 +1,38 @@
+--- bzip2.cpp.orig	2007-03-25 04:59:24.000000000 +0600
++++ bzip2.cpp		2008-03-09 11:19:55.000000000 +0500
+@@ -19,6 +19,7 @@
+ #include "system.h"
+ #include "tmpstore.h"
+ #include "bzip2.h"
++#include <stdio.h>
+
+ char *bzip2_compressor_name[MAX_BZIP2_COMPRESSORS] = {"0.9.0c", "1.0.2", "1.0.3", "1.0.4"};
+ char *bzip2_name[MAX_BZIP2_COMPRESSORS] = {NULL, NULL, NULL, NULL};
+@@ -31,14 +32,12 @@
+   system(command.c_str());
+
+   FILE * fp;
+-  char * line = NULL;
++  char line[2*CHAR_MAX];
+   string fname;
+-  size_t len = 0;
+-  ssize_t read;
+   fp = fopen(tempfile.c_str(), "r");
+   if (fp == NULL)
+        exit(EXIT_FAILURE);
+-  while ((read = getline(&line, &len, fp)) != -1) {
++  while (fgets(line, 2*CHAR_MAX, fp)!=NULL) {
+ //                 printf("Retrieved line of length %zu :\n", read);
+ //                 printf("%s", line);
+        char *v = strstr(line, "Version");
+@@ -56,8 +55,8 @@
+        }
+        fname = line;
+   }
+-  if (line)
+-       free(line);
++//  if (line)
++//      free(&line);
+   if (verbose) {
+     printf("found bzip2 compressors/decompressors:\n");
+     for (int i = 0; i < MAX_BZIP2_COMPRESSORS; ++i) {
--- files/patch-deltup.cpp.orig		2005-06-05 21:32:48.000000000 +0600
+++ files/patch-deltup.cpp		2008-03-09 16:13:13.000000000 +0500
@@ -1,19 +1,19 @@
---- deltup.cpp.orig	Fri May 27 18:53:49 2005
-+++ deltup.cpp	Fri May 27 18:55:24 2005
-@@ -748,14 +748,14 @@
- void applyPatchfile(char *fname) {
+--- deltup.cpp.orig	2007-07-13 09:22:20.000000000 +0600
++++ deltup.cpp		2008-03-08 23:18:08.000000000 +0500
+@@ -520,14 +520,14 @@
    IStream *f = new IFStream(fname);
    Injectable_IStream f2(*f);
--  if (((IFStream*)f)->bad()) {fprintf(stderr, "file is missing: %s\n", fname); return;}
-+  if (((IFStream*)f)->bad()) {fprintf(stderr, "file is missing: %s\n", fname); exit(1);}
-   int type = determine_filetype(f2);
+   if (((IFStream*)f)->bad()) {
+-    fprintf(stderr, "file is missing: %s\n", fname.c_str()); return;}
++    fprintf(stderr, "file is missing: %s\n", fname.c_str()); exit(1);}
+   unsigned type = determine_filetype(f2);
    delete f;
    switch (type) {
      case GZIP: f = new GZ_IFStream(fname); break;
      case BZIP2: f = new BZ_IFStream(fname); break;
      case DTU: f = new IFStream(fname); break;
--    case UNKNOWN_FMT: fprintf(stderr, "cannot read file %s\n", fname); return;
-+    case UNKNOWN_FMT: fprintf(stderr, "cannot read file %s\n", fname); exit(1);
+-    case UNKNOWN_FMT: fprintf(stderr, "cannot read file %s\n", fname.c_str()); return;
++    case UNKNOWN_FMT: fprintf(stderr, "cannot read file %s\n", fname.c_str()); exit(1);
      case TARBALL :
        f = new IFStream(fname);
        unsigned zero_count;
--- files/patch-system.cpp.orig		1970-01-01 05:00:00.000000000 +0500
+++ files/patch-system.cpp		2008-03-09 16:13:41.000000000 +0500
@@ -0,0 +1,11 @@
+--- system.cpp.orig	2007-03-25 04:45:52.000000000 +0600
++++ system.cpp		2008-03-08 22:51:00.000000000 +0500
+@@ -19,7 +19,7 @@
+ using namespace std;
+ #include "file.h"
+ #include "bpatch.h"
+-
++#include <sys/wait.h>
+ #include "filetypes.h"
+ 
+ bool verbose = false;


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->novel 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Sun Mar 9 11:50:06 UTC 2008 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=121517 

From: Yar Odin <yarodin@gmail.com>
To: bug-followup@freebsd.org,
 yarodin@gmail.com
Cc:  
Subject: Re: ports/121517: [UPDATE] sysutils/deltup to 0.4.4
Date: Wed, 12 Mar 2008 19:58:19 +0500

 --Boundary-00=_M++1HevvQ73ocpq
 Content-Type: text/plain;
   charset="us-ascii"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: inline
 
 New improved port of deltup 0.4.4:
 - build&install old bzip2(1.0.2/1.0.4) needed for several dtu's.
 - patch for proper detecting and using gnu gzip (freebsd gzip isn't fit)
 - fix some depends
 
 --Boundary-00=_M++1HevvQ73ocpq
 Content-Type: text/plain;
   charset="us-ascii";
   name="patch-deltup.txt"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: attachment;
 	filename="patch-deltup.txt"
 
 diff -ruN deltup.orig/Makefile deltup/Makefile
 --- deltup.orig/Makefile	2005-06-05 21:32:48.000000000 +0600
 +++ deltup/Makefile	2008-03-10 22:12:36.000000000 +0500
 @@ -6,22 +6,37 @@
  #
  
  PORTNAME=	deltup
 -PORTVERSION=	0.4.2
 -PORTREVISION=	1
 +PORTVERSION=	0.4.4
  CATEGORIES=	sysutils
 -MASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
 +MASTER_SITES=	http://deltup.org/e107_files/downloads/ \
 +		${MASTER_SITE_SOURCEFORGE} \
 +		http://www.bzip.org/${BZIP2_102}/:bzip2102src \
 +		http://www.bzip.org/${BZIP2_103}/:bzip2103src
  MASTER_SITE_SUBDIR=	${PORTNAME}
 +DISTFILES+=	${PORTNAME}-${PORTVERSION}.tar.gz ${BZIP2_102_SOURCE}:bzip2102src ${BZIP2_103_SOURCE}:bzip2103src
  
  MAINTAINER=	novel@FreeBSD.org
  COMMENT=	Source delta update program
  
 -RUN_DEPENDS=	bdelta:${PORTSDIR}/misc/bdelta
 +RUN_DEPENDS=	bdelta:${PORTSDIR}/misc/bdelta \
 +		xdelta:${PORTSDIR}/misc/xdelta \
 +		gzip:${PORTSDIR}/archivers/gzip
 +
 +BZIP2_102_SOURCE=	bzip2-${BZIP2_102}.tar.gz
 +BZIP2_103_SOURCE=	bzip2-${BZIP2_103}.tar.gz
 +
 +BZIP2_102=	1.0.2
 +BZIP2_103=	1.0.3
  
  USE_OPENSSL=	yes
 +USE_GMAKE=	yes
  ALL_TARGET=	deltup
  PLIST_FILES=	bin/deltup \
 -		bin/bzip2_old
 +		bin/bzip2_1.0.2 \
 +		bin/bzip2_1.0.3
  MAN1=		deltup.1
 +WRKSRC_BZIP2_102=	${WRKDIR}/bzip2-${BZIP2_102}
 +WRKSRC_BZIP2_103=	${WRKDIR}/bzip2-${BZIP2_103}
  
  .if !defined(NOPORTDOCS)
  PORTDOCS=	ChangeLog README
 @@ -29,11 +44,16 @@
  
  do-install:
  	${INSTALL_PROGRAM} ${WRKSRC}/deltup ${PREFIX}/bin
 +	${INSTALL_PROGRAM} ${WRKSRC_BZIP2_102}/bzip2 ${PREFIX}/bin/bzip2_1.0.2
 +	${INSTALL_PROGRAM} ${WRKSRC_BZIP2_103}/bzip2 ${PREFIX}/bin/bzip2_1.0.3
  	${INSTALL_MAN} ${WRKSRC}/deltup.1 ${PREFIX}/man/man1
 -.if !exists(${PREFIX}/bin/bzip2_old)
 -	@${LN} -s ${BZIP2_CMD} ${PREFIX}/bin/bzip2_old
 -.endif
 -
 +pre-build:
 +	@${REINPLACE_CMD} -e 's|-Wall -Winline -O2|-Wall -Winline -O2 ${CFLAGS}|' \
 +	${WRKSRC_BZIP2_102}/Makefile
 +	@${REINPLACE_CMD} -e 's|-Wall -Winline -O -g|-Wall -Winline -O2 ${CFLAGS}|' \
 +	${WRKSRC_BZIP2_103}/Makefile
 +	@cd ${WRKSRC_BZIP2_102}; ${GMAKE} bzip2; \
 +	cd ${WRKSRC_BZIP2_103}; ${GMAKE} bzip2;
  .if !defined(NOPORTDOCS)
  post-install:
  	@${MKDIR} ${DOCSDIR}
 diff -ruN deltup.orig/distinfo deltup/distinfo
 --- deltup.orig/distinfo	2006-01-24 06:06:02.000000000 +0500
 +++ deltup/distinfo	2008-03-10 20:35:01.000000000 +0500
 @@ -1,3 +1,9 @@
 -MD5 (deltup-0.4.2.tar.gz) = ac097b01b67719e51df8c6d677d28cd7
 -SHA256 (deltup-0.4.2.tar.gz) = a4b20833130aa186b28fa6d936499513685f37888972e928778977187dbaa6a9
 -SIZE (deltup-0.4.2.tar.gz) = 15714
 +MD5 (deltup-0.4.4.tar.gz) = 3b8da493eec796bf4aa09f59f318a9cc
 +SHA256 (deltup-0.4.4.tar.gz) = fba7f1a970a04b2b786402e55c017c667b065f1974154f2ba6a65c855357b744
 +SIZE (deltup-0.4.4.tar.gz) = 14905
 +MD5 (bzip2-1.0.2.tar.gz) = ee76864958d568677f03db8afad92beb
 +SHA256 (bzip2-1.0.2.tar.gz) = 4b526afa73ca1ccd6f5f1f5fd23813f159f715c3d0e00688f1df54b51f443cdd
 +SIZE (bzip2-1.0.2.tar.gz) = 665198
 +MD5 (bzip2-1.0.3.tar.gz) = 8a716bebecb6e647d2e8a29ea5d8447f
 +SHA256 (bzip2-1.0.3.tar.gz) = 4aaa8e7b4ecf03d91c33e8bf92d489533fa6c1f99e825c34058003f18eb68c13
 +SIZE (bzip2-1.0.3.tar.gz) = 669075
 diff -ruN deltup.orig/files/patch-Makefile deltup/files/patch-Makefile
 --- deltup.orig/files/patch-Makefile	2005-05-20 09:26:52.000000000 +0600
 +++ deltup/files/patch-Makefile	2008-03-10 21:15:26.000000000 +0500
 @@ -1,11 +1,22 @@
 ---- Makefile.orig	Sat Jul 19 22:25:26 2003
 -+++ Makefile	Fri May 20 03:23:04 2005
 -@@ -5,7 +5,7 @@
 +--- Makefile.orig	2005-05-21 06:23:34.000000000 +0600
 ++++ Makefile		2008-03-10 20:39:02.000000000 +0500
 +@@ -1,16 +1,16 @@
 + DESTDIR=
 +-PREFIX=/usr
 ++PREFIX=/usr/local
 + BINDIR=$(PREFIX)/bin
 + 
 + CC = g++
 + 
 +-objfiles=bpatch.o bzip2.o file.o system.o tmpstore.o deltup.o 
 ++objfiles=bpatch.o bzip2.o gzip.o file.o system.o tmpstore.o deltup.o 
 + libs=-lstdc++ -lz -lbz2 -lssl
 + 
   #edelta: edelta.cpp deltup
   #	gcc edelta.cpp ${CXXFLAGS} -o edelta
 - deltup: deltup.cpp file.h linklist.h
 --	gcc deltup.cpp ${CXXFLAGS} -o deltup -lstdc++ -lz -lbz2 -lssl
 -+	${CXX} deltup.cpp ${CXXFLAGS} -o deltup -lstdc++ -lz -lbz2 -lssl -lcrypto
 - install: deltup
 - 	mkdir -p $(DESTDIR)$(BINDIR)
 - 	install -m 755 mkdtu $(DESTDIR)$(BINDIR)
 + %.o : %.cpp
 +-	${CC} -c $< -o $@ -g #-Wall -pedantic #-DFIXED_FRAMERATE
 ++	${CC} -c $< -o $@ ${CXXFLAGS} #-g #-Wall -pedantic #-DFIXED_FRAMERATE
 + 
 + all: deltup
 + 
 \ No newline at end of file
 diff -ruN deltup.orig/files/patch-bzip2.cpp deltup/files/patch-bzip2.cpp
 --- deltup.orig/files/patch-bzip2.cpp	1970-01-01 05:00:00.000000000 +0500
 +++ deltup/files/patch-bzip2.cpp	2008-03-10 20:50:42.000000000 +0500
 @@ -0,0 +1,38 @@
 +--- bzip2.cpp.orig	2007-03-25 04:59:24.000000000 +0600
 ++++ bzip2.cpp		2008-03-09 23:37:35.000000000 +0500
 +@@ -19,6 +19,7 @@
 + #include "system.h"
 + #include "tmpstore.h"
 + #include "bzip2.h"
 ++#include <stdio.h>
 + 
 + char *bzip2_compressor_name[MAX_BZIP2_COMPRESSORS] = {"0.9.0c", "1.0.2", "1.0.3", "1.0.4"};
 + char *bzip2_name[MAX_BZIP2_COMPRESSORS] = {NULL, NULL, NULL, NULL};
 +@@ -31,14 +32,12 @@
 +   system(command.c_str());
 + 
 +   FILE * fp;
 +-  char * line = NULL;
 ++  char line[2*CHAR_MAX];
 +   string fname;
 +-  size_t len = 0;
 +-  ssize_t read;
 +   fp = fopen(tempfile.c_str(), "r");
 +   if (fp == NULL)
 +        exit(EXIT_FAILURE);
 +-  while ((read = getline(&line, &len, fp)) != -1) {
 ++  while (fgets(line, 2*CHAR_MAX, fp)!=NULL) {
 + //                 printf("Retrieved line of length %zu :\n", read);
 + //                 printf("%s", line);
 +        char *v = strstr(line, "Version");
 +@@ -56,8 +55,8 @@
 +        }
 +        fname = line;
 +   }
 +-  if (line)
 +-       free(line);
 ++//  if (line)
 ++//      free(&line);
 +   if (verbose) {
 +     printf("found bzip2 compressors/decompressors:\n");
 +     for (int i = 0; i < MAX_BZIP2_COMPRESSORS; ++i) {
 diff -ruN deltup.orig/files/patch-deltup.cpp deltup/files/patch-deltup.cpp
 --- deltup.orig/files/patch-deltup.cpp	2005-06-05 21:32:48.000000000 +0600
 +++ deltup/files/patch-deltup.cpp	2008-03-10 20:51:41.000000000 +0500
 @@ -1,19 +1,122 @@
 ---- deltup.cpp.orig	Fri May 27 18:53:49 2005
 -+++ deltup.cpp	Fri May 27 18:55:24 2005
 -@@ -748,14 +748,14 @@
 - void applyPatchfile(char *fname) {
 +--- deltup.cpp.orig	2007-07-13 09:22:20.000000000 +0600
 ++++ deltup.cpp		2008-03-10 14:03:08.000000000 +0500
 +@@ -32,6 +32,7 @@
 + #include "filetypes.h"
 + #include "system.h"
 + #include "bzip2.h"
 ++#include "gzip.h"
 + 
 + bool force_overwrite = false, remove_intermediate = false,
 +      info_mode = false, ensure_md5sum = false, use_bdelta = false;
 +@@ -150,28 +151,33 @@
 + 
 + void gzip_without_header(string in, string out, char compression) {
 +   string tempfile = getTmpFilename();
 +-  
 +-  deflate("gzip", in, tempfile, compression, false);
 ++  find_gzip_compressor();
 ++  if (gzip_name != NULL) {
 ++    deflate(gzip_name, in, tempfile, compression, false);
 + //  printf("here2 %s %s %c\n", in.c_str(), tempfile.c_str(), compression);
 +-  unsigned filesize = getLenOfFile(tempfile);
 +-  char inbuf[12];
 +-  IFStream *f = new IFStream(tempfile);
 +-  f->read(inbuf, 10);
 +-  char flags = inbuf[3];
 +-  
 +-  if (flags & 2) f->read(inbuf, 2);
 +-  if (flags & 4) {
 +-    unsigned extrafieldsize = read_word(*f);
 +-    while (extrafieldsize) 
 +-      extrafieldsize -= f->read(inbuf, extrafieldsize<10?extrafieldsize:10);
 +-  }
 +-  if (flags & 8) do f->read(inbuf, 1); while (*inbuf);
 +-  if (flags & 16) do f->read(inbuf, 1); while (*inbuf);
 +-  if (flags & 32) f->read(inbuf, 2);
 +-  
 +-  OFStream o(out);
 +-  copy_bytes_to_file(*f, o, filesize-f->loc());
 +-  delete f;
 ++    unsigned filesize = getLenOfFile(tempfile);
 ++    char inbuf[12];
 ++    IFStream *f = new IFStream(tempfile);
 ++    f->read(inbuf, 10);
 ++    char flags = inbuf[3];
 ++  
 ++    if (flags & 2) f->read(inbuf, 2);
 ++    if (flags & 4) {
 ++       unsigned extrafieldsize = read_word(*f);
 ++       while (extrafieldsize) 
 ++         extrafieldsize -= f->read(inbuf, extrafieldsize<10?extrafieldsize:10);
 ++    }
 ++    if (flags & 8) do f->read(inbuf, 1); while (*inbuf);
 ++    if (flags & 16) do f->read(inbuf, 1); while (*inbuf);
 ++    if (flags & 32) f->read(inbuf, 2);
 ++  
 ++    OFStream o(out);
 ++    copy_bytes_to_file(*f, o, filesize-f->loc());
 ++    delete f;
 ++    gzip_found = 1;
 ++  } else {
 ++    gzip_found = 0;
 ++  }
 +   doneTmpFile(tempfile);
 + 
 + }
 +@@ -245,12 +251,16 @@
 +     string gzip_temp = getTmpFilename();
 +     const char *lev = "968712534";
 +     do {
 +-      printf("here %c\n", *lev);
 +       gzip_without_header(file2.uname, gzip_temp, *lev);
 ++      if (gzip_found == 0) { break; 
 ++      } else {
 ++         printf("here %c\n", *lev);
 ++      }
 +       makeDelta(use_bdelta, gzip_temp, file2.fullname(), pristineName);
 +       ++lev;
 +     } while (*lev && getLenOfFile(pristineName)>1024);
 +-    if (!*lev) error("Unknown gzip compression format");
 ++    if (gzip_found == 0) { error("Can't find GNU gzip");
 ++    } else if (!*lev) { error("Unknown gzip compression format"); }
 +     compression_level=*(lev-1)-'0';
 +     doneTmpFile(gzip_temp);
 +   } else if (file2.type==BZIP2) {
 +@@ -315,7 +325,7 @@
 +   }
 +   }
 +   switch (patch_compression_type) {
 +-    case GZIP: deflate("gzip", finalName, patchfname, patch_compression, false); break;
 ++    case GZIP:         deflate("gzip", finalName, patchfname, patch_compression, false); break;
 +     case BZIP2: deflate("bzip2", finalName, patchfname, patch_compression, false); break;
 +     case UNKNOWN_FMT: cat(finalName, patchfname, false); break;
 +   }
 +@@ -365,7 +375,10 @@
 +                            bzip2_name[i]);
 +       } else fprintf(stderr, "Error: Deltup cannot find the proper bzip2 to rebuild the package\n");
 +       break;
 +-    case GZIP: gzip_without_header(f.uname, finalName, c); break;
 ++    case GZIP: 
 ++      gzip_without_header(f.uname, finalName, c); 
 ++      if (gzip_found == 0) error("Can't find GNU gzip");
 ++      break;
 +     case UNKNOWN_FMT: cat(f.uname, finalName, false);
 +     
 +   };
 +@@ -520,14 +533,14 @@
     IStream *f = new IFStream(fname);
     Injectable_IStream f2(*f);
 --  if (((IFStream*)f)->bad()) {fprintf(stderr, "file is missing: %s\n", fname); return;}
 -+  if (((IFStream*)f)->bad()) {fprintf(stderr, "file is missing: %s\n", fname); exit(1);}
 -   int type = determine_filetype(f2);
 +   if (((IFStream*)f)->bad()) {
 +-    fprintf(stderr, "file is missing: %s\n", fname.c_str()); return;}
 ++    fprintf(stderr, "file is missing: %s\n", fname.c_str()); exit(1);}
 +   unsigned type = determine_filetype(f2);
     delete f;
     switch (type) {
       case GZIP: f = new GZ_IFStream(fname); break;
       case BZIP2: f = new BZ_IFStream(fname); break;
       case DTU: f = new IFStream(fname); break;
 --    case UNKNOWN_FMT: fprintf(stderr, "cannot read file %s\n", fname); return;
 -+    case UNKNOWN_FMT: fprintf(stderr, "cannot read file %s\n", fname); exit(1);
 +-    case UNKNOWN_FMT: fprintf(stderr, "cannot read file %s\n", fname.c_str()); return;
 ++    case UNKNOWN_FMT: fprintf(stderr, "cannot read file %s\n", fname.c_str()); exit(1);
       case TARBALL :
         f = new IFStream(fname);
         unsigned zero_count;
 diff -ruN deltup.orig/files/patch-gzip.cpp deltup/files/patch-gzip.cpp
 --- deltup.orig/files/patch-gzip.cpp	1970-01-01 05:00:00.000000000 +0500
 +++ deltup/files/patch-gzip.cpp	2008-03-12 19:41:54.000000000 +0500
 @@ -0,0 +1,62 @@
 +--- gzip.cpp.orig	1970-01-01 05:00:00.000000000 +0500
 ++++ gzip.cpp		2008-03-10 14:15:19.000000000 +0500
 +@@ -0,0 +1,59 @@
 ++/* Copyright (C) 2007  John Whitney
 ++ *
 ++ * This program is free software; you can redistribute it and/or modify
 ++ * it under the terms of the GNU General Public License as published by
 ++ * the Free Software Foundation; version 2 of the License.
 ++ *
 ++ * This program is distributed in the hope that it will be useful,
 ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
 ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 ++ * GNU General Public License for more details.
 ++ *
 ++ * Author: John Whitney <jjw@deltup.org>
 ++ */
 ++
 ++#include <string>
 ++#include <list>
 ++using namespace std;
 ++#include "file.h"
 ++#include "system.h"
 ++#include "tmpstore.h"
 ++#include "gzip.h"
 ++#include <stdio.h>
 ++
 ++int gzip_found = 0;
 ++char *gzip_name = NULL;
 ++
 ++void find_gzip_compressor() {
 ++  string tempfile = getTmpFilename();
 ++  string command = "find `echo $PATH | tr \":\" \" \"` -iname \"gzip\" -exec sh -c 'echo {};{} -V 2>&1|grep \"^gzip\"' \\; 2> /dev/null > "
 ++     + tempfile;
 ++
 ++  system(command.c_str());
 ++
 ++  FILE * fp;
 ++  char line[2*CHAR_MAX];
 ++  string fname;
 ++  fp = fopen(tempfile.c_str(), "r");
 ++  if (fp == NULL)
 ++       exit(EXIT_FAILURE);
 ++  while (fgets(line, 2*CHAR_MAX, fp)!=NULL) {
 ++       char *v = strstr(line, "gzip");       
 ++       if (v) {
 ++         int index=-1;
 ++        if (strncmp(v+5, "1.", 2) == 0) index=0;
 ++        if (index!=-1)
 ++        {
 ++          gzip_name = new char[fname.length()];
 ++          strncpy(gzip_name, fname.c_str(), fname.length()-1);
 ++          gzip_name[fname.length()-1] = 0;
 ++          break;
 ++        }
 ++       }
 ++      fname = line;
 ++  }
 ++  if (verbose) {
 ++    printf("found gnu gzip compressor/decompressor:\n");
 ++    if (gzip_name!=NULL) printf("  %s\n", gzip_name);
 ++  }
 ++}
 diff -ruN deltup.orig/files/patch-gzip.h deltup/files/patch-gzip.h
 --- deltup.orig/files/patch-gzip.h	1970-01-01 05:00:00.000000000 +0500
 +++ deltup/files/patch-gzip.h	2008-03-10 21:12:23.000000000 +0500
 @@ -0,0 +1,20 @@
 +--- gzip.h.orig		1970-01-01 05:00:00.000000000 +0500
 ++++ gzip.h		2008-03-10 10:38:01.000000000 +0500
 +@@ -0,0 +1,17 @@
 ++/* Copyright (C) 2007  John Whitney
 ++ *
 ++ * This program is free software; you can redistribute it and/or modify
 ++ * it under the terms of the GNU General Public License as published by
 ++ * the Free Software Foundation; version 2 of the License.
 ++ *
 ++ * This program is distributed in the hope that it will be useful,
 ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
 ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 ++ * GNU General Public License for more details.
 ++ *
 ++ * Author: John Whitney <jjw@deltup.org>
 ++ */
 ++
 ++extern char *gzip_name;
 ++extern int gzip_found;
 ++void find_gzip_compressor();
 diff -ruN deltup.orig/files/patch-system.cpp deltup/files/patch-system.cpp
 --- deltup.orig/files/patch-system.cpp	1970-01-01 05:00:00.000000000 +0500
 +++ deltup/files/patch-system.cpp	2008-03-12 19:42:02.000000000 +0500
 @@ -0,0 +1,11 @@
 +--- system.cpp.orig	2007-03-25 04:45:52.000000000 +0600
 ++++ system.cpp		2008-03-08 22:51:00.000000000 +0500
 +@@ -19,7 +19,7 @@
 + using namespace std;
 + #include "file.h"
 + #include "bpatch.h"
 +-
 ++#include <sys/wait.h>
 + #include "filetypes.h"
 + 
 + bool verbose = false;
 
 --Boundary-00=_M++1HevvQ73ocpq--
Responsible-Changed-From-To: novel->itetcu 
Responsible-Changed-By: itetcu 
Responsible-Changed-When: Wed Mar 19 07:59:24 UTC 2008 
Responsible-Changed-Why:  
I'll take it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=121517 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/121517: commit references a PR
Date: Wed, 19 Mar 2008 13:27:59 +0000 (UTC)

 rafan       2008-03-19 13:27:48 UTC
 
   FreeBSD ports repository
 
   Modified files:
     sysutils/deltup      Makefile distinfo 
     sysutils/deltup/files patch-Makefile patch-deltup.cpp 
   Added files:
     sysutils/deltup/files patch-bzip2.cpp patch-system.cpp 
   Log:
   - Update to 0.4.4
   
   PR:             ports/121517
   Submitted by:   Yarodin <yarodin at gmail.com>
   Approved by:    novel (maintainer, implicit)
   
   Revision  Changes    Path
   1.4       +8 -3      ports/sysutils/deltup/Makefile
   1.3       +3 -3      ports/sysutils/deltup/distinfo
   1.3       +20 -9     ports/sysutils/deltup/files/patch-Makefile
   1.1       +38 -0     ports/sysutils/deltup/files/patch-bzip2.cpp (new)
   1.2       +9 -9      ports/sysutils/deltup/files/patch-deltup.cpp
   1.1       +11 -0     ports/sysutils/deltup/files/patch-system.cpp (new)
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: open->closed 
State-Changed-By: rafan 
State-Changed-When: Wed Mar 19 13:30:22 UTC 2008 
State-Changed-Why:  
Committed. Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=121517 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/121517: commit references a PR
Date: Wed, 19 Mar 2008 13:48:39 +0000 (UTC)

 rafan       2008-03-19 13:48:33 UTC
 
   FreeBSD ports repository
 
   Modified files:
     sysutils/deltup      Makefile distinfo 
     sysutils/deltup/files patch-Makefile patch-bzip2.cpp 
                           patch-deltup.cpp 
   Added files:
     sysutils/deltup/files patch-gzip.cpp patch-gzip.h 
   Log:
   Add missing patch from PR:
   
   - Build and install old versions of bzip2 which are needed by dtu's
   - Patch for properly detecting and using GNU gzip (our gzip does not fit)
   - Add missing dependency on misc/xdelta
   
   PR:             ports/121517
   Submitted by:   Yarodin <yarodin at gmail.com>
   Approved by:    novel (maintainer, implicit)
   
   Revision  Changes    Path
   1.5       +27 -9     ports/sysutils/deltup/Makefile
   1.4       +6 -0      ports/sysutils/deltup/distinfo
   1.4       +6 -6      ports/sysutils/deltup/files/patch-Makefile
   1.2       +3 -3      ports/sysutils/deltup/files/patch-bzip2.cpp
   1.3       +105 -2    ports/sysutils/deltup/files/patch-deltup.cpp
   1.1       +62 -0     ports/sysutils/deltup/files/patch-gzip.cpp (new)
   1.1       +20 -0     ports/sysutils/deltup/files/patch-gzip.h (new)
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
