text:
summaryrefslogtreecommitdiff log msg author committer range
blob: e3e831f149e670a4eb35c71cc5d4c2d5df15bf7f (plain)
 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220  pre { line-height: 125%; } td.linenos pre { color: #000000; background-color: #f0f0f0; padding-left: 5px; padding-right: 5px; } span.linenos { color: #000000; background-color: #f0f0f0; padding-left: 5px; padding-right: 5px; } td.linenos pre.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } .highlight .hll { background-color: #ffffcc } .highlight .c { color: #888888 } /* Comment */ .highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */ .highlight .k { color: #008800; font-weight: bold } /* Keyword */ .highlight .ch { color: #888888 } /* Comment.Hashbang */ .highlight .cm { color: #888888 } /* Comment.Multiline */ .highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */ .highlight .cpf { color: #888888 } /* Comment.PreprocFile */ .highlight .c1 { color: #888888 } /* Comment.Single */ .highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */ .highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ .highlight .ge { font-style: italic } /* Generic.Emph */ .highlight .gr { color: #aa0000 } /* Generic.Error */ .highlight .gh { color: #333333 } /* Generic.Heading */ .highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ .highlight .go { color: #888888 } /* Generic.Output */ .highlight .gp { color: #555555 } /* Generic.Prompt */ .highlight .gs { font-weight: bold } /* Generic.Strong */ .highlight .gu { color: #666666 } /* Generic.Subheading */ .highlight .gt { color: #aa0000 } /* Generic.Traceback */ .highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */\section{Ebuild-specific Commands} \label{sec:pkg-mgr-commands} The following commands will always be available in the ebuild environment, provided by the package manager. Except where otherwise noted, they may be internal (shell functions or aliases) or external commands available in \t{PATH}; where this is not specified, ebuilds may not rely upon either behaviour. Unless otherwise noted, any output of these commands ends with a newline. \subsection{Failure behaviour and related commands} \label{sec:failure-behaviour} \featurelabel{die-on-failure} Where a command is listed as having EAPI dependent failure behaviour, a failure shall either result in a non-zero exit status or abort the build process, as determined by table~\ref{tab:commands-die-table}. The following commands affect this behaviour: \begin{description} \item[nonfatal] \featurelabel{nonfatal} Takes one or more arguments and executes them as a command, preserving the exit status. If this results in a command being called that would normally abort the build process due to a failure, instead a non-zero exit status shall be returned. Only in EAPIs listed in table~\ref{tab:commands-die-table} as supporting \t{nonfatal}. In EAPIs listed in table~\ref{tab:commands-die-table} as having \t{nonfatal} defined both as a shell function and as an external command, the package manager must provide both implementations to account for calling directly in ebuild scope or through \t{xargs}. Explicit \t{die} or \t{assert} commands only respect \t{nonfatal} when called with the \t{-n} option and in EAPIs supporting this option, see table~\ref{tab:die-properties}. \end{description} \ChangeWhenAddingAnEAPI{7} \begin{centertable}{EAPI command failure behaviour} \label{tab:commands-die-table} \begin{tabular}{llll} \toprule \multicolumn{1}{c}{\textbf{EAPI}} & \multicolumn{1}{P{8em}}{\textbf{Command failure behaviour}} & \multicolumn{1}{P{5em}}{\textbf{Supports \t{nonfatal}?}} & \multicolumn{1}{P{12em}}{\textbf{\t{nonfatal} is both a function and an external command?}} \\ \midrule 0, 1, 2, 3 & Non-zero exit & No & n/a \\ 4, 5, 6 & Aborts & Yes & No \\ 7 & Aborts & Yes & Yes \\ \bottomrule \end{tabular} \end{centertable} \subsection{Banned commands} \label{sec:banned-commands} \featurelabel{banned-commands} Some commands are banned in some EAPIs. If a banned command is called, the package manager must abort the build process indicating an error. \ChangeWhenAddingAnEAPI{7} \begin{centertable}{Banned commands} \label{tab:banned-commands-table} \begin{tabular}{lllllll} \toprule \multicolumn{1}{c}{\textbf{EAPI}} & \multicolumn{6}{c}{\textbf{Command banned?}} \\ \multicolumn{1}{c}{} & \multicolumn{1}{c}{\textbf{\t{dohard}}} & \multicolumn{1}{c}{\textbf{\t{dosed}}} & \multicolumn{1}{c}{\textbf{\t{einstall}}} & \multicolumn{1}{c}{\textbf{\t{dohtml}}} & \multicolumn{1}{c}{\textbf{\t{dolib}}} & \multicolumn{1}{c}{\textbf{\t{libopts}}} \\ \midrule 0, 1, 2, 3 & No & No & No & No & No & No \\ 4, 5 & Yes & Yes & No & No & No & No \\ 6 & Yes & Yes & Yes & No & No & No \\ 7 & Yes & Yes & Yes & Yes & Yes & Yes \\ \bottomrule \end{tabular} \end{centertable} \subsection{Sandbox commands} These commands affect the behaviour of the sandbox. Each command takes a single directory as argument. Ebuilds must not run any of these commands once the current phase function has returned. \begin{description} \item[addread] Add a directory to the permitted read list. \item[addwrite] Add a directory to the permitted write list. \item[addpredict] Add a directory to the predict list. Any write to a location in this list will be denied, but will not trigger access violation messages or abort the build process. \item[adddeny] Add a directory to the deny list. \end{description} \subsection{Package manager query commands} These commands are used to extract information about the system. Ebuilds must not run any of these commands in parallel with any other package manager command. Ebuilds must not run any of these commands once the current phase function has returned. \featurelabel{pm-query-options} In EAPIs listed in table~\ref{tab:pm-query-options} as supporting option \t{-{}-host-root}, this flag as the first argument will cause the query to apply to the host root. Otherwise, it applies to \t{ROOT}. In EAPIs listed in table~\ref{tab:pm-query-options} as supporting options \t{-b}, \t{-d} and \t{-r}, these mutually exclusive flags as the first argument will cause the query to apply to locations targetted by \t{BDEPEND}, \t{DEPEND} and \t{RDEPEND}, respectively. When none of these options are given, \t{-r} is assumed. \begin{description} \item[has_version] Takes exactly one package dependency specification as an argument. Returns true if a package matching the specification is installed, and false otherwise. \item[best_version] Takes exactly one package dependency specification as an argument. If a matching package is installed, prints \t{category/package-version} of the highest matching version; otherwise, prints an empty string. The exit code is unspecified. \end{description} \ChangeWhenAddingAnEAPI{7} \begin{centertable}{Package manager query command options supported by EAPIs} \label{tab:pm-query-options} \begin{tabular}{lllll} \toprule \multicolumn{1}{c}{\textbf{EAPI}} & \multicolumn{1}{c}{\textbf{\t{-{}-host-root}?}} & \multicolumn{1}{c}{\textbf{\t{-b}?}} & \multicolumn{1}{c}{\textbf{\t{-d}?}} & \multicolumn{1}{c}{\textbf{\t{-r}?}} \\ \midrule 0, 1, 2, 3, 4 & No & No & No & No \\ 5, 6 & Yes & No & No & No \\ 7 & No & Yes & Yes & Yes \\ \bottomrule \end{tabular} \end{centertable} \subsection{Output commands} These commands display messages to the user. Unless otherwise stated, the entire argument list is used as a message, with backslash-escaped characters interpreted as for the \t{echo -e} command of bash, notably \t{\textbackslash t} for a horizontal tab, \t{\textbackslash n} for a new line, and \t{\textbackslash\textbackslash} for a literal backslash. Ebuilds must not run any of these commands once the current phase function has returned. \featurelabel{output-no-stdout} Unless otherwise noted, output may be sent to stderr or some other appropriate facility. In EAPIs listed in table~\ref{tab:output-commands} as not allowing stdout output, using stdout as an output facility is forbidden. \begin{description} \item[einfo] Displays an informational message. \item[einfon] Displays an informational message without a trailing newline. \item[elog] Displays an informational message of slightly higher importance. The package manager may choose to log \t{elog} messages by default where \t{einfo} messages are not, for example. \item[ewarn] Displays a warning message. Must not go to stdout. \item[eqawarn] \featurelabel{eqawarn} Display a QA warning message intended for ebuild developers. The package manager may provide appropriate mechanisms to skip those messages for normal users. Must not go to stdout. Only available in EAPIs listed in table~\ref{tab:output-commands} as supporting \t{eqawarn}. \item[eerror] Displays an error message. Must not go to stdout. \item[ebegin] Displays an informational message. Should be used when beginning a possibly lengthy process, and followed by a call to \t{eend}. \item[eend] Indicates that the process begun with an \t{ebegin} message has completed. Takes one fixed argument, which is a numeric return code, and an optional message in all subsequent arguments. If the first argument is 0, prints a success indicator; otherwise, prints the message followed by a failure indicator. Returns its first argument as exit status. \end{description} \ChangeWhenAddingAnEAPI{7} \begin{centertable}{Output commands for EAPIs} \label{tab:output-commands} \begin{tabular}{lll} \toprule \multicolumn{1}{c}{\textbf{EAPI}} & \multicolumn{1}{c}{\textbf{Commands can output to stdout?}} & \multicolumn{1}{c}{\textbf{Supports \t{eqawarn}?}} \\ \midrule 0, 1, 2, 3, 4, 5, 6 & Yes & No \\ 7 & No & Yes \\ \bottomrule \end{tabular} \end{centertable} \subsection{Error commands} These commands are used when an error is detected that will prevent the build process from completing. Ebuilds must not run any of these commands once the current phase function has returned. \begin{description} \item[die] \featurelabel{nonfatal-die} If called under the \t{nonfatal} command (as per section~\ref{sec:failure-behaviour}) and with \t{-n} as its first parameter, displays a failure message provided in its following argument and then returns a non-zero exit status. Only in EAPIs listed in table~\ref{tab:die-properties} as supporting option~\t{-n}. Otherwise, displays a failure message provided in its first and only argument, and then aborts the build process. \featurelabel{subshell-die} In EAPIs listed in table~\ref{tab:die-properties} as not providing subshell support, \t{die} is \e{not} guaranteed to work correctly if called from a subshell environment. \item[assert] Checks the value of the shell's pipe status variable, and if any component is non-zero (indicating failure), calls \t{die}, passing any parameters to it. \end{description} \ChangeWhenAddingAnEAPI{7} \begin{centertable}{Properties of \t{die} and \t{assert} commands in EAPIs} \label{tab:die-properties} \begin{tabular}{lll} \toprule \multicolumn{1}{c}{\textbf{EAPI}} & \multicolumn{2}{c}{\textbf{\t{die} and \t{assert}}} \\ & \multicolumn{1}{c}{\textbf{support \t{-n}?}} & \multicolumn{1}{c}{\textbf{work in subshell?}} \\ \midrule 0, 1, 2, 3, 4, 5 & No & No \\ 6 & Yes & No \\ 7 & Yes & Yes \\ \bottomrule \end{tabular} \end{centertable} \subsection{Patch commands} These commands are used during the \t{src_prepare} phase to apply patches to the package's sources. Ebuilds must not run any of these commands once the current phase function has returned. \begin{description} \item[eapply] \featurelabel{eapply} Takes zero or more GNU patch options, followed by one or more file or directory paths. Processes options and applies all patches found in specified locations according to algorithm~\ref{alg:eapply}. If applying the patches fails, it aborts the build using \t{die}, unless run using \t{nonfatal}, in which case it returns non-zero exit status. Only available in EAPIs listed in table~\ref{tab:patch-commands} as supporting \t{eapply}. \begin{algorithm} \caption{\t{eapply} logic} \label{alg:eapply} \begin{algorithmic}[1] \IF{any parameter is equal to \t{"-{}-"}} \STATE collect all parameters before the first \t{"-{}-"} in the \t{options} array \STATE collect all parameters after the first \t{"-{}-"} in the \t{files} array \ELSIF{any parameter that begins with a hyphen follows one that does not} \STATE abort the build process with an error \ELSE \STATE collect all parameters beginning with a hyphen in the \t{options} array \STATE collect all remaining parameters in the \t{files} array \ENDIF \IF{the \t{files} array is empty} \STATE abort the build process with an error \ENDIF \FORALL{\t{x} in the \t{files} array} \IF{\t{\$x} is a directory} \IF{\NOT any files match \t{\$x/*.diff} or \t{\$x/*.patch}} \STATE abort the build process with an error \ENDIF \FORALL{files \t{f} matching \t{\$x/*.diff} or \t{\$x/*.patch}, sorted in POSIX locale} \STATE call \t{patch -p1 -f -g0 -{}-no-backup-if-mismatch "\$\{options[@]\}" < "\$f"} \IF{child process returned with non-zero exit status} \RETURN immediately with that status \ENDIF \ENDFOR \ELSE \STATE call \t{patch -p1 -f -g0 -{}-no-backup-if-mismatch "\$\{options[@]\}" < "\$x"} \IF{child process returned with non-zero exit status} \RETURN immediately with that status \ENDIF \ENDIF \ENDFOR \RETURN shell true (0) \end{algorithmic} \end{algorithm} \item[eapply_user] \featurelabel{eapply-user} Takes no arguments. Package managers supporting it apply user-provided patches to the source tree in the current working directory. Exact behaviour is implementation defined and beyond the scope of this specification. Package managers not supporting it must implement the command as a no-op. Returns shell true (0) if patches applied successfully, or if no patches were provided. Otherwise, aborts the build process, unless run using \t{nonfatal}, in which case it returns non-zero exit status. Only available in EAPIs listed in table~\ref{tab:patch-commands} as supporting \t{eapply_user}. In EAPIs where it is supported, \t{eapply_user} must be called once in the \t{src_prepare} phase. For any subsequent calls, the command will do nothing and return~0. \end{description} \ChangeWhenAddingAnEAPI{7} \begin{centertable}{Patch commands for EAPIs} \label{tab:patch-commands} \begin{tabular}{lll} \toprule \multicolumn{1}{c}{\textbf{EAPI}} & \multicolumn{1}{c}{\textbf{\t{eapply}?}} & \multicolumn{1}{c}{\textbf{\t{eapply_user}?}} \\ \midrule 0, 1, 2, 3, 4, 5 & No & No \\ 6, 7 & Yes & Yes \\ \bottomrule \end{tabular} \end{centertable} \subsection{Build commands} These commands are used during the \t{src_configure}, \t{src_compile}, \t{src_test}, and \t{src_install} phases to run the package's build commands. Ebuilds must not run any of these commands once the current phase function has returned. \begin{description} \item[econf] Calls the program's \t{./configure} script. This is designed to work with GNU Autoconf-generated scripts. Any additional parameters passed to \t{econf} are passed directly to \t{./configure}, after the default options below. \t{econf} will look in the current working directory for a configure script unless the \t{ECONF_SOURCE} environment variable is set, in which case it is taken to be the directory containing it. \featurelabel{econf-options} \t{econf} must pass the following options to the configure script: \begin{itemize} \item \t{-{}-prefix} must default to \t{\$\{EPREFIX\}/usr} unless overridden by \t{econf}'s caller. \item \t{-{}-mandir} must be \t{\$\{EPREFIX\}/usr/share/man} \item \t{-{}-infodir} must be \t{\$\{EPREFIX\}/usr/share/info} \item \t{-{}-datadir} must be \t{\$\{EPREFIX\}/usr/share} \item \t{-{}-sysconfdir} must be \t{\$\{EPREFIX\}/etc} \item \t{-{}-localstatedir} must be \t{\$\{EPREFIX\}/var/lib} \item \t{-{}-docdir} must be \t{\$\{EPREFIX\}/usr/share/doc/\$\{PF\}}, if the EAPI is listed in table~\ref{tab:econf-options-table} as using it. This option will only be passed if the string \t{-{}-docdir} occurs in the output of \t{configure -{}-help}. \item \t{-{}-htmldir} must be \t{\$\{EPREFIX\}/usr/share/doc/\$\{PF\}/html}, if the EAPI is listed in table~\ref{tab:econf-options-table} as using it. This option will only be passed if the string \t{-{}-htmldir} occurs in the output of \t{configure -{}-help}. \item \t{-{}-with-sysroot} must be \t{\$\{ESYSROOT\}}, if the EAPI is listed in table~\ref{tab:econf-options-table} as using it. This option will only be passed if the string \t{-{}-with-sysroot} occurs in the output of \t{configure -{}-help}. \item \t{-{}-build} must be the value of the \t{CBUILD} environment variable. This option will only be passed if \t{CBUILD} is non-empty. \item \t{-{}-host} must be the value of the \t{CHOST} environment variable. \item \t{-{}-target} must be the value of the \t{CTARGET} environment variable. This option will only be passed if \t{CTARGET} is non-empty. \item \t{-{}-libdir} must be set according to algorithm~\ref{alg:econf-libdir}. \item \t{-{}-disable-dependency-tracking}, if the EAPI is listed in table~\ref{tab:econf-options-table} as using it. This option will only be passed if the string \t{-{}-disable-dependency-tracking} occurs in the output of \t{configure -{}-help}. \item \t{-{}-disable-silent-rules}, if the EAPI is listed in table~\ref{tab:econf-options-table} as using it. This option will only be passed if the string \t{-{}-disable-silent-rules} occurs in the output of \t{configure -{}-help}. \end{itemize} \ChangeWhenAddingAnEAPI{7} \begin{centertable}{Extra \t{econf} arguments for EAPIs} \label{tab:econf-options-table} \begin{tabular}{llllll} \toprule \multicolumn{1}{c}{\textbf{EAPI}} & \multicolumn{1}{P{9em}}{\textbf{-{}-disable-dependency-tracking}} & \multicolumn{1}{P{5em}}{\textbf{-{}-disable-silent-rules}} & \multicolumn{1}{c}{\textbf{-{}-docdir}} & \multicolumn{1}{c}{\textbf{-{}-htmldir}} & \multicolumn{1}{c}{\textbf{-{}-with-sysroot}} \\ \midrule 0, 1, 2, 3 & No & No & No & No & No \\ 4 & Yes & No & No & No & No \\ 5 & Yes & Yes & No & No & No \\ 6 & Yes & Yes & Yes & Yes & No \\ 7 & Yes & Yes & Yes & Yes & Yes \\ \bottomrule \end{tabular} \end{centertable} Note that the \t{\$\{EPREFIX\}} component represents the same offset-prefix as described in table~\ref{tab:defined-vars}. It facilitates offset-prefix installations which is supported by EAPIs listed in table~\ref{tab:offset-env-vars-table}. When no offset-prefix installation is in effect, \t{EPREFIX} becomes the empty string, making the behaviour of \t{econf} equal for both offset-prefix supporting and agnostic EAPIs. \t{econf} must be implemented internally---that is, as a bash function and not an external script. Should any portion of it fail, it must abort the build using \t{die}, unless run using \t{nonfatal}, in which case it must return non-zero exit status. \begin{algorithm} \caption{\t{econf -{}-libdir} logic} \label{alg:econf-libdir} \begin{algorithmic}[1] \STATE let prefix=\$\{EPREFIX\}/usr \IF{the caller specified -{}-prefix=\$p} \STATE let prefix=\$p \ENDIF \STATE let libdir= \IF{the ABI environment variable is set} \STATE let libvar=LIBDIR_\$ABI \IF{the environment variable named by libvar is set} \STATE let libdir=the value of the variable named by libvar \ENDIF \ENDIF \IF{libdir is non-empty} \STATE pass -{}-libdir=\$prefix/\$libdir to configure \ENDIF \end{algorithmic} \end{algorithm} \item[emake] Calls the \t{\$MAKE} program, or GNU make if the \t{MAKE} variable is unset. Any arguments given are passed directly to the make command, as are the user's chosen \t{MAKEOPTS}\@. Arguments given to \t{emake} override user configuration. See also section~\ref{sec:guaranteed-system-commands}. \t{emake} must be an external program and cannot be a function or alias---it must be callable from e.\,g.\ \t{xargs}. Failure behaviour is EAPI dependent as per section~\ref{sec:failure-behaviour}. \item[einstall] A shortcut for the command given in listing~\ref{lst:einstall}. Any arguments given to \t{einstall} are passed verbatim to \t{emake}, as shown. Failure behaviour is EAPI dependent as per section~\ref{sec:failure-behaviour}. In EAPIs listed in table~\ref{tab:banned-commands-table}, this command is banned as per section~\ref{sec:banned-commands}. The variable \t{ED} is defined as in table~\ref{tab:defined-vars} and depends on the use of an offset-prefix. When such offset-prefix is absent, \t{ED} is equivalent to \t{D}\@. \t{ED} is always available in EAPIs that support offset-prefix installations as listed in table~\ref{tab:offset-env-vars-table}, hence EAPIs lacking offset-prefix support should use \t{D} instead of \t{ED} in the command given in listing~\ref{lst:einstall}. Variable \t{libdir} is an auxiliary local variable whose value is determined by algorithm~\ref{alg:ebuild-libdir}. \begin{listing}[H] \caption{\t{einstall} command} \label{lst:einstall} \begin{verbatim} emake \ prefix="${ED}"/usr \ datadir="${ED}"/usr/share \ mandir="${ED}"/usr/share/man \ infodir="${ED}"/usr/share/info \ libdir="${ED}"/usr/${libdir} \ localstatedir="${ED}"/var/lib \ sysconfdir="${ED}"/etc \ -j1 \ "$@" \ install \end{verbatim} \end{listing} \end{description} \subsection{Installation commands} These commands are used to install files into the staging area, in cases where the package's \t{make install} target cannot be used or does not install all needed files. Except where otherwise stated, all filenames created or modified are relative to the staging directory including the offset-prefix \t{ED} in offset-prefix aware EAPIs, or just the staging directory \t{D} in offset-prefix agnostic EAPIs. Existing destination files are overwritten. These commands must all be external programs and not bash functions or aliases---that is, they must be callable from \t{xargs}. Calling any of these commands without a filename parameter is an error. Ebuilds must not run any of these commands once the current phase function has returned. \begin{description} \item[dobin] Installs the given files into \t{DESTTREE/bin}, where \t{DESTTREE} defaults to \t{/usr}. Gives the files mode \t{0755} and transfers file ownership to the superuser or its equivalent on the system or installation at hand. In a non-offset-prefix installation this ownership is \t{root:root}, while in an offset-prefix aware installation this may be e.\,g.\ \t{joe:users}. Failure behaviour is EAPI dependent as per section~\ref{sec:failure-behaviour}. \item[doconfd] Installs the given config files into \t{/etc/conf.d/}, by default with file mode \t{0644}, or with the \t{install} options set by the most recent \t{insopts} call. Failure behaviour is EAPI dependent as per section~\ref{sec:failure-behaviour}. \item[dodir] Creates the given directories, by default with file mode \t{0755}, or with the \t{install} options set by the most recent \t{diropts} call. Failure behaviour is EAPI dependent as per section~\ref{sec:failure-behaviour}. \item[dodoc] \featurelabel{dodoc} Installs the given files into a subdirectory under \t{/usr/share/doc/\$\{PF\}/} with file mode \t{0644}. The subdirectory is set by the most recent call to \t{docinto}. If \t{docinto} has not yet been called, instead installs to the directory \t{/usr/share/doc/\$\{PF\}/}. For EAPIs listed in table~\ref{tab:dodoc-table} as supporting \t{-r}, if the first argument is \t{-r}, any subsequent arguments that are directories are installed recursively to the appropriate location; in any other case, it is an error for a directory to be specified. Failure behaviour is EAPI dependent as per section~\ref{sec:failure-behaviour}. \item[doenvd] Installs the given environment files into \t{/etc/env.d/}, by default with file mode \t{0644}, or with the \t{install} options set by the most recent \t{insopts} call. Failure behaviour is EAPI dependent as per section~\ref{sec:failure-behaviour}. \item[doexe] Installs the given files into the directory specified by the most recent \t{exeinto} call. If \t{exeinto} has not yet been called, behaviour is undefined. Files are installed by default with file mode \t{0755}, or with the \t{install} options set by the most recent \t{exeopts} call. Failure behaviour is EAPI dependent as per section~\ref{sec:failure-behaviour}. \item[dohard] Takes two parameters. Creates a hardlink from the second to the first. Both paths are relative to the staging directory including the offset-prefix \t{ED} in offset-prefix aware EAPIs, or just the staging directory \t{D} in offset-prefix agnostic EAPIs. In EAPIs listed in table~\ref{tab:banned-commands-table}, this command is banned as per section~\ref{sec:banned-commands}. \item[doheader] \featurelabel{doheader} Installs the given header files into \t{/usr/include/}, by default with file mode \t{0644}, or with the \t{install} options set by the most recent \t{insopts} call. If the first argument is \t{-r}, then operates recursively, descending into any directories given. Only available in EAPIs listed in table~\ref{tab:doheader-table} as supporting \t{doheader}. Failure behaviour is EAPI dependent as per section~\ref{sec:failure-behaviour}. \item[dohtml] Installs the given HTML files into a subdirectory under \t{/usr/share/doc/\$PF/}. The subdirectory is \t{html} by default, but this can be overridden with the \t{docinto} function. Files to be installed automatically are determined by extension and the default extensions are \t{css}, \t{gif}, \t{htm}, \t{html}, \t{jpeg}, \t{jpg}, \t{js} and \t{png}. These default extensions can be extended or reduced (see below). The options that can be passed to \t{dohtml} are as follows: \begin{compactdesc} \item[\t{-r}] enables recursion into directories. \item[\t{-V}] enables verbosity. \item[\t{-A}] adds file type extensions to the default list. \item[\t{-a}] sets file type extensions to only those specified. \item[\t{-f}] list of files that are able to be installed. \item[\t{-x}] list of directories that files will not be installed from (only used in conjunction with \t{-r}). \item[\t{-p}] sets a document prefix for installed files, not to be confused with the global offset-prefix. \end{compactdesc} In EAPIs listed in table~\ref{tab:banned-commands-table}, this command is banned as per section~\ref{sec:banned-commands}. Failure behaviour is EAPI dependent as per section~\ref{sec:failure-behaviour}. It is undefined whether a failure shall occur if \t{-r} is not specified and a directory is encountered. Ebuilds must not rely upon any particular behaviour. \item[doinfo] Installs the given GNU Info files into the \t{/usr/share/info} area with file mode \t{0644}. Failure behaviour is EAPI dependent as per section~\ref{sec:failure-behaviour}. \item[doinitd] Installs the given initscript files into \t{/etc/init.d}, by default with file mode \t{0755}, or with the \t{install} options set by the most recent \t{exeopts} call. Failure behaviour is EAPI dependent as per section~\ref{sec:failure-behaviour}. \item[doins] \featurelabel{doins} Takes one or more files as arguments and installs them into \t{INSDESTTREE}, by default with file mode \t{0644}, or with the \t{install} options set by the most recent \t{insopts} call. If the first argument is \t{-r}, then operates recursively, descending into any directories given. For EAPIs listed in table~\ref{tab:doins-table}, \t{doins} must install symlinks as symlinks; for other EAPIs, behaviour is undefined if any symlink is encountered. Failure behaviour is EAPI dependent as per section~\ref{sec:failure-behaviour}. \item[dolib.a] For each argument, installs it into the appropriate library subdirectory under \t{DESTTREE}, as determined by algorithm~\ref{alg:ebuild-libdir}. Files are installed with file mode \t{0644}. Any symlinks are installed into the same directory as relative links to their original target. Failure behaviour is EAPI dependent as per section~\ref{sec:failure-behaviour}. \item[dolib.so] As for \t{dolib.a} except each file is installed with mode \t{0755}. \item[dolib] As for \t{dolib.a} except that the default install mode can be overriden with the \t{install} options set by the most recent \t{libopts} call. In EAPIs listed in table~\ref{tab:banned-commands-table}, this command is banned as per section~\ref{sec:banned-commands}. \begin{algorithm} \caption{Determining the library directory} \label{alg:ebuild-libdir} \begin{algorithmic}[1] \IF{CONF_LIBDIR_OVERRIDE is set in the environment} \STATE return CONF_LIBDIR_OVERRIDE \ENDIF \IF{CONF_LIBDIR is set in the environment} \STATE let LIBDIR_default=CONF_LIBDIR \ELSE \STATE let LIBDIR_default=lib'' \ENDIF \IF{ABI is set in the environment} \STATE let abi=ABI \ELSIF{DEFAULT_ABI is set in the environment} \STATE let abi=DEFAULT_ABI \ELSE \STATE let abi=default'' \ENDIF \STATE return the value of LIBDIR_\$abi \end{algorithmic} \end{algorithm} \item[doman] Installs the given man pages into the appropriate subdirectory of \t{/usr/share/man} depending upon its apparent section suffix (e.\,g.\ \t{foo.1} goes to \t{/usr/share/man/man1/foo.1}) with file mode \t{0644}. \featurelabel{doman-langs} In EAPIs listed in table~\ref{tab:doman-table} as supporting language detection by filename, a man page with name of the form \t{foo.}\i{lang}\t{.1} shall go to \t{/usr/share/man/}\i{lang}\t{/man1/foo.1}, where \i{lang} refers to a pair of lower-case ASCII letters optionally followed by an underscore and a pair of upper-case ASCII letters. Failure behaviour is EAPI dependent as per section~\ref{sec:failure-behaviour}. With option \t{-i18n=}\i{lang}, a man page shall be installed into an appropriate subdirectory of \t{/usr/share/man/}\i{lang} (e.\,g.\ \t{/usr/share/man/}\i{lang}\t{/man1/foo.pl.1} would be the destination for \t{foo.pl.1}). The \i{lang} subdirectory level is skipped if \i{lang} is the empty string. In EAPIs specified by table~\ref{tab:doman-table}, the \t{-i18n} option takes precedence over the language code in the filename. \item[domo] \featurelabel{domo-path} Installs the given \t{.mo} files with file mode \t{0644} into the appropriate subdirectory of the locale tree, generated by taking the basename of the file, removing the \t{.*} suffix, and appending \t{/LC_MESSAGES}\@. The name of the installed files is the package name with \t{.mo} appended. Failure behaviour is EAPI dependent as per section~\ref{sec:failure-behaviour}. The locale tree location is EAPI dependent as per table~\ref{tab:domo-path}. \item[dosbin] As \t{dobin}, but installs to \t{DESTTREE/sbin}. \item[dosym] Creates a symbolic link named as for its second parameter, pointing to the first. If the directory containing the new link does not exist, creates it. Failure behaviour is EAPI dependent as per section~\ref{sec:failure-behaviour}. \item[fowners] Acts as for \t{chown}, but takes paths relative to the image directory. Failure behaviour is EAPI dependent as per section~\ref{sec:failure-behaviour}. \item[fperms] Acts as for \t{chmod}, but takes paths relative to the image directory. Failure behaviour is EAPI dependent as per section~\ref{sec:failure-behaviour}. \item[keepdir] For each argument, creates a directory as for \t{dodir}, and an empty file whose name starts with \t{.keep} in that directory to ensure that the directory does not get removed by the package manager should it be empty at any point. Failure behaviour is EAPI dependent as per section~\ref{sec:failure-behaviour}. \item[newbin] \featurelabel{newfoo-stdin} As for \t{dobin}, but takes two parameters. The first is the file to install; the second is the new filename under which it will be installed. In EAPIs specified by table~\ref{tab:newfoo-stdin-table}, standard input is read when the first parameter is \t{-} (a hyphen). In this case, it is an error if standard input is a terminal. \item[newconfd] As for \t{doconfd}, but takes two parameters as for \t{newbin}. \item[newdoc] As above, for \t{dodoc}. \item[newenvd] As above, for \t{doenvd}. \item[newexe] As above, for \t{doexe}. \item[newheader] As above, for \t{doheader}. \item[newinitd] As above, for \t{doinitd}. \item[newins] As above, for \t{doins}. \item[newlib.a] As above, for \t{dolib.a}. \item[newlib.so] As above, for \t{dolib.so}. \item[newman] As above, for \t{doman}. \item[newsbin] As above, for \t{dosbin}. \end{description} \ChangeWhenAddingAnEAPI{7} \begin{centertable}{EAPIs supporting \t{dodoc -r}} \label{tab:dodoc-table} \begin{tabular}{ll} \toprule \multicolumn{1}{c}{\textbf{EAPI}} & \multicolumn{1}{c}{\textbf{Supports \t{dodoc -r}?}} \\ \midrule 0, 1, 2, 3 & No \\ 4, 5, 6, 7 & Yes \\ \bottomrule \end{tabular} \end{centertable} \ChangeWhenAddingAnEAPI{7} \begin{centertable}{EAPIs supporting \t{doheader} and \t{newheader}} \label{tab:doheader-table} \begin{tabular}{ll} \toprule \multicolumn{1}{c}{\textbf{EAPI}} & \multicolumn{1}{c}{\textbf{Supports \t{doheader} and \t{newheader}?}} \\ \midrule 0, 1, 2, 3, 4 & No \\ 5, 6, 7 & Yes \\ \bottomrule \end{tabular} \end{centertable} \ChangeWhenAddingAnEAPI{7} \begin{centertable}{EAPIs supporting symlinks for \t{doins}} \label{tab:doins-table} \begin{tabular}{ll} \toprule \multicolumn{1}{c}{\textbf{EAPI}} & \multicolumn{1}{c}{\textbf{\t{doins} supports symlinks?}} \\ \midrule 0, 1, 2, 3 & No \\ 4, 5, 6, 7 & Yes \\ \bottomrule \end{tabular} \end{centertable} \ChangeWhenAddingAnEAPI{7} \begin{centertable}{\t{doman} language support options for EAPIs} \label{tab:doman-table} \begin{tabular}{lll} \toprule \multicolumn{1}{c}{\textbf{EAPI}} & \multicolumn{1}{c}{\textbf{Language detection by filename?}} & \multicolumn{1}{c}{\textbf{Option \t{-i18n} takes precedence?}} \\ \midrule 0, 1 & No & Not applicable \\ 2, 3 & Yes & No \\ 4, 5, 6, 7 & Yes & Yes \\ \bottomrule \end{tabular} \end{centertable} \ChangeWhenAddingAnEAPI{7} \begin{centertable}{EAPIs supporting stdin for \t{new*} commands} \label{tab:newfoo-stdin-table} \begin{tabular}{ll} \toprule \multicolumn{1}{c}{\textbf{EAPI}} & \multicolumn{1}{c}{\textbf{\t{new*} can read from stdin?}} \\ \midrule 0, 1, 2, 3, 4 & No \\ 5, 6, 7 & Yes \\ \bottomrule \end{tabular} \end{centertable} \ChangeWhenAddingAnEAPI{7} \begin{centertable}{\t{domo} destination path in EAPIs} \label{tab:domo-path} \begin{tabular}{ll} \toprule \multicolumn{1}{c}{\textbf{EAPI}} & \multicolumn{1}{c}{\textbf{Destination path}} \\ \midrule 0, 1, 2, 3, 4, 5, 6 & \t{\$\{DESTTREE\}/share/locale} \\ 7 & \t{/usr/share/locale} \\ \bottomrule \end{tabular} \end{centertable} \subsection{Commands affecting install destinations} The following commands are used to set the various destination trees and options used by the above installation commands. They must be shell functions or aliases, due to the need to set variables read by the above commands. Ebuilds must not run any of these commands once the current phase function has returned. \begin{description} \item[into] Takes exactly one argument, and sets the value of \t{DESTTREE} for future invocations of the above utilities to it. Creates the directory under \t{\$\{ED\}} in offset-prefix aware EAPIs or under \t{\$\{D\}} in offset-prefix agnostic EAPIs, using \t{install -d} with no additional options, if it does not already exist. Failure behaviour is EAPI dependent as per section~\ref{sec:failure-behaviour}. \item[insinto] As \t{into}, for \t{INSDESTTREE}. \item[exeinto] As \t{into}, for install path of \t{doexe} and \t{newexe}. \item[docinto] As \t{into}, for install subdirectory of \t{dodoc} et al. \item[insopts] Takes one or more arguments, and sets the options passed by \t{doins} et al.\ to the \t{install} command to them. Behaviour upon encountering empty arguments is undefined. \item[diropts] As \t{insopts}, for \t{dodir} et al. \item[exeopts] As \t{insopts}, for \t{doexe} et al. \item[libopts] As \t{insopts}, for \t{dolib} et al. In EAPIs listed in table~\ref{tab:banned-commands-table}, this command is banned as per section~\ref{sec:banned-commands}. \end{description} \subsection{Commands controlling manipulation of files in the staging area} These commands are used to control optional manipulations that the package manager may perform on files in the staging directory \t{ED}, like compressing files or stripping symbols from object files. For each of the operations mentioned below, the package manager shall maintain an inclusion list and an exclusion list, in order to control which directories and files the operation may or may not be performed upon. The initial contents of the two lists is specified below for each of the commands, respectively. Any of these operations shall be carried out after \t{src_install} has completed, and before the execution of any subsequent phase function. For each item in the inclusion list, pretend it has the value of the \t{ED} variable prepended, then: \begin{compactitem} \item If it is a directory, act as if every file or directory immediately under this directory were in the inclusion list. \item If the item is a file, the operation may be performed on it, unless it has been excluded as described below. \item If the item does not exist, it is ignored. \end{compactitem} Whether an item is to be excluded is determined as follows: For each item in the exclusion list, pretend it has the value of the \t{ED} variable prepended, then: \begin{compactitem} \item If it is a directory, act as if every file or directory immediately under this directory were in the exclusion list. \item If the item is a file, the operation shall not be performed on it. \item If the item does not exist, it is ignored. \end{compactitem} The package manager shall take appropriate steps to ensure that any operations that it performs on files in the staging area behave sensibly even if an item is listed in the inclusion list multiple times or if an item is a symlink. \featurelabel{docompress} In EAPIs listed in table~\ref{tab:staging-area-commands} as supporting controllable compression, the package manager may optionally compress a subset of the files under the \t{ED} directory. The package manager shall ensure that its compression mechanisms do not compress a file twice if it is already compressed using the same compressed file format. For compression, the initial values of the two lists are as follows: \begin{compactitem} \item The inclusion list contains \t{/usr/share/doc}, \t{/usr/share/info} and \t{/usr/share/man}. \item The exclusion list contains \t{/usr/share/doc/\$\{PF\}/html}. \end{compactitem} \featurelabel{dostrip} In EAPIs listed in table~\ref{tab:staging-area-commands} as supporting controllable stripping of symbols, the package manager may strip a subset of the files under the \t{ED} directory. For stripping of symbols, the initial values of the two lists are as follows: \begin{compactitem} \item If the \t{RESTRICT} variable described in section~\ref{sec:restrict} enables a \t{strip} token, the inclusion list is empty; otherwise it contains \t{/} (the root path). \item The exclusion list is empty. \end{compactitem} The following commands may be used in \t{src_install} to alter these lists. It is an error to call any of these functions from any other phase. \begin{description} \item[docompress] If the first argument is \t{-x}, add each of its subsequent arguments to the exclusion list for compression. Otherwise, add each argument to the respective inclusion list. Only available in EAPIs listed in table~\ref{tab:staging-area-commands} as supporting \t{docompress}. \item[dostrip] If the first argument is \t{-x}, add each of its subsequent arguments to the exclusion list for stripping of symbols. Otherwise, add each argument to the respective inclusion list. Only available in EAPIs listed in table~\ref{tab:staging-area-commands} as supporting \t{dostrip}. \end{description} \ChangeWhenAddingAnEAPI{7} \begin{centertable}{Commands controlling manipulation of files in the staging area in EAPIs} \label{tab:staging-area-commands} \begin{tabular}{lll} \toprule \multicolumn{1}{c}{\textbf{EAPI}} & \multicolumn{1}{P{13.5em}}{\textbf{Supports controllable compression and \t{docompress}?}} & \multicolumn{1}{P{10.5em}}{\textbf{Supports controllable stripping and \t{dostrip}?}} \\ \midrule 0, 1, 2, 3 & No & No \\ 4, 5, 6 & Yes & No \\ 7 & Yes & Yes \\ \bottomrule \end{tabular} \end{centertable} \subsection{USE list functions} These functions provide behaviour based upon set or unset use flags. Ebuilds must not run any of these commands once the current phase function has returned. It is an error if an ebuild calls any of these functions in global scope. Unless otherwise noted, if any of these functions is called with a flag value that is not included in \t{IUSE_EFFECTIVE}, either behaviour is undefined or it is an error as decided by table~\ref{tab:use-list-strictness}. \begin{description} \item[use] Returns shell true (0) if the first argument (a \t{USE} flag name) is enabled, false otherwise. If the flag name is prefixed with \t{!}, returns true if the flag is disabled, and false if it is enabled. It is guaranteed that this command is quiet. \item[usev] The same as \t{use}, but also prints the flag name if the condition is met. \item[useq] Deprecated synonym for \t{use}. \item[use_with] \featurelabel{use-with} Has one-, two-, and three-argument forms. The first argument is a USE flag name, the second a \t{configure} option name (\t{\$\{opt\}}), defaulting to the same as the first argument if not provided, and the third is a string value (\t{\$\{value\}}). For EAPIs listed in table~\ref{tab:use-with-third-arg} as not supporting it, an empty third argument is treated as if it weren't provided. If the USE flag is set, outputs \t{-{}-with-\$\{opt\}=\$\{value\}} if the third argument was provided, and \t{-{}-with-\$\{opt\}} otherwise. If the flag is not set, then it outputs \t{-{}-without-\$\{opt\}}. The condition is inverted if the flag name is prefixed with~\t{!}; this is valid only for the two- and three-argument forms. \item[use_enable] Works the same as \t{use_with()}, but outputs \t{-{}-enable-} or \t{-{}-disable-} instead of \t{-{}-with-} or \t{-{}-without-}. \item[usex] \featurelabel{usex} Accepts at least one and at most five arguments. The first argument is a USE flag name, any subsequent arguments (\t{\$\{arg2\}} to \t{\$\{arg5\}}) are string values. If not provided, \t{\$\{arg2\}} and \t{\$\{arg3\}} default to \t{yes} and \t{no}, respectively; \t{\$\{arg4\}} and \t{\$\{arg5\}} default to the empty string. If the USE flag is set, outputs \t{\$\{arg2\}\$\{arg4\}}. Otherwise, outputs \t{\$\{arg3\}\$\{arg5\}}. The condition is inverted if the flag name is prefixed with~\t{!}. Only available in EAPIs listed in table~\ref{tab:use-list-functions} as supporting \t{usex}. \item[in_iuse] \featurelabel{in-iuse} Returns shell true (0) if the first argument (a \t{USE} flag name) is included in \t{IUSE_EFFECTIVE}, false otherwise. Only available in EAPIs listed in table~\ref{tab:use-list-functions} as supporting \t{in_iuse}. \end{description} \ChangeWhenAddingAnEAPI{7} \begin{centertable}{EAPI behaviour for use queries not in \t{IUSE_EFFECTIVE}} \label{tab:use-list-strictness} \begin{tabular}{ll} \toprule \multicolumn{1}{c}{\textbf{EAPI}} & \multicolumn{1}{c}{\textbf{Behaviour}} \\ \midrule 0, 1, 2, 3 & Undefined \\ 4, 5, 6, 7 & Error \\ \bottomrule \end{tabular} \end{centertable} \ChangeWhenAddingAnEAPI{7} \begin{centertable}{EAPIs supporting empty third argument in \t{use_with} and \t{use_enable}} \label{tab:use-with-third-arg} \begin{tabular}{ll} \toprule \multicolumn{1}{c}{\textbf{EAPI}} & \multicolumn{1}{c}{\textbf{Supports empty third argument?}} \\ \midrule 0, 1, 2, 3 & No \\ 4, 5, 6, 7 & Yes \\ \bottomrule \end{tabular} \end{centertable} \ChangeWhenAddingAnEAPI{7} \begin{centertable}{EAPIs supporting \t{usex} and \t{in_iuse}} \label{tab:use-list-functions} \begin{tabular}{lll} \toprule \multicolumn{1}{c}{\textbf{EAPI}} & \multicolumn{1}{c}{\textbf{\t{usex}?}} & \multicolumn{1}{c}{\textbf{\t{in_iuse}?}} \\ \midrule 0, 1, 2, 3, 4 & No & No \\ 5 & Yes & No \\ 6, 7 & Yes & Yes \\ \bottomrule \end{tabular} \end{centertable} \subsection{Text list functions} These functions check whitespace-separated lists for a particular value. \begin{description} \item[has] Returns shell true (0) if the first argument (a word) is found in the list of subsequent arguments, false otherwise. Guaranteed quiet. \item[hasv] The same as \t{has}, but also prints the first argument if found. \item[hasq] Deprecated synonym for \t{has}. \end{description} \subsection{Version manipulation and comparison commands} \featurelabel{ver-commands} These commands provide utilities for working with version strings. They must all be implemented internally as shell functions, i.\,e., they are callable in global scope. Availability of these commands per EAPI is listed in table~\ref{tab:version-commands}. For the purpose of version manipulation commands, the specification provides a method for splitting an arbitrary version string (not necessarily conforming to section~\ref{sec:version-spec}) into a series of version components and version separators. A version component consists either purely of digits (\t{[0-9]+}) or purely of uppercase and lowercase ASCII letters (\t{[A-Za-z]+}). A version separator is either a string of any other characters (\t{[\textasciicircum A-Za-z0-9]+}), or it occurs at the transition between a sequence of digits and a sequence of letters, or vice versa. In the latter case, the version separator is an empty string. The version string is processed left-to-right, with the successive version components being assigned successive indices starting with 1. The separator following a version component is assigned the index of the preceding version component. If the first version component is preceded by a non-empty string of version separator characters, this separator is assigned the index 0. The version components are presumed present if not empty. The version separators between version components are always presumed present, even if they are empty. The version separators preceding the first version component and following the last are only presumed present if they are not empty. Whenever the commands support ranges, the range is specified as an unsigned integer, optionally followed by a hyphen (\t{-}), which in turn is optionally followed by another unsigned integer. A single integer specifies a single component or separator index. An integer followed by a hyphen specifies all components or separators starting with the one at the specified index. Two integers separated by a hyphen specify a range starting at the index specified by the first and ending at the second, inclusively. \begin{description} \item[ver_cut] Takes a range as the first argument, and optionally a version string as the second. Prints a substring of the version string starting at the version component specified as start of the range and ending at the version component specified as end of the range. If the version string is not specified, \t{\$\{PVR\}} is used. If the range spans outside the present version components, the missing components and separators are presumed empty. In particular, the range starting at zero includes the zeroth version separator if present, and the range spanning past the last version component includes the suffix following it if present. A range that does not intersect with any present version components yields an empty string. \item[ver_rs] Takes one or more pairs of arguments, optionally followed by a version string. Every argument pair specifies a range and a replacement string. Prints a version string after performing the specified separator substitutions. If the version string is not specified, \t{\$\{PVR\}} is used. For every argument pair specified, each of the version separators present at indices specified by the range is replaced with the replacement string, in order. If the range spans outside the range of present version separators, it is silently truncated. \item[ver_test] Takes two or three arguments. In the 3-argument form, takes an LHS version string, followed by an operator, followed by an RHS version string. In the 2-argument form, the first version string is omitted and \t{\$\{PVR\}} is used as LHS version string. The operator can be \t{-eq} (equal to), \t{-ne} (not equal to), \t{-gt} (greater than), \t{-ge} (greater than or equal to), \t{-lt} (less than) or \t{-le} (less than or equal to). Returns shell true (0) if the specified relation between the LHS and RHS version strings is fulfilled. Both version strings must conform to the version specification in section~\ref{sec:version-spec}. Comparison is done using algorithm~\ref{alg:version-comparison}. \end{description} \ChangeWhenAddingAnEAPI{7} \begin{centertable}{EAPIs supporting version manipulation commands} \label{tab:version-commands} \begin{tabular}{llll} \toprule \multicolumn{1}{c}{\textbf{EAPI}} & \multicolumn{1}{c}{\textbf{\t{ver_cut}?}} & \multicolumn{1}{c}{\textbf{\t{ver_rs}?}} & \multicolumn{1}{c}{\textbf{\t{ver_test}?}} \\ \midrule 0, 1, 2, 3, 4, 5, 6 & No & No & No \\ 7 & Yes & Yes & Yes \\ \bottomrule \end{tabular} \end{centertable} \subsection{Misc commands} The following commands are always available in the ebuild environment, but don't really fit in any of the above categories. Ebuilds must not run any of these commands once the current phase function has returned. \begin{description} \item[dosed] Takes any number of arguments, which can be files or \t{sed} expressions. For each argument, if it names, relative to \t{ED} (offset-prefix aware EAPIs) or \t{D} (offset-prefix agnostic EAPIs) a file which exists, then \t{sed} is run with the current expression on that file. Otherwise, the current expression is set to the text of the argument. The initial value of the expression is \t{s:\$\{ED\}::g} in offset-prefix aware EAPIs and \t{s:\$\{D\}::g} in offset-prefix agnostic EAPIs. In EAPIs listed in table~\ref{tab:banned-commands-table}, this command is banned as per section~\ref{sec:banned-commands}. \item[unpack] Unpacks one or more source archives, in order, into the current directory. For compressed files, creates the target file in the current directory, with the compression suffix removed from its name. After unpacking, must ensure that all filesystem objects inside the current working directory (but not the current working directory itself) have permissions \t{a+r,u+w,go-w} and that all directories under the current working directory additionally have permissions \t{a+x}. Arguments to \t{unpack} are interpreted as follows: \begin{compactitem} \item A filename without path (i.\,e., not containing any slash) is looked up in \t{DISTDIR}. \item An argument starting with the string \t{./} is a path relative to the working directory. \item \featurelabel{unpack-absolute} Otherwise, for EAPIs listed in table~\ref{tab:unpack-behaviour} as supporting absolute and relative paths, the argument is interpreted as a literal path (absolute, or relative to the working directory); for EAPIs listed as \e{not} supporting such paths, \t{unpack} shall abort the build process. \end{compactitem} Any unrecognised file format shall be skipped silently. If unpacking a supported file format fails, \t{unpack} shall abort the build process. \featurelabel{unpack-extensions} Must be able to unpack the following file formats, if the relevant binaries are available: \begin{itemize} \item tar files (\t{*.tar}). Ebuilds must ensure that GNU tar is installed. \item gzip-compressed files (\t{*.gz, *.Z}). Ebuilds must ensure that GNU gzip is installed. \item gzip-compressed tar files (\t{*.tar.gz, *.tgz, *.tar.Z}). Ebuilds must ensure that GNU gzip and GNU tar are installed. \item bzip2-compressed files (\t{*.bz2, *.bz}). Ebuilds must ensure that bzip2 is installed. \item bzip2-compressed tar files (\t{*.tar.bz2, *.tbz2, *.tar.bz, *.tbz}). Ebuilds must ensure that bzip2 and GNU tar are installed. \item zip files (\t{*.zip, *.ZIP, *.jar}). Ebuilds must ensure that Info-ZIP Unzip is installed. \item 7zip files (\t{*.7z, *.7Z}). Ebuilds must ensure that P7ZIP is installed. \item rar files (\t{*.rar, *.RAR}). Ebuilds must ensure that RARLAB's unrar is installed. \item LHA archives (\t{*.LHA, *.LHa, *.lha, *.lzh}). Ebuilds must ensure that the lha program is installed. \item ar archives (\t{*.a}). Ebuilds must ensure that GNU binutils is installed. \item deb packages (\t{*.deb}). Ebuilds must ensure that the deb2targz program is installed on those platforms where the GNU binutils ar program is not available and the installed ar program is incompatible with GNU archives. Otherwise, ebuilds must ensure that GNU binutils is installed. \item lzma-compressed files (\t{*.lzma}). Ebuilds must ensure that XZ Utils is installed. \item lzma-compressed tar files (\t{*.tar.lzma}). Ebuilds must ensure that XZ Utils and GNU tar are installed. \item xz-compressed files (\t{*.xz}). Ebuilds must ensure that XZ Utils is installed. Only for EAPIs listed in table~\ref{tab:unpack-extensions-table} as supporting \t{.xz}. \item xz-compressed tar files (\t{*.tar.xz, *.txz}). Ebuilds must ensure that XZ Utils and GNU tar are installed. Only for EAPIs listed in table~\ref{tab:unpack-extensions-table} as supporting \t{.tar.xz} or \t{.txz}. \end{itemize} It is up to the ebuild to ensure that the relevant external utilities are available, whether by being in the system set or via dependencies. \featurelabel{unpack-ignore-case} \t{unpack} matches filename extensions in a case-insensitive manner, for EAPIs listed such in table~\ref{tab:unpack-behaviour}. \ChangeWhenAddingAnEAPI{7} \begin{centertable}{\t{unpack} behaviour for EAPIs} \label{tab:unpack-behaviour} \begin{tabular}{lll} \toprule \multicolumn{1}{c}{\textbf{EAPI}} & \multicolumn{1}{c}{\textbf{Supports absolute and relative paths?}} & \multicolumn{1}{c}{\textbf{Case-insensitive matching?}} \\ \midrule 0, 1, 2, 3, 4, 5 & No & No \\ 6, 7 & Yes & Yes \\ \bottomrule \end{tabular} \end{centertable} \ChangeWhenAddingAnEAPI{7} \begin{centertable}{\t{unpack} extensions for EAPIs} \label{tab:unpack-extensions-table} \begin{tabular}{llll} \toprule \multicolumn{1}{c}{\textbf{EAPI}} & \multicolumn{1}{c}{\textbf{\t{.xz}?}} & \multicolumn{1}{c}{\textbf{\t{.tar.xz}?}} & \multicolumn{1}{c}{\textbf{\t{.txz}?}} \\ \midrule 0, 1, 2 & No & No & No \\ 3, 4, 5 & Yes & Yes & No \\ 6, 7 & Yes & Yes & Yes \\ \bottomrule \end{tabular} \end{centertable} \item[inherit] See section~\ref{sec:inherit}. \item[default] \featurelabel{default-func} Calls the \t{default_} function for the current phase (see section~\ref{sec:default-phase-funcs}). Must not be called if the \t{default_} function does not exist for the current phase in the current EAPI\@. Only available in EAPIs listed in table~\ref{tab:misc-commands} as supporting \t{default}. \item[einstalldocs] \featurelabel{einstalldocs} Takes no arguments. Installs the files specified by the \t{DOCS} and \t{HTML_DOCS} variables or a default set of files, according to algorithm~\ref{alg:einstalldocs}. If called using \t{nonfatal} and any of the called commands returns a non-zero exit status, returns immediately with the same exit status. Only available in EAPIs listed in table~\ref{tab:misc-commands} as supporting \t{einstalldocs}. \begin{algorithm} \caption{\t{einstalldocs} logic} \label{alg:einstalldocs} \begin{algorithmic}[1] \STATE save the value of the install directory for \t{dodoc} \STATE set the install directory for \t{dodoc} to \t{/usr/share/doc/\$\{PF\}} \IF{the DOCS variable is a non-empty array} \STATE call \t{dodoc -r "\$\{DOCS[@]\}"} \ELSIF{the DOCS variable is a non-empty scalar} \STATE call \t{dodoc -r \$\{DOCS\}} \ELSIF{the DOCS variable is unset} \FORALL{$d$matching the filename expansion of \t{README*} \t{ChangeLog} \t{AUTHORS} \t{NEWS} \t{TODO} \t{CHANGES} \t{THANKS} \t{BUGS} \t{FAQ} \t{CREDITS} \t{CHANGELOG}} \IF{file$d$exists and has a size greater than zero} \STATE call \t{dodoc} with$d$as argument \ENDIF \ENDFOR \ENDIF \STATE set the install directory for \t{dodoc} to \t{/usr/share/doc/\$\{PF\}/html} \IF{the HTML_DOCS variable is a non-empty array} \STATE call \t{dodoc -r "\$\{HTML_DOCS[@]\}"} \ELSIF{the HTML_DOCS variable is a non-empty scalar} \STATE call \t{dodoc -r \$\{HTML_DOCS\}} \ENDIF \STATE restore the value of the install directory for \t{dodoc} \RETURN shell true (0) \end{algorithmic} \end{algorithm} \item[get_libdir] \featurelabel{get-libdir} Prints the libdir name obtained according to algorithm~\ref{alg:get-libdir}. Only available in EAPIs listed in table~\ref{tab:misc-commands} as supporting \t{get_libdir}. \begin{algorithm} \caption{\t{get_libdir} logic} \label{alg:get-libdir} \begin{algorithmic}[1] \STATE let libdir=lib \IF{the ABI environment variable is set} \STATE let libvar=LIBDIR_\$ABI \IF{the environment variable named by libvar is set} \STATE let libdir=the value of the variable named by libvar \ENDIF \ENDIF \STATE print the value of libdir \end{algorithmic} \end{algorithm} \end{description} \ChangeWhenAddingAnEAPI{7} \begin{centertable}{Misc commands for EAPIs} \label{tab:misc-commands} \begin{tabular}{llll} \toprule \multicolumn{1}{c}{\textbf{EAPI}} & \multicolumn{1}{c}{\textbf{\t{default}?}} & \multicolumn{1}{c}{\textbf{\t{einstalldocs}?}} & \multicolumn{1}{c}{\textbf{\t{get_libdir}?}} \\ \midrule 0, 1 & No & No & No \\ 2, 3, 4, 5 & Yes & No & No \\ 6, 7 & Yes & Yes & Yes \\ \bottomrule \end{tabular} \end{centertable} \subsection{Debug commands} The following commands are available for debugging. Normally all of these commands should be no ops; a package manager may provide a special debug mode where these commands instead do something. Ebuilds must not run any of these commands once the current phase function has returned. \begin{description} \item[debug-print] If in a special debug mode, the arguments should be outputted or recorded using some kind of debug logging. \item[debug-print-function] Calls \t{debug-print} with \t{\$1: entering function} as the first argument and the remaining arguments as additional arguments. \item[debug-print-section] Calls \t{debug-print} with \t{now in section \\$*}. \end{description} \subsection{Reserved commands and variables} Except where documented otherwise, all functions and variables that contain any of the following strings (ignoring case) are reserved for package manager use and may not be used or relied upon by ebuilds: \begin{compactitem} \item \t{__} (two underscores) at beginning of string \item \t{abort} \item \t{dyn} \item \t{ebuild} \item \t{hook} \item \t{paludis} \item \t{portage} \item \t{prep} \end{compactitem} % vim: set filetype=tex fileencoding=utf8 et tw=100 spell spelllang=en : %%% Local Variables: %%% mode: latex %%% TeX-master: "pms" %%% LaTeX-indent-level: 4 %%% LaTeX-item-indent: 0 %%% TeX-brace-indent-level: 4 %%% fill-column: 100 %%% End:


text:
Answer: Where can you find this lonely tree on a lake?

The Question: Where can you find this lonely tree on a lake?

format: plain


text:
# Denjoy-Wolff theorem

Wolff–Denjoy theorem

For a domain $\mathcal{D}$ in a complex Banach space $X$ one denotes by $\operatorname {Hol}( \mathcal{D} )$ the set of all holomorphic self-mappings of $\mathcal{D}$ (cf. also Analytic function).

The classical Denjoy–Wolff theorem is the following one-dimensional result: Let $\Delta$ be the open unit disc in the complex plane $\mathbf{C}$. If $F \in \operatorname { Hol } ( \Delta )$ is not the identity and is not an automorphism of $\Delta$ with exactly one fixed point in $\Delta$, then there is a unique point $a$ in the closed unit disc $\overline{\Delta}$ such that the iterates $\{ F ^ { n } \} _ { n = 1 } ^ { \infty }$ of $F$ converge to $a$, uniformly on compact subsets of $\Delta$.

This result is, in fact, a summary of the following three assertions A)–C) due to A. Denjoy and J. Wolff [a9], [a33], [a34], [a35], [a36].

