Commit Graph

272 Commits

Author SHA1 Message Date
Simon J. Gerraty
ccfb965433 Add META_MODE support.
Off by default, build behaves normally.
WITH_META_MODE we get auto objdir creation, the ability to
start build from anywhere in the tree.

Still need to add real targets under targets/ to build packages.

Differential Revision:       D2796
Reviewed by: brooks imp
2015-06-13 19:20:56 +00:00
Simon J. Gerraty
44d314f704 dirdeps.mk now sets DEP_RELDIR 2015-06-08 23:35:17 +00:00
Simon J. Gerraty
98e0ffaefb Merge sync of head 2015-05-27 01:19:58 +00:00
Jung-uk Kim
01ed3ca3de Remove defunct SSLv2 support from fetch(1) and fetch(3). 2015-03-25 18:56:36 +00:00
Baptiste Daroussin
3e11bd9e2a Convert to usr.bin/ to LIBADD
Reduce overlinking
2014-11-25 14:29:10 +00:00
Simon J. Gerraty
ee7b0571c2 Merge head from 7/28 2014-08-19 06:50:54 +00:00
Baptiste Daroussin
2b7af31cf5 use .Mt to mark up email addresses consistently (part3)
PR:		191174
Submitted by:	Franco Fichtner  <franco at lastsummer.de>
2014-06-23 08:23:05 +00:00
Simon J. Gerraty
fae50821ae Updated dependencies 2014-05-16 14:09:51 +00:00
Simon J. Gerraty
cc3f4b9965 Merge from head 2014-05-08 23:54:15 +00:00
Warner Losh
c6063d0da8 Use src.opts.mk in preference to bsd.own.mk except where we need stuff
from the latter.
2014-05-06 04:22:01 +00:00
Simon J. Gerraty
3b8f084595 Merge head 2014-04-28 07:50:45 +00:00
Dag-Erling Smørgrav
c2ea176dac Increase the default (and minimum) buffer size from 4 kB to 16 kB. Also,
propagate the buffer size to libc, which uses a 1 kB buffer by default,
negating any hypothetical benefit of increasing fetch(1)'s buffer size.

MFC after:	3 days
2014-01-28 14:32:04 +00:00
Dag-Erling Smørgrav
2043423cd1 whitespace and bump copyright 2014-01-28 14:29:24 +00:00
Simon J. Gerraty
34b33809b7 Updated dependencies 2013-10-13 00:24:00 +00:00
Simon J. Gerraty
d1d0158641 Merge from head 2013-09-05 20:18:59 +00:00
Dag-Erling Smørgrav
1453595f49 Include an Accept header in requests.
PR:		kern/180917
MFC after:	1 week
2013-07-30 13:07:55 +00:00
Dag-Erling Smørgrav
cb67f01df2 Add Michael Gmelin's name to the copyright statement. 2013-07-30 13:05:51 +00:00
Joel Dahl
b5a4266b48 Remove EOL whitespace. 2013-07-28 06:16:12 +00:00
Dag-Erling Smørgrav
dcd47379ff Implement certificate verification, and many other SSL-related
imrovements; complete details in the PR.

PR:		kern/175514
Submitted by:	Michael Gmelin <freebsd@grem.de>
MFC after:	1 week
2013-07-26 15:53:43 +00:00
Dag-Erling Smørgrav
011a8335f8 mdoc nit 2013-07-21 07:24:25 +00:00
Eitan Adler
a96469b791 Correct check to see if file changes.
Reported by:	swildner@DragonFlyBSD.org
Reviewed by:	des
2013-06-02 18:10:07 +00:00
Simon J. Gerraty
f5f7c05209 Updated dependencies 2013-02-16 01:23:54 +00:00
David E. O'Brien
d9a447559b Sync with HEAD. 2013-02-08 16:10:16 +00:00
Andre Oppermann
162361c198 Fix bandwidth reporting when doing a restarted download with "-r".
The offset is already accounted for in xs->lastrcvd and doesn't
have to be subtracted again.

