Commit graph

133 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
wiz
a818e03080 Recognize -tar.gz as tar.gz files. PR 33571 by Dieter Roelants. 2006-05-30 23:51:38 +00:00
dmcmahill
c72147afb6 when generating the list of pkgsrc packages, use
${BMAKE} show-subdir-var VARNAME=SUBDIR
instead of just grepping through the makefiles.  This seems
to be a litle more robust.  Suggested by Joerg Sonnenberger.
2006-05-29 02:41:26 +00:00
dmcmahill
9f0c8c2d39 strip trailing comments when searching for SUBDIR+= lines in the Makefiles 2006-05-28 16:34:09 +00:00
salo
27e4f856bf Back to pkg-vulnerabilities format 1.0.0. 2006-04-15 15:00:24 +00:00
jlam
ffdd852782 Remove an unsed script -- print-la-libnames was replaced with
plist/libtool-expand after the plist module was committed.
2006-03-22 22:51:53 +00:00
adrianp
28554c4f65 Add .tar.bz support 2006-02-19 15:38:23 +00:00
rillig
3297636963 - Added "set -e" at the top of the file to prevent uncontrolled execution.
- Added "set -u" at the top of the file to prevent spelling errors.
- Renamed UNZIP to UNZIP_CMD, since that is used by the rest of pkgsrc.
- Found a singleton use of $extract_options and replaced it with
  ${EXTRACT_OPTS_LHA}.
- Took the default assignment for TMPDIR out of the block. All other
  entries are tools.
- Removed unnecessary variables.
- Make sure that distfile can always be resolved, even if the current
  working directory is changed.
- Provide default values for all EXTRACT_OPTS_* variables, as close as
  possible to the point where they are used.
- Replaced all "$@" with ${1+"$@"} to avoid errors when no parameters are
  given.
- Made the removal of the temporary file for .tar extraction more robust.
2006-02-04 18:06:47 +00:00
joerg
afe110c086 .tar.z is a valid tar extension. 2006-02-03 11:22:12 +00:00
joerg
d9221c21a4 Fix unrar usage: the command to extract is 'x', without hyphen. 2006-02-02 14:28:17 +00:00
jlam
03451a917b Ensure that decompress_cat and tarprog always have vaild default values
in the case where the user makes bad option choices on the command line.
2006-01-24 15:26:06 +00:00
jlam
b032c82c21 If the package directory doesn't exist, then return a non-zero code. This
allows us to distinguish the case where everything is what we expect, and
any deviations from that main case.
2006-01-23 18:38:27 +00:00
wiz
6b00839b12 Handle *.ZIP the same way as *.zip -- fixes fonts/cyberbit-ttf extraction. 2006-01-23 17:52:02 +00:00
jlam
ae4a2129c3 While walking the dependency graph, push the dependencies onto the
stack in the reverse order that show-depends-pkgpaths outputs them.
This makes the top element of the stack the first child dependency
that was marked as "pushed".  This change orders the default "postfix"
output of this script in such a way that for any package listed in
the output, there is no earlier package that depends on it.

In other words, you can take the default output and install from first
to last and never need to install any dependencies, because any
dependencies are guaranteed to have already been installed earlier.
2006-01-21 22:16:13 +00:00
jlam
d04be0cdcb duh... stacks are LIFOs not FIFOs. 2006-01-21 21:46:24 +00:00
jlam
fd7b3b4b47 Allow using standard input for the archive contents for tar and shar
extraction.
2006-01-21 19:26:09 +00:00
jlam
c7dd4d5b8f Fix the case where -X excludefile is used so that we don't error out trying
to remove "".
2006-01-21 18:21:08 +00:00
jlam
9e65705d03 Teach the extract script how to exclude files specified on the command
line from extraction when using tar (it already knew how to do it for pax).
2006-01-21 18:01:26 +00:00
jlam
53a8e34fec Teach extract how to extract *.z files using gzip. 2006-01-21 16:48:10 +00:00
jlam
42c1f7217d Teach the extract script a "-d dir" option to extract into a specific
directory.
2006-01-21 16:40:19 +00:00
jlam
e5ae84bc32 Fix up the comments, and add a fall-through for unrecognized archive
formats.
2006-01-21 15:33:05 +00:00
jlam
f6a5617420 Fix other instance of _ZOO -> _ZIP and remove a debugging line. 2006-01-21 14:31:56 +00:00
jlam
722d39d511 unzip should be using EXTRACT_OPTS_ZIP, not *_ZOO. 2006-01-21 14:23:08 +00:00
jlam
863c8a3454 Teach the extract script to simply copy the distfile over to the
current working directory by default if it can't figure out what type
of archive it is.  This handles the most common case of overriding
EXTRACT_CMD in package Makefiles, which is to copy a C file or a Perl
script over to the work directory.

