Commit Graph

60 Commits

Author SHA1 Message Date
David E. O'Brien
73f69794ee Set the real limits on 5-current, add 5-stable, add 6-current. 2004-10-17 14:36:30 +00:00
Alexander Kabaev
617e8b416d Downgrade WARNS level to more tolerable value. Attempt to fix
casts as lvalue usage whenever possible.
2004-07-28 07:19:15 +00:00
Oliver Eikemeier
b9ba84598d - pkg_add spawns itself as argv[0] when installing dependent packages, to
enable the use as a port on older systems

- use absolute paths in all calls to external programs, to account for strange
  PATH settings

- use INDEX or INDEX-5 depending on FreeBSD version, to enable the use on
  FreeBSD 4.x as a port.

- conditionalize all 4.x/5.x differences on __FreeBSD_version, so that the
  pkg_install tools can be kept in sync on 4.x and 5.x

- Bump PKG_INSTALL_VERSION

Reviewed by:	portmgr (bento run)
MFC after:	4 weeks
2004-06-29 19:06:42 +00:00
Bruce A. Mah
b98176bc0b Add 4.10 and 5.2.1 entries so that pkg_add -r fetches from the right
package sets.

PR:		66251
Submitted by:	eik
2004-05-08 23:45:31 +00:00
Ken Smith
e77e03a08a Add command line option for chrootdir, all pkg_add(8) operations will be
done inside of chroot(2) to chrootdir.  Added to help with sysinstall(8)
support of install to alternate root but possibly useful for setting up
jails, etc.

No objection from:	portmgr@
Style(9) abuse due to:	entire program violates style(9)
Approved by:		rwatson (mentor)
2004-03-01 21:58:21 +00:00
Bruce A. Mah
2b5c94a768 Catch up with reality with respect to the location of 4.8, 4.9,
5.0, 5.1, 5.2, and CURRENT packages.
2004-01-02 00:13:20 +00:00
Bruce A. Mah
b07931e581 Teach pkg_add -r how to find 4.7-RELEASE packages with an appropriate
osreldate.

(Actually, due to differences in package compression formats, I'm
not sure that a -CURRENT pkg_add -r will do the right thing in
this case, once it finds them.)
2002-10-08 05:15:21 +00:00
Bruce A. Mah
7b89cd2657 Fix minor off-by-one error.
Submitted by:	jhb
2002-09-09 21:21:34 +00:00
Bruce A. Mah
bc49694c45 Make pkg_install go to the right place for 4.6-RELEASE and 4.6.2-RELEASE
packages.

Pointed out by:	obrien
Reviewed by:	jhb
2002-09-09 19:44:17 +00:00
David E. O'Brien
1ab94a83c2 Find remaining hardcoded gzip bits and change to bzip2 bits.
Mark with XXX so someone that cares about being able to handle either
bziped or gziped packages knows where the remaining nits are.
2002-08-25 01:00:16 +00:00
David E. O'Brien
0d8875ff46 Fix SCM ID's. 2002-04-01 09:39:07 +00:00
David E. O'Brien
150e0ea706 Increase the number of packages that can be installed by an order of
magnitude.  Geez, this is Unix, what is with the arbitrary needless
constants.
2001-10-16 06:42:06 +00:00
Maxim Sobolev
d100deb8cc WARNS=2 cleanup.
Tested on:	i386, alpha
MFC after:	2 weeks
2001-10-10 06:58:42 +00:00
Maxim Sobolev
9ad4f43281 Fix segfault introduced in previous commit (when adding local packages). 2001-09-17 13:37:50 +00:00
Bill Swingle
0fe2f8cb85 Fixes problem with pkg_add -r when adding multiple pkgs.
Reviewed by:	chris
2001-09-07 22:32:37 +00:00
David E. O'Brien
0dd1c79320 Reduce private "lesser known" function redirection to improve clarity.
Approved by:	jkh
2001-08-13 04:18:30 +00:00
David E. O'Brien
43b866b0ed The security officer requested this be backed out for discussion. 2001-07-28 04:44:09 +00:00
David E. O'Brien
2bae1ab6a5 Remove s_strl*(). I am not sure what was thought they accomplished.
When reading the code I had to stop, say "ok, what does *these*
modifications of strl*() do?  Pull out grep.  Oh, not in add/, maybe above
in ../lib/?  Yep.  So what do they do?  Comments above them are misleading,
guess I'll have to read the code.  Oh, they just test strl* against the
size and return the result of the test.  Now I can continue to read the
code I was.

