Commit graph

18 commits

Author SHA1 Message Date
dsainty
004b23284b Alter the behaviour of the "fetch" executable to accept zero download sites
as an acceptable input.

Fixes Pkgsrc for users that set PKG_RESUME_TRANSFERS=yes in their mk.conf if
installing a package that has an interactive fetch stage, after
mk/fetch/fetch.mk revision 1.66.

Tested for all combinations of:

+ PKG_RESUME_TRANSFERS=yes/no; and
+ interactive fetch=yes/no; and
+ distfile=downloaded/not downloaded

... with no signs of misbehaviour.

The specific case that was broken, and this change fixes, is:

+ PKG_RESUME_TRANSFERS=yes; and
+ interactive fetch=yes; and
+ distfile=downloaded

This change was designed with the following considerations:

1. Given it's a freeze, keep it simple.

2. The change in behaviour allows 'fetch' to succeed where it would previously
   fail fatally, so it's unlikely to affect any (intentional) existing
   behaviour in Pkgsrc.

3. The behaviour of 'fetch' with zero sites is essentially the same as a
   fetch where all the possible download sites fail, I.e. Pkgsrc already
   expects to handle such behaviour.

ok gdt@
2015-09-19 11:45:56 +00:00
joerg
d047710b53 Make the post-fetch hook a bit more useful by also handing down the URL
the file was obtained from. This makes it easier to skip any local
mirrors.
2015-09-08 12:37:56 +00:00
joerg
0cf087a0ae Add a hook for running an action after a successful fetch.
This is intended for keeping distfile archives synchronised between
different machines without requiring NFS mounts or the like.
2015-09-08 11:13:12 +00:00
obache
c75fa9d794 Remove fetched file if fetch command succeeds to fetch but checksum mismatch
with PKG_RESUME_TRANSFERS=YES.

PR 39896.
2013-02-16 07:32:28 +00:00
joerg
7cc2780855 Add support for fetching from URLs that do not end in the distfile.
If the URL is prefixed with a dash, it is considered complete.
2009-08-02 02:38:52 +00:00
tnn
37e6cb108f Specify the name of the distfile instead of allowing the fetch tool to
infer it from the URL. No objections on tech-pkg@
2009-07-20 09:09:02 +00:00
taca
beb4f88cfa Remove extra debug codes which noted by Ryo HAYASAKA as PR pkg/40175. 2008-12-15 09:01:30 +00:00
rillig
5a901cfed5 Added a -v flag to the verify_file function, which in case of a
verification failure prints a useful and concrete error message.
2008-12-14 14:09:32 +00:00
rillig
930598a2d4 Corrected the usage message. 2008-09-15 21:07:46 +00:00
obache
1d2a0b073b Move ${DISTDIR} write permission check to just before really need to write.
Patch provided by Aleksej Saushev in PR 36473.
2007-08-04 15:00:29 +00:00
rillig
777113885f Backed out my previous change. The variable fetchdir needs to be a
relative path.

The error message nevertheless includes the full path.
2007-01-18 10:51:48 +00:00
rillig
39f6b30d1d It's more informative to use absolute pathnames in error messages than
just ".".
2007-01-10 14:31:35 +00:00
jlam
f3381a1115 Typo in comment. 2006-08-03 14:02:58 +00:00
joerg
eeaca99630 verify_file() returns a non-zero result whenever the distfile does not
currently exist. This triggers a bug in the Bourne shell of at least
DragonFly and Irix, when set -e is also active. Remove set -e to avoid
this. Discussed with jlam@, shown by DragonFly bulk builds, complains on
DragonFly's user list and PR 34036.

A test case for this shell bug is, which should return 0:

set -e

testf () {
	test -f /nonexistent || return 1
	return 0
}

if testf; then
	exit 1
fi
exit 0
2006-07-20 13:31:08 +00:00
jlam
ec6f4ba413 Comment the code a bit more. 2006-07-19 15:13:40 +00:00
jlam
2936f01adf Add a verbose flag to the fetch script to output the actual fetch command. 2006-07-19 14:16:29 +00:00
jlam
833691e2fe Overhaul fetch module:
* All the smarts is now encapsulated in the "fetch" script.  The fetch
  script understands how to use the distinfo file (if specified) to
  look up the size and checksums of the file to fetch and will use
  that information to verify checksums of the fetched files or resume
  transfers of interrupted fetches.

* Move the default settings for FETCH_RESUME_ARGS and FETCH_OUTPUT_ARGS
  for "ftp" from mk/defaults/mk.conf into mk/fetch/fetch.mk.  We rewrite
  it to avoid needing conditional statements.

* Avoid spawning a new make(1) process just to mirror a distfile.

* Split out fetch-list targets into a separate file fetch-list.mk.
  These targets should probably be moved into a standalone script.

* Fix distclean target to properly remove partial downloads.
2006-07-18 22:41:06 +00:00
jlam
e65b7c1371 First cut at a fetch script to replace the humungous fetch "macros" in
fetch.mk.  This script currently completely replaces the functionality
in _FETCH_FILE.  I will eventually add the ability to resume a file
transfer to this script.
2006-07-17 15:34:22 +00:00