Ports config recursive relationship

Configuring Port Range for Passive FTP Mode (Windows)

ports config recursive relationship

All of the recursive nameservers in the world are going to find the NS If you wanted them to use a different port, you'd have to configure every. Instead it uses the ports default > >options. > > That's what "make config- recursive" is for. When installing > something through ports that is. The junkgenie.info(5) filename installed by the port has been changed: .. Note especially that dnsmasq will no longer answer non-recursive queries. unless it is have opted to keep the master/slave port relationship but not choose a.

ports config recursive relationship

Searching with whereis The easiest way of searching for an application is by name using the whereis command. This will search for the command on your system and within the ports tree.

If it finds a match, it will return the relevant path info for the application on your system. Typically, if the application is not installed but the search was for a valid port, it will return the path to the port within the ports tree.

FAQs-What has changed in the behavior of "allow-recursion" and "allow-query-cache"

If the application is installed, it will usually return the path to the executable, the port, and often the man page: For example, we can search for the wget utility by typing this: We can use the path returned if we wish to install this port. If the wget command is already installed, we may see output that looks like this: Searching Using the echo Command on the Filesystem Hierarchy In the FreeBSD Handbookthe authors also suggest a rather novel way of searching using only the echo command and the built-in structure of the ports tree.

In the filesystem, each port is represented by a distinct directory that contains all of the information necessary to build and install the software on the FreeBSD system.

So in the wget example above, we see that the wget command has been categorized within the ftp group. We can exploit this consistent structure through the use of the echo command and wildcards. Since we probably do not know the category the port will exist in, we will replace that directory level with an asterisk.

We can also put these before and after our search term if we want to be more flexible in our matching. So we can search for wget related programs by typing: Searching Using the Available make Targets The most powerful way to search for ports is to use the make command. This is also the command that is used to build and install ports onto the system, but is more generally a flexible tool that can be used to easily execute complex tasks that have been defined in a config file.

The FreeBSD developers have created make "targets" task definitions that will perform a search of the ports tree for different criteria.

To use this functionality, you must first move to the base of the ports tree. This is where the make targets are defined: These have exactly the same functionality, differing only in their default display.

The search target will return information about the name of the port, path in the port tree, a general description and then details about the build including the maintainer email, build dependencies, run dependencies, and the upstream URL. The quicksearch target only returns the port name, path, and description. The search types can be any of the following: Search only within the name field of the port.

Search within the name, comment, and dependencies fields of the port. Search a specific path within the ports hierarchy.

Search within the info description field of the port. Searches by the maintainer email address. Searches based on the category of the port. Searches the build-time dependencies of each port. Searches the run-time dependencies of each port. Searches the ports website. You can also prepend an "x" before any of the above categories to remove results that satisfy a match. Let's go over some quick examples.

Below, you can see the difference in the output of the search and quicksearch targets. The search target includes full information about the matches: Better top 1 - interactive process viewer Maint: Better top 1 - interactive process viewer It is possible to combine different search types to narrow down the results.

For example, if we were to search for the ntop network monitor, we might see results that look like this: Free Python tutorial book that is "not For Dummies tm " Port: Network monitoring tool with command line and web interfaces Port: Monitor status of network nodes using fping Here, we can see that most of the results are related to ntop, but we also have a book about learning Python.

We can further filter by adding a path specification: Monitor status of network nodes using fping We can also modify the behavior of the search in a few different ways.

Some valid modifiers are: Set this to "1" to turn on case-insensitivity. This is the default. To make searches case-sensitive, set this to "0". This contains a list of fields, separated by commas, to display in the output. Limit the searching using the "key" search type only to those fields being displayed. Turn this on by setting it to "1". For instance, we could search for descriptions or paths that contain the capitalized string "Paste" by typing: Copy, Paste, and Move support for content components Path: Pastebin web application to upload and read text on a webserver Path: Pastebin web application to upload snippets of text Path: Pastebin Django application that powers dpaste.

Paste to several pastebin services via bash script One further situation that you may come across in your searches is a port that has been moved or deleted. These results look like this: Upstream disappeared and distfile is no longer available Port: Vulnerable since Port: If this field is present, but empty, the port has been deleted. Even though these are deleted, they will still show up in your search results.

For example, to set this variable to "0" for only the command that follows, using the default tcsh, we can type: Paste to several pastebin services via bash script As you can see, all of the entries that had been moved or deleted are now filtered out of our results. To install a port, change to the directory of the port within the port tree. You can find this location through any of the search methods given above. To demonstrate this, we will be installing a port called portmaster, which we will need later in this guide.

