Commit Graph

56 Commits

Author SHA1 Message Date
Colin Percival
e08aa295d0 Fix bug in deleting files: If two ports had the same tarball and one of
them changed (or was removed from the tree) then portsnap would delete
that file.  This happened earlier today when one of two empty port
directories was removed.  Uniquifying the lists of needed files fixes
this.

9.2-RELEASE candidate.

MFC after:	3 days
2013-07-11 22:19:18 +00:00
Xin LI
410bcf7cc7 Make 'portsnap alfred' overwrite ports tree if it's not created by a
portsnap.

Discussed with:	alfred
Reviewed by:	cperciva
2013-06-07 20:21:30 +00:00
Joel Dahl
37b983c09b mdoc sweep 2013-05-13 18:13:50 +00:00
Joel Dahl
2710751bc3 mdoc sweep. 2013-05-12 22:22:12 +00:00
Alfred Perlstein
7b4708028a Change progress indicator for downloading patches.
Use a percent style indicator instead of emitting one
long line of patch numbers.
2012-12-13 01:39:49 +00:00
Eitan Adler
ba8999e989 Avoid changing IFS in a global context as this can sometimes cause
errors later on.

PR:		bin/172715
Submitted by:	Matthew D.Fuller <fullermd@over-yonder.net> (older
version)
Submitted by:	dteske
Approved by:	cperciva
MFC after:	1 week
2012-10-24 12:49:03 +00:00
Joel Dahl
a01d461b70 Remove cvs/cvsup reference. 2012-10-14 10:12:32 +00:00
Isabell Long
6e95460966 Change "only only" to "only" in portsnap(8).
Spotted by:	Ruslan Mahmatkhanov
Approved by:	gabor (mentor, implicit)
2012-09-28 11:40:59 +00:00
Isabell Long
eacee75a76 Add a note to portsnap(8) about the behaviour of the example cron command.
PR:		docs/171759
Submitted by:	Paul Hoffman (phoffman at proper dot com)
Approved by:	cperciva, gabor (mentor)
MFC after:	3 days
2012-09-28 11:11:42 +00:00
Eitan Adler
a6c38148a0 Add interactive option to override portsnap's automagical detection of
a terminal.

Submitted by:	Hannes h2+fbsdports@fsfe.org
Approved by:	cperciva
MFC after:	1 week
2012-08-05 21:13:21 +00:00
Eitan Adler
94fd46b06b make it easier for users used to a VCS that allows up to be a shortcut
for update.

PR:		bin/152856
Approved by:	cperciva
MFC after:	3 days
2012-05-09 21:56:10 +00:00
Alfred Perlstein
c13b66c053 Fix spelling of extract.
Pointed out by: gcooper
2011-11-13 06:39:49 +00:00
Alfred Perlstein
d1982439b2 Utilize shell's IFS instead of forking ~6 processes to
handle splitting input files on a '|'.  This greatly
reduces the time taken to process several databases
during the update process.

Additionally add some more debug logging.
2011-11-13 03:18:57 +00:00
Jilles Tjoelker
b77e3cbad1 portsnap: Detect error immediately if we can't fetch the snapshot metadata.
Also add some quotes around command substitution where useful and possible.

Reviewed by:	cperciva
MFC after:	1 week
2011-10-04 22:28:06 +00:00
Simon L. B. Nielsen
52e3f1458b Add --numeric-owner to tar extract operations in portsnap.
This is done to speed up extraction significantly (both for portsnap
extract and update) in the case of slow NSS modules (like nss_ldap) as
it avoids having to look up uid and gid for root / wheel.

The reason this is a bigger problem for portsnap than for many other
system operations, is that portsnap executes tar(1) once for each port
so the internal uid/gid caching in tar(1) only helps a bit, resulting
in many user lookup calls.

Discussed with:	cperciva
2010-12-19 23:09:42 +00:00
Ulrich Spörlein
0d9deed52c mdoc: drop redundant .Pp and .LP calls
They have no effect when coming in pairs, or before .Bl/.Bd
2010-10-08 12:40:16 +00:00
Joel Dahl
c2025a7660 Fix typos, spelling, formatting and mdoc mistakes found by Nobuyuki while
translating these manual pages.  Minor corrections by me.

Submitted by:	Nobuyuki Koganemaru <n-kogane@syd.odn.ne.jp>
2010-08-16 15:18:30 +00:00
Colin Percival
07759af5eb Add undocumented 'portsnap alfred' command, which runs (fetch|cron)
based on whether fd 0 is a terminal, and then runs (extract|update)
based on whether ${PORTSDIR} exists.

