Commit Graph

54 Commits

Author SHA1 Message Date
sobomax
fe9d5c831c When creating a package sort dependencies in such a way that if dependency
A depends on dependency B then dependency A will be in all cases listed
before B, so ``pkg_add -r'' will fetch/install packages in the correct order.

Previously dependencies were sorted just by its names, which is why
``pkg_add -r'' never actually worked properly.

To be usefull, hovewer, this fix requires that all packages have been
rebuilt, so it will take some time until users would be able to feel
posititive improvements. For the same reasons it is desirable to propagate
these changes to the 4-stable package building cluster *before* 4.3 ports
freeze, so packages for 4.3-RELEASE would be properly prepared.

Prompted by:			kris
Insanely appreciated by:	obrien
Silently approved by:		jkh, -ports
2001-03-15 10:47:00 +00:00
sobomax
4d6dab1288 - 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
sobomax
4f0908e679 - Fix a nasty bug where pkg_create doesn't gzip package if lengh of package
name is less than 5 and doesn't contain recognizeable suffix (one of .tar or
  .tgz), while gzip's it if lengh of the name greater than 4. For example
  `pkg_create [options] pkg1' will create pkg1.tar, while
  `pkg_create [options] pkg11' will create pkg11.tgz;
- use TRUE/FALSE as a values for boolean variables instead of explicit 1/0 and
  erroneous YES in one case.

MFC candidate.
2001-01-16 08:27:28 +00:00
sobomax
254d567a68 Add "-o" option to pkg_create(1) and pkg_info(1). This option intended to record
a path of the port from which package has been created within FreeBSD Ports
Collection and will be used to improve pkg_version(1) and similar tools.

Reviewed by:	ports@FreeBSD.org, jkh
Approved by:	jkh
2000-10-23 07:01:31 +00:00
jkh
aa761fd55e Cause fatal error messages to be a little more helpful to the programmer
concerning where they're taking place.

Switch from [r]index() to str[r]chr() functions, which are more ISO
compliant.

Prompted by:	Edward Welbourne <eddy@vortigen.demon.co.uk>
2000-10-22 09:53:27 +00:00
peter
b6784c4210 $Id$ -> $FreeBSD$ 1999-08-28 01:35:59 +00:00
billf
59887a99f7 -Wall fixes. Ambigious if/elses, uninitialized values, missing headers,
missing prototypes, and empty format strings.
1999-08-11 20:55:42 +00:00
jkh
be66220741 Make it possible to have separate install scripts as well as have
an on-delete script.

Submitted by:	Rajesh Vaidheeswarran <rv@fore.com>
1998-12-16 13:59:31 +00:00
asami
37c5c2e32c Fix support for uncompressed (".tar") package types. It's not completely
fixed (chained dependency checking for pkg_add is broken, for one thing)
but at least you can now create one package and use it.
1998-12-05 06:29:03 +00:00
jkh
9835bde2b9 correct usage of cleanup() everywhere - this became bogus when the warnx/errx
stuff was added and nobody seems to have noticed. :)
Noticed by:	Josh MacDonald <jmacd@paris.CS.Berkeley.EDU>
1998-09-11 07:26:58 +00:00
jkh
1b1b3e89e3 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
jkh
abeedb99ab Fix bogus suffix stripping to be less naive.
PR:		3418
Noted by:	pst
1998-09-08 03:15:41 +00:00
jkh
4d2aa47575 Don't exit() from cleanup() if we got there via a non-signal since
we're only going to exit (after printing a more detailed error message)
afterwards anyway.
PR:		7020
1998-07-28 11:55:39 +00:00
jkh
92b370bb35 Eliminate the idea of nested "playpens" entirely - it just obfuscated
the code and, in at least one case, made it more dangerous to no gain.
1998-02-16 17:16:51 +00:00
jkh
f44431a539 MF22: Revert part of -p handling. 1997-11-14 01:56:04 +00:00
jkh
4bf8058de9 The prefix override code was bogus. The original idea was sound
enough, but we're not using the pkg_create tool that way anymore
in the ports collection.

PR:		4894
Submitted by:	Adrian Colley <aecolley@ois.ie>
1997-11-13 11:49:23 +00:00
jkh
3e3b2901a0 Don't return from cleanup() - if it's removed the playpen then very
bad things will happen if we return to unsuspecting code.
Noted to my great dismay by:	Tim Vanderhoek <hoek@hwcn.org>
1997-10-13 15:03:55 +00:00
charnier
cd42e7664e Use err(3). Cosmetics in usage string and man page. 1997-10-08 07:48:21 +00:00
jkh
f4cb476ed1 Add proper md5 comments to ports-installed packages also by
masticating it through the same routine used by pkg_create.
Submitted by:	se
1997-07-04 04:48:02 +00:00
jkh
ca1b83a362 Add support for srcdir overrides. 1997-06-06 12:19:11 +00:00
peter
32d6b795de Revert $FreeBSD$ to $Id$ 1997-02-22 16:15:28 +00:00
jkh
9c0cd3f9df 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
jkh
7241e8251f 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
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
jdp
894475c5ab Close a file descriptor that I had (harmlessly) left open in a child
process.
1996-03-20 19:05:59 +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
jkh
64d0f989f9 Bring forward my changes from 2.1 1995-10-25 15:38:37 +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
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
d802ff79cb Add a great deal more error checking to various things. 1995-04-26 15:06:58 +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
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
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
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
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
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
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
141b211302 This should do it - I forgot about pkg_info. 1994-10-14 05:55:57 +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
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
e953d5871e Change in_plist() call to find_plist(). 1994-05-25 06:24:41 +00:00
alm
12a6e70ece Add `-h' option to force tar to follow symbolic links 1994-05-19 18:27:41 +00:00
jkh
29e567f255 Doc new % sequence expansion for command execution.
Fixed bad verbose message.
1993-09-18 03:39:21 +00:00
jkh
b4c8f0e3c1 Whoops - got the exclude flag wrong, try again. 1993-09-12 20:56:40 +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