The uses of s_strl*() then test that result and errx()'s.
Lets think about the "optimized" code I am removing:

In general the compiler pushes the three args to strl* onto the stack and calls
s_strl*.  s_strl* has to indirectly access 3 args from the stack.  Then push
them on the stack a 2nd time for the real strl* call.  s_strl* then pops the
return from strl* off the stack; or moves it from the register it was returned
in, to the register where tests can happen.  s_strl* then pops the three
arguments to strl*.  Perform the test, push the result of the test, or move it
from the result register to the return value register.  The caller to s_strl*
now has to either pop the return value of s_strl* or move it from the return
value register to the test register.  The caller then pops the three args to
s_strl* off the stack (the same args that s_strl* itself had to pop off after
the real call to strl*).  The s_strl* caller then performs a simular test to
what has already been done, and conditionally jumps.  By doing things this way, we've given the compiler optimizer less to work with.

Also, please don't forget the that call to s_strl* has possibly jumped to code
not in the cache due to being far away from the calling code, thus causing a
pipeline stall.

So where is the "optimization" from s_strl*?
It isn't code clarity.
It isn't code execution speed.  It isn't code size either.
2001-07-28 01:59:58 +00:00
Kris Kennaway
371af8a555 Only match the first osreldate date range for constructing the FTP URL,
not all of them.

Noticed by:	obrien
2001-07-26 20:25:50 +00:00
Kris Kennaway
1da665ef09 Correct a reversion in r1.39 which introduced a new instance of strcpy()
after r1.38 had attempted to remove them all.
2001-07-19 06:01:23 +00:00
Maxim Sobolev
0add99417d bzip2(1) is in the base system - we don't need /usr/local/bin in the PATH
anymore.
2001-07-10 15:10:47 +00:00
Jim Pirzyk
d316920f0c Fixed pkg_add so when it does not find a package, it returns != 0.
PR:		bin/23083
Submitted by:	Patch submitted by Maxime Henrion <mux@qualys.com>
MFC after:	2 weeks
2001-06-04 21:35:08 +00:00
Kris Kennaway
ff7543ca42 Clean up some of the evil string handling in this code, replace
warnx()+exit() with errx() and replace a big if..then..else construct
to determine the package download directory with a lookup table.

Reviewed by:	jkh
MFC after:	2 weeks
2001-05-12 09:44:32 +00:00
David E. O'Brien
3f514cfc4c rcsid style fix. 2001-05-09 01:38:28 +00:00
David E. O'Brien
1e5a82fe65 A WIP snuck in the rev 1.34 commit. 2001-05-09 01:37:49 +00:00
Andrey A. Chernov
f39162a2e1 Fix typo in prev commit - add missing comma 2001-04-26 06:48:59 +00:00
David E. O'Brien
f9722b4b48 Add /usr/X11R6/bin to the exported PATH. If /usr/local/bin is there,
/usr/X11R6/bin should be there.  This helps all the ports that need to
run `mkfontdir' and error out as many port maintainers do not realize
`mkfontdir' isn't in the path.

Prompted by:	pkg_add pcemu
2001-04-25 19:11:09 +00:00
David E. O'Brien
310857ac13 MFS: getpackagesite() from RELENG_4 that allows the code to be the same. 2001-02-17 20:04:41 +00:00
David E. O'Brien
eb0dde377b In light of the dismal transfer times from ftp.FreeBSD.org, add a new
`PACKAGEROOT' env var which you would set to a proper mirror of
ftp.FreeBSD.org (say "export PACKAGEROOT=ftp://ftp3.FreeBSD.org"), to
fetch from an alternate place.  This is easier to use than `PACKAGESITE'
for true mirrors, and can be used in your dot files across all versions
of FreeBSD.
2001-02-13 09:49:14 +00:00
Maxim Sobolev
acf6a4418d - Add ability to handle bzip2-compressed packages;
- fix cosmetics to shut-up compiler in -pedantic mode (axe several unused vars
  and provide default clause in several switch() statements).

