Commit Graph

291 Commits

Author SHA1 Message Date
jkh
e693c16dd8 Bring in my changes for removing the pestilent obj links (unless you
really want them) from /usr/src.  This is the final version of the
patches, incorporating the feedback I've received from -current.
1996-06-24 04:26:21 +00:00
jkh
16cc4e880c Make pkg_install understand and use libftpio instead of its own
copies of the ftp support routines.  Also some cosmetic and minor
bug fixes I've been meaning to incorporate for awhile.
1996-06-20 18:33:55 +00:00
jkh
02f1302e74 Make a small optimization which shaves about a second off the time
it takes to build the `All' menu in configPackages.
1996-06-16 16:33:34 +00:00
alex
39a83c904c Change min_free to return free space as an off_t instead of a size_t. 1996-06-08 00:46:33 +00:00
jkh
eaf12e3a12 fix PR#599
Submitted-By: jdp
1996-06-03 04:40:43 +00:00
jkh
cdd804ebcb Oh my, looks like I didn't understand .B as well as I thought I did! :-) 1996-06-01 20:51:47 +00:00
mpp
dfbf6cbddc Correct some man page xrefs, and some other minor changes to bring some
man pages up to mdoc guidelines and fix some minor formatting glitches.
Also fixed a number of man pages to not abuse the .Xr macro to
display functions and path names and a lot of other junk.
1996-04-08 04:18:31 +00:00
jdp
894475c5ab Close a file descriptor that I had (harmlessly) left open in a child
process.
1996-03-20 19:05:59 +00:00
jkh
b8029dbe28 Fix a couple of miscellaneous bugs and make pkg_add also support reading
from stdin.
1996-03-12 06:12:43 +00:00
mpp
29f3a7dcc3 Initialize the argument list in the unpack() routine to zero.
This prevents a core dump due to the stack being trashed if pkg_add
is asked to process something that really isn't a package file.
1996-02-19 02:35:56 +00:00
mpp
37272cd2d1 Another round of man page cleanups.
Down to only about 100 items left to cleanup! :-)
1996-02-12 04:57:03 +00:00
jkh
e9cb417381 Fix to catch a stupid oversight on my part which allowed this thing
to remove the current directory under certain circumstances.
Submitted by:	Richard J Kuhns <rjk@watson.grauel.com>
1996-02-09 12:05:26 +00:00
jdp
7976c75ce6 Fixed pkg_create to eliminate the limits on the size of the PLIST.
Formerly, there were limits on both the number of files (hard-coded into
the program) and the number of characters (because of the ARG_MAX limit
in exec(2)).  In this new version, the filenames are passed to tar through
a pipe, using tar's "-T" option, rather than on the command line.
1996-02-06 22:49:11 +00:00
peter
639da796bd recording cvs-1.6 file death 1995-12-30 19:02:48 +00:00
jkh
ef7c9d2cde Bring my pkg_install improvements forward from 2.1. 1995-11-12 04:55:40 +00:00
jkh
f5655d6180 Fix the `pkg_add relative to .' bug. Thank you, Ville!
Submitted by:	Ville Eerola <ville@vlsi.fi>
1995-10-31 20:30:18 +00:00
jkh
64d0f989f9 Bring forward my changes from 2.1 1995-10-25 15:38:37 +00:00
jkh
c38d6e3874 Don't be needlessly verbose in the pkg_create. 1995-08-28 14:47:30 +00:00
jkh
2253462e62 Make the play-pen searching routine even more agile in trying
to create a /usr/tmp dir if it makes sense to do so.
1995-08-26 18:36:27 +00:00
jkh
fb55562c26 Use size_t properly in all fs size ops. This kills a bug
encountered by someone who had his /tmp on a partition with 3.7GB of
free space!
Spotted by:	Francisco Rosich Viana <rosich@power.ci.uv.es>
1995-08-26 10:15:18 +00:00
jkh
1da1cf69d4 Some fixes to make this "TMPDIR agile".
Submitted by:	jmacd + some of my own fixes.
1995-08-17 00:36:06 +00:00
jkh
25cd61f859 Make "out of space in ${PKG_TMPDIR}" handling a bit more robust.
Print the right thing, do the right thing.  Back to you, Satoshi!
1995-08-06 03:21:04 +00:00
jkh
eaa736c3ae Remove useless -lftp arguments from Makefiles.
Suggested by: ache
1995-08-04 07:14:08 +00:00
jkh
6b5b7123ac Round this out. Now seems to transfer packages properly over ftp
as it was supposed to.  PKG_PATH more sorely needed than ever now..
Hmmmm.
1995-08-01 09:49:27 +00:00
jkh
892871b8f0 Argh! I hate my life! I can't seem to do anything right here today.
This should restore functionality to the pkg_install suite.
1995-08-01 07:16:51 +00:00
asami
12ef3fe69b Sync this up with ftp.c. 1995-07-31 04:00:01 +00:00
jkh
f98dba1276 Remove dependency on sysinstall. 1995-07-31 02:27:58 +00:00
jkh
2a1f928885 Add ftp.c to makefile - that might make it work better. Sheesh! 1995-07-31 01:26:58 +00:00
jkh
505802b1b0 Change the environment variable this looks for from FTP_PASSIVE to
FTP_PASSIVE_MODE.  It would be really nice if we could standardise on
this name so that all tools (like ncftp) that offer passive/active
ftp selection would work seamlessly with one user environment variable
setting.
1995-07-30 09:41:21 +00:00
jkh
820e95d52e Document how to get pkg_add to use PASSIVE MODE ftp in such transfers. 1995-07-30 09:37:31 +00:00
jkh
5386b068bc Totally eliminate the dependency on libftp (which will be removed from the
FreeBSD source tree) and switch to the internal ftp routines developed
by Poul-Henning and used in sysinstall.
1995-07-30 09:33:31 +00:00
jkh
b4c08e6c56 o Fix PR# bin/643 - always set "where_to" properly.
o Nuke dependence on libftp - it's about to die!
1995-07-30 09:11:20 +00:00
asami
18a4b5b400 The default for temporary directory is /var/tmp, not /tmp. 1995-07-30 05:25:35 +00:00
ache
2360072913 You can run pkg_info everywhere expect /var/db/pkg directory :-)
Running there you got any kind of strange errors from tar caused
by treating directories as tar files!
Fix it by adding new isfile(name) (check for reg. files) to simple fexists(name) calls.
1995-07-30 01:44:45 +00:00
ache
187d46fc1a If some files lost in /var/db/pkg/<port>/ after system crash f.e.,
pkg_manage silently dumps core, pkg_info claims about them to
stderr, which makes very difficult to find what directory cause it via
tons of pkg_info -a output. I found solution which covers both variants,
now pkg_info claims about missing files to stdout among valid output
with ERROR: prefix. It heals pkg_manage to not dump core and makes
easy to find errors in pkg_info -a output by simple /ERROR 'more' command.
1995-07-30 01:08:34 +00:00
ache
b6b6127fa6 Fix coredump for -v flag
Submitted by: Thomas Gellekum <thomas@ghpc8.ihf.rwth-aachen.de>
Obtained from:
1995-07-28 01:50:35 +00:00
asami
984358d0aa Use lstat() instead of access() for checking file existence. It works
for symlinks too, and according to Rod, access() is evil anyway.