For $\xi \in \partial \Delta$ and $R > 0$, the set

$$\tag{a1} D _ { \xi } = D ( \xi , R ) : = \left\{ z \in \Delta : \frac { | 1 - z \overline { \xi } | ^ { 2 } } { 1 - | z | ^ { 2 } } < R \right\}$$

is called a horocycle at $\xi$ with radius $R$. This set is a disc in $\Delta$ which is internally tangent to $\partial \Delta$ at $\xi$ (cf. also Horocycle).

A) The Wolff–Schwarz lemma: If $F \in \operatorname { Hol } ( \Delta )$ has no fixed point in $\Delta$, then there is a unique unimodular point $a \in \partial \Delta$ such that every horocycle $D _ { a }$ in $\Delta$, internally tangent to $\partial \Delta$ at $a$, is $F$-invariant, i.e.,

$$\tag{a2} F ( D _ { a } ) \subset D _ { a }$$

This assertion is a natural complement of the Julia–Wolff–Carathéodory theorem [a6].

B) If $F \in \operatorname { Hol } ( \Delta )$ has no fixed point in $\Delta$, then there is a unique unimodular point $b \in \partial \Delta$ such that the sequence $\{ F ^ { n } \} _ { n = 1 } ^ { \infty }$ converges to $b$, uniformly on compact subsets of $\Delta$.