The FreeBSD ports system.

First, change to the port location. The portmaster port is kept in the ports-mgmt category: Since these operations affect our system, we will need to use sudo. The long way to do this is through individual calls to make, like this. Do not type these commands yet, we will show you a much shorter version momentarily: Each of the targets listed above will call any preceding targets necessary in order to complete the task.

So the above could simply be condensed into: We usually want to specify config-recursive, an option not in the above pipeline, before the install target in order to take care of configuration for this port and any dependencies at the beginning of the installation. Otherwise the build process may halt and wait for user input part way through building the necessary dependencies.

We also usually want to clean up a bit after the installation to reclaim disk space and keep a clean system. We can do this with the clean or distclean targets. The clean target deletes the extracted source code used to build this port and any dependency ports. So a typical installation command may look like this: Afterwards it will download and verify the integrity of the source archive.

It will then change contexts to fulfill any missing dependencies. When that process is complete, it will return to the port in question, extract the archive, apply any necessary patches, and configure it according to the options you selected. It will then compile the application and install it on your system. Afterwards, it will remove the expanded source code for this port and any dependencies.

It will then delete the source archive for this port. If you are using one of the listed shells, you can choose to configure shell completion for the tool here: The most traditional and annoying is shared libraries.

If a required shared library is absent, the program doesn't run, period. It is completely broken. Other similar dependencies have less dramatic effects, plugins.

The absence of a plugin will mean reduced functionality, but we still enjoy part of the functionality. However dependencies may be of other types, for example some data files. An example is a firmware file which is necessary for running some piece of hardware. Dependencies can even be executables, for example the font editor fontforge may use the bitmap tracing tool autotrace to convert bitmap fonts to postscript outlines and further edit them.

Then autotrace works as a coprocess, and without it, there is reduced functionality. Note that this dependency is not recorded by FreeBSD. To summarize, there may be all sorts of run time dependencies, fatal or not fatal, recorded by the system or not, bogus or not, still we have to simplify and talk only of the run time dependencies recorded by the system, whatever they are.

Moreover we are speaking of recursively expanded dependencies. A closely related concept is the concept of conflicts.

This means that two ports are declared conflicting, you cannot install both, usually because both install files of the same name in the same place. The Makefile of the emacs port has: So this is a case where installing a port, instead of requiring another port, requires its absence.

ports config recursive relationship

Note that like dependency, which has to be recursively extended, conflicts also imply recursion. Indeed if portA requires recursively portE, and portB requires recursively portF, but portE and portF are conflicting, this implies that portA and portB conflict. Clearly this generates great complexity in a port management system, notably Debian apt system has a lot of consideration for this subject.

ports config recursive relationship

Finally the dependency mechanism is used to compose metaports whose only aim is to bring a lot of dependencies. Moreover this is parametrized by variables in the following way: If packageA depends on packageB and packageB depends on packageC, then packageA depends on packageC because we have assumed that dependencies have been recursively extended, in particular those of packageA. So the relation is transitive. Finally if packageA depends on packageB we must install packageB before packageA.

If packageB depends furthermore on packageA, we must install in the other order, so there is a deadlock situation. Hence it is necessary to ensure that this only occurs when packageA is equal to packageB, that is reflexivity. We have seen that the dependency relation is a partial order relation.

The FreeBSD ports system.

In such cases it is frequently useful to extend this order relation to a total order relation, that is, enumerating all packages in some order such that if packageA comes before packageB, then we know that packageA depends on packageB. So when we have a set of packages, we know we can safely install them beginning by the end, the smaller with respect with this order relation, and progress all the way to the first.

This extension problem is frequently presented in graphical form. Imagine a set of nodes, with a node for each port in the system, and a set of arrows, going from node to node, where there is an arrow from nodeA to nodeB if corresponding packageA depends on packageB.

This forms a directed graph, directed because the edges are oriented by the arrow heads. Now the fundamental property of this graph is that it doesn't have any cycles, at least it should not have any.

Getting started with BIND - how to build and run named with a basic recursive configuration

This means that there is no set of nodes, N1, This does not mean there is no unoriented cycles in the graph, i. The reason is the same as for the reflexivity of dependency relation, this would produce a deadlock in the installation procedure of packages, and is thus expressly forbidden in the Porter's handbook. In other words, it is the responsibility of port maintainers that there are no oriented cycles in the graph. It is also a direct consequence of transitivity and reflexivity, since under the above hypothesis, N1 is greater or equal to Nk and Nk greater or equal to N1, hence they are equal and the cycle has one less node.