Also, modify the script to allow the file format to be specified on
the command line via a -f option, which will force the extract script
to interpret the archive as the specified a format.  This covers the
case where there is a distfile with an unusual file extension that is
actually in well-known format, and we would like to just tell the
extract script which format this is.
2006-01-21 05:24:36 +00:00
jlam
6f807e3cce Teach this script a default extraction method for *.bin files (which are
what Sun packagse its JRE/JDKs as).  While here, cleanup up the comments
slightly.
2006-01-20 23:58:49 +00:00
jlam
f14f207bfd Support listing files/patterns for exclusion in an "excludefile",
which is correctly parsed and translated into the correct syntax for
the underlying tool.
2006-01-20 22:26:12 +00:00
jlam
e9396cdb62 Add some whitespace for readability. 2006-01-20 20:00:44 +00:00
jlam
3afa428cae Fix processing of -t tarprog. 2006-01-20 20:00:15 +00:00
jlam
348fa15438 First pass at a script that replaces many of the variables, loops and
logic in bsd.pkg.extract.mk.  This script "knows" how to extract files
depending on their file extension.
2006-01-20 18:00:45 +00:00
jlam
1de033d120 Add a "-s pkgsrcdir" option that allows specifying the path to the pkgsrc
directory tree on the command line more easily.
2006-01-18 18:21:56 +00:00
jlam
ca35caf06f Modify the show-depends-pkgpaths implementation so that we don't assume
package directories specified in DEPENDS lines begin with "../..".  The
new standalone script pkgsrc/mk/scripts/pkg_path will canonicalize them
into package paths relative to ${PKGSRCDIR}.
2006-01-18 18:03:08 +00:00
jlam
eb3653b4a8 whitespace nit. 2006-01-18 17:43:08 +00:00
jlam
8eef20de06 Pass MAKEFLAGs to the depends-depth-first.awk script, which will be
used by the "make show-depends-pkgpaths" process to short-circuit some
of the rather lengthy computations that are spread throughout bsd.pkg.mk
and files included by bsd.pkg.mk.  This causes the script to speed up
noticeably.

Also, rename the _DEPENDS_DEPTH_FIRST_CMD variable to _DEPENDS_WALK_CMD
for brevity and to allow for other implementations in the future.
2006-01-18 03:58:19 +00:00
jlam
5c5ac03ec1 Create a standalone awk script, depends-depth-first.awk, that encapsulates
the code that performs the dependency graph traversal (in depth-first
fashion).  This script has a hook that allows executing a shell command
line upon visiting a dependency's package directory in either prefix
or postfix order, and may be used to simplify the code in bsd.pkg.mk
that iterates over dependencies.

