Bug 160896 - [nanobsd] [patch] use getopts, jobs option, delay -c usage improvements to nanobsd.sh
Summary: [nanobsd] [patch] use getopts, jobs option, delay -c usage improvements to na...
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: misc (show other bugs)
Version: 9.0-BETA2
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-22 08:40 UTC by Enji Cooper
Modified: 2018-01-03 05:16 UTC (History)
0 users

See Also:


Attachments
file.diff (3.85 KB, patch)
2011-09-22 08:40 UTC, Enji Cooper
no flags Details | Diff
160896.patch (4.94 KB, patch)
2011-10-27 00:42 UTC, Enji Cooper
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Enji Cooper freebsd_committer 2011-09-22 08:40:07 UTC
This patch does the following items:

1. Drops getopt in favor of getopts builtin handling. This is preferred as getopt is deprecated by POSIX.
2. Adds a -j option so that users can specify -j via the command line, which is passed to make.
3. Delays the sourcing of the nanobsd config_file so that users can depend on already on internal variables that are set later, like $NANO_MAKE_CONF_BUILD . This makes it possible for developers to depend on this file.

These enhancements were based on some of the code present in the FreeNAS sourcebase.

Fix: Patch attached with submission follows:
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2011-09-22 08:54:48 UTC
Responsible Changed
From-To: freebsd-bugs->imp

Over to maintainer.
Comment 2 Mark Linimon 2011-09-22 10:19:21 UTC
----- Forwarded message from Warner Losh <imp@bsdimp.com> -----

Date: Thu, 22 Sep 2011 02:57:49 -0600
From: Warner Losh <imp@bsdimp.com>
To: linimon@FreeBSD.org
Cc: freebsd-bugs@FreeBSD.org, Warner Losh <imp@FreeBSD.org>,
	Garrett Cooper <yaneurabeya@gmail.com>
Subject: Re: conf/160896: [nanobsd] [patch] use getopts, jobs option, delay -c usage improvements to nanobsd.sh
X-Mailer: Apple Mail (2.1084)

Rejecting parts of this patch.  Specifically, the delated -c stuff is
bogusly implemented.  Before the change, you could have multiple -c
options on the command line.  after this you can't.

Don't like how -j is implemented in this patch.  Need to think about this
because it breaks some nanobsd config files that specify NANO_PMAKE command.

Other stuff looks good and it, or variations of it, will go in when we're
out of the freeze.

Warner

----- End forwarded message -----
Comment 3 Mark Linimon 2011-09-22 18:22:55 UTC
----- Forwarded message from Garrett Cooper <yaneurabeya@gmail.com> -----

Date: Thu, 22 Sep 2011 08:53:16 -0700
From: Garrett Cooper <yaneurabeya@gmail.com>
To: Warner Losh <imp@bsdimp.com>
Cc: linimon@freebsd.org, freebsd-bugs@freebsd.org,
	Warner Losh <imp@freebsd.org>
Subject: Re: conf/160896: [nanobsd] [patch] use getopts, jobs option, delay -c
	usage improvements to nanobsd.sh

On Thu, Sep 22, 2011 at 1:57 AM, Warner Losh <imp@bsdimp.com> wrote:
> Rejecting parts of this patch.  Specifically, the delated -c stuff is
> bogusly implemented.  Before the change, you could have multiple -c
> options on the command line.  after this you can't.

I'm wouldn't mind doing something like this:

nano_confs
while getopts '...' optch
do
    case "$optch" in
    ...
    c)
        nano_confs="$nano_confs $OPTARG"
        ;;
...

for nano_conf in $nano_confs; do
    . $nano_confs
done

The problem I was trying to work around is that (unfortunately) some
packages code features (ipv6) into the names (take apr for instance),
which means that the logic in FreeNAS currently always says "build a
fat image" when $DEBUG == 1.

> Don't like how -j is implemented in this patch.  Need to think about
> this because it breaks some nanobsd config files that specify NANO_PMAKE
> command.

My concern was that not all of my build machines are homogeneous. I
have access to some "powerhouse" server machines and some low power
desktops. FreeNAS had -j8 coded into NANO_PMAKE, but I made it
variable ($CPUS), but I thought that was a bad idea for what should go
back into nanobsd (it didn't match the defaults and could cause other
issues) -- if the default (1) is incorrect, I'm all for bumping it up
to 3 again. I just wasn't sure why 3 was the chosen default.

> Other stuff looks good and it, or variations of it, will go in when
> we're out of the freeze.

Thanks for the feedback!
-Garrett


----- End forwarded message -----
Comment 4 Enji Cooper freebsd_committer 2011-10-27 00:42:27 UTC
 	This version of the patch should be more acceptable as it restores 
the multiple -c specifier functionality.
Thanks!
-Garrett
Comment 5 Enji Cooper freebsd_committer 2011-10-27 01:43:45 UTC
Puck.. I ran into a chicken and egg problem with the MAKEOBJDIRPREFIX,
where the files get sourced, etc. I'll hardcode the variable for
make.conf.build in nanobsd/common and shuffle it around in the patch
once I've build tested things a couple times.
-Garrett
Comment 6 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 08:00:59 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped