X-Original-To: alpine-devel@lists.alpinelinux.org Delivered-To: alpine-devel@lists.alpinelinux.org Received: from mail.wtbts.no (mail.wtbts.no [213.234.126.131]) by lists.alpinelinux.org (Postfix) with ESMTP id BF3001EBFF1 for ; Wed, 29 Dec 2010 07:45:46 +0000 (UTC) Received: from localhost (bsna.nor.wtbts.net [127.0.0.1]) by mail.wtbts.no (Postfix) with ESMTP id A1E7AAE4002; Wed, 29 Dec 2010 07:45:45 +0000 (UTC) X-Virus-Scanned: Yes Received: from mail.wtbts.no ([127.0.0.1]) by localhost (bsna.nor.wtbts.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id BLjBfjfT7X1x; Wed, 29 Dec 2010 07:45:44 +0000 (UTC) Received: from mail.ytre.org (extmail.nor.wtbts.net [10.65.72.14]) by mail.wtbts.no (Postfix) with ESMTP id 901EAAE4001; Wed, 29 Dec 2010 07:45:44 +0000 (UTC) Received: from mail.ytre.org (localhost [127.0.0.1]) by mail.ytre.org (Postfix) with ESMTP id 5D6E96150F4EF; Wed, 29 Dec 2010 07:45:44 +0000 (UTC) Received: from ncopa-desktop.nor.wtbts.net (unknown [10.65.65.1]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: ncopa@ytre.org) by mail.ytre.org (Postfix) with ESMTPSA id 12B1960A87547; Wed, 29 Dec 2010 07:45:43 +0000 (UTC) Date: Wed, 29 Dec 2010 08:45:40 +0100 From: Natanael Copa To: Matt Smith Cc: alpine-devel@lists.alpinelinux.org Subject: Re: [alpine-devel] [PATCH] abuild: created 'saveas-*://' URI support Message-ID: <20101229084540.3012bfc8@ncopa-desktop.nor.wtbts.net> In-Reply-To: <1293589337-5232-1-git-send-email-mcs@darkregion.net> References: <1293589337-5232-1-git-send-email-mcs@darkregion.net> X-Mailer: Claws Mail 3.7.8 (GTK+ 2.22.1; x86_64-unknown-linux-gnu) X-Mailinglist: alpine-devel Precedence: list List-Id: Alpine Development List-Unsubscribe: List-Post: List-Help: List-Subscribe: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP On Tue, 28 Dec 2010 20:22:17 -0600 Matt Smith wrote: > 'saveas-*://' URI support has been created for use with the source= > line of APKBUILD files. > > It allows for a remote source file to be saved with an arbitrary > filename. This is useful in situations where the last component of > the URI is not the preferred filename. > > Here's how it works. Say we have the following URI: > > http://oss.example.org/?get=software&ver=1.0 > > Both Busybox Wget and GNU Wget will save this with the filename: > > ?get=software&ver=1.0 Yes, I'm aware of this problem. > To get around this, we could use cURL to save the file using the > filename in the HTTP response headers: > > $ curl -JO "http://oss.example.org/?get=software&ver=1.0" The drawback with this is that abuild will not know the filename til after the file is downloaded. How do we check if the file already exist in cache? How do we know what package we shoudl try unpack? > Or we could use this 'saveas' hack. Essentially, the original URI is > converted to read: > > saveas-http://oss.example.org/?get=software&ver=1.0/software-1.0.tar.gz > > In the download process, the 'saveas-' portion is removed, and the > file is downloaded from the original URI, but is saved with the > filename being the last component of the URI. In this case, it will > be saved as 'software-1.0.tar.gz'. > > It is designed so that it works with any protocol supported by abuild. > For example: > > saveas-ftp://oss.example.org/?get=software&ver=1.0/software-1.0.tar.gz > > Check it out and let me know what you think. I think this hack was pretty clever. It is technically simple to implement. The only thing im sceptic about is that adding "magic" features makes it harder for newcomers. We would need to document it. Do we have other options? I'd say we got for the saveas- hack unless someone have better a better option. -nc --- Unsubscribe: alpine-devel+unsubscribe@lists.alpinelinux.org Help: alpine-devel+help@lists.alpinelinux.org ---