Such a graph is called a directed acyclic graph DAG. The problem of extending the dependency relation to total order consists in setting all the nodes on a line in such order that all arrows go from left to right.

Of course this sorting is not unique, but we don't care. Let N be the number of nodes and V be the number of arrows. It consists of first scanning the graph, noting all nodes, the list of arrows pointing to them and the number of arrows pointing from them, also noting all arrows, and keeping track of the couple of nodes between them.

We also maintain a stack of the nodes with no arrow originating from them. Then one chooses a node in the stack the liberty of choice here exactly describes all possible orderswe decree it is the smallest element of the graph, remove it from the graph.

We also remove all arrows pointing to it from the set of arrows, and decrease by one the arrow count of their origins. All the nodes whose arrow count fall to 0 so they were previously of level 1 are added to the stack. If we want to maintain a natural level ordering we can push them to the beginning of the stack, while we pop from the end.

We are now in the same situation as in the beginning but with one less node. In N steps we are done. Of course one needs to be careful programming it, not introducing stupid O NV or similar procedures, since the numbers here are very big. When done properly this algorithm is really minimal with respect to the number of operations being done. Loop detection is also built in.

Suppose that at some point in the algorithm the stack is empty but the graph is not. This is because we have a loop, all elements of which have arrow count one, and we cannot find any element with arrow count 0. Hence the algorithm fails if and only if we have a loop.

To proceed we need to arbitrarily remove an arrow that is remove a dependency which breaks the cycle. In theory there are optimal breakings, but here this optimality means nothing because only human intervention can discriminate the correct dependency to remove.

Hence the only meaningful solution is to display the cycle for further study, which is trivial at this point. The program Portupgrade has such a topological sorting procedure built in, in the ruby script pkgtsort. Recall it is necessary to start upgrading a set of packages in correct dependency order. All of them are due to Akinori Musha. The library packages are located in the standard ruby library location.

Each of executables has a man page. A remarkable feature is that portsdb can list master ports, even recursively if -R is specified: Moreover portsdb has some convenience features like the -F option which downloads an INDEX file such as make fetchindex. No wonders it weights 37Megs on my machine which has ports installed. In fact one of the fundamental ideas of portupgrade is that, as we have explained, the standard package database suffers bit rot as new ports or packages are installed, and that it needs to be fixed.

This is controversial because once these modifications are done, the previous state is lost forever, while modifications to some private database would be safe. The problem being that it is highly probable that these modifications are bogus, all the more when user is prompted to help fix inconsistencies, while he is usually the less able of having any clue about the necessary modifications. A package management system should never assume that the final user knows anything, or wants to know anything about the complex net of dependencies in his system.

He wants to see a black box, which works. Citing the man pages, "pkgdb helps resolve stale dependencies, unlink cyclic dependencies, complete stale or missing origins and remove duplicates. Recall that stale dependencies are ports which were present when the package was installed and on which the given package depends, but have since then disappeared and don't show up in the ports tree. It may be because they have completely disappeared like portindex, or because they have moved, either or name, or changed place in the ports tree.

Portupgrade may reassociate automatically such dependencies to the correct new location if the file MOVED contains the necessary information. Stale or missing origins represent the same problem, a package whose port has disappeared or been moved. Breaking dependency cycles is the problem we have mentioned above, about DAGs.

In principle there should be no cycle, if there is one, only user intervention can choose the correct dependency to remove which unbreaks the cycle. Finally if we have a port which needs, say tk Hence portupgrade will prompt to remove the dependency to tk Of course they should be upgraded in order. It shows packages which need to be updated according to the ports.

We have now described the building blocks in the operation of the main program in the system, portupgrade. First assume one has run pkgdb -F so that all dependencies are correct. Afterwards each operation will update pkgdb. If used with the -N options it is equivalent to portinstall, and installs a new package.

Otherwise, it upgrades packages. First the collection is topologically sorted, then one proceeds to upgrade packages one by one beginning by the less dependent ones. The procedure is to backup the package the package can be kept using the -b option install the new package, register the new package in the database, and interate.

Between each operation portupgrade checks the consistency of its databases, which is very slow. One can make the procedure speedier but certainly not speedy by setting the -O option which omits these checks, assuming that pkgdb -F has been run and has done a good job. With the -p option, copies of the freshly built packages are kept.

Assuming that everything works OK, when the new package is installed and registered, portupgrade deletes the copy of the backup. If something gets wrong, it reinstalls the old package.