C) If $F \in \operatorname { Hol } ( \Delta )$ is not an automorphism of $\Delta$ but has a fixed point $c$ in $\Delta$, then this point is unique in $\Delta$, and the sequence $\{ F ^ { n } \} _ { n = 1 } ^ { \infty }$ converges to $c$ uniformly on compact subsets of $\Delta$. The limit point in B) is sometimes called the Denjoy–Wolff point of $F$.

The point $a$ in A) and the point $b$ in B) are one and the same. However, this is not always the case in higher-dimensional situations.

Therefore, in the general case, the point $a$ in A) is usually called the sink point of $F$. So, the sink point is the Denjoy–Wolff point if it is also attractive.

By using the Schwarz lemma, assertion C) can be rephrased as follows:

D) Let $F \in \operatorname { Hol } ( \Delta )$ have a fixed point $c \in \Delta$. If $F$ is not the identity, then $F$ is power convergent if and only if $| F ^ { \prime } ( c ) | < 1$.

Since 1926, these results have been developed in several directions. For a nice exposition of the one-dimensional case see [a5].

When $X = \mathcal{H}$ is a complex Hilbert space with the inner product $( \, . \, , \, . \, )$, and $\mathbf{B}$ is its open unit ball, the following generalization of the Wolff–Schwarz lemma is due to K. Goebel [a13]: If $F \in \operatorname { Hol } ( \bf B )$ has no fixed point, then there exists a unique point $a \in \partial \bf B$ such that for each $0 < R < \infty$ the set

