Warning: there may be occasional oddness due to css and blog edits. **KNOWN ISSUE: possible hidden text**
Showing posts with label dialog4ports. Show all posts
Showing posts with label dialog4ports. Show all posts

Tuesday, March 12, 2024

Was dialog4ports now portconfig

Somewhere I ran across the existence of portconfig which is a drop-in replacement for dialog4ports.  I installed and I believe removed dialog4ports shortly after.  What I did not do was investigate the manpage and that documentation already installed.  I have now tried some of its options and saw how it is somewhat different.  I never thought to look at the manpage for dialog4ports but looking at it shows me that its replacement has some improvements also.  Portconfig is indeed a drop-in replacement, all that needs to be done to switch to it is remove the old and install the new.

This is more of an introduction than anything, so how about comparing the manpages.

DIALOG4PORTS(1)		    General Commands Manual	       DIALOG4PORTS(1)          PORTCONFIG(1)           FreeBSD General Commands Manual          PORTCONFIG(1)

NAME                                                                                    NAME
       dialog4ports -- a dialog	for FreeBSD ports                                            portconfig – port options

SYNOPSIS                                                                                SYNOPSIS
       Port environment	variables dialog4ports.                                              portconfig [-h | -v]

DESCRIPTION                                                                             DESCRIPTION
       dialog4ports is a utility for providing a dialog	interface to configure                The portconfig utility provides a TUI to customize the options to build a
       ports options                                                                         port.  The following options are available:

ENVIRONMENT                                                                                  -h      Display options, a short description and exit.
       The list	of environment variables dialog4ports:
                                                                                             -v      Show version and exit.
       D4PHEIGHT
	 Dialog	height.	(Default value:	0)                                                   The following user interface features are available:

       D4PMINHEIGHT                                                                          F1 key  General PORTS usage.
	 Minimal dialog	height,	for example:
	 if  D4PMINHEIGHT     5	 and  count of options elements(1-4) less than               Help button
	 D4PMINHEIGHT, then height will	extended to 5. (Default	value: 0)                            Specific port help, if pkg-help exists.

       D4PWIDTH                                                                              Space key
	 Dialog	width. (Default	value: 80)                                                           Select/deselect an option.

       D4PFULLSCREEN                                                                    ENVIRONMENT
	 Dialog	full screen mode. (Default: N)                                               The following environment variables can customize portconfig:

       D4PALIGNCENTER                                                                        NO_COLOR
	 Text in dialog	becomes	to center. (Default: N)                                              Disable colors if present and not an empty string (regardless of
                                                                                                     its value).
       D4PASCIILINES
	 Use ASCII character for line drawing. (Default: N)                                  PORTCONFIG_ALIGNCENTER
                                                                                                     Align options to center, “YES” to enable, default left.
SEE ALSO
       dialog(3)                                                                             PORTCONFIG_ASCIILINES
                                                                                                     Ascii characters to draw lines, “YES” to enable.
AUTHORS
       The dialog4ports	utility	was written by:                                              PORTCONFIG_FULLSCREEN
       Ilya A. Arkhipov	<rum1cro@yandex.ru>                                                          Fullscreen mode, “YES” to enable.
       with help from:
       Eitan Adler <eadler@FreeBSD.org>,                                                     PORTCONFIG_HEIGHT
       Baptiste	Daroussin <bapt@FreeBSD.org>,                                                        Fixed height, default autosize.
       Alexey Dokuchaev	<danfe@FreeBSD.org>
                                                                                             PORTCONFIG_MINHEIGHT
FreeBSD	13.2			 March 9, 2013		       DIALOG4PORTS(1)                       Minimum height, takes effect only with autosize.

                                                                                             PORTCONFIG_MINWIDTH
                                                                                                     Minimum width, takes effect only with autosize.

                                                                                             PORTCONFIG_NOLINES
                                                                                                     Do not draw lines, “YES” to enable.

                                                                                             PORTCONFIG_NOSHADOW
                                                                                                     “YES” to disable dialog shadow.

                                                                                             PORTCONFIG_WIDTH
                                                                                                     Fixed width, default autosize.

                                                                                           Compatibility
                                                                                             The following environment variables are available for compatibility:
                                                                                                   D4PALIGNCENTER        PORTCONFIG_ALIGNCENTER
                                                                                                   D4PASCIILINES         PORTCONFIG_ASCIILINES
                                                                                                   D4PFULLSCREEN         PORTCONFIG_FULLSCREEN
                                                                                                   D4PHEIGHT             PORTCONFIG_HEIGHT
                                                                                                   D4PMINHEIGHT          PORTCONFIG_MINHEIGHT
                                                                                                   D4PWIDTH              PORTCONFIG_WIDTH

                                                                                        EXIT STATUS
                                                                                             The portconfig utility exits 0 on success, and >0 if an error occurs.

                                                                                        SEE ALSO
                                                                                             ports(7)

                                                                                        AUTHORS
                                                                                             The portconfig utility was written by Alfonso Sabato Siciliano
                                                                                             <asiciliano@FreeBSD.org>.

                                                                                        THANKS TO
                                                                                             Baptiste Daroussin <bapt@FreeBSD.org> for suggestions, help, and testing.

                                                                                        FreeBSD 14.0-STABLE             August 4, 2023             FreeBSD 14.0-STABLE