Reported by:	Florian Smeets <flo@smeets.im>
Submitted by:	Mateusz Guzik <mjguzik@gmail.com>
Tested by:	Florian Smeets <flo@smeets.im>
MFC after:	1 week
2012-12-09 22:54:03 +00:00
Eitan Adler
2214137ab1 Add check for failure of mkstemp and setenv.
Reviewed by:	des
Approved by:	cperciva (implicit)
Obtained from:	DragonFlyBSD
MFC after:	1 week
2012-12-08 18:41:16 +00:00
Andre Oppermann
ae7dc19cd1 Change fetch(1) to:
o Report the instantaneous bandwidth instead of an average since the
  beginning of the download.

o At the finish of the download report the average bandwidth and also
  the total time it took instead of 00m00s.

Reviewed by:	des
MFC after:	1 week
2012-11-16 12:05:10 +00:00
Simon J. Gerraty
23090366f7 Sync from head 2012-11-04 02:52:03 +00:00
Ed Schouten
bf70becee6 More -Wmissing-variable-declarations fixes.
In addition to adding `static' where possible:

- bin/date: Move `retval' into extern.h to make it visible to date.c.
- bin/ed: Move globally used variables into ed.h.
- sbin/camcontrol: Move `verbose' into camcontrol.h and fix shadow warnings.
- usr.bin/calendar: Remove unneeded variables.
- usr.bin/chat: Make `line' local instead of global.
- usr.bin/elfdump: Comment out unneeded function.
- usr.bin/rlogin: Use _Noreturn instead of __dead2.
- usr.bin/tset: Pull `Ospeed' into extern.h.
- usr.sbin/mfiutil: Put global variables in mfiutil.h.
- usr.sbin/pkg: Remove unused `os_corres'.
- usr.sbin/quotaon, usr.sbin/repquota: Remove unused `qfname'.
2012-10-19 14:49:42 +00:00
Dag-Erling Smørgrav
0e50a83330 Use libmd if and only if OpenSSL is not available.
PR:		bin/171402
MFC after:	3 days
2012-09-14 13:00:43 +00:00
Marcel Moolenaar
7750ad47a9 Sync FreeBSD's bmake branch with Juniper's internal bmake branch.
Requested by: Simon Gerraty <sjg@juniper.net>
2012-08-22 19:25:57 +00:00
Dag-Erling Smørgrav
0ce8603c4a Revert r232274 - unauthorized, unnecessary and incorrect. 2012-05-26 17:19:41 +00:00
Glen Barber
2fccbf04cc General mdoc(7) and typo fixes.
PR:		167696
Submitted by:	Nobuyuki Koganemaru (kogane!jp.freebsd.org)
MFC after:	3 days
2012-05-10 02:07:00 +00:00
David E. O'Brien
800f97228a Document the 'URL' argument. 2012-02-28 22:15:46 +00:00
Dag-Erling Smørgrav
2a7daafe67 Fix two issues related to the use of SIGINFO in fetch(1) to display
progress information.  The first is that fetch_read() (used in the HTTP
code but not the FTP code) can enter an infinite loop if it has previously
been interrupted by a signal.  The second is that when it is interrupted,
fetch_read() will discard any data it may have read up to that point.
Luckily, both bugs are extremely timing-sensitive and therefore difficult
to trigger.

PR:		bin/153240
Submitted by:	Mark <markjdb@gmail.com>
MFC after:	3 weeks
2012-01-18 15:13:21 +00:00
Dag-Erling Smørgrav
b6f6aba365 latin1 -> utf8 2011-10-04 15:00:54 +00:00
Dag-Erling Smørgrav
bb6e332901 Document the fact that passive mode is now the default.
Update copyright dates and strip my middle name.
2011-09-27 19:02:44 +00:00
Dag-Erling Smørgrav
5c5052cca4 Use fseeko() instead of fseek(). The rest of the code is off_t-aware,
but the use of fseek() means fetch(1) can't correctly resume a transfer
that was interrupted past the 2 GB mark.

Pointed out by:	ache@
MFC after:	3 weeks
2011-09-27 17:11:31 +00:00
Dag-Erling Smørgrav
27274e81b2 Followup to r225599: the fseek() was a no-op since the file was opened
in append mode.  Open it in read-write mode instead.  Also move the
fseek up one level to cover the (unlikely but not impossible) case where
the server accepts ranges but does not send a Content-Size header.

PR:		bin/117277
MFC after:	3 weeks
2011-09-27 15:57:13 +00:00
Dag-Erling Smørgrav
a17e51c108 When resuming an HTTP download, we failed to verify that the range
returned by the server matched what we requested, and blindly appended
what we received to what we already had.  This could go two ways: if the
delivered offset was higher than expected, the local file would contain
duplicate data, while if it was lower than expected, there would be data
missing from the middle of the file.  Furthermore, if the transfer was
interrupted again, each subsequent attempt would compound the error.
Fix the first problem by restarting the transfer from scratch if there
is a gap, and the second by explicitly seeking to the correct location
in the local file so as to overwrite any duplicated data.

PR:		bin/117277
Approved by:	re (kib)
MFC after:	3 weeks
2011-09-15 22:50:31 +00:00
Ruslan Ermilov
c59ee18a21 Fixed static linkage. 2010-02-26 09:41:16 +00:00
Ed Schouten
b7946da96b Build usr.bin/ with WARNS=6 by default.
Also add some missing $FreeBSD$ to keep svn happy.
2010-01-02 10:27:05 +00:00
Ruslan Ermilov
8181961a73 Treat an empty argument as an error, instead of fetching the
contents of the root directory.

MFC after:	1 week
2009-12-30 23:01:49 +00:00
Xin LI
821df508e8 Revert most part of 200420 as requested, as more review and polish is
needed.
2009-12-13 03:14:06 +00:00
Xin LI
6f2d322192 Remove unneeded header includes from usr.bin/ except contributed code.
Tested with:	make universe
2009-12-11 23:35:38 +00:00
Dag-Erling Smørgrav
3187195884 The FTP_TIMEOUT and HTTP_TIMEOUT environment variables were ignored because
T_secs already had a non-zero default.  Unbreak by moving the default to
ftp_timeout / http_timeout.

Submitted by:	Christoph Mallon <christoph.mallon@gmx.de>
MFC after:	2 weeks
2009-01-17 13:34:56 +00:00
Murray Stokely
e8f612b687 1. Update fetch to consistently return 1 on error, as the man page states,
rather than usually returning 1 but in a few instances using a sysexits(3)
   return value.

2. Remove a few unused variables from libfetch.

PR:		docs/122470  (1, only)
Reviewed by:	des
2008-12-17 18:00:18 +00:00
Murray Stokely
7f92799f67 Add support for HTTP 1.1 If-Modified-Since behavior.
fetch(1) accepts a new argument -i <file> that if specified will cause
the file to be downloaded only if it is more recent than the mtime of
<file>.

libfetch(3) accepts the mtime in the url structure and a flag to
indicate when this behavior is desired.

PR:		bin/87841
Submitted by:	Jukka A. Ukkonen <jau@iki.fi> (partially)
Reviewed by:	des, ru
MFC after:	3 weeks
2008-12-15 08:27:44 +00:00
Ruslan Ermilov
e801aa4856 Improve usage and sync SYNOPSIS with usage. 2008-12-13 17:48:06 +00:00
Dag-Erling Smørgrav
2b8907e7e2 Apply the same defaults to https as to http.
Submitted by:	Mike Tancsa <mike@sentex.net>
MFC after:	1 week
2008-12-11 06:54:36 +00:00
David E. O'Brien
8acee1c0ca Use the SCHEME_ knobs rather than knowing what they expand to.
Reviewed by:	des
2008-08-21 14:12:34 +00:00