$$\tag{a3} E ( a , R ) = \left\{ x \in \mathbf{B} : \frac { | 1 - ( x , a ) | ^ { 2 } } { 1 - \| x \| ^ { 2 } } < R \right\}$$

is $F$-invariant.

Geometrically, the set $E ( a , R )$ is an ellipsoid the closure of which intersects the unit sphere $\partial \bf B$ at the point $a$. It is a natural analogue of the horocycle $D ( a , R )$.

In the finite-dimensional case, $\mathcal{H} = \mathbf{C} ^ { n }$, the sink point $a$ is also the Denjoy–Wolff point of $F$; see [a14], [a24], [a20], [a7].

For infinite-dimensional Hilbert balls, A. Stachura [a30] has given a counterexample to show that the convergence result fails even for biholomorphic self-mappings.

Nevertheless, some restrictions on a mapping from $\operatorname{Hol} ( \mathbf{B} )$ lead to a generalization of assertion B). In particular, C.-H. Chu and P. Mellon [a8] showed that if $F \in \operatorname { Hol } ( \bf B )$ is a compact mapping with no fixed point in $\mathbf{B}$, then the sink point $a$ in (a3) is attractive in the topology of locally uniform convergence. For weak convergence results see, for example, [a12].

In 1941, M.H. Heins [a15] extended the Denjoy–Wolff theorem to a finitely connected domain bounded by Jordan curves in $\mathbf{C}$ (cf. also Jordan curve). His approach is specific to the one-dimensional case.

