From owner-freebsd-ports@FreeBSD.ORG Wed Oct 19 22:51:36 2005 Return-Path: X-Original-To: freebsd-ports@freebsd.org Delivered-To: freebsd-ports@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C352616A44F for ; Wed, 19 Oct 2005 22:51:34 +0000 (GMT) (envelope-from nox@saturn.kn-bremen.de) Received: from gwyn.kn-bremen.de (gwyn.kn-bremen.de [212.63.36.242]) by mx1.FreeBSD.org (Postfix) with ESMTP id 635DC43DB2 for ; Wed, 19 Oct 2005 22:51:08 +0000 (GMT) (envelope-from nox@saturn.kn-bremen.de) Received: from gwyn.kn-bremen.de (gwyn [127.0.0.1]) by gwyn.kn-bremen.de (8.13.4/8.13.4/Debian-3) with ESMTP id j9JMoSKF014632; Thu, 20 Oct 2005 00:50:28 +0200 Received: from saturn.kn-bremen.de (uucp@localhost) by gwyn.kn-bremen.de (8.13.4/8.13.4/Submit) with UUCP id j9JMoSfT014630; Thu, 20 Oct 2005 00:50:28 +0200 Received: from saturn.kn-bremen.de (localhost [127.0.0.1]) by saturn.kn-bremen.de (8.13.1/8.13.1) with ESMTP id j9JMkVYx013330; Thu, 20 Oct 2005 00:46:31 +0200 (CEST) (envelope-from nox@saturn.kn-bremen.de) Received: (from nox@localhost) by saturn.kn-bremen.de (8.13.1/8.13.1/Submit) id j9JMkUIj013329; Thu, 20 Oct 2005 00:46:30 +0200 (CEST) (envelope-from nox) Date: Thu, 20 Oct 2005 00:46:30 +0200 (CEST) From: Juergen Lock Message-Id: <200510192246.j9JMkUIj013329@saturn.kn-bremen.de> To: rmh@aybabtu.com X-Newsgroups: local.list.freebsd.ports In-Reply-To: <20051019102706.GA28521@aragorn> References: <20051018140137.GA16159@aragorn> <20051018200544.GA26528@saturn.kn-bremen.de> Organization: home Cc: freebsd-ports@freebsd.org Subject: Re: gzip-like CLI wrapper for p7zip X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Oct 2005 22:51:37 -0000 In article <20051019102706.GA28521@aragorn> you write: >On Tue, Oct 18, 2005 at 10:05:44PM +0200, Juergen Lock wrote: >> >> Well I could add it to the port (see below), but I think the need for >> tempfiles is unfortunate because it can cause problems like /tmp >> filling up. > >I'm aware of this. Unfortunately, p7zip doesn't seem to support streaming. >Try the following command: > > $ echo foo | 7z a dummy -si -so > /dev/null > > (see http://bugs.debian.org/323932 for more details on this) > >I don't think the changes are trivial. Most likely the algorithm requires >random access, and with my very reduced knowledge in compression techniques or >p7zip internals, this isn't something I can fix. > Well, even if it does, one could always compress fixed-size chunks of data sequentially. >> Maybe the 7z lib that cloop uses [1] [2] could be used >> for a `real' tempfile-less p7zip? >> [...] >> [1] http://advancemame.sourceforge.net/comp-readme.html > >It reads: > >"Recompress ZIP, GZ, PNG and MNG files using the Deflate 7-Zip implementation." > >I don't think this means it supports 7z format. Most likely it just means it >took the deflate algorithm code (for gzip, etc) from the 7-zip program (the >Windows version, which is also LGPL). > Nono, it is indeed 7z (the algo is called LZMA afaik), it is used by cloop to get better compression than it had previosly (using gzip/bzip2 libs.) >> (I dont know the 7z file format, >> maybe a new format has to be created in order to require no seeking, >> meaning the extension would have to be changed as well. (like gzip >> had to do with the zip format.) so maybe we shouldn't standardize >> on a p7zip command just yet...) > >Sorry, I don't know the 7z format either. However, much like other compression >formats, it is versioned: > > rmh@aragorn:/tmp$ echo foo | p7zip | file - > /dev/stdin: 7z archive data, version 0.2 > >I don't think there's a problem with standarising on a p7zip command. Streaming >is IMHO an essential capability in Un*x-style compressors. I think it's better >to emulate it poorly via /tmp hacks, than not having it at all. For example, >tar expects compressor programs to support streaming, so if we want to patch it >to do something like this: > > $ tar -cIf foo.tar.7z bar > >we'll need that. (In fact, this is what I had in mind when writing this >script). > >In case p7zip supports streaming properly later on (either by bumping the format >version to 0.3 or not), we can get rid of the script, or modify it to something >that just provides a gzip-like CLI interface that tar would work with. > Well, i dont know if the 7z maintainers are interested in supporting streaming themselves, it could well happen they bump their version for other reasons, which means p7zip's version numbering would have to be orthogonal to theirs... >(please note, in the above example I'm referring to gnu tar. I don't know which >tar implementation is used in FreeBSD, but the same would apply, I think) > Actually bsdtar calls the compression libraries itself (libz and libbz2), so best would in fact be to turn p7zip into a library too, but _that_ could still be done later. >> Index: files/p7zip >> @@ -0,0 +1,74 @@ >> +#!/bin/sh >> +# gzip-like CLI wrapper for p7zip >> +set -e > >Btw, I would verify that the script works on FreeBSD. In particular, I'd check >the `mktemp' and `which' commands are present and work the same way. As for >shell, it needs bourne. I don't recall using any bashisms but I'm not 1:1 sure. Yes I had to adapt the script slightly, as you can see... Juergen