There are some environment variables that are new.  We are all accustomed to the dialog4ports config screen but below is a rather clean and crisp portconfig screen for my unofficial minetest-dev port.

The following is what I placed in my user's .xinitrc file so that I will get the result above regardless of defaults.  I think I could use a different group of settings in the .cshrc file for root, which would function primarily if I were at console rather than in a terminal that I 'switched user' to root.  I have decided that I need the lines and I prefer not fullscreen, and centered looks best.  I can do either black and white like the image above or use the blue and white and black the way the former dialog4ports had.

##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~##
## Portconfig options via environment vars              ##
##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~##
# Disable colors if present and not an empty string (regardless of its value)
NO_COLOR="NO"
export NO_COLOR

# Align options to center, “YES” to enable, default left.
PORTCONFIG_ALIGNCENTER="YES"
export PORTCONFIG_ALIGNCENTER

# Ascii characters to draw lines, “YES” to enable.
PORTCONFIG_ASCIILINES="NO"
export PORTCONFIG_ASCIILINES

# Fullscreen mode, “YES” to enable.
#PORTCONFIG_FULLSCREEN=
#export PORTCONFIG_FULLSCREEN

# Fixed height, default autosize.
#PORTCONFIG_HEIGHT=
#export PORTCONFIG_HEIGHT

# Minimum height, takes effect only with autosize.
#PORTCONFIG_MINHEIGHT=
#export PORTCONFIG_MINHEIGHT

# Minimum width, takes effect only with autosize.
#PORTCONFIG_MINWIDTH=
#export PORTCONFIG_MINWIDTH

# Do not draw lines, “YES” to enable.
PORTCONFIG_NOLINES="NO"
export PORTCONFIG_NOLINES

# “YES” to disable dialog shadow.
PORTCONFIG_NOSHADOW="NO"
export PORTCONFIG_NOSHADOW

# Fixed width, default autosize.
#PORTCONFIG_WIDTH=
#export PORTCONFIG_WIDTH

Whether you define any of the variables above within your .cshrc or .xinitrc or another file, or at the moment directly on the commandline, you will still need to comply with the format and syntax for the shell that is used.  How you decide which options to use or how to configure it may take a little exploration to understand.  There do not seem to be shadows without color and it may be that you agree with me that lines are useful.  One other thing to consider when using a terminal is whether the font used has the line characters and if you prefer a font that has none you may want the ascii lines instead.

WARNING: The NO_COLOR environment variable will also be interpreted by xterm to disable colors which may eliminate one way portclippy displays the differences needing adjustment.

If you like white text on a black background, want to be very specific about the dimensions of the dialog, or prefer color without shadows or lines, then this portconfig will be able to do all this.  It may be that this would become the permanent replacement for dialog4ports but even if it does not, while it is maintained we have two options for our port configuration menu needs.

Saturday, February 20, 2021

make doesn't config

Clearly something is broken but I do not know precisely how or exactly what.  All that I do know is that when I try to configure a port, by going to that port directory, such as for minetest, or use the command as below,

make -C /usr/ports/games/minetest config

all I get is this.

===> Options unchanged

I am not aware of any of the myriad of changes I have ever made to my system which would result in such a bizarre error.  My extensive make.conf permits me the ability to adjust options but it is a far more tedious method, especially since I must first look at the Makefile or freshports.org to parse out the possible options.

Prior to this recent very strange issue, I had another, which I may have partially resolved more by avoiding certain ports than by curing the weird dependency issue.  Yes, for surely the second time my system claims a vast number of dependencies which are inaccurate.  Previously it was rust which somehow gained the excess dependents and now it is openjdk7 which has remained wrong even with kernel and world update, and various attempts to solve the issue.  My seeming quasi-solution was to discover by close monitoring, which port was the first of the series which suddenly required openjdk7.  I also gathered the list of ports which failed when openjdk7 itself failed to build and by failing made it very easy to see all the dependents.  I then tweaked the option config for each of the ports in turn, and in the process also discovered that for ages I have had kerberos installed but never used.  The initial lynchpin was apr.  The additional peculiarity is that the dependency issue seems to somehow very strangely be limited to poudriere bulk port builds as individual semi-automated make builds seem to be immune in some way while even after succeeding outside of poudriere, within its jail the dependency issue remained.

So it is very likely that this whole dependency issue (attempts to repair it) is what provoked some other modification to my system which has finally broken my ability to configure ports the normal way within the ports tree.

I could say "the fun part about.." but I'm not sure this is really fun as it is rather frustrating and there doesn't seem to be any documentation about how to extricate my system from this pickle.  What is needed to be able to configure a port?  There is no such list, no steps to enable, nothing.  The same goes for my prior dependency issue, there is no tool or method to solve it or to reset the mess to get things working properly again.  Lucky for you, if I ever solve it for myself there will be this blog post to reference if you somehow manage to accidentally follow in my footsteps.