Another look at the Denjoy–Wolff theorem is provided by a useful result of P. Yang [a38] concerning a characterization of the horocycle in terms of the Poincaré hyperbolic metric in $\Delta$ (cf. also Poincaré model). More precisely, he established the following formula:

$$\tag{a4} \operatorname { lim } _ { \mu \rightarrow \alpha } [ \rho ( \lambda , \mu ) - \rho ( 0 , \mu ) ] = \frac { 1 } { 2 } \operatorname { log } \frac { | 1 - \lambda \overline { a }| ^ { 2 } } { 1 - | \lambda | ^ { 2 } }.$$

So, in these terms the horocycle $D _ { a }$ in $\Delta$ can be described by the formula

$$\tag{a5} D ( a , R ) =$$

\begin{equation*} = \left\{ z \in \Delta : \operatorname { lim } _ { \omega \rightarrow a } [ \rho ( z , \omega ) - \rho ( 0 , \omega ) ] < \frac { 1 } { 2 } \operatorname { log } R \right\}. \end{equation*}

Since a hyperbolic metric can be defined in each bounded domain in $\mathbf{C} ^ { n }$, one can try to extend this formula and use it as a definition of the horosphere in a domain in $\mathbf{C} ^ { n }$. Unfortunately, in general the limit in (a4) does not exist.

