Commit Graph

401 Commits

Author SHA1 Message Date
Devin Teske
fcb16c1036 Optimize f_sprintf() for bash
bash lacks the ksh93 optimization that makes sub-shells fast if they do
not alter io. bash 3.1-alpha1 introduced printf -v var_to_set which is not
as fast but is still significantly faster than var_to_set=$( printf ) when
using any version of bash. If we find our interpreter to somehow be bash
by invocation or inclusion, use the feature that provides fastest results.
2016-01-31 21:22:10 +00:00
Devin Teske
57ef9b750b Reset OPTIND to 1 in f_device_find() 2016-01-31 21:14:31 +00:00
Devin Teske
0f913ed5f9 Replace awk with more efficient builtins-only algo 2016-01-27 02:11:58 +00:00
Devin Teske
22fc021043 Use dpv(1) in `bsdconfig packages' 2016-01-27 00:12:58 +00:00
Devin Teske
c4ba688294 Fix ABI parsing 2016-01-27 00:09:53 +00:00
Devin Teske
938443fdf6 Change incorrect path 2016-01-27 00:08:23 +00:00
Devin Teske
33291485ae Fix a typo in a comment
MFC after:	3 days
X-MFC-to:	stable/10
2016-01-24 17:15:42 +00:00
Devin Teske
7cf0da249a Fix improper duration for f_dialog_pause() API
MFC after:	3 days
X-MFC-to:	stable/10
2016-01-09 23:13:43 +00:00
Bryan Drewery
b1f92fa229 META MODE: Update dependencies with 'the-lot' and add missing directories.
This is not properly respecting WITHOUT or ARCH dependencies in target/.
Doing so requires a massive effort to rework targets/ to do so.  A
better approach will be to either include the SUBDIR Makefiles directly
and map to DIRDEPS or just dynamically lookup the SUBDIR.  These lose
the benefit of having a userland/lib, userland/libexec, etc, though and
results in a massive package.  The current implementation of targets/ is
very unmaintainable.

Currently rescue/rescue and sys/modules are still not connected.

Sponsored by:	EMC / Isilon Storage Division
2015-12-01 05:23:19 +00:00
Bryan Drewery
93e779a26c META MODE: These need object directories to handle staging.
Sponsored by:	EMC / Isilon Storage Division
2015-11-26 01:14:27 +00:00
Bryan Drewery
ed74ab27a7 Rename checked-in 'includes' to 'includes.sh' to avoid colliding with share/mk
target 'make includes'.

The file is still installed to /usr/libexec/bsdconfig/includes/includes.

MFC after:	1 week
Sponsored by:	EMC / Isilon Storage Division
2015-11-19 17:57:31 +00:00
Devin Teske
bfe64a81a2 Add support for "rc.conf.d" file(s).
Differential Revision:	https://reviews.freebsd.org/D3551
Reviewed by:	allanjude
MFC after:	1 week
X-MFC-to:	stable/10
X-MFC-with:	290337
Relnotes:	yes
2015-11-12 00:30:33 +00:00
Eitan Adler
463a577b27 Fix a ton of speelling errors
arc lint is helpful

Reviewed By: allanjude, wblock, #manpages, chris@bsdjunk.com
Differential Revision: https://reviews.freebsd.org/D3337
2015-10-21 05:37:09 +00:00
Bryan Drewery
54c7d75a06 META_MODE: Remove DEP_RELDIR from Makefile.depend files.
This has not been needed since r284171 in projects/bmake.

Sponsored by:	EMC / Isilon Storage Division
2015-09-25 19:26:08 +00:00
Devin Teske
dc68c8b311 Fix code typo (no functional change)
MFC after:	3 days
X-MFC-to:	stable/10
2015-09-14 21:26:48 +00:00
Devin Teske
e8e8c93935 Interim fix for "Login not found" error.
PR:		bin/196514
MFC after:	3 days
X-MFC-to:	stable/10
2015-06-19 21:32:20 +00:00
Simon J. Gerraty
ccfb965433 Add META_MODE support.
Off by default, build behaves normally.
WITH_META_MODE we get auto objdir creation, the ability to
start build from anywhere in the tree.

Still need to add real targets under targets/ to build packages.

Differential Revision:       D2796
Reviewed by: brooks imp
2015-06-13 19:20:56 +00:00
Simon J. Gerraty
98e0ffaefb Merge sync of head 2015-05-27 01:19:58 +00:00
Devin Teske
8f9bc4e2ba Fix typo in a comment.
MFC after:	3 days
X-MFC-to:	stable/10 stable/9
2015-03-31 21:34:42 +00:00
Colin Percival
11d9aa6707 Step 1 of eliminating the "games" distribution: Move binaries to /usr/bin;
update paths; and include everything in the "base" distribution.

The "games" distribution being optional made sense when there were more
games and we had small disks; but the "games-like" games were moved into
the ports tree a dozen years ago and the remaining "utility-like" games
occupy less than 0.001% of my laptop's small hard drive.  Meanwhile every
new user is confronted by the question "do you want games installed" when
they they try to install FreeBSD.

The next steps will be:

2. Removing punch card (bcd, ppt), phase-of-moon (pom), clock (grdc), and
caesar cipher (caesar, rot13) utilities.  I intend to keep fortune, factor,
morse, number, primes, and random, since there is evidence that those are
still being used.

3. Merging src/games into src/usr.bin.

This change will not be MFCed.

Reviewed by:	jmg
Discussed at:	EuroBSDCon
Approved by:	gjb (release-affecting changes)
2015-02-12 05:35:00 +00:00
Devin Teske
35994c42c3 Update copyrights. 2015-02-10 03:34:42 +00:00
Devin Teske
75855cb6c0 Add "vt_"* aliases to bsdconfig console entries.
NB: "syscons_"* kept for backward compatibility
2015-02-10 03:17:51 +00:00
Devin Teske
b39eff3362 Add bsdconfig api function f_dialog_menutag2help() 2015-02-10 03:15:54 +00:00
Devin Teske
3c63cc68ae Add bsdconfig api functions f_dialog_pause()/f_dialog_pause_no_cancel() 2015-02-10 03:12:11 +00:00
Devin Teske
fb1f1bee0d Eliminate sub-shells where possible for performance.
MFC after:	7 days
2015-02-10 02:55:10 +00:00
Devin Teske
ad8d629a0c Whitespace.
MFC after:	3 days
2015-02-10 02:53:26 +00:00
Devin Teske
ec273ebf3b Comments.
MFC after:	3 days
2015-02-10 01:02:02 +00:00
Devin Teske
fda64d7c85 Add new alias "bsdconfig api" (same as "bsdconfig includes")
NB: My fingers like typing "api" a lot more than "includes"

MFC after:	3 days
2015-02-09 19:20:59 +00:00
Devin Teske
94f2a70e88 Replace the only instance of sed(1) in bsdconfig(8) with awk(1).
MFC after:	3 days
2015-02-09 19:16:19 +00:00
Devin Teske
dd8a17d457 Revert SVN r278464 -- fingers were in perforce mode (premature
commit of future stuffs not yet ready).
2015-02-09 17:22:54 +00:00
Devin Teske
a831d7d1c5 Replace the only instance of sed(1) in bsdconfig(8) with awk(1).
MFC after:	3 days
2015-02-09 17:18:10 +00:00
Simon J. Gerraty
9268022b74 Merge from head@274682 2014-11-19 01:07:58 +00:00
Devin Teske
e91afc1cda Default bsdconfig timezone' and tzsetup' to `-s' in a VM.
Recommended by:	cperciva
Reviewed by:	cperciva
Relnotes:	tzsetup and bsdconfig now assume that the "hardware" clock inside a VM is set to UTC
2014-11-11 19:37:17 +00:00
Alexander V. Chernikov
603eaf792b Renove faith(4) and faithd(8) from base. It looks like industry
have chosen different (and more traditional) stateless/statuful
NAT64 as translation mechanism. Last non-trivial commits to both
faith(4) and faithd(8) happened more than 12 years ago, so I assume
it is time to drop RFC3142 in FreeBSD.

