FreeBSD Bugzilla – Attachment 123501 Details for
Bug 166855
[patch] Automatic Detection of Dependencies Addendum for Porter's Handbook
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 2.07 KB, created by
A.J. Kehoe IV
on 2012-04-11 19:40:11 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
A.J. Kehoe IV
Created:
2012-04-11 19:40:11 UTC
Size:
2.07 KB
patch
obsolete
>--- book.sgml.old 2012-04-11 13:34:36.000000000 -0400 >+++ book.sgml 2012-04-11 14:27:09.000000000 -0400 >@@ -3843,6 +3843,56 @@ > may be able to save a large number of people—including > yourself— a lot of grief in the process.</para> > </sect2> >+ >+ <sect2> >+ <title>Automatic Detection Causes Problems</title> >+ >+ <para>Dependencies must be declared either explicitly or by >+ using the <link >+ linkend="makefile-options">OPTIONS framework</link>. >+ Using other methods like automatic detection complicates >+ indexing, which causes problems for port and package >+ management.</para> >+ >+ <example> >+ <title>Wrong Declaration of an Optional Dependency</title> >+ >+ <programlisting>.include <bsd.port.pre.mk> >+ >+.if exists(${LOCALBASE}/bin/foo) >+LIB_DEPENDS= bar:${PORTSDIR}/foo/bar >+.endif</programlisting> >+ </example> >+ >+ <para>The problem with the above method is that it declares a >+ dependency based on the existence of a file that may have >+ been installed by another port. If all options were >+ recursively defined for a batch of ports and an index of >+ these ports was built, then the index would become >+ inconsistent during the installation of this batch if one of >+ its ports installed that file. A new index would need to be >+ created, but it too may be inconsistent if there are other >+ ports that use this same method.</para> >+ >+ <example> >+ <title>Correct Declaration of an Optional Dependency</title> >+ >+ <programlisting>OPTIONS= BAR "Enable bar support" on >+ >+.include <bsd.port.pre.mk> >+ >+.if defined(WITH_BAR) && !defined(WITHOUT_BAR) >+LIB_DEPENDS= bar:${PORTSDIR}/foo/bar >+.endif</programlisting> >+ </example> >+ >+ <para>This second method is correct because it would not cause >+ inconsistencies in the index of a batch of ports, provided >+ the batch's options were defined prior to the index's build. >+ This makes it possible to use simple scripts to automate the >+ building, installation, and updating of these ports and >+ their packages.</para> >+ </sect2> > </sect1> > > <sect1 id="makefile-masterdir">
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 166855
: 123501