From owner-freebsd-ports@FreeBSD.ORG Wed Oct 19 10:27:02 2005 Return-Path: X-Original-To: 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 AA5F816A41F for ; Wed, 19 Oct 2005 10:27:02 +0000 (GMT) (envelope-from rmh@aybabtu.com) Received: from khazad.dyndns.org (216.red-62-57-140.user.auna.net [62.57.140.216]) by mx1.FreeBSD.org (Postfix) with ESMTP id C9B5E43D48 for ; Wed, 19 Oct 2005 10:27:01 +0000 (GMT) (envelope-from rmh@aybabtu.com) Received: from rmh by khazad.dyndns.org with local (Exim 4.52) id 1ESBA3-0007Tt-3c for ports@freebsd.org; Wed, 19 Oct 2005 12:27:07 +0200 Date: Wed, 19 Oct 2005 12:27:06 +0200 From: Robert Millan To: ports@freebsd.org Message-ID: <20051019102706.GA28521@aragorn> References: <20051018140137.GA16159@aragorn> <20051018200544.GA26528@saturn.kn-bremen.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20051018200544.GA26528@saturn.kn-bremen.de> Sender: Robert Millan Organisation: free as in freedom User-Agent: Mutt/1.5.10i Cc: 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 10:27:02 -0000 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. > 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). > (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. (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) > 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. -- Robert Millan