No response from:	-ports
2001-01-22 12:01:55 +00:00
Bill Fumerola
3bbd4ccc80 -CURRENT is now 500000, reflect that. 2000-03-13 18:47:48 +00:00
Chris Piazza
79e970edde Make pkg_add -r package1 package2 package3 ... work correctly.
Reviewed by:	billf
1999-11-18 23:32:43 +00:00
Bill Fumerola
db86a11e69 o Remove all of the objformat logic, it's never coming back.
o Simplify getpackagesite(), it comes back in full glory when we branch
again. It's still needed however to get the i386 or alpha directory.
1999-09-25 03:02:08 +00:00
Peter Wemm
97d92980a9 $Id$ -> $FreeBSD$ 1999-08-28 01:35:59 +00:00
Warner Losh
02db1769f3 '?' shouldn't be in the usage string. Unknown characters are already
converted to '?'.
1999-06-24 06:33:24 +00:00
Bill Fumerola
69f8389253 If we are going to have a case for '?' then we should define it in Options.
Submitted by:	Ben Olson <bseth@chc-chimes.com>
1999-06-23 16:54:38 +00:00
David E. O'Brien
ba83352b78 Support Alpha and -CURRENT in the "-r" option case. 1999-06-14 21:58:59 +00:00
Bill Fumerola
2d073cdff2 Fix nasty bug where getpackagesite() will return an integer if it doesn't
know what revision of FreeBSD is being run. This case should never happen,
but just in case.
1999-01-28 20:17:32 +00:00
Bill Fumerola
ad22d0720b Numbering typo, missed a '0'
Submitted by:	Brian Feldman
1999-01-26 22:31:23 +00:00
Bill Fumerola
c6a6c9c017 Update pkg_add's remote package feature to reflect the new structure of
wcarchive. This needs to be updated when:

(a) The directory structure changes on wcarchive
(b) getosreldate() has a new significance
	(ie. get ELF packages/get a.out packages)
(c) Branches are changed around

As we stand right now, 3.0-postELFday and 4.0-x all point to the same
directory, but when 4.0 starts to have its own packages, this file will
need to be changed.
1999-01-25 21:08:13 +00:00
Bill Fumerola
99ebed6b50 Style police, inline ifs.
Submitted by:	 Brian Feldman <green@unixhelp.org>
1999-01-18 03:54:17 +00:00
Bill Fumerola
ab13b06dc0 Add a new option for pkg_add, -r.
The remote option allows for automatic package fetching and installation
using the package repository found on wcarchive. Naturally, this site
can be overridden with a enviornment variable.

This code uses getobjformat() and getosreldate(). This means when some event
causes the package to be fetched to change (such as e-day) the logic also
needs to be changed.

Sorta reviewed by:	jkh
Code suggestions:	peter, jkh, eivind, msmith
1999-01-17 01:22:55 +00:00
Jordan K. Hubbard
355150a489 Use a more reasonable default umask in case the root umask is too
fascist.
PR:		4014
1998-09-14 19:22:59 +00:00
Jordan K. Hubbard
8c26c30381 o Set paths internally for pkg_add for tools we might want to invoke.
o Fix bogus suffix handling.
o Tell user when an FTP url is being xferred rather than being silent.
  This sort of violates "the unix way" but it stops people from whacking
  ^C when they think it's hung, too.  Sometimes visual indication of
  success is important.  Doesn't spit out anything if not on a TTY.
1998-09-08 10:42:26 +00:00
Philippe Charnier
6fed414929 Use err(3). Cosmetics in usage string and man page. 1997-10-08 07:48:21 +00:00
Poul-Henning Kamp
d030d2d2ae Many places in the code NULL is used in integer context, where
plain 0 should be used.  This happens to work because we #define
NULL to 0, but is stylistically wrong and can cause problems
for people trying to port bits of code to other environments.

PR:		2752
Submitted by:	Arne Henrik Juul <arnej@imf.unit.no>
1997-09-18 14:08:40 +00:00
Warner Losh
6c3f552a31 compare return value from getopt against -1 rather than EOF, per the final
posix standard on the topic.
1997-03-31 05:11:47 +00:00
Peter Wemm
476602a9d0 Revert $FreeBSD$ to $Id$ 1997-02-22 16:15:28 +00:00
Jordan K. Hubbard
1130b656e5 Make the long-awaited change from $Id$ to $FreeBSD$
This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore.  This update would have been
insane otherwise.
1997-01-14 07:20:47 +00:00
Jordan K. Hubbard
50f56e483a Add MD5 checksums to packing list for all files during pkg_create and use
later at pkg_delete time to verify that you're deleting what you added.
This, of course, does NOT cover the case where a file you still need
hasn't changed!  That's a tougher problem to solve, and this provides
only the minimal amount of safety belt.  MD5 checksums are stored in comment
fields, so packages produced with these tools are backwards compatible with
the older ones.
1996-07-30 10:48:20 +00:00