Subject: Re: PR pkg/26448 resuming pkgsrc distfile fetches implementation is
To: None <tech-pkg@NetBSD.org>
From: Juan RP <juan@xtraeme.nopcode.org>
List: tech-pkg
Date: 10/25/2004 17:15:09
--Signature=_Mon__25_Oct_2004_17_15_09_+0200_Hms=HfVKrv.IocOV
Content-Type: multipart/mixed;
boundary="Multipart=_Mon__25_Oct_2004_17_15_09_+0200_gzjme9gWcukCFnqD"
--Multipart=_Mon__25_Oct_2004_17_15_09_+0200_gzjme9gWcukCFnqD
Content-Type: text/plain; charset=US-ASCII
Content-Disposition: inline
Content-Transfer-Encoding: 7bit
Hi Robert,
I've been looking into the problems reported in your Problem Report, and
I think that I got a working patch finally, please review or share suggestions.
The patch does it:
copy the file not finished to a temporary one ($$bfile.temp), use a new
option to specify the output file name (FETCH_OUTPUT_ARGS, by default-o with
NetBSD's ftp(1)), if our downloaded file is matching the checksum recorded
in distinfo, the file is renamed to the original name.
I tested it with some packages and it's working fine, but maybe is not perfect.
--Multipart=_Mon__25_Oct_2004_17_15_09_+0200_gzjme9gWcukCFnqD
Content-Type: application/octet-stream;
name="resume_transfers.diff"
Content-Disposition: attachment;
filename="resume_transfers.diff"
Content-Transfer-Encoding: base64
SW5kZXg6IGJzZC5wa2cubWsKPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PQpSQ1MgZmlsZTogL2N2c3Jvb3QvcGtnc3JjL21r
L2JzZC5wa2cubWssdgpyZXRyaWV2aW5nIHJldmlzaW9uIDEuMTUyMgpkaWZmIC1iIC11IC1yMS4x
NTIyIGJzZC5wa2cubWsKLS0tIGJzZC5wa2cubWsJMjEgT2N0IDIwMDQgMTc6MTg6NDQgLTAwMDAJ
MS4xNTIyCisrKyBic2QucGtnLm1rCTI1IE9jdCAyMDA0IDE1OjAyOjU0IC0wMDAwCkBAIC0xNDYy
LDM0ICsxNDYyLDcyIEBACiAjIGFkZGluZyBwcmUtKiBvciBwb3N0LS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mYXVsdDogLVIKICMgUG9zc2libGU6IGRlcGVuZHMgb24geW91ciBGRVRDSF9D
TUQgdmFsdWUuCiAKK0ZFVENIX09VVFBVVF9BUkdTPz0JLW8KKyMgRGVmYXVsdCBhcmd1bWVudCB0
byB0aGUgb3V0cHV0IGZpbGUgd2hlbiByZXN1bWluZyB0cmFuc2ZlcmVuY2llcyBvbgorIyBwa2dz
cmMuCisjIERlZmF1bHQ6IC1vCisjIFBvc3NpYmxlOiBkZXBlbmRzIG9uIHlvdXIgRkVUQ0hfQ01E
IHZhbHVlLgorCiBMSUJUT09MSVpFX1BMSVNUPz0JeWVzCiAjIFRoaXMgZGV0ZXJtaW5lcyB3aGV0
aGVyIHRvIGV4cGFuZCBsaWJ0b29sIGFyY2hpdmVzIGluIFBMSVNUcyBpbnRvIHRoZQogIyByZXBy
ZXNlbnRlZCBsaWJyYXJ5IG5hbWVzLgo=
--Multipart=_Mon__25_Oct_2004_17_15_09_+0200_gzjme9gWcukCFnqD--
--Signature=_Mon__25_Oct_2004_17_15_09_+0200_Hms=HfVKrv.IocOV
Content-Type: application/pgp-signature
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (NetBSD)
iD8DBQFBfRh9ypkLYVDran0RAo4OAJ9TvZnWDU/pZLSln97pSzdfkLXAiQCeKV1K
eV5FThi253w6X6sz9MX0ioY=
=P+uB
-----END PGP SIGNATURE-----
--Signature=_Mon__25_Oct_2004_17_15_09_+0200_Hms=HfVKrv.IocOV--