No objections from:	net@
2014-11-09 21:33:01 +00:00
Devin Teske
7431dfd458 Follow-up to r255036; remove beforeinstall directives from bsdconfig(8)
Makefile's, fixing concurrent installworld (`make -j17 installworld').

Thanks to:	delphij, emaste
Reviewed by:	delphij
MFC after:	3 days
X-MFC-to:	stable/10, stable/9
2014-11-04 00:14:38 +00:00
Devin Teske
09866e97a6 Rename awk(1) implementation of GNU awk's built-in asorti() function to
prevent fatal conflict should one-true-awk ever be replaced -- e.g., in
an appliance -- with GNU awk. NB: Renamed my implementation to _asorti()

MFC after:	3 days
X-MFC-to:	stable/10, stable/9
2014-10-14 03:22:37 +00:00
Devin Teske
489979a77d Fix awk(1) asorti() implementation to work when called in a loop.
MFC after:	3 days
X-MFC-to:	stable/10, stable/9
2014-10-14 03:11:46 +00:00
Devin Teske
b74ae45b45 Fix regression introduced by SVN r270954. Correct way to reset getopts
is to set OPTIND to 1, not unset it (which causes an error).

Thanks to:	jilles
2014-09-02 22:59:40 +00:00
Devin Teske
2c4a847864 Fix a bug where command line arguments could be misprocessed if getopts is
used prior to f_dialog_init() -- e.g., in a script that sets
DIALOG_SELF_INITIALIZE to NULL, preventing f_dialog_init() from being run
automaticaly when `dialog.subr' is included. Caused by sub-shell processing
of arguments inheriting prior value of $OPTIND, used by getopts. Solved by
unsetting OPTIND prior to [re-]processing of positional arguments.
2014-09-01 22:53:47 +00:00
Stefan Eßer
f071b64ed3 More man pages that need to know about vt in addition to syscons.
MFC after:	3 dayS
2014-08-26 10:55:08 +00:00
Devin Teske
36fb8bfcd3 Optimize f_which() to be slightly faster still. 2014-08-24 16:40:31 +00:00
Devin Teske
3a2e3fe269 Add `-A' flag to pkg-install(8) invocation when installing dependencies.
MFC after:	3 days
X-MFC-to:	stable/10, stable/9
Reported by:	gjb
Discussed with:	jelischer, gjb, bdrewery
2014-08-21 17:15:09 +00:00
Simon J. Gerraty
ee7b0571c2 Merge head from 7/28 2014-08-19 06:50:54 +00:00
Devin Teske
341e5ca37c Add required `exec' before Xdialog(1) invocation for the case where we
expect (require) data on stdin. The effect of this is that, when
backgrounded, $! returns the pid of an Xdialog(1) instance instead of
an sh(1) instance -- the difference being a later kill of $! will reach
the Xdialog(1) instance whereas without the exec the kill succeeds on
the sh(1) instance leaving Xdialog(1) open.
2014-08-03 05:02:00 +00:00
Devin Teske
7729d5e3ac Update command and add check for edge-case. 2014-07-31 22:13:31 +00:00
Devin Teske
13243ba9b2 Fix a syntax error when running under bash(1) for portability. 2014-07-31 22:05:18 +00:00
Devin Teske
4d5a468d88 Define a setvar() function for platforms using a shell unlike FreeBSD's
sh(1) for `/bin/sh' (e.g., bash(1) which lacks a setvar definition).
This is to improve portability to other Operating Systems (e.g., Linux).
2014-07-31 22:00:36 +00:00
Devin Teske
298f5fdc24 Fix a bug where include file `networking/services.subr' was not being
properly clustered.

Change `fixedsize' to `fixedsize = true' to satisfy newer versions of dot(1)
generating error "Warning: <stdin>: syntax error in line 27 near ','".