Reviewed by:	jkh
1995-06-24 10:12:59 +00:00
rgrimes
8f6e1a9b69 Merge RELENG_2_0_5 into HEAD 1995-06-11 19:33:05 +00:00
rgrimes
5a145b5eb1 Remove trailing whitespace. 1995-05-30 03:57:47 +00:00
jkh
2337819219 Only apply @mode directives to files.
Don't use the -p flag to tar; it sets the files to the wrong permissions.
Submitted by:	jmz
1995-05-19 22:40:54 +00:00
jkh
08c18f3924 Fix a long-standing bug that broke pkg_info utterly and probably made
pkg_add a little wiggy too.
1995-05-10 23:00:16 +00:00
jkh
f44afd3b68 Fix a long-standing bug that broke pkg_info utterly and probably made
pkg_add a little wiggy too.  Document the fact that pkg_info can also
take a URL.
1995-05-10 23:00:07 +00:00
jkh
972bf21fab Bump the number of allowable args by a factor of 4. I just scanned
all possible packing lists and found that at least one of them is
pretty large!
1995-05-10 22:33:55 +00:00
jkh
a579ce6ccb Document fetch-by-URL. 1995-05-10 20:56:19 +00:00
jkh
bfc680fe3e Re-work make_dist() routine to build the tar command more reasonably.
This should eliminate the problem with truncated packages.
1995-05-10 20:46:06 +00:00
jkh
77dec30366 Whoops! One of my automatics was initialized to garbage. Fix it. 1995-04-28 18:24:31 +00:00
jkh
2ba4c8f5f4 Use mtree -U instead of -u and put back error check. Thanks Rod! 1995-04-28 04:16:30 +00:00
jkh
6192eebed2 Don't bother checking the return status of the mtree command - it returns
non-zero stats when it changes things, too.
1995-04-27 11:33:08 +00:00
jkh
1aa5ad31bd Add code for dealing with URLs. 1995-04-26 15:08:23 +00:00
jkh
8a4aaefb17 Make pkg_info URL aware (and also make it use the PKG_PATH properly, like
everyone else).  Try this:
	pkg_info ftp://freebsd.org/pub/FreeBSD/packages/all/gmake-3.73.tgz
