Commit graph

26 commits

Author SHA1 Message Date
jlam
c78510391e Refactor "fetch" and "extract" code into correspondingly named
subdirectories of pkgsrc/mk.  Move the following files around for
locality:

	pkgsrc/mk/scripts/extract  -> pkgsrc/mk/extract/extract
	pkgsrc/mk/bsd.sites.mk     -> pkgsrc/mk/fetch/sites.mk

Also get rid of the recursive make for the "fetch" and "extract"
targets.  This basically merges the "fetch" and "extract" phases into
the "patch" phase.

There is still much more work to do to simplify the fetch code, but
this is a good start.
2006-06-06 03:05:48 +00:00
jlam
3fbe129b69 Use PHASE_MSG, STEP_MSG, WARNING_MSG, and ERROR_MSG in place of ECHO_MSG
in various places.
2006-06-05 22:49:44 +00:00
jlam
e914dab1ef Drop the use of _ACQUIRE_LOCK and _RELEASE_LOCK and replace with
acquire-lock and release-lock macro targets.  Take advantage of using
a make target by breaking up the _ACQUIRE_LOCK script into smaller
pieces, and make better use of the *_MSG definitions for printing
messages within the acquire-lock and release-lock targets.
2006-06-04 04:31:47 +00:00
jlam
e5eb2c56af First pass at implementing support for package system flavors other
than pkgsrc's current one.  This is an important lead-up to any project
that redesigns the pkg_* tools in that it doesn't tie us to past design
(mis)choices.  This commit mostly deals with rearranging code, although
there was a considerable amount of rewriting done in cases where I
thought the code was somewhat messy and was difficult to understand.

The design I chose for supporting multiple package system flavors is
that the various depends, install, package, etc.  modules would define
default targets and variables that may be overridden in files from
pkgsrc/mk/flavor/${PKG_FLAVOR}.  The default targets would do the
sensible thing of doing nothing, and pkgsrc infrastructure would rely
on the appropriate things to be defined in pkgsrc/mk/flavor to do the
real work.  The pkgsrc/mk/flavor directory contains subdirectories
corresponding to each package system flavor that we support.  Currently,
I only have "pkg" which represents the current pkgsrc-native package
flavor.  I've separated out most of the code where we make assumptions
about the package system flavor, mostly either because we directly
use the pkg_* tools, or we make assumptions about the package meta-data
directory, or we directly manipulate the package meta-data files, and
placed it into pkgsrc/mk/flavor/pkg.

There are several new modules that have been refactored out of bsd.pkg.mk
as part of these changes: check, depends, install, package, and update.
Each of these modules has been slimmed down by rewriting them to avoid
some recursive make calls.  I've also religiously documented which
targets are "public" and which are "private" so that users won't rely
on reaching into pkgsrc innards to call a private target.

The "depends" module is a complete overhaul of the way that we handle
dependencies.  There is now a separate "depends" phase that occurs
before the "extract" phase where dependencies are installed.  This
differs from the old way where dependencies were installed just before
extraction occurred.  The reduce-depends.mk file is now replaced by
a script that is invoked only once during the depends phase and is
used to generate a cookie file that holds the full set of reduced
dependencies.  It is now possible to type "make depends" in a package
directory and all missing dependencies will be installed.

Future work on this project include:

    * Resolve the workflow design in anticipation of future work on
      staged installations where "package" conceptually happens before
      "install".

    * Rewrite the buildlink3 framework to not assume the use of the
      pkgsrc pkg_* tools.

    * Rewrite the pkginstall framework to provide a standard pkg_*
      tool to perform the actions, and allowing a purely declarative
      file per package to describe what actions need to be taken at
      install or deinstall time.

    * Implement support for the SVR4 package flavor.  This will be
      proof that the appropriate abstractions are in place to allow
      using a completely different set of package management tools.