To overcome this difficulty, M. Abate [a1] introduced two kinds of horospheres. More precisely, he defined the small horosphere $E _ { z _ { 0 } } ( x , R )$ of centre $x$, pole $z_0$ and radius $R$ by the formula

\begin{equation*} E _ { z _ { 0 } } ( x , R ) = \end{equation*}

\begin{equation*} = \left\{ z \in \mathcal{D} : \operatorname { limsup } _ { w \rightarrow x } [ K _ { \mathcal{D} } ( z , w ) - K _ { \mathcal{D} } ( z _ { 0 } , w ) ] < \frac { 1 } { 2 } \operatorname { log } R \right\}, \end{equation*}

and the big horosphere $F _ { z _ { 0 } } ( x , R )$ of centre $x$, pole $z_0$ and radius $R$ by the formula

\begin{equation*} F _ { z _ { 0 } } ( x , R ) = \end{equation*}

\begin{equation*} = \{ z \in {\cal D} : \operatorname { lim\,inf } _ { w \rightarrow x } [ K _ {\cal D } ( z , w ) - K _ {\cal D } ( z_0 , w ) ] < \frac { 1 } { 2 } \operatorname { log } R \}, \end{equation*}

where $\mathcal{D}$ is a bounded domain in $\mathbf{C} ^ { n }$ and $K _ { \mathcal{D} }$ is its Kobayashi metric (cf. Hyperbolic metric). For the Euclidean ball in $\mathbf{C} ^ { n }$, $E _ { z _ { 0 } } ( x , R ) = F _ { z _ { 0 } } ( x , R )$.

Thus, each assertion which states for a domain $\mathcal{D}$ in $\mathbf{C} ^ { n }$ the existence of a point $a \in \partial \mathcal{D}$ such that

$$\tag{a6} F ^ { n } ( E _ { z } ( a , R ) ) \subset F _ { z } ( a , R )$$

for all $z \in \mathcal{D}$, $R > 0$, $F \in \operatorname{Hol} ( {\cal D} )$ and $n = 1,2 , \dots$ is a generalization of the Wolff–Schwarz lemma. This is true, for example, for a bounded convex domain in $\mathbf{C} ^ { n }$ [a1]. However, in this case B) does not hold in general. Nevertheless, the convergence result does hold for bounded strongly convex $C ^ { 2 }$ domains, and for strongly pseudo-convex hyperbolic domains with a $C ^ { 2 }$ boundary [a1], [a2].

Assertion A) can be generalized to the operator ball over a Hilbert space $\mathcal{H}$ and, more generally, to the open unit ball $U$ of a so-called $J ^ { * }$-algebra (see [a37], [a25] and the references there), while B) fails in general even if the compactness of $F$ is assumed [a8].

For the particular case when $F$ is defined by the Riesz–Dunford integral in the sense of the functional calculus (cf. also Dunford integral), a full analogue of the Denjoy–Wolff theorem is due to K. Fan [a10], [a11].

For general Banach spaces there are examples showing that there are situations where even a sink point does not exist [a22].

However, the question is still open (as of 2000) for reflexive Banach spaces. Moreover, when $\mathcal{D}$ is the open unit ball of a strictly convex Banach space $X$ and $F$ is compact or, more generally, condensing (cf. also Contraction operator), then the analogue of B) is valid [a16], [a17], [a18].

