Commit Graph

44 Commits

Author SHA1 Message Date
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
Jordan K. Hubbard
1c3f12fd44 Fix a couple of miscellaneous bugs and make pkg_add also support reading
from stdin.
1996-03-12 06:12:43 +00:00
Jordan K. Hubbard
0ad65298ab Bring my pkg_install improvements forward from 2.1. 1995-11-12 04:55:40 +00:00
Jordan K. Hubbard
36b7319742 Bring forward my changes from 2.1 1995-10-25 15:38:37 +00:00
Rodney W. Grimes
709e8f9ae1 Remove trailing whitespace. 1995-05-30 03:57:47 +00:00
Jordan K. Hubbard
6c5325bf0e Add true support for dependency lists.
1. pkg_create now has a -P argument for specifying dependencies on the
   command line.
2. pkg_add will honor dependencies and chain-load them automatically if
   it finds the required package(s) in the same directory as the package
   that is being loaded.  For best results, install packages from a directory
   containing all the packages you'll possibly need
   (like /usr/ports/packages/all).

2 remaining flaws:

1. pkg_add looks in one place (where you were when you loaded the primary
   pkg) for depended packages.  If you can come up with a search path scheme
   that's not a total hack - be my guest!

2. Recursive dependency expansion can result in the name of a dep being
   listed more than once.  This doesn't bother pkg_add since it checks
   for package existance with pkg_info and will skip already-loaded packages.
   I don't know how/if pkg_delete handles this yet, however.  I need to look
   into it.
1995-04-09 15:05:01 +00:00
Jordan K. Hubbard
8f396ebfb6 Many of John T. Kohl's patches from NetBSD. Thanks, John!
Submitted by:	jkohl
1994-12-06 00:51:50 +00:00
Jordan K. Hubbard
5db659db0b Fixed broken -t flag; thanks Rich! 1993-09-14 19:53:01 +00:00
Jordan K. Hubbard
368b3399cd Made staging area configurable rather than assuming /tmp (-t)
Made pkg_add -n less bitchy.
Made -p in pkg_add override "default" package location in pkg_create.

Added concept of "slave" and "master" modes, allowing many different things
to be done to packing lists on the fly.  This is really something for
front-end drivers to use, but also something for the more expert user.

rename()'ing files before trying to copy them, thus saving
considerable time when targets and staging area are on same filesystem.
1993-09-05 04:53:51 +00:00
Jordan K. Hubbard
a9c42a2388 Lots of misc tweaks, support for arbitrary separators in pkg_info, more
intelligent name handling in pkg_create.  Most of these files are changed
because of rcsid's being different in my cvs tree and freefall's (foo).
1993-09-03 23:01:17 +00:00
Jordan K. Hubbard
6d946b2e52 The release version of my package install suite. Please see man pages
for info.
1993-08-26 01:19:55 +00:00