2006-06-03 23:11:42 +00:00
wiz
a818e03080 Recognize -tar.gz as tar.gz files. PR 33571 by Dieter Roelants. 2006-05-30 23:51:38 +00:00
rillig
bc677ecae9 gzcat needs the full command, not only the pathname, in case it is
${GZIP} -cd.
2006-01-23 14:43:50 +00:00
rillig
f6609e47f8 The ../../mk/scripts/extract shell program does not work with Solaris'
/bin/sh. Fixed by invoking it via ${SH}.
2006-01-23 14:19:08 +00:00
jlam
6a485fcc01 Don't write ${FOO:Mbar} == "bar", when !empty(FOO:Mbar) will suffice.
In this case, "FOO" is "INTERACTIVE_STAGE".
2006-01-21 21:32:51 +00:00
jlam
b9431606d0 Set EXTRACT_CMD_DEFAULT to the default extraction command that invokes
the "extract" script.  This allows custom EXTRACT_CMD settings to still
invoke ${EXTRACT_CMD_DEFAULT}.
2006-01-21 19:39:22 +00:00
jlam
d9e6b299d6 Use /usr/pkgsrc/mk/scripts/extract to do extraction instead of using all
that Makefile code to determine the right extraction command to use.
This change removes EXTRACT_CMD.<suffix>.
2006-01-21 18:55:10 +00:00
jlam
338850bba1 Rename EXTRACT_ENV.bin to EXTRACT_ENV in preparation for a reimplementation
of how distfiles are extracted.  EXTRACT_ENV is a more generic name
and will be applicable for all extraction commands.
2006-01-20 23:55:02 +00:00
jlam
81db182ecc Rename the following variables to reduce the number that we need to track:
EXTRACT_CMD_OPTS.bin		->  EXTRACT_OPTS_BIN
	EXTRACT_CMD_OPTS.lha		->  EXTRACT_OPTS_LHA
	EXTRACT_CMD_OPTS.rar		->  EXTRACT_OPTS_RAR
	EXTRACT_CMD_OPTS.tar		->  EXTRACT_OPTS_TAR
	EXTRACT_CMD_OPTS.tar.Z		->  EXTRACT_OPTS_TAR
	EXTRACT_CMD_OPTS.tar.bz2	->  EXTRACT_OPTS_TAR
	EXTRACT_CMD_OPTS.tar.gz		->  EXTRACT_OPTS_TAR
	EXTRACT_CMD_OPTS.tbz		->  EXTRACT_OPTS_TAR
	EXTRACT_CMD_OPTS.tbz2		->  EXTRACT_OPTS_TAR
	EXTRACT_CMD_OPTS.tgz		->  EXTRACT_OPTS_TAR
	EXTRACT_CMD_OPTS.zip		->  EXTRACT_OPTS_ZIP
	EXTRACT_CMD_OPTS.zoo		->  EXTRACT_OPTS_ZOO
	EXTRACT_CMD_OPTS_tar.gz		->  EXTRACT_OPTS_TAR
2006-01-20 23:41:29 +00:00
jlam
4a3e4a25bc Move more of the "extract"-related variables and targets out of bsd.pkg.mk
and into bsd.pkg.extract.mk.
2006-01-19 19:35:25 +00:00
rillig
5504acc8f3 Added .tbz2 to the list of known suffixes. Fixes PR #31564.
Patch contributed by Geert Hendrickx.
2005-10-12 15:18:59 +00:00
rillig
9c2ed58976 Cleaned up the code that checks which tools are needed for extraction. 2005-08-21 07:29:48 +00:00
rillig
6f9f44642c Reordered the conditions of checking for .tar files in DISTFILES to improve
readability.
2005-08-15 12:57:07 +00:00
jlam
bf9129c41e Drop distinction between PKGSRC_USE_TOOLS and USE_TOOLS by making
PKGSRC_USE_TOOLS go away.  There is now only a single USE_TOOLS variable
that specifies all of the tools we need to build/run the package.
2005-07-15 18:27:48 +00:00
jlam
9f94b112f0 Remove the old tools framework and references to _USE_NEW_TOOLS. 2005-05-22 19:11:12 +00:00
jlam
26e97aafd5 _tar.gz is a recognized suffix, so recognize that we need the right tool
to untar the archive.
2005-05-17 22:11:14 +00:00
jlam
0f437f77f6 Allow tweaking of options to pax/tar via EXTRACT_CMD_OPTS.*. 2005-05-17 21:34:29 +00:00
jlam
482689cdaa NetBSD's (and bootstrap's) pax-as-tar is GNUish enough to extract most
GNU tar archives.  Create a new EXTRACT_USING value "nbtar" that causes
tar/ustar archives to be extracted using pax-as-tar, which understands
most GNU tar extensions.  Default to EXTRACT_USING=nbtar, as quite a
few packages are distributed in GNU tar archives.
2005-05-16 18:43:20 +00:00
jlam
ed2ba77faa Document EXTRACT_USING in bsd.pkg.extract.mk where it is used. 2005-05-16 04:22:40 +00:00
jlam
2338cbae27 Change the EXTRACT_USING_PAX defined/undefined option into a EXTRACT_USING
which can take multiple values -- "pax" or "gtar".  The default value
of EXTRACT_USING is "pax", which more closely matches reality since
before, we were using bootstrap "tar" for ${GTAR} and it was actually
pax-as-tar.  Also, stop pretending pax-as-tar from the bootstrap kit
or on NetBSD is GNU tar.  Lastly, in bsd.pkg.extract.mk, note whether
we need "pax" or "gtar" depending on what we need to extract the
distfiles.
2005-05-16 03:04:44 +00:00
jlam
e0fd563afe distfiles that end in .Z require gzcat as part of the extraction process. 2005-05-15 03:57:21 +00:00
jlam
ec7c68e97c Teach the new tools framework about lha, unrar, unzip, and unzoo and
modify bsd.pkg.extract.mk to use them.  As a side-effect, we stop
hardcoding ${LOCALBASE} as the install prefix for these tools so this
becomes more pkgviews-friendly.
2005-05-13 22:08:20 +00:00
jlam
0e589ad8af Separate out the variables and targets for the "extract" phase into a
separate file pkgsrc/mk/bsd.pkg.extract.mk.  Also, include this file
ahead of the inclusion of bsd.tools.mk so that tools required to
extract are created by the tools framework.
2005-05-11 04:01:49 +00:00