Requested by:	alfred
MFC after:	1 month
2009-12-30 06:28:47 +00:00
Daniel Gerzo
3bea701ec8 - remove superfluous word
PR:		docs/127401
Submitted by:	Mick Charles Beaver <mick@cs.wisc.edu>
MFC after:	1 week
2008-09-15 16:30:06 +00:00
Colin Percival
bdd9aff946 Add support for specifying which INDEX files to build via portsnap.conf.
Requested by:	brooks
Reminded by:	brooks, about halfway through his BSDCan talk
2008-05-17 16:26:27 +00:00
Colin Percival
a4c77fdccb Attempt to reduce the rate of foot-shooting injuries by adding a new
paragraph clarifying that portsnap does not behave the same way as
cvs and cvsup where local modifications are concerned.

Submitted by:	peter
Feet shot:	peter, kris, obrien, + many others
2007-12-28 20:39:18 +00:00
Colin Percival
607fc5a213 When generating ports INDEX files from downloaded "describes" data, build
an index for FreeBSD 7.x too.

MFC After:	1 week
Approved by:	re (hrs)
2007-08-02 02:05:23 +00:00
Colin Percival
f2890dbd24 Set LC_ALL=C in order to avoid problems with character ranges and
sorting.

PR:		bin/104505
MFC after:	3 days
2006-10-21 11:04:34 +00:00
Ruslan Ermilov
bc84aa4ba3 Markup fixes. 2006-09-29 17:57:04 +00:00
Colin Percival
444f80d54b s/MAN8/MAN/
Pointed out by:	ru
2006-09-01 09:49:09 +00:00
Colin Percival
2a569ec900 Use some features of sh(1) which I didn't know about until today ("read"
can read two variables at once; and suffix pattern deletion) to make the
extract command fork fewer processes.

With the portsnap snapshot and the ports tree in swap-backed memory
disks on my 1.4GHz laptop, this reduces 178800 processes and 195/56/126
seconds of real/user/sys time to 44600 processes and 103/34/60 seconds.
2006-05-30 07:08:41 +00:00
Colin Percival
1e1de0e499 Fix typo.
Pointed out by:	ceri
2006-05-13 18:04:48 +00:00
Colin Percival
d600d37002 Add a mechanism for constructing INDEX files which include local ports.
Requested by:	brooks
2006-05-13 15:56:35 +00:00
Colin Percival
343c554c88 Use 'rm -rf foo/bar' to remove a port instead of 'rm -rf foo/bar/'.
When /usr/ports/foo/bar is a symlink pointing outside the tree, this
deletes the symlink instead of the directory it points to.

Requested by:	delphij
2006-05-12 10:42:40 +00:00
Colin Percival
b39855baee Allow the HTTP_PROXY environment variable to be (mis)spelled as
"http_proxy", since some people apparently do this and fetch(3)
allows it.
2006-05-05 04:47:00 +00:00
Colin Percival
a414ca11d5 Fix the test for whether ${HTTP_PROXY} is set -- I got it backwards.
Pointy hat to:	cperciva
Pointed out by:	pjd
2006-05-05 03:44:13 +00:00
Colin Percival
37c8250c90 Remove two lines of debugging which I forgot to remove before the last
commit.

Noticed by:     simon
2006-05-03 22:09:42 +00:00
Colin Percival
4b93a7cae2 The approach portsnap uses of "pick a random HTTP mirror" doesn't
interact very nicely with HTTP proxies: Since proxies do not know
that all the files on portsnap1.freebsd.org are identical to the
files with the same names on portsnap2.freebsd.org, said proxies end
up downloading and storing files in duplicate.

This commit uses the HTTP_PROXY environment variable, if set, to
generate a random number seed for use in selecting a mirror.  This
means that if several systems all have the same HTTP_PROXY value set,
they will ask the proxy to fetch files from the same mirror (unless
that mirror fails, in which case all the systems will use the same
second choice, et cetera).

Portsnap still doesn't interact very well with "transparent" HTTP
proxies, but there's nothing I can do about those.

Requested by:	simon
Sponsored by:   FreeBSD security development fundraiser
2006-05-03 21:29:01 +00:00
Colin Percival
1e87b57202 Instead of selecting a mirror and failing if it is inaccessible, keep
track of which mirrors we have tried and try a different mirror if we
fail when trying to download the SSL public key or the snapshot
signature.

Failures later in the download process will not result in switching to
a different mirror, for two reasons:
1. If is very unlikely that a mirror will fail partway through the
process of downloading updates.
2. If we switched from a more recently updated mirror to a less
recently updated mirror partway through the download process, we would
end up failing anyway because we would be trying to fetch files which
the second mirror didn't have yet.

PR:		bin/96288
Requested by:	lots of people
Sponsored by:	FreeBSD security development fundraiser
2006-05-03 21:19:43 +00:00
Colin Percival
96b468e33b Teach portsnap to parse the output of the host(1) in BIND 8 as well as
the host(1) from BIND 9.  This doesn't matter for HEAD, but will help
people who install portsnap from the ports tree onto older versions of
FreeBSD.