Remove bounding cluster surrounding various include-groupings, allowing
groups of include files to float freely to the greatest consumer (reducing
the density of rendered diagrams).

While here, change the bgcolor of include clusters from white to X11 color
`thistle' (a light purple).

Also, add the word "Subroutines" after include cluster labels.

Do not terminate the digraph definition with a semi-colon [;] after the
ending brace to satisfy newer versions of dot(1) generating error "Warning:
<stdin>: syntax error in line 940 near ';'".

MFC after:	3 days
X-MFC-to:	stable/10, stable/9
2014-07-23 21:08:04 +00:00
Devin Teske
95d45410b5 Add example script `add_some_packages.sh', demonstrating how to install
a list of packages using the bsdconfig(8) API, providing dialog(8) based
user experience (versus plain console output were you to use pkg(8)
directly to install the same list of packages).

Remove example script `browse_packages_ftp.sh', made obsolete because
the digests.txz and packagesite.txz databases for pkg(8) are not
available via FTP (HTTP only to pkg.freebsd.org SRV hosts).

Update example script `browse_packages_http.sh', made to work with new
pkg(8) demonstrating how to generate a local package repository.

Fix a bug in `bsdconfig packages' where packages were listed twice. This
fix requires pkg(8) version 1.2.7_4 or higher.

NB: It is the introduction of pkg(8) 1.2.7_4 wherein I am also able to
drastically reduce the generation time of package dependencies prior to
the dialog display (by utilizing the new `-I' flag to pkg-rquery(8)).