The situation is more fully understood when $F$ has a fixed point $c$ inside a bounded domain $\mathcal{D} \subset X$.

Simple examples show that one cannot always expect $c$ to be an attractive fixed point, even if $F$ is not an automorphism. Nevertheless, rephrasing C) in the form D), one can show (see, for example, [a22]) that $c$ is an attractive fixed point of $F$ if and only if the spectral radius of the Fréchet derivative $F ^ { \prime } ( c )$ is strictly less than $1$.

In the one-dimensional case, if $F \in \operatorname{Hol} ( {\cal D} )$ is not the identity, has an interior fixed point and is power convergent, then $c$ is unique. However, this is no longer true in higher dimensions.

A full description of such a situation was obtained by E. Vesentini [a32]: Suppose that $F$ has a fixed point $c \in \mathcal{D}$, and denote the spectrum of the linear operator $F ^ { \prime } ( c )$ by $\sigma ( F ^ { \prime } ( c ) )$ (cf. also Spectrum of an operator). Then $F$ is power convergent if and only if the following two conditions hold:

i) $\sigma ( F ^ { \prime } ( c ) ) \subset \Delta \cup \{ 1 \}$; and

ii) $1$ is a pole of the resolvent of $F ^ { \prime } ( c )$ of order at most one.

Condition ii) is actually equivalent to the condition

\begin{equation*} \operatorname { Ker } ( I - F ^ { \prime } ( c ) ) \bigoplus \operatorname { Im } ( I - F ^ { \prime } ( c ) ) = X \end{equation*}

(see, for example, [a23]). It is also known that conditions i) and ii) are equivalent to $F ^ { \prime } ( c )$ being power-convergent to a projection $P$ onto $\operatorname { Ker } ( I - F ^ { \prime } ( c ) )$. So, if the retraction $R \in \operatorname { Hol } ( \mathcal{D} )$ is the limit point of $\{ F ^ { n } \}$ under these conditions, then $R = c$ is constant if and only if $P = 0$.

The family $\{ F ^ { n } \} _ { n = 1 } ^ { \infty }$ of iterates of $F \in \operatorname{Hol} ( {\cal D} )$ can be considered a one-parameter discrete sub-semi-group of $\operatorname {Hol}( \mathcal{D} )$ (cf. also Semi-group of holomorphic mappings). Therefore, another direction is concerned with analogues of the Denjoy–Wolff theorem for continuous semi-groups of holomorphic self-mappings of $D$. This approach has been used to study the asymptotic behaviour of solutions to Cauchy problems (see, for example, [a4], [a2], [a3], [a21], [a26], [a27], and [a18]). E. Berkson and H. Porta [a4] have applied their continuous analogue of the Denjoy–Wolff theorem to the study of the eigenvalue problem for composition operators on Hardy spaces.

For results on the asymptotic behaviour (in the spirit of the Denjoy–Wolff theorem) of (not necessarily holomorphic) mappings and semi-groups that are non-expansive with respect to hyperbolic metrics, see, for example, [a19], [a28], [a29], [a31].

#### References

 [a1] M. Abate, "Horospheres and iterates of holomorphic maps" Math. Z. , 198 (1988) pp. 225–238 [a2] M. Abate, "Converging semigroups of holomorphic maps" Atti Accad. Naz. Lincei , 82 (1988) pp. 223–227 [a3] M. Abate, "The infinitesimal generators of semigroups of holomorphic maps" Ann. Mat. Pura Appl. , 161 (1992) pp. 167–180 [a4] E. Berkson, H. Porta, "Semigroups of analytic functions and composition operators" Michigan Math. J. , 25 (1978) pp. 101–115 [a5] R.B. Burckel, "Iterating analytic self-maps of discs" Amer. Math. Monthly , 88 (1981) pp. 396–407 [a6] C.C. Cowen, B.D. MacCluer, "Composition operators on spaces of analytic functions" , CRC (1995) [a7] G.N. Chen, "Iteration for holomorphic maps of the open unit ball and the generalized upper half-plane of $\mathbf{C} ^ { n }$" J. Math. Anal. Appl. , 98 (1984) pp. 305–313 [a8] C.-H. Chu, P. Mellon, "Iteration of compact holomorphic maps on a Hilbert ball" Proc. Amer. Math. Soc. , 125 (1997) pp. 1771–1777 [a9] A. Denjoy, "Sur l'itération des fonctions analytiques" C.R. Acad. Sci. Paris , 182 (1926) pp. 255–257 [a10] K. Fan, "Iteration of analytic functions of operators I" Math. Z. , 179 (1982) pp. 293–298 [a11] K. Fan, "Iteration of analytic functions of operators II" Linear and Multilinear Algebra , 12 (1983) pp. 295–304 [a12] K. Goebel, S. Reich, "Uniform convexity, hyperbolic geometry and nonexpansive mappings" , M. Dekker (1984) [a13] K. Goebel, "Fixed points and invariant domains of holomorphic mappings of the Hilbert ball" Nonlin. Anal. , 6 (1982) pp. 1327–1334 [a14] M. Hervé, "Quelques propriétés des applications analytiques d'une boule à $m$ dimensions dans elle-même" J. Math. Pures Appl. , 42 (1963) pp. 117–147 [a15] M.H. Heins, "On the iteration of functions which are analytic and single-valued in a given multiply-connected region" Amer. J. Math. , 63 (1941) pp. 461–480 [a16] J. Kapeluszny, T. Kuczumow, S. Reich, "The Denjoy–Wolff theorem in the open unit ball of a strictly convex Banach space" Adv. Math. , 143 (1999) pp. 111–123 [a17] J. Kapeluszny, T. Kuczumow, S. Reich, "The Denjoy–Wolff theorem for condensing holomorphic mappings" J. Funct. Anal. , 167 (1999) pp. 79–93 [a18] T. Kuczumow, S. Reich, D. Shoikhet, "The existence and non-existence of common fixed points for commuting families of holomorphic mappings" Nonlin. Anal. (in press) [a19] T. Kuczumow, A. Stachura, "Iterates of holomorphic and $k _ { D }$-nonexpansive mappings in convex domains in $\mathbf{C} ^ { n }$" Adv. Math. , 81 (1990) pp. 90–98 [a20] Y. Kubota, "Iteration of holomorphic maps of the unit ball into itself" Proc. Amer. Math. Soc. , 88 (1983) pp. 476–480 [a21] V. Khatskevich, S. Reich, D. Shoikhet, "Asymptotic behavior of solutions of evolution equations and the construction of holomorphic retractions" Math. Nachr. , 189 (1998) pp. 171–178 [a22] V. Khatskevich, D. Shoikhet, "Differentiable operators and nonlinear equations" , Birkhäuser (1994) [a23] Yu. Lyubich, J. Zemanek, "Precompactness in the uniform ergodic theory" Studia Math. , 112 (1994) pp. 89–97 [a24] B.D. MacCluer, "Iterates of holomorphic self-maps of the unit ball in $\mathbf{C} ^ { n }$" Michigan Math. J. , 30 (1983) pp. 97–106 [a25] P. Mellon, "Another look at results of Wolff and Julia type for $J ^ { * }$-algebras" J. Math. Anal. Appl. , 198 (1996) pp. 444–457 [a26] S. Reich, D. Shoikhet, "Semigroups and generators on convex domains with the hyperbolic metric" Atti Accad. Naz. Lincei , 8 (1997) pp. 231–250 [a27] S. Reich, D. Shoikhet, "The Denjoy–Wolff theorem" Ann. Univ. Mariae Curie–Skłodowska , 51 (1997) pp. 219–240 [a28] S. Reich, "Averaged mappings in the Hilbert ball" J. Math. Anal. Appl. , 109 (1985) pp. 199–206 [a29] S. Reich, "The asymptotic behavior of a class of nonlinear semigroups in the Hilbert ball" J. Math. Anal. Appl. , 157 (1991) pp. 237–242 [a30] A. Stachura, "Iterates of holomorphic self-maps of the unit ball in Hilbert space" Proc. Amer. Math. Soc. , 93 (1985) pp. 88–90 [a31] R. Sine, "Behavior of iterates in the Poincaré metric" Houston J. Math. , 15 (1989) pp. 273–289 [a32] E. Vesentini, "Su un teorema di Wolff e Denjoy" Rend. Sem. Mat. Fis. Milano , 53 (1983) pp. 17–26 [a33] J. Wolff, "Sur l'itération des fonctions holomorphes dans une région, et dont les valeurs appartiennent à cette région" C.R. Acad. Sci. Paris , 182 (1926) pp. 42–43 [a34] J. Wolff, "Sur l'itération des fonctions bornées" C.R. Acad. Sci. Paris , 182 (1926) pp. 200–201 [a35] J. Wolff, "Sur une généralisation d'un théorème de Schwarz" C.R. Acad. Sci. Paris , 182 (1926) pp. 918–920 [a36] J. Wolff, "Sur une généralisation d'un théorème de Schwarz" C.R. Acad. Sci. Paris , 183 (1926) pp. 500–502 [a37] K. Wlodarczyk, "Julia's lemma and Wolff's theorem for $J ^ { * }$-algebras" Proc. Amer. Math. Soc. , 99 (1987) pp. 472–476 [a38] P. Yang, "Holomorphic curves and boundary regularity of biholomorphic maps of pseudoconvex domains" preprint (1978)
How to Cite This Entry:
Denjoy-Wolff theorem. Encyclopedia of Mathematics. URL: http://encyclopediaofmath.org/index.php?title=Denjoy-Wolff_theorem&oldid=49926
This article was adapted from an original article by Simeon ReichDavid Shoikhet (originator), which appeared in Encyclopedia of Mathematics - ISBN 1402006098. See original article


text:
# What is the effective axiomatization in Godel's incompleteness theorem?

I've been always curious about Godel's incompleteness theorem and today, I decided to understand it. To understand the theorem, I started from the concepts of propositional logic and predicate logic. So to speak, I was a complete novice in mathematical logic before.

I studied through to the point that Godel's theorem states that the set of axioms cannot satisfy three conditions at the same time: 1. effective axiomatization 2. completeness 3. consistency.

I think I understand what they mean: The effective axiomatization is the existence of an algorithm that can enumerate all the theorems derived from the set of axioms. The completeness is that any statement in the language of the axioms can be proved or disproved. The consistency means that statement cannot be proved and disproved at the same time under the set of axioms.

I can connect with the concepts of completeness and consistency. Completeness is what Godel's theorem tries to disprove. Consistency seems quite natural because if it's not, the axioms are absurd as the system of axioms can't be used for proof. But I don't quite understand why we need effective axiomatization.

Can somebody please explain to me why we need effective axiomatization for Godel's theorem? And what's the implication of the condition?

• Very roughly, we demand a algorithmic simplicity to the set of axioms because without that, you could, say, take the set of true sentences in the natural numbers as your set of axioms for arithmetic, in which case you'd have a complete, consistent, and totally useless, axiomatization. We want to be able to recognize valid proofs, so we need to be able to identify which formulas are axioms as part of that.
– Ned
Jun 27, 2020 at 15:04

