Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 1 Jun 2004 21:25:14 +0000 (UTC)
From:      "Bjoern A. Zeeb" <bzeeb-lists@lists.zabbadoz.net>
To:        Peter Wemm <peter@freebsd.org>
Cc:        FreeBSD amd64 mailing list <freebsd-amd64@freebsd.org>
Subject:   patch|hack: amd64 native cvsup with compress working
Message-ID:  <Pine.BSF.4.53.0406012110280.26723@e0-0.zab2.int.zabbadoz.net>

next in thread | raw e-mail | index | archive | help
Hi,

I have compiled ezm3 and cvsup-without-gui from the sources with the
files from http://people.freebsd.org/~peter/ezm3-amd64/ .

As discussed in this thread[1] there still is a problem with
compression (libz).

[1] http://lists.freebsd.org/pipermail/freebsd-amd64/2004-February/thread.html#669

The following hack makes cvsup work with compression:

--- hack/patch ---
!
! the problem seems to be that Ugzip.Z_BUF_ERROR = -5 but
! if status = -5 it actually is 4294967291 and not -5
!
! most likely other negative values might have the same problem.
!
--- suplib/src/GzipWr.m3.orig	Tue Mar  4 19:26:23 2003
+++ suplib/src/GzipWr.m3	Tue Jun  1 21:06:41 2004
@@ -125,8 +125,8 @@
 	0,
 	ADR(self.wr.buff[self.wr.st]) + self.wr.cur - self.wr.lo,
 	self.wr.hi - self.wr.cur,
-	Ugzip.Z_PARTIAL_FLUSH);
-      IF status # Ugzip.Z_OK AND status # Ugzip.Z_BUF_ERROR THEN
+	Ugzip.Z_SYNC_FLUSH); (* Z_PARTIAL_FLUSH will go away according to zlib.h*)
+      IF status # Ugzip.Z_OK AND status # 4294967291 AND status # Ugzip.Z_BUF_ERROR THEN
 	RAISE Wr.Failure(GzipError.FromStatus(status));
       END;
       self.wr.cur := self.wr.hi - self.strmp.avail_out;
--- suplib/src/GzipRd.m3.orig	Tue Jun  1 21:02:48 2004
+++ suplib/src/GzipRd.m3	Tue Jun  1 21:03:30 2004
@@ -168,7 +168,7 @@
 	  ELSE
 	    RETURN RdClass.SeekResult.Eof;
 	  END;
-	ELSIF status # Ugzip.Z_OK AND status # Ugzip.Z_BUF_ERROR THEN
+	ELSIF status # Ugzip.Z_OK AND status # 4294967291 AND status # Ugzip.Z_BUF_ERROR THEN
 	  RAISE Rd.Failure(GzipError.FromStatus(status));
 	END;

--- /hack/patch ---

while one can reproduce the problem by using a Logger to print
	Fmt.Int(status)			(* 4294967291 *)
	Fmt.Int(-5)			(* -5 *)
	Fmt.Int(Ugzip.Z_BUF_ERROR)	(* -5 *)
I am still unsure where the problem comes from; but that's been
my first hours looking at m3 and I will most likely not further
dig into this.

here my test. I picked out one file of those and it looked ok.

--- cut ---
bz@noc:/u2/ports/net/cvsup-without-gui/work/cvsup-snap-16.1h/client/FBSD_AMD64> ./cvsup -g -L2 -z -s /u2/test/distrib-supfile
Parsing supfile "/u2/test/distrib-supfile"
Connecting to cvsup2.de.FreeBSD.org
Connected to cvsup2.de.FreeBSD.org
Server software version: SNAP_16_1h
Negotiating file attribute support
Exchanging collection information
Establishing multiplexed-mode data connection
Running
Updating collection distrib/cvs
 Mkdir distrib
 Mkdir distrib/cvsup
 Mkdir distrib/cvsup/sup
 Create distrib/cvsup/sup/README,v
 Mkdir distrib/cvsup/sup/cvs-all
 Create distrib/cvsup/sup/cvs-all/list.cvs,v
 Create distrib/cvsup/sup/cvs-all/releases,v
...
 SetAttrs distrib/cvsup/sup/www
 SetAttrs distrib/cvsup/sup
 Create distrib/cvsup/supfile,v
 SetAttrs distrib/cvsup
 SetAttrs distrib
Shutting down connection to server
Finished successfully
--- cut ---

-- 
Greetings

Bjoern A. Zeeb				bzeeb at Zabbadoz dot NeT



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.53.0406012110280.26723>