1995-04-26 15:08:02 +00:00
jkh
9c5a2da6c5 Add depend on libftp since this is now in lib. 1995-04-26 15:07:14 +00:00
jkh
d802ff79cb Add a great deal more error checking to various things. 1995-04-26 15:06:58 +00:00
jkh
fab1481f35 Further work on making all this more robust in the face of failure.
Also allow URL specification for a package.  This works for things the
package may depend on, too.

Allow PKG_PATH to be used anywhere a package is being searched for.
1995-04-26 15:06:26 +00:00
jkh
da5332be07 Yikes! How did that typo slip past! I'd swear I compiled it. Oh well,
thanks, Satoshi!

Embarrassed by:	asami
1995-04-26 12:37:46 +00:00
jkh
7e86a7df0e As per Bruce's advice, use sysconf to get the max argument size and
dynamically allocate that much space, also using snprintf() and strncat()
to do proper bounds checking.
1995-04-26 11:43:20 +00:00
jkh
fbd106c11e Check dependencies BEFORE doing final extraction of package.
Fix a bug where direct-extract mode would have still invoked the
packing list reordering commands.
1995-04-26 07:43:35 +00:00
jkh
65f5cd0e72 My handling of the missing dependency but !Verbose was wrong. Make
the right message come out.
1995-04-26 06:56:05 +00:00
jkh
ba8fd66470 Use ARG_MAX instead of _POSIX_ARG_MAX: 4K is too small!
This should stop the SIGBUS errors in pkg_create for some packages.
1995-04-24 21:50:11 +00:00
jkh
aacd5261e4 Stage almost nothing through the playpen now - this should speed pkg_creates
up by a couple of factors, as well as decrease the amount of temporary space
required to build a package down to almost nothing.
1995-04-22 14:55:07 +00:00
jkh
1f09bd00a0 Export the min_free() function. 1995-04-22 13:58:44 +00:00
jkh
c63844d550 Second round:
1. Make paths work correctly.
2. Make pkg_add generally more robust in the face of failure.
3. Make the depend messages come out on stderr or stdout, but not both
   interspersed! :-)
1995-04-22 13:58:24 +00:00
jkh
7be6bd93c4 1. Add an new @option directive. You'll understand it better in a moment.
2. Fix a long-standing bug in pkg_add where the failure of one package in
   a multipackage installation (pkg_add *.tgz) would blow you right out of
   the water.  Ick.