It is easy to come up with a consistent and complete set of axioms. Usually Gödel's incompleteness theorem is phrased in terms of Peano arithmetic, which is supposed to axiomatise arithmetic in the natural numbers. So let's take that as an example. Let $$\mathcal{L}$$ be the language of Peano arithmetic and let $$T$$ be the set of all $$\mathcal{L}$$-sentences that are true in the natural numbers. Then for every sentence $$\phi$$ either $$\phi \in T$$ or $$\neg \phi \in T$$. So this system is complete, and it is clearly consistent because it has the natural numbers as a model. The point is of course that this is not effective.
So we have seen a reason why this assumption is necessary. We can also find a reason in the proof of the incompleteness theorem. It roughly goes as follows*. We can code the algorithm internally in our system (so the system also needs to be strong enough to be able to do this). What this means is that there is some formula $$\operatorname{Thm}(n, t)$$ that says "$$t$$ is the $$n$$th theorem on our list". Then the formula $$\exists n \operatorname{Thm}(n, t)$$ says "$$t$$ is a theorem of our system". So the system is able to talk about its own theorems! This then gives the famous "liar paradox" by constructing a sentence $$G$$ that is equivalent to $$\neg \exists n \operatorname{Thm}(n, G)$$. That is, $$G$$ is equivalent to the assertion that $$G$$ is not a theorem of our system. As you can see, this all heavily relies on our algorithm that enumerates all theorems, and on the fact that algorithms can be coded internally in our system.


text:
# atomica.utils¶

Define utility classes used throughout Atomica

Functions

 evaluate_plot_string(plot_string) Evaluate a plotting output specification format_duration(t[, pluralize]) User-friendly string format of a duration nested_loop(inputs, loop_order) Zip list of lists in order

Classes

 NDict(*args, **kwargs) Store and sync items with a name property NamedItem([name]) TimeSeries([t, vals, units, assumption, sigma]) Class to store time-series data
class atomica.utils.NDict(*args, **kwargs)[source]

Store and sync items with a name property

append(value)[source]

Support an append method, like a list

copy(old, new)[source]

Copy an item and return the copy

Parameters
• old – The key of the existing item

• new – The new name for the item

Returns

The copied item

Example usage: >>> new_parset = proj.parsets.copy(‘old_name’,’new_name’)

class atomica.utils.NamedItem(name=None)[source]
copy(name=None)[source]
class atomica.utils.TimeSeries(t=None, vals=None, units=None, assumption=None, sigma=None)[source]

Class to store time-series data

Internally values are stored as lists rather than numpy arrays because insert/remove operations on lists tend to be faster (and working with sparse data is a key role of TimeSeries objects). Note that methods like interpolate() return numpy arrays, so the output types from such functions should generally match up with what is required by the calling function.

Parameters
• t – Optionally specify a scalar, list, or array of time values

• vals – Optionally specify a scalar, list, or array of values (must be same size as t)

• units (Optional[str]) – Optionally specify units (as a string)

• assumption (Optional[float]) – Optionally specify a scalar assumption

• sigma (Optional[float]) – Optionally specify a scalar uncertainty

_sampled = None

Flag to indicate whether sampling has been performed. Once sampling has been performed, cannot sample again

assumption = None

The time-independent scalar assumption

copy()[source]

Return a copy of the TimeSeries

Returns

An independent copy of the TimeSeries

get(t)[source]

Retrieve value at a particular time

This function will automatically retrieve the value of the assumption if no time specific values have been provided, or if any time specific values are provided, will return the value entered at that time. If time specific values have been entered and the requested time is not explicitly present, an error will be raised.

This function may be deprecated in future because generally it is more useful to either call TimeSeries.interpolate() if interested in getting values at arbitrary times, or TimeSeries.get_arrays() if interested in retrieving values that have been entered.

Parameters

t – A time value. If None, will return assumption regardless of whether time data has been entered or not

Return type

float

Returns

The value at the corresponding time. Returns None if the value no value present

get_arrays()[source]

Return arrays with the contents of this TimeSeries

The TimeSeries instance may have time values, or may simply have an assumption. If obtaining raw arrays is desired, this function will return arrays with values extracted from the appropriate attribute of the TimeSeries. However, in general, it is usually .interpolate() that is desired, rather than .get_arrays()

Returns

Tuple with two arrays - the first item is times (with a single NaN if the TimeSeries only has an assumption) and the second item is values

property has_data

Check if any data has been provided

Return type

bool

Returns

True if any data has been entered (assumption or time-specific)

property has_time_data

Check if time-specific data has been provided

Unlike has_data, this will return False if only an assumption has been entered

Return type

bool

Returns

True if any time-specific data has been entered

insert(t, v)[source]

Insert a value at a particular time

If the value already exists in the TimeSeries, it will be overwritten/updated. The arrays are internally sorted by time value, and this order will be maintained.

Parameters
• t – Time value to insert or update. If None, the value will be assigned to the assumption

• v – Value to insert. If None, this function will return immediately without doing anything

Return type

None

interpolate(t2, method='linear', **kwargs)[source]

Return interpolated values

This method returns interpolated values from the time series at time points t2 according to a given interpolation method. There are 4 possibilities for the method

• ‘linear’ - normal linear interpolation (with constant, zero-gradient extrapolation)

• ‘pchip’ - legacy interpolation with some curvature between points (with constant, zero-gradient extrapolation)

• ‘previous’ - stepped interpolation, maintain value until the next timepoint is reached (with constant, zero-gradient extrapolation)

• Interpolation class or generator function

That final option allows the use of arbitrary interpolation methods. The underlying call will be

c = method(t1, v1, **kwargs) return c(t2)

so for example, if you wanted to use the base Scipy pchip method with no extrapolation, then could pass in

>>> TimeSeries.interpolate(...,method=scipy.interpolate.PchipInterpolator)

Note that the following special behaviours apply:

• If there is no data at all, this function will return np.nan for all requested time points

• If only an assumption exists, this assumption will be returned for all requested time points

• Otherwise, arrays will be formed with all finite time values
• If no finite time values remain, an error will be raised (in general, a TimeSeries should not store such values anyway)

• If only one finite time value remains, then that value will be returned for all requested time points

• Otherwise, the specified interpolation method will be used

Parameters
• t2 (<built-in function array>) – float, list, or array, with times

• method – A string ‘linear’, ‘pchip’ or ‘stepped’ OR a callable item that returns an Interpolator

Return type

<built-in function array>

Returns

array the same length as t2, with interpolated values

remove(t)[source]

Remove single time point

Parameters

t – Time value to remove. Set to None to remove the assumption

Return type

None

remove_after(t_remove)[source]

Remove times from start

Parameters

tval – Remove times up to but not including this time

Return type

None

remove_before(t_remove)[source]

Remove times from start

Parameters

tval – Remove times up to but not including this time

Return type

None

remove_between(t_remove)[source]

Remove a range of times

Note that the endpoints are not included

Parameters

t_remove – two element iterable e.g. array, with [min,max] times

Return type

None

sample(constant=True)[source]

Return a sampled copy of the TimeSeries

This method returns a copy of the TimeSeries in which the values have been perturbed based on the uncertainty value.

Parameters

constant – If True, time series will be perturbed by a single constant offset. If False, an different perturbation will be applied to each time specific value independently.

Returns

A copied TimeSeries with perturbed values

sigma = None

Uncertainty value, assumed to be a standard deviation

t = None

Sorted array of time points. Normally interacted with via methods like insert()

units = None

The units of the quantity

vals = None

Time-specific values - indices correspond to self.t

atomica.utils.evaluate_plot_string(plot_string)[source]

Evaluate a plotting output specification

The plots in the framework are specified as strings - for example,

>>> plot_string = "{'New active DS-TB':['pd_div:flow','nd_div:flow']}"

This needs to be (safely) evaluated so that the actual dict can be used. This function evaluates a string like this and returns a variable accordingly. For example

>>> x = evaluate_plot_string("{'New active DS-TB':['pd_div:flow','nd_div:flow']}")

is the same as

>>> x = {'New active DS-TB':['pd_div:flow','nd_div:flow']}

This will only happen if tokens associated with dicts and lists are present - otherwise the original string will just be returned directly

Parameters

plot_string (str) – A string representation of Python structures (e.g., lists, dicts)

Returns

Evaluated expression, the same as if it has originally been entered in a .py file

atomica.utils.format_duration(t, pluralize=False)[source]

User-friendly string format of a duration

This helper function is used when displaying durations in plots. It takes in a duration in units of years, and returns a string representation in user-friendly units. This function is mainly intended to be used to format denominators e.g., going from ‘probability’ and ‘1/365’ to ‘probability/day’

Parameters
• t (float) – A duration in units of years

• pluralize – Always return a plural suffix

Return type

str

Returns

A string

Example usage:

>>> format_duration(1)
'year'
>>> format_duration(1, pluralize=True)
'years'
>>> format_duration(1/365)
'day'
>>> format_duration(2/365)
'2 days'
>>> format_duration(1.5/52)
'1.5 weeks'
>>> format_duration(2/52)
'fortnight'
>>> format_duration(2.5/12)
'2.5 months'

atomica.utils.nested_loop(inputs, loop_order)[source]

Zip list of lists in order

This is used in plot_bars() to control whether ‘times’ or ‘results’ are the outer grouping. This function takes in a list of lists to iterate over, and their nesting order. It then yields tuples of items in the given order. Only tested for two levels (which are all that get used in plot_bars() but in theory supports an arbitrary number of items.

Parameters
• inputs – List of lists. All lists should have the same length

• loop_order – Nesting order for the lists

Returns

Generator yielding tuples of items, one for each list

Example usage:

>>> list(nested_loop([['a','b'],[1,2]],[0,1]))
[['a', 1], ['a', 2], ['b', 1], ['b', 2]]

Notice how the first two items have the same value for the first list while the items from the second list vary. If the loop_order is reversed, then:

>>> list(nested_loop([['a','b'],[1,2]],[1,0]))
[['a', 1], ['b', 1], ['a', 2], ['b', 2]]

Notice now how now the first two items have different values from the first list but the same items from the second list.

atomica.utils.parent_dir()[source]


text:
Nicky from Westende Junior School approached this problem very logically. He wrote:

Subtract the value of the numbers from each of the five number plates.
So, for the illustrated car,
$2+0+8=10$ $65-10=55$ so S+V+B+J=$55$.

And for the 4 other cars
$2+5+3=10$ $65-10=55$ so V+H+D+S=$55$
$5+1+6=12$ $65-12=53$ so R+J+S+H=$53$
$2+0+2=4$ $65-4=61$ so V+B+D+S=$61$
$9+6+8=23$ $65-23=42$ so T+H+T+R=$42$.

Look at the letters on the two number plates beginning with V (VHDS & VBDS). There is only one letter different. The plate with H has a value 6 less than the one with a B, so that implies the alphabet has been written backwards as the numbers increase e.g.
$1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26$
Z Y X W V U T S R Q P O N M L K J I H G F E D C B A

Check this solution works for the $5$ number plates which add up to $65$. It does.
Use the code to find the value of the two new number plates:
T$584$YME and P$214$DOR both add up to $62$.

Excellent reasoning Nicky, although you were lucky you picked Z as $1$ to start with! Bronya from Tattingstone School used a similar method and noticed that it seemed to be that the closer the letter is to the beginning of the alphabet, the bigger the amount it is worth. She then tried A = $26$, B = $25$ etc as Nicky did.

Many of you read the clue and worked from there. Very sensible! Leila and Sheya from St Andrew's C of E Primary School in Totteridge told us:

First we tried A=$1$ B=$2$ C=$3$ and so on but that did not work.
Then we tried A=$2$ B=$3$ C=$4$ and so on but that did not work either.
The we tried the alphabet in reverse order A=$26$ B=$25$ C=$24$ and so on and that worked!
Then using the code we worked out the total of the bottom number plates:
T$584$YME=$7+5+8+4+2+14+22$=$62$
P$214$DOR=$11+2+1+4+23+12+9$=$62$

I wonder if you read the clue, girls?!