I cannot be certain yet if anything regarding the dependency issue has changed, but I discovered that I can obtain an index file by make -C /usr/ports fetchindex though when I attempted this it failed due I suspect to ssl or cert issues.  I simply used the url with fetch and adjusted for no ssl.  The file was obtained in bzip2 format so I unpacked it.  I used my recert alias which is set to make -C /usr/ports/security/ca_root_nss reinstall clean to update my local certs after.

Since I can survive tediously without the ability to adjust port configs the usual way, I am rebuilding all my ports with poudriere.  It seems that I may have squashed the openjdk7 dependency issue afterall, as there have not yet been 1200 skipped ports due to openjdk7 failing to build, thus proving it.  I could be wrong, but the series of skipped ports usually appeared near the beginning of the over 2000 port bulk build.  Once that finishes and the installed packages are updated/installed, I can resume beating my head against the 'make config' wall.

How about I list the things I know that I did to possibly resolve the dependency issue?  Maybe some or all of it caused the present issue.  In approximate order mostly:

  • removed the /var/db/ports directory
  • reinstalled as many ports as would successfully build (though my script iterated a list):
    make -C /usr/ports/port/origin install clean
  • erased the /var/db/pkg files: FreeBSD.meta, local.sqlite, poudriere.meta, repo-FreeBSD.sqlite, repo-poudriere.sqlite
  • removed the /usr/ports/INDEX-12 file
  1. reinstalled pkg
    make -C /usr/ports/ports-mgmt/pkg deinstall reinstall clean
  2. (rebootstrapped pkg)
    pkg bootstrap -f
  3. attempted to find missing dependencies
    pkg check -Ba
  4. re-created the poudriere repo:
    pkg repo /usr/local/poudriere/data/packages/13amd64-default
  5. updated /usr/src, rebuilt and reinstalled kernel and world
  6. updated the poudriere 13amd64 jail
  7. re-created the poudriere repo:
    pkg repo /usr/local/poudriere/data/packages/13amd64-default
  8. copied a fresh /etc/pkg.conf from /etc/pkg.conf.sample and revised it to match my former revised pkg.conf

I keep thinking (now) that the one thing I have not yet touched is also directly related to make, the /etc/make.conf but if it had some sort of syntax error surely it would be noticed, caught automatically by shell or make itself.  Once my latest round of poudriere bulk port builds are finished, I can stash the extensive make.conf and see if that solves the configuration issue.  The make.conf is copied to an appropriately named poudriere make.conf file name, so it could affect both methods of build somehow.  However, as well as I can remember, outside of the poudriere jail ports did not have inordinate dependence upon openjdk7.  Stashing the make.conf did not solve the issue.

Finally, I managed to type the right search terms which found an old FreeBSD forum post that helped solve my issue.

make -C /usr/ports/ports-mgmt/dialog4ports install clean

Exactly why ports-mgmt/dialog4ports is not a dependency somewhere, or automatically installed by make config in any port directory, or at least mentioned in man ports is a complete mystery to me.  Instead, it appears that I am blind, below is a subsection of man 7 ports.

     The following targets will be run automatically by each proceeding target
     in order.  That is, build will be run (if necessary) by install, and so
     on all the way to fetch.  Usually, you will only use the install target.

     config         Configure OPTIONS for this port using dialog4ports(1).

     fetch          Fetch all of the files needed to build this port from the
                    sites listed in MASTER_SITES and PATCH_SITES.  See
                    FETCH_CMD, MASTER_SITE_OVERRIDE and MASTER_SITE_BACKUP.

     checksum       Verify that the fetched distfile's checksum matches the
                    one the port was tested against.  If the distfile's
                    checksum does not match, it also fetches the distfiles
                    which are missing or failed the checksum calculation.
                    Defining NO_CHECKSUM will skip this step.

     depends        Install (or compile if only compilation is necessary) any
                    dependencies of the current port.  When called by the
                    extract or fetch targets, this is run in piecemeal as
                    fetch-depends, build-depends, etc.  Defining NO_DEPENDS
                    will skip this step.

     extract        Expand the distfile into a work directory.

     patch          Apply any patches that are necessary for the port.

     configure      Configure the port.  Some ports will ask you questions
                    during this stage.  See INTERACTIVE and BATCH.

     build          Build the port.  This is the same as calling the all
                    target.

     install        Install the port and register it with the package system.
                    This is all you really need to do.

     The following targets are not run during the normal install process.

     showconfig           Display OPTIONS config for this port.

     showconfig-recursive
                          Display OPTIONS config for this port and all its
                          dependencies.

     rmconfig             Remove OPTIONS config for this port.

     rmconfig-recursive   Remove OPTIONS config for this port and all its
                          dependencies.

     config-conditional   Skip the ports which have already had their OPTIONS
                          configured.

     config-recursive     Configure OPTIONS for this port and all its
                          dependencies using dialog4ports(1).

I would strongly recommend looking at the rest of the manpage, as you may discover other interesting capabilities as yet unknown.  In particular from the manpage for ports: did you know about showconfig or config-conditional?

Frequently viewed this week