While here, fix a positional argument nit for f_index_initialize() of
`packages/index.subr' include (the one and only argument is positional
argument 1 to state the by-ref handle, indicating the variable to set
in the caller's namespace; the nit I'm fixing here is that we were
querying positional argument 2 for this information incorrectly; caused
by a missing hunk back around SVN r257795).

Fix a bug in sysrc(8) described by PR bin/187458 "sysrc(8) silently and
unexpectedly bootstraps pkg". This was caused by an explicit entry in
`/usr/share/bsdconfig/common.subr' (used by sysrc(8)) that called pkg(8)
to populate the $PKG_ABI global (called in a way that allows implicit
bootstrap of pkg(8)). The solution to which was to find every place in
bsdconfig(8) that requires the $PKG_ABI global and add a layer of
protection by way of introducing the new API call f_musthavepkg_init()
(provided by new include, `/usr/share/bsdconfig/packages/musthavepkg.subr'
intented to mirror `/usr/share/bsdconfig/mustberoot.subr'). When the
$PKG_ABI global is required, you can use `f_musthavepkg_init' to cause
graceful premature termination in the event that pkg(8) has not yet been
bootstrapped, and thus cannot be used to populate $PKG_ABI.

NB: If running interactively ($nonInteractive is NULL or unset), the
f_musthavepkg_init() API call will attempt to bootstrap pkg(8), but only
if the user chooses "Yes" to a Yes/No dialog confirming it is ok to
bootstrap.

While here, simplify an if-conditional in `media/http.subr' include to
use sh(1) inline assignment-with-break.

Also, fix a bug in `media/http.subr' and `media/httpproxy.subr' wherein
the error messages for various HTTP failures were not finding their way
to the console (needed to pass stdout to pass-thru descriptor).

While here, remove the executable bit from `packages/categories.subr',
`packages/index.subr', and `packages/packages.subr' includes.

Fix issues where pkg(8) complains about PACKAGESITE being defined.
Previously, we would set $PACKAGESITE and export it. Now we only set
$PACKAGESITE for invocations of "pkg update" -- getting rid of all the
spurious warnings about PACKAGESITE being deprecated (it's still used
in the case of "pkg update" for simplicity versus having to configure
a config-file).

Remove the leading argument from invocations of f_index_initialize() in
`packages/packages.subr' include. The leading argument no longer means
what it used to, pre SVN r257995).

PR:		bin/187458
Reviewed by:	nwhitehorn
MFC after:	1 week
X-MFC-to:	stable/10, stable/9
2014-07-22 23:10:12 +00:00
Devin Teske
c7136fd54f Fix a code typo that prevented mkdir from firing (unnoticed
usually because another part of the code succeeded in making
the same directory).

MFC after:      3 days
2014-06-20 17:40:38 +00:00