This awk script requires the target "show-depends-pkgpaths", which is
defined in a new Makefile pkgsrc/mk/bsd.utils.mk.  This file should
accumulate "utility" targets that current exist in bsd.pkg.mk, i.e.,
"helper" targets for various actions.
2006-01-18 00:10:07 +00:00
dmcmahill
d188673373 Rework the way the vulnerabilities list is displayed a bit to
remove the vulnerability ID from the pkg-vulnerabilities file
which managed to creep into the README.html output.
2006-01-17 23:52:17 +00:00
dmcmahill
f372299bb4 Fix a bug which caused the README.html generation to fail when the packages
directory did not exist.  Now the generation completes with a warning that
no binary packages were found.  Reported in PR pkg/32351.
2006-01-05 22:19:42 +00:00
rillig
3113583dcc Added a few FIXMEs at places where this program might fail unexpectedly. 2005-11-18 11:07:27 +00:00
rillig
36f560a653 Renamed append to append_flag. Removed superfluous quotes around that
variable. As it is controlled completely by this program, they are not
needed.
2005-11-18 10:58:37 +00:00
rillig
2de6abd1be Don't accept anything besides the known options on the command line. As
no additional parameters are used it's better to reject them.
2005-11-18 10:55:30 +00:00
rillig
794ebf4f2f - Added section headings.
- Renamed DEBUG to debug_flag, as it is not modifiable via the environment.
- Removed trailing white-space from the --help output.
- Removed the clean_and_exit function, as it had been practically unused.
- Replaced some "if"s with "case"s to avoid line noise.
2005-11-18 10:51:53 +00:00
rillig
e342ad9bd9 Properly quoted variables. 2005-11-17 21:46:42 +00:00
rillig
66a0b139ae Added a code snippet that demonstrates how to set the $@ array to the
lines printed by a shell command. In contrast to the read(1) shell
utility, there are no problems when the output contains backslashes.
2005-08-24 21:51:10 +00:00
wiz
96a7a5307e Recognize inet6 in PKG_SUPPORTED_OPTIONS as an indicator
that a package support IPv6 (for the README-IPv6.html generation).
2005-06-01 18:16:20 +00:00
dmcmahill
93521480a1 Add more error checking. PACKAGES must exist. No extra command line args taken. 2005-05-24 21:48:22 +00:00
dmcmahill
2d0657da0e improve the message when an invalid cache file version is found 2005-05-24 20:56:47 +00:00
dmcmahill
8512f22e60 Improve error checking. Specifically, after a new cache file is
created in a temp directory, issue a warning if we fail to install
it in the package directory.  If the error happens on the top
level (master) cache file, then error out.  For a subdirectory,
issue a warning and drop that directory from the master cache.
2005-05-24 20:49:41 +00:00
dmcmahill
78adb68b24 pass down FIND to genreadme.awk and binpkg-cache 2005-05-22 01:37:31 +00:00
dmcmahill
6806d580c9 use find ${DIR}/ -name \*${SUFX} instead of ls ${DIR}/*${SUFX} when
generating a list of possibles packages.  Avoids proglems with too long
of a command line for ls.  While here change find to ${FIND}.
2005-05-22 01:36:49 +00:00
dmcmahill
84ada91a3b get rid of a spurious %%SUBDIR%% which found its way into the generated category README.html 2005-05-20 21:48:45 +00:00
dmcmahill
69dfa5b1c2 Rework how the lookup of binary packages in the cache is performed.
As data for a given binary package is loaded, increment a count
stored with PKGPATH as the index.  Then use a psuedo-multidimensional
array with PKGPATH and the # as the index.  This allows for much
faster lookups and scales linearly with the number of packages.
The old way scaled as the product of the number of pkgsrc entries
and the total number of binary packages.  Not a pretty value.

This makes the actual README.html generation part run about 3x faster.

Approach suggested by soda.
2005-05-20 04:39:44 +00:00
dmcmahill
49e27f3b48 make local variables in a few functions be local 2005-05-19 21:11:24 +00:00
dmcmahill
e6574d0456 allow spaces after the "=" in the .pkgcache files. This was noted with
some of the older packages on ftp.netbsd.org.  For example,
pkg_info -B ftp://ftp.netbsd.org/pub/NetBSD/packages/1.5.2/vax/All/cascade-1.4.tgz
will give

OPSYS= NetBSD

instead of

OPSYS=NetBSD
2005-05-19 11:46:40 +00:00
dmcmahill
82b5d7feb9 - if the mv of the temporary cache file to the real one fails, usually
due to a directory permissions error, then error out.

- when the master cache has just been newly created, don't also report
  that the master cache is up to date.

Both were suggested by Christian Hattemer.
2005-05-19 03:58:40 +00:00
dmcmahill
6d38639554 if the top level package cache file does not exist then exit with
a fatal error.  Noted by Christian Hattemer.
2005-05-19 03:50:39 +00:00
dmcmahill
afce691e43 make use of the new tools framework via the prereq-readme package to
extract tools needed for the README.html generation.  Suggested by
Johnny Lam and Rolland Illig.
2005-05-18 04:51:35 +00:00
dmcmahill
832614bc4c Rework the README.html generation code. Major changes are:
- completely redo the code which decides on the machine architecture,
  operating system, and operating system version for the binary packages.
  The old way just used to directory names to take a guess.  The new
  way creates a cache file containing meta-data for all the binary packages
  in each "All" directory.  This cache file is consulted when generating
  the lists of available binary packages.  The meta-data is obtained with
  pkg_info so it should always be correct even if you do something silly
  like mix OS_VERSION or MACHINE_ARCH packages up in the same directory.

  Among the benefits are:  works when PACKAGES is not $PKGSRC/packages,
  works with a more or less arbitrary subdirectory structure, works
  when there are subdirectories for multiple operating systems.

  This portion of the fix should address PR25390.

  The cache files are only updated when the contents of an "All" directory
  changes or if the cache file format changes.  There is some room for
  improving the updating of the cache files, but its not too bad the way
  it is.

- fix up some of the awk code so that generadme.awk works with Solaris
  nawk as well as NetBSD's nawk and gawk (for pre-2.0 systems).

- remove some "if ! foo" shell constructs to increase portability.

- be more consistent with what variables get passed to mkreadme from
  make and which ones are determined automatically.  Mostly this meant
  moving stuff into mkreadme to make it easier to run it standalone.
2005-05-17 21:46:59 +00:00
jlam
8a7d3d2ec6 Don't expand .la files in PLISTs that are symlinks. The expansion should
only occur with the real .la file.  This avoids the problem noted by
Greg Troxel in:

	http://mail-index.netbsd.org/tech-pkg/2004/11/12/0018.html
2004-11-12 21:21:08 +00:00
jlam
1191106c78 Check for presence of the libname listed in the libtool archive before
outputting it to stdout.
2004-10-05 22:34:07 +00:00
jlam
79f68f7905 Don't exit on error if the *.la file is not a libtool archive. 2004-09-21 17:54:38 +00:00
jlam
12830b2534 Add a lock_file function that generates lockfiles that are usable on
NFS-mounted directories.
2004-09-21 15:14:08 +00:00
jlam
5073201af9 * Do the *.la expansion within the current _PLIST_AWK_SCRIPT framework.
We no longer require that LIBTOOL_LA_FILES be defined in the package
  Makefile, and the libtool archives should once again be listed in the
  PLIST.

* Add a new yes/no variable "LIBTOOLIZE_PLIST" to control whether to
  have bsd.pkg.mk automatically expand *.la files in PLISTs into the
  true library names represented by the libtool archives.

* Rename the "transform-la" script to "print-la-libnames" which more
  correctly reflects its function.

Many thanks to Todd Vierling for the original implementation and for
his contructive comments on how to improve the changes in this commit.
2004-09-10 19:51:50 +00:00
jlam
b9a3fde88c Add a library of useful shell functions. There are functions for
logging, backslash quoting, and two queue implementations: one entirely
in memory and one using a file.
2004-09-06 18:33:23 +00:00
tv
57110d93e1 Add new variable LIBTOOL_LA_FILES, which may be used instead of listing
all of the .a, .la, .so, and .so.* files in the PLIST.  This will
autogenerate the PLIST entries based on the informaion in the .la file.

This include print-PLIST support; if LIBTOOL_LA_FILES contains an
installed .la, its entries will be elided from the output PLIST template.
2004-08-16 03:12:02 +00:00
wiz
d4e8b44315 Retire buildlink2, now that all packages using it have been converted to
buildlink3.
2004-07-06 22:49:16 +00:00
yyamano
d7a4550b36 Use ${BMAKE} instead of make to make this work on non NetBSD platforms. 2003-09-23 01:51:44 +00:00
dmcmahill
592bab0b32 s/vulnerabilities/pkg-vulnerabilites 2003-09-11 03:00:21 +00:00
jlam
841b57441b Merge pkgviews-mk branch into the HEAD by running:
cd pkgsrc/mk
	cvs update -Pd -A
	cvs update -Pd -j pkgviews-mk-base -j pkgviews-mk
2003-09-02 06:59:37 +00:00
dmcmahill
bcee7aab52 - fix bug that gave an invalid entry in the homepage field when there is
no listed homepage.  Thanks to Grant Beattie for noting this and providing a
  patch which I changed slightly.
- fix a bug which put extra stuff in the categories field.  Thanks to Grant
  for noting this.
2003-07-25 12:58:20 +00:00
dmcmahill
981a376c35 - add HOMEPAGE as the last field in the INDEX file.
- make the paths be relative to PKGSRCDIR as opposed to absolute.
- some cleanup/simplification of the awk code.
2003-07-24 22:27:16 +00:00
dmcmahill
28fd31fa83 rework the INDEX file generation. The new approach speeds up things by
several orders of magnitude and 'make index' now takes 30 minutes or so
instead of several days on my test machine.  The approach now is to take
one pass through every package and extract some key information including
the explicitly listed dependencies.  After the data is extracted, the
dependencies are flattened in one step which avoids the extremely
inefficient recursive make that was previously used.
2003-07-23 09:41:23 +00:00
jmmv
f1446ddf2b Drop trailing whitespace. Ok'ed by wiz. 2003-05-06 17:40:18 +00:00
dmcmahill
4e909683e7 when there are no build depends, indicate this with "none" instead of
having an empty list.  Do the same for run depends.  Suggested by
Christian Hattemer in a private email.
2003-03-21 12:49:58 +00:00
dmcmahill
58b8bccbc6 - fix a bug in the HOMEPAGE link when the URL contains an ampersand
- fix a bug in which caused only packages listed as DEPENDS to show
  up in the 'packages needed to build' section.  Now the BUILD_DEPENDS
  are also shown.  Thanks to Christian Hattemer for noting this.

- fix a bug which caused error messages claiming that category and top
  level README.html files could not be created even though they were
  created.  This bug only showed up if an old README.html file did not
  exist.  As part of this, clean up and unify the code which handles
  comparing the new README.html file to a possibly pre-existing one and
  only copying it over if there is a change.
2003-03-19 20:46:55 +00:00
dmcmahill
8dbf77cd41 fix a few 'strings split across lines' bugs which caused some dependencies
to be dropped from the README.html files.  Problem of missing dependencies
noted by Christian Hattemer in a private email.
2003-03-19 02:12:11 +00:00
wiz
620d99bab0 Open/close HTML mark-up in the correct order. Noted by Kevin P. Neal. 2003-02-09 14:59:12 +00:00
yyamano
274016a5d7 Add backslash for a line continuation to fix "make readme" error
on darwin. Approved by mcmahill.
2003-02-08 06:47:52 +00:00
dmcmahill
dd9d9f18d5 fix a bug introduced by the last commit where a string was accidentally
split across a line.  Thanks to Greg Woods for catching this.
2003-01-20 01:31:21 +00:00
dmcmahill
e2438ae141 Many white space and indenting fixes to bring this more in line with
/usr/share/misc/style.  Prompted by a private email from Greg Woods,
woods at weird dot com.
2003-01-18 04:28:57 +00:00
dmcmahill
a89746c11a avoid the use of the gensub() function as it is a gawk extension not
found in other awk implementations.  Patch provided by Greg Woods,
woods at weird dot com, via private email.
2003-01-15 00:40:50 +00:00
dmcmahill
3c18e7dacd add a -a|--append option to allow appending to an existing database instead of
creating a new one.
2003-01-05 15:17:24 +00:00
dmcmahill
76343e4400 expr -> ${EXPR} 2003-01-04 22:27:46 +00:00
dmcmahill
98812f4595 move bulk/{mkreadme,genreadme.awk} to scripts/ as this is a more suitable
location.  They are not really part of the bulk build stuff.
2003-01-04 21:13:34 +00:00
dmcmahill
06ea622f25 add two scripts used for creating dependency databases. These scripts
can be used anytime one needs to extract the complete dependency information
for a package for example, when creating a README.html file for the pkg.
The approach used by mkdatabase requires exactly one make call per package
which makes it scale well to packages with large dependency trees that have
many paths to the leaves.
2003-01-04 21:03:08 +00:00