PR:		ports/93901
Sponsored by:	FreeBSD security development fundraiser
2006-05-02 05:27:30 +00:00
Ruslan Ermilov
e1fe3dba5c Reimplementation of world/kernel build options. For details, see:
http://lists.freebsd.org/pipermail/freebsd-current/2006-March/061725.html

The src.conf(5) manpage is to follow in a few days.

Brought to you by:	imp, jhb, kris, phk, ru (all bugs are mine)
2006-03-17 18:54:44 +00:00
Hajimu UMEMOTO
2fd4604aa4 Remove trailing dot from the servername in the serverlist to be able
to use portsnap from behind a http proxy.  Some HTTP proxy don't like
trailing dot in the servername.

Approved by:	cperciva
MFC after:	2 days
2006-03-07 19:13:00 +00:00
Wojciech A. Koszek
6b58c641d6 Reference sha256(1) instead of sha256(8), which doesn't exist.
Approved by:	cognet (mentor)
MFC after:	3 days
2006-02-26 22:59:40 +00:00
Joel Dahl
fbf9b468d5 Expand contractions. 2006-02-01 14:33:14 +00:00
Colin Percival
66915bd926 Replace "fetch" with "fetch -r" when downloading the initial ~38MB
snapshot in order to avoid unnecessary re-downloading.

Remove the earlier "rm -f ${SNAPSHOTHASH}.tgz" to make this work.

Suggested by:	Lars Engels
MFC after:	7 days
2006-01-22 23:48:07 +00:00
Colin Percival
afb9481259 Mention that the random time slept by "portsnap cron" is between 1 and
3600 seconds.

Suggested by:	Niki Denev
MFC after:	3 days
2006-01-17 03:02:44 +00:00
Colin Percival
7e6b02f651 Make "portsnap extract" automatically create ${PORTSDIR} if necessary
instead of complaining that "Directory does not exist or is not
writable".

Suggested by:	{tlp, siep} via IRC
MFC after:	1 week
2006-01-06 20:39:11 +00:00
Colin Percival
82835af3f1 Add a note pointing out that certain information (IP address, list of
files fetched, FreeBSD release level) is transmitted to the portsnap
server when portsnap is run, but that this information is only used
anonymously and in aggregate.
2005-09-18 12:19:32 +00:00
Colin Percival
ac8189712e Portsnap uses host(1) to search for mirrors, but this is only available
when the base system is not compiled with NO_BIND set.  Before we start
searching for mirrors, make sure that host(1) can be found, and if it
doesn't exist then fallback to the A record instead of the SRV records.

Submitted by:	Luca Morettoni
2005-09-15 13:29:10 +00:00
Colin Percival
e2d583aca4 Fix typo: ${PORTDIR} -> ${PORTSDIR}.
Apologies to everyone who has run portsnap in 7.0-CURRENT since
Tuesday; if there is a file "/.portsnap.INDEX" on your system, you can
delete it (or even better, move it to /usr/ports/.portsnap.INDEX).

Big pointy hat to:	cperciva
Reported that things weren't working properly:	Aleksander Fafula
2005-09-11 12:55:07 +00:00
Colin Percival
73b2114b4e Fix typo: Cowarly -> Cowardly.
Reported by:	Joerg Sonnenberger
2005-09-07 19:32:15 +00:00
Colin Percival
ff69e5b71e Teach portsnap how to ignore unwanted parts of the ports tree. A line
of the form "REFUSE foo" in portsnap.conf will result in parts of the
tree matching "^foo" being (a) not extracted by "portsnap extract", (b)
not updated by "portsnap update", and (c) not having any patches or new
ports downloaded by "portsnap fetch" or "portsnap cron". The example
shown in portsnap.conf demonstrates ignoring all the language categories.

As mentioned in portsnap.conf.5, the use of an imcomplete ports tree is
not officially supported; but this is something which many users have
requested, so I'm adding it anyway.

PR:		bin/85619 (but not the patch provided therein)
MFC after:	1 month
2005-09-06 19:28:37 +00:00
Colin Percival
24a3ff142f Spell "cmp > /dev/null" as "cmp -s".
Suggested by:	dougb
2005-08-14 02:45:04 +00:00
Colin Percival
723c596167 Correctly exit from extract_run() and update_run() if files needed are
missing from ${WORKDIR}/files/.

This bug was caused by the astonishing interaction of "return" and
pipelines; in the following code, the "return" does not exit the
function, but instead exits the subshell which was spawned for the last
element of the pipeline; consequently, the output produced is "foo".

foo() {
	echo bar | while read baz; do
		if [ ${baz} = "bar" ]; then
			return 1
		fi
	done

	echo foo
}

Reported by:	simon
2005-08-13 21:28:43 +00:00
Simon L. B. Nielsen
d24cff0fb0 Misc mdoc(7) fixes:
- Bump document date for recent updates.
- Use .Fx for FreeBSD.
- Remove EOL whitespace.
- Start new sentences on new lines.

Reviewed by:	cperciva
2005-08-13 19:08:10 +00:00