1995-04-22 07:41:02 +00:00
jkh
ca5a05f3b5 Argh - missed a printf! That should be the last of plist-spewers. 1995-04-22 01:20:13 +00:00
jkh
b483579b3d Don't spew garbage into the packing list when PlistOnly and verbose are
both on.  Whoops!
1995-04-22 00:59:33 +00:00
jkh
37f9a22c9b Some patches to make deletions of non-existent files and directories slightly
less fatal (so that the database entry is subsequently removed anyway).
Submitted by:	Edward Wang <edward@edcom.com>
1995-04-22 00:14:20 +00:00
jkh
28f0ab6b88 1. Add proper dependencies to the library in my Makefiles. This was pointed
out by Bruce.
2. Add a "feature" to pkg_create (OK, OK, it's a miserable hack!) to get
   it to dump its internal packing list out so that the `fake-pkg' rule in
   bsd.port.mk can generate a more meaningful packing list.
1995-04-22 00:03:18 +00:00
jkh
9fb96438b8 Correct a bogusly formatted printf(). 1995-04-21 06:30:41 +00:00
jkh
30f9fbb8e1 Greatly simplify the calling of mtree - the error handling wasn't working
anyway, at least not with FreeBSD's mtree, and the arguments were being
built incorrectly.
1995-04-19 14:54:25 +00:00
jkh
190d84cea2 Add support for the ${PKG_DBDIR} environment variable. /var/db/pkg is the
default, and probably not something you'd ever change, but now it's
possible to do so for local/custom installations.
1995-04-19 14:02:01 +00:00
jkh
4cc95b6fd0 Use a more nicely formatted message when we run out of space. 1995-04-18 13:04:34 +00:00
jkh
57cde8c5ec Neither of these tools really told you what you needed to know neatly
and succinctly in verbose mode.  I hope people find this more to their
liking.
1995-04-10 08:01:52 +00:00
jkh
6546aeeaf8 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
jkh
33a52f7ec4 Rename TMPDIR to PKG_TMPDIR, just to make Jeff happy.. :-) 1995-02-16 12:43:00 +00:00
jkh
9c179e8e05 Make pkg_install use /var/tmp instead of /tmp
Suggested by:	hsu
1995-02-15 03:48:13 +00:00
jkh
6baa0e3d46 Whoops! How embarassing. Just now noticed that I forget to update the .Os
lines.  Done.
1995-01-05 10:37:13 +00:00
jkh
48a0c6eea5 Fix a bad formatting directive. 1995-01-05 10:31:42 +00:00
jkh
3f805a54cc Fix misleading typo in description of @unexec. 1995-01-05 10:22:51 +00:00
swallace
ce84ce2f5d Added new function show_index() which does a 'smart' display of the index file.
Index descriptions are limited to MAXINDEXSIZE (60) chars.  Any description
beyond that is truncated.  Also, only the first line is displayed as well.
This allows pkg_info -a -I to be formated in two columns with one line
per package for easy reading.

Reviewed by:	jkh
1995-01-05 01:10:13 +00:00
jkh
492d4eeb1e More changes from John T. Kohl. Man pages, mostly.
Submitted by:	jtkohl
1994-12-06 01:04:17 +00:00
jkh
3f74cd1688 Many of John T. Kohl's patches from NetBSD. Thanks, John!
Submitted by:	jkohl
1994-12-06 00:51:50 +00:00
jkh
8bec5bd96a Don't create packages with bogus @name lines. 1994-11-17 10:54:11 +00:00
jkh
bcb02cd44f Protect against old packages with bogus @name fields. Use basename_of()
on the name before recording it in /var/db/pkg.  Sorry, Kaleb, you
were right after all!  It was my fault! :)
1994-11-17 10:53:21 +00:00
jkh
bedd10c589 Add a new basename_of() function. 1994-11-17 10:51:51 +00:00
jkh
f9d710d682 Remove the QUERY_* functions. I don't think they're as good an
idea as I apparently once did.
1994-11-17 10:35:04 +00:00
jkh
09568fc4e1 Sigh. NOW it's ok! :-) 1994-10-14 05:57:49 +00:00
jkh
293a6e40e9 Print a better verbose message when creating packages. 1994-10-14 05:56:15 +00:00
jkh
141b211302 This should do it - I forgot about pkg_info. 1994-10-14 05:55:57 +00:00
jkh
c290ec9715 Whoops - variable was in wrong scope. Correct. 1994-10-14 05:43:41 +00:00
jkh
581e05c57d Fix bug in home directory calculation that I introduced with the free space
checking code.  Fix the free space checking code, while I'm at it! ;)
Thanks to Garrett for spotting the home dir problem.
1994-10-14 05:42:24 +00:00
jkh
94e76f25f8 Fix bug in home directory calculation that I introduced with the free space
checking code.  Fix the free space checking code, while I'm at it! ;)
Thanks to Garrett for spotting the home dir problem.
1994-10-14 05:34:04 +00:00
jkh
f3c4f7552f Be optionally verbose about free-space checking. I need this to ascertian
whether or not this always works.
1994-10-08 23:55:36 +00:00
jkh
16f6fc702d Add the ability to verify that a package won't extract in the space
available.  Thanks to Michael Elbel for pushing me in the right direction.
1994-10-04 16:07:50 +00:00
jkh
841e26b0dc My last commit to bsd.port.mk made me think - `pkg_create -p ...' should
override the PLIST file's own first @cwd.  Make this so.
1994-10-04 15:54:39 +00:00
jkh
8e4c62b12c Don't let pkg_delete remove the recorded location until everything has
absolutely, positively been successfully removed.
Reviewed by:
Submitted by:
Obtained from:
1994-09-29 13:19:43 +00:00
jkh
04d52dfae7 Delete obsoleted *dist targets. 1994-09-13 10:20:37 +00:00
jkh
20db4e2bae Make this stop trying to go into /usr/local and inherit the settings
from above instead.
1994-09-13 10:20:02 +00:00
adam
15f01e5c36 Allow creation of absolute package names
typo index() --> rindex()  in order to split correct suffix
Fix @srcdir so it actually works
Submitted by:	adam
1994-08-29 16:31:38 +00:00
jkh
4a685877e3 Add @srcdir option for customizing creation of packages.
Submitted by:	jkh
1994-08-28 14:15:30 +00:00
jkh
01fdc4c888 Argh! What a boneheaded bug! Finally fix the blank-line-in-packing list
problem!  I am pond scum!
1994-07-11 01:11:14 +00:00
asami
03fc4eafdc Add explanation of -e in usage(). 1994-06-01 05:15:00 +00:00
asami
43cbd99843 Close /dev/tty that is opened in y_or_n()...this is called many times
so it will run out of ptys if not properly closed.
1994-06-01 05:14:19 +00:00
asami
74d2e8623c The environment variable PKG_PREFIX is set to the first @cwd command
in the packing list, or the argument to -p if it is specified, before
the requirements/installation/deinstallation scripts are called.  This
enables the scripts to be written to work on the final installation
destination, even if the user uses -p to override the package's default.
1994-05-25 18:00:04 +00:00
jkh
b268489b34 Change Header to Id. 1994-05-25 06:28:14 +00:00
jkh
189816e5d0 Add new find_plist() function. 1994-05-25 06:27:24 +00:00
jkh
e953d5871e Change in_plist() call to find_plist(). 1994-05-25 06:24:41 +00:00
jkh
894d036b83 Remove find_name(), replace with more generic find_plist() function. 1994-05-25 06:24:18 +00:00
asami
dd5b7190ed Typo (pkg_add => pkg-add). 1994-05-20 19:35:33 +00:00
asami
4ca9bd9f11 Make clear what arguments the "require" script gets. 1994-05-20 19:34:44 +00:00
asami
5ef5d950a9 Make clear what arguments the "require" package gets (the original didn't
make any sense, with a ".b" instead of ".B" in front of "INSTALL"!).
1994-05-20 19:33:08 +00:00
alm
12a6e70ece Add `-h' option to force tar to follow symbolic links 1994-05-19 18:27:41 +00:00
jkh
2721283a01 Whoops, -Y and -N would work better if they were in the getopts string! 1994-04-16 21:50:53 +00:00
jkh
0caac1d9bf Make y_or_n() pay attention to AutoAnswer global. 1994-04-05 14:08:47 +00:00
jkh
b4e863ad0e Add -N and -Y flags for auto-answer feature. 1994-04-05 14:05:40 +00:00
jkh
615aa68eaf Cleaning house. 1994-01-06 08:19:38 +00:00
jkh
7bd539b1ff If require script fails, don't try to delete installed package. 1993-10-10 20:25:31 +00:00
jkh
3751f5fdb4 Added files necessary for automating packing of distributions. 1993-10-10 20:24:47 +00:00
jkh
1747554767 Fix problems with executing from current directory 1993-10-08 01:19:35 +00:00
nate
c8f3143ccb Now works with/without obj directories 1993-09-20 23:47:51 +00:00
jkh
d029a968bb Finally stuck a version number on this thing! :) 1993-09-19 01:52:33 +00:00
jkh
a9c908e47a Added code for doing % sequence expansion, added new @unexec command. 1993-09-18 03:39:50 +00:00
jkh
29e567f255 Doc new % sequence expansion for command execution.
Fixed bad verbose message.
1993-09-18 03:39:21 +00:00
jkh
9ad8e7c602 Make sure permissions on registry location are readable by pkg_info.
Add new % sequence expansion for command execution.
1993-09-18 03:38:48 +00:00
jkh
d6bf4d4cb2 Fixed broken -t flag; thanks Rich! 1993-09-14 19:53:01 +00:00
jkh
b4c8f0e3c1 Whoops - got the exclude flag wrong, try again. 1993-09-12 20:56:40 +00:00
jkh
55c1577db5 Fixed an embarassing bug with @owner, @mode & @group 1993-09-12 20:45:53 +00:00
jkh
181dee1323 Added and doc'd -X flag to pkg_create that allows you to specify an exclude
list for the final package.
1993-09-12 20:45:31 +00:00
jkh
e4541f4b1a Rudementary README 1993-09-08 23:46:04 +00:00
jkh
eb4ae1b582 Added two new options, one of which is fairly far reaching:
-q	turns on "quiet" mode, where informational headers and such are not
	dumped, just the information.

-L	Shows full pathnames of files comprising a package.  With -q,
	this can be useful for doing fileset operations, such as
	"du -s `pkg_info -q -L foo_bin`" to see how much space package
	"foo_bin" is taking up.
1993-09-08 01:46:59 +00:00
jkh
00524474a0 Nailed one last lurking ^L. 1993-09-07 01:01:32 +00:00
jkh
b6ff6e9619 Fixed bug in copying script files from absolute locations 1993-09-06 23:28:42 +00:00
jkh
ce70f09a1a Doc'd option for current directory prefix in @exec 1993-09-06 23:28:19 +00:00
jkh
1a4113a1f5 Added option for current directory prefix in @exec (without which it's pretty
useless).
1993-09-06 23:26:21 +00:00
jkh
ee7696e75e Added -e flag to pkg_info. Now you can test to see whether a package
is installed or not rather easily (useful for install scripts that want
to check for prerequisite packages).  See man page for details.
1993-09-05 22:36:54 +00:00
jkh
ed233e07b3 Made staging area configurable rather than assuming /tmp (-t) 1993-09-05 04:54:24 +00:00
jkh
762ca476c1 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
jkh
b091944915 Fixed bug in pkg_create that affected Rich's attempts to package emacs 1993-09-04 18:19:41 +00:00
jkh
c729c4bf98 Added Rich's wish front-end. 1993-09-04 17:06:09 +00:00
jkh
fee19370f0 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
jkh
83a6225604 Removed annoying -Wall 1993-08-30 01:51:16 +00:00
jkh
ffd243ab29 Install man pages in /usr/local/man 1993-08-30 01:47:26 +00:00
jkh
e83dde8008 The release version of my package install suite. Please see man pages
for info.
1993-08-26 01:19:55 +00:00