Update Lorax documentation - 24.1
This commit is contained in:
parent
8ab53eb3b1
commit
76362a8dd2
@ -1,4 +1,4 @@
|
|||||||
# Sphinx build info version 1
|
# Sphinx build info version 1
|
||||||
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
|
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
|
||||||
config: 4551e3a239e6fc5ed4241438c4f07bb3
|
config: a09c162d23fb15b626e4b201ce80537f
|
||||||
tags: 645f666f9bcd5a90fca523b33c5a78b7
|
tags: 645f666f9bcd5a90fca523b33c5a78b7
|
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
|
||||||
<title>Overview: module code — Lorax 23.12 documentation</title>
|
<title>Overview: module code — Lorax 24.1 documentation</title>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<link rel="top" title="Lorax 23.12 documentation" href="../index.html"/>
|
<link rel="top" title="Lorax 24.1 documentation" href="../index.html"/>
|
||||||
|
|
||||||
|
|
||||||
<script src="_static/js/modernizr.min.js"></script>
|
<script src="_static/js/modernizr.min.js"></script>
|
||||||
@ -195,7 +195,7 @@
|
|||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var DOCUMENTATION_OPTIONS = {
|
var DOCUMENTATION_OPTIONS = {
|
||||||
URL_ROOT:'../',
|
URL_ROOT:'../',
|
||||||
VERSION:'23.12',
|
VERSION:'24.1',
|
||||||
COLLAPSE_INDEX:false,
|
COLLAPSE_INDEX:false,
|
||||||
FILE_SUFFIX:'.html',
|
FILE_SUFFIX:'.html',
|
||||||
HAS_SOURCE: true
|
HAS_SOURCE: true
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
|
||||||
<title>pylorax — Lorax 23.12 documentation</title>
|
<title>pylorax — Lorax 24.1 documentation</title>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<link rel="top" title="Lorax 23.12 documentation" href="../index.html"/>
|
<link rel="top" title="Lorax 24.1 documentation" href="../index.html"/>
|
||||||
<link rel="up" title="Module code" href="index.html"/>
|
<link rel="up" title="Module code" href="index.html"/>
|
||||||
|
|
||||||
|
|
||||||
@ -311,7 +311,8 @@
|
|||||||
<span class="n">add_templates</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
<span class="n">add_templates</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
||||||
<span class="n">add_template_vars</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
<span class="n">add_template_vars</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
||||||
<span class="n">add_arch_templates</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
<span class="n">add_arch_templates</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
||||||
<span class="n">add_arch_template_vars</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span>
|
<span class="n">add_arch_template_vars</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
||||||
|
<span class="n">verify</span><span class="o">=</span><span class="bp">True</span><span class="p">):</span>
|
||||||
|
|
||||||
<span class="k">assert</span> <span class="bp">self</span><span class="o">.</span><span class="n">_configured</span>
|
<span class="k">assert</span> <span class="bp">self</span><span class="o">.</span><span class="n">_configured</span>
|
||||||
|
|
||||||
@ -444,6 +445,13 @@
|
|||||||
<span class="n">logger</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s">"cleaning unneeded files"</span><span class="p">)</span>
|
<span class="n">logger</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s">"cleaning unneeded files"</span><span class="p">)</span>
|
||||||
<span class="n">rb</span><span class="o">.</span><span class="n">cleanup</span><span class="p">()</span>
|
<span class="n">rb</span><span class="o">.</span><span class="n">cleanup</span><span class="p">()</span>
|
||||||
|
|
||||||
|
<span class="k">if</span> <span class="n">verify</span><span class="p">:</span>
|
||||||
|
<span class="n">logger</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s">"verifying the installroot"</span><span class="p">)</span>
|
||||||
|
<span class="k">if</span> <span class="ow">not</span> <span class="n">rb</span><span class="o">.</span><span class="n">verify</span><span class="p">():</span>
|
||||||
|
<span class="n">sys</span><span class="o">.</span><span class="n">exit</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span>
|
||||||
|
<span class="k">else</span><span class="p">:</span>
|
||||||
|
<span class="n">logger</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s">"Skipping verify"</span><span class="p">)</span>
|
||||||
|
|
||||||
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">debug</span><span class="p">:</span>
|
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">debug</span><span class="p">:</span>
|
||||||
<span class="n">rb</span><span class="o">.</span><span class="n">writepkgsizes</span><span class="p">(</span><span class="n">joinpaths</span><span class="p">(</span><span class="n">logdir</span><span class="p">,</span> <span class="s">"final-pkgsizes.txt"</span><span class="p">))</span>
|
<span class="n">rb</span><span class="o">.</span><span class="n">writepkgsizes</span><span class="p">(</span><span class="n">joinpaths</span><span class="p">(</span><span class="n">logdir</span><span class="p">,</span> <span class="s">"final-pkgsizes.txt"</span><span class="p">))</span>
|
||||||
|
|
||||||
@ -598,7 +606,7 @@
|
|||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var DOCUMENTATION_OPTIONS = {
|
var DOCUMENTATION_OPTIONS = {
|
||||||
URL_ROOT:'../',
|
URL_ROOT:'../',
|
||||||
VERSION:'23.12',
|
VERSION:'24.1',
|
||||||
COLLAPSE_INDEX:false,
|
COLLAPSE_INDEX:false,
|
||||||
FILE_SUFFIX:'.html',
|
FILE_SUFFIX:'.html',
|
||||||
HAS_SOURCE: true
|
HAS_SOURCE: true
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
|
||||||
<title>pylorax.base — Lorax 23.12 documentation</title>
|
<title>pylorax.base — Lorax 24.1 documentation</title>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<link rel="top" title="Lorax 23.12 documentation" href="../../index.html"/>
|
<link rel="top" title="Lorax 24.1 documentation" href="../../index.html"/>
|
||||||
<link rel="up" title="pylorax" href="../pylorax.html"/>
|
<link rel="up" title="pylorax" href="../pylorax.html"/>
|
||||||
|
|
||||||
|
|
||||||
@ -250,7 +250,7 @@
|
|||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var DOCUMENTATION_OPTIONS = {
|
var DOCUMENTATION_OPTIONS = {
|
||||||
URL_ROOT:'../../',
|
URL_ROOT:'../../',
|
||||||
VERSION:'23.12',
|
VERSION:'24.1',
|
||||||
COLLAPSE_INDEX:false,
|
COLLAPSE_INDEX:false,
|
||||||
FILE_SUFFIX:'.html',
|
FILE_SUFFIX:'.html',
|
||||||
HAS_SOURCE: true
|
HAS_SOURCE: true
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
|
||||||
<title>pylorax.buildstamp — Lorax 23.12 documentation</title>
|
<title>pylorax.buildstamp — Lorax 24.1 documentation</title>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<link rel="top" title="Lorax 23.12 documentation" href="../../index.html"/>
|
<link rel="top" title="Lorax 24.1 documentation" href="../../index.html"/>
|
||||||
<link rel="up" title="pylorax" href="../pylorax.html"/>
|
<link rel="up" title="pylorax" href="../pylorax.html"/>
|
||||||
|
|
||||||
|
|
||||||
@ -244,7 +244,7 @@
|
|||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var DOCUMENTATION_OPTIONS = {
|
var DOCUMENTATION_OPTIONS = {
|
||||||
URL_ROOT:'../../',
|
URL_ROOT:'../../',
|
||||||
VERSION:'23.12',
|
VERSION:'24.1',
|
||||||
COLLAPSE_INDEX:false,
|
COLLAPSE_INDEX:false,
|
||||||
FILE_SUFFIX:'.html',
|
FILE_SUFFIX:'.html',
|
||||||
HAS_SOURCE: true
|
HAS_SOURCE: true
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
|
||||||
<title>pylorax.decorators — Lorax 23.12 documentation</title>
|
<title>pylorax.decorators — Lorax 24.1 documentation</title>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<link rel="top" title="Lorax 23.12 documentation" href="../../index.html"/>
|
<link rel="top" title="Lorax 24.1 documentation" href="../../index.html"/>
|
||||||
<link rel="up" title="pylorax" href="../pylorax.html"/>
|
<link rel="up" title="pylorax" href="../pylorax.html"/>
|
||||||
|
|
||||||
|
|
||||||
@ -216,7 +216,7 @@
|
|||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var DOCUMENTATION_OPTIONS = {
|
var DOCUMENTATION_OPTIONS = {
|
||||||
URL_ROOT:'../../',
|
URL_ROOT:'../../',
|
||||||
VERSION:'23.12',
|
VERSION:'24.1',
|
||||||
COLLAPSE_INDEX:false,
|
COLLAPSE_INDEX:false,
|
||||||
FILE_SUFFIX:'.html',
|
FILE_SUFFIX:'.html',
|
||||||
HAS_SOURCE: true
|
HAS_SOURCE: true
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
|
||||||
<title>pylorax.discinfo — Lorax 23.12 documentation</title>
|
<title>pylorax.discinfo — Lorax 24.1 documentation</title>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<link rel="top" title="Lorax 23.12 documentation" href="../../index.html"/>
|
<link rel="top" title="Lorax 24.1 documentation" href="../../index.html"/>
|
||||||
<link rel="up" title="pylorax" href="../pylorax.html"/>
|
<link rel="up" title="pylorax" href="../pylorax.html"/>
|
||||||
|
|
||||||
|
|
||||||
@ -225,7 +225,7 @@
|
|||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var DOCUMENTATION_OPTIONS = {
|
var DOCUMENTATION_OPTIONS = {
|
||||||
URL_ROOT:'../../',
|
URL_ROOT:'../../',
|
||||||
VERSION:'23.12',
|
VERSION:'24.1',
|
||||||
COLLAPSE_INDEX:false,
|
COLLAPSE_INDEX:false,
|
||||||
FILE_SUFFIX:'.html',
|
FILE_SUFFIX:'.html',
|
||||||
HAS_SOURCE: true
|
HAS_SOURCE: true
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
|
||||||
<title>pylorax.dnfhelper — Lorax 23.12 documentation</title>
|
<title>pylorax.dnfhelper — Lorax 24.1 documentation</title>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<link rel="top" title="Lorax 23.12 documentation" href="../../index.html"/>
|
<link rel="top" title="Lorax 24.1 documentation" href="../../index.html"/>
|
||||||
<link rel="up" title="pylorax" href="../pylorax.html"/>
|
<link rel="up" title="pylorax" href="../pylorax.html"/>
|
||||||
|
|
||||||
|
|
||||||
@ -293,7 +293,7 @@
|
|||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var DOCUMENTATION_OPTIONS = {
|
var DOCUMENTATION_OPTIONS = {
|
||||||
URL_ROOT:'../../',
|
URL_ROOT:'../../',
|
||||||
VERSION:'23.12',
|
VERSION:'24.1',
|
||||||
COLLAPSE_INDEX:false,
|
COLLAPSE_INDEX:false,
|
||||||
FILE_SUFFIX:'.html',
|
FILE_SUFFIX:'.html',
|
||||||
HAS_SOURCE: true
|
HAS_SOURCE: true
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
|
||||||
<title>pylorax.executils — Lorax 23.12 documentation</title>
|
<title>pylorax.executils — Lorax 24.1 documentation</title>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<link rel="top" title="Lorax 23.12 documentation" href="../../index.html"/>
|
<link rel="top" title="Lorax 24.1 documentation" href="../../index.html"/>
|
||||||
<link rel="up" title="pylorax" href="../pylorax.html"/>
|
<link rel="up" title="pylorax" href="../pylorax.html"/>
|
||||||
|
|
||||||
|
|
||||||
@ -177,8 +177,8 @@
|
|||||||
|
|
||||||
<span class="kn">import</span> <span class="nn">os</span>
|
<span class="kn">import</span> <span class="nn">os</span>
|
||||||
<span class="kn">import</span> <span class="nn">subprocess</span>
|
<span class="kn">import</span> <span class="nn">subprocess</span>
|
||||||
|
<span class="kn">from</span> <span class="nn">subprocess</span> <span class="kn">import</span> <span class="n">TimeoutExpired</span>
|
||||||
<span class="kn">import</span> <span class="nn">signal</span>
|
<span class="kn">import</span> <span class="nn">signal</span>
|
||||||
<span class="kn">from</span> <span class="nn">time</span> <span class="kn">import</span> <span class="n">sleep</span>
|
|
||||||
|
|
||||||
<span class="kn">import</span> <span class="nn">logging</span>
|
<span class="kn">import</span> <span class="nn">logging</span>
|
||||||
<span class="n">log</span> <span class="o">=</span> <span class="n">logging</span><span class="o">.</span><span class="n">getLogger</span><span class="p">(</span><span class="s">"pylorax"</span><span class="p">)</span>
|
<span class="n">log</span> <span class="o">=</span> <span class="n">logging</span><span class="o">.</span><span class="n">getLogger</span><span class="p">(</span><span class="s">"pylorax"</span><span class="p">)</span>
|
||||||
@ -233,6 +233,7 @@
|
|||||||
<span class="sd"> :param reset_lang: whether to set the locale of the child process to C</span>
|
<span class="sd"> :param reset_lang: whether to set the locale of the child process to C</span>
|
||||||
<span class="sd"> :param kwargs: Additional parameters to pass to subprocess.Popen</span>
|
<span class="sd"> :param kwargs: Additional parameters to pass to subprocess.Popen</span>
|
||||||
<span class="sd"> :return: A Popen object for the running command.</span>
|
<span class="sd"> :return: A Popen object for the running command.</span>
|
||||||
|
<span class="sd"> :keyword preexec_fn: A function to run before execution starts.</span>
|
||||||
<span class="sd"> """</span>
|
<span class="sd"> """</span>
|
||||||
<span class="k">if</span> <span class="n">env_prune</span> <span class="ow">is</span> <span class="bp">None</span><span class="p">:</span>
|
<span class="k">if</span> <span class="n">env_prune</span> <span class="ow">is</span> <span class="bp">None</span><span class="p">:</span>
|
||||||
<span class="n">env_prune</span> <span class="o">=</span> <span class="p">[]</span>
|
<span class="n">env_prune</span> <span class="o">=</span> <span class="p">[]</span>
|
||||||
@ -279,7 +280,8 @@
|
|||||||
<span class="n">preexec_fn</span><span class="o">=</span><span class="n">preexec</span><span class="p">,</span> <span class="n">cwd</span><span class="o">=</span><span class="n">root</span><span class="p">,</span> <span class="n">env</span><span class="o">=</span><span class="n">env</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
|
<span class="n">preexec_fn</span><span class="o">=</span><span class="n">preexec</span><span class="p">,</span> <span class="n">cwd</span><span class="o">=</span><span class="n">root</span><span class="p">,</span> <span class="n">env</span><span class="o">=</span><span class="n">env</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
|
||||||
</div>
|
</div>
|
||||||
<span class="k">def</span> <span class="nf">_run_program</span><span class="p">(</span><span class="n">argv</span><span class="p">,</span> <span class="n">root</span><span class="o">=</span><span class="s">'/'</span><span class="p">,</span> <span class="n">stdin</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">stdout</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">env_prune</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">log_output</span><span class="o">=</span><span class="bp">True</span><span class="p">,</span>
|
<span class="k">def</span> <span class="nf">_run_program</span><span class="p">(</span><span class="n">argv</span><span class="p">,</span> <span class="n">root</span><span class="o">=</span><span class="s">'/'</span><span class="p">,</span> <span class="n">stdin</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">stdout</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">env_prune</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">log_output</span><span class="o">=</span><span class="bp">True</span><span class="p">,</span>
|
||||||
<span class="n">binary_output</span><span class="o">=</span><span class="bp">False</span><span class="p">,</span> <span class="n">filter_stderr</span><span class="o">=</span><span class="bp">False</span><span class="p">,</span> <span class="n">raise_err</span><span class="o">=</span><span class="bp">False</span><span class="p">,</span> <span class="n">callback</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span>
|
<span class="n">binary_output</span><span class="o">=</span><span class="bp">False</span><span class="p">,</span> <span class="n">filter_stderr</span><span class="o">=</span><span class="bp">False</span><span class="p">,</span> <span class="n">raise_err</span><span class="o">=</span><span class="bp">False</span><span class="p">,</span> <span class="n">callback</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
||||||
|
<span class="n">env_add</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">reset_handlers</span><span class="o">=</span><span class="bp">True</span><span class="p">,</span> <span class="n">reset_lang</span><span class="o">=</span><span class="bp">True</span><span class="p">):</span>
|
||||||
<span class="sd">""" Run an external program, log the output and return it to the caller</span>
|
<span class="sd">""" Run an external program, log the output and return it to the caller</span>
|
||||||
|
|
||||||
<span class="sd"> :param argv: The command to run and argument</span>
|
<span class="sd"> :param argv: The command to run and argument</span>
|
||||||
@ -292,6 +294,9 @@
|
|||||||
<span class="sd"> :param filter_stderr: whether to exclude the contents of stderr from the returned output</span>
|
<span class="sd"> :param filter_stderr: whether to exclude the contents of stderr from the returned output</span>
|
||||||
<span class="sd"> :param raise_err: whether to raise a CalledProcessError if the returncode is non-zero</span>
|
<span class="sd"> :param raise_err: whether to raise a CalledProcessError if the returncode is non-zero</span>
|
||||||
<span class="sd"> :param callback: method to call while waiting for process to finish, passed Popen object</span>
|
<span class="sd"> :param callback: method to call while waiting for process to finish, passed Popen object</span>
|
||||||
|
<span class="sd"> :param env_add: environment variables to add before execution</span>
|
||||||
|
<span class="sd"> :param reset_handlers: whether to reset to SIG_DFL any signal handlers set to SIG_IGN</span>
|
||||||
|
<span class="sd"> :param reset_lang: whether to set the locale of the child process to C</span>
|
||||||
<span class="sd"> :return: The return code of the command and the output</span>
|
<span class="sd"> :return: The return code of the command and the output</span>
|
||||||
<span class="sd"> :raises: OSError or CalledProcessError</span>
|
<span class="sd"> :raises: OSError or CalledProcessError</span>
|
||||||
<span class="sd"> """</span>
|
<span class="sd"> """</span>
|
||||||
@ -302,12 +307,17 @@
|
|||||||
<span class="n">stderr</span> <span class="o">=</span> <span class="n">subprocess</span><span class="o">.</span><span class="n">STDOUT</span>
|
<span class="n">stderr</span> <span class="o">=</span> <span class="n">subprocess</span><span class="o">.</span><span class="n">STDOUT</span>
|
||||||
|
|
||||||
<span class="n">proc</span> <span class="o">=</span> <span class="n">startProgram</span><span class="p">(</span><span class="n">argv</span><span class="p">,</span> <span class="n">root</span><span class="o">=</span><span class="n">root</span><span class="p">,</span> <span class="n">stdin</span><span class="o">=</span><span class="n">stdin</span><span class="p">,</span> <span class="n">stdout</span><span class="o">=</span><span class="n">subprocess</span><span class="o">.</span><span class="n">PIPE</span><span class="p">,</span> <span class="n">stderr</span><span class="o">=</span><span class="n">stderr</span><span class="p">,</span>
|
<span class="n">proc</span> <span class="o">=</span> <span class="n">startProgram</span><span class="p">(</span><span class="n">argv</span><span class="p">,</span> <span class="n">root</span><span class="o">=</span><span class="n">root</span><span class="p">,</span> <span class="n">stdin</span><span class="o">=</span><span class="n">stdin</span><span class="p">,</span> <span class="n">stdout</span><span class="o">=</span><span class="n">subprocess</span><span class="o">.</span><span class="n">PIPE</span><span class="p">,</span> <span class="n">stderr</span><span class="o">=</span><span class="n">stderr</span><span class="p">,</span>
|
||||||
<span class="n">env_prune</span><span class="o">=</span><span class="n">env_prune</span><span class="p">,</span> <span class="n">universal_newlines</span><span class="o">=</span><span class="ow">not</span> <span class="n">binary_output</span><span class="p">)</span>
|
<span class="n">env_prune</span><span class="o">=</span><span class="n">env_prune</span><span class="p">,</span> <span class="n">universal_newlines</span><span class="o">=</span><span class="ow">not</span> <span class="n">binary_output</span><span class="p">,</span>
|
||||||
|
<span class="n">env_add</span><span class="o">=</span><span class="n">env_add</span><span class="p">,</span> <span class="n">reset_handlers</span><span class="o">=</span><span class="n">reset_handlers</span><span class="p">,</span> <span class="n">reset_lang</span><span class="o">=</span><span class="n">reset_lang</span><span class="p">)</span>
|
||||||
|
|
||||||
<span class="k">if</span> <span class="n">callback</span><span class="p">:</span>
|
<span class="k">if</span> <span class="n">callback</span><span class="p">:</span>
|
||||||
<span class="k">while</span> <span class="n">callback</span><span class="p">(</span><span class="n">proc</span><span class="p">)</span> <span class="ow">and</span> <span class="n">proc</span><span class="o">.</span><span class="n">poll</span><span class="p">()</span> <span class="ow">is</span> <span class="bp">None</span><span class="p">:</span>
|
<span class="k">while</span> <span class="n">callback</span><span class="p">(</span><span class="n">proc</span><span class="p">)</span> <span class="ow">and</span> <span class="n">proc</span><span class="o">.</span><span class="n">poll</span><span class="p">()</span> <span class="ow">is</span> <span class="bp">None</span><span class="p">:</span>
|
||||||
<span class="n">sleep</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span>
|
<span class="k">try</span><span class="p">:</span>
|
||||||
|
<span class="p">(</span><span class="n">output_string</span><span class="p">,</span> <span class="n">err_string</span><span class="p">)</span> <span class="o">=</span> <span class="n">proc</span><span class="o">.</span><span class="n">communicate</span><span class="p">(</span><span class="n">timeout</span><span class="o">=</span><span class="mi">1</span><span class="p">)</span>
|
||||||
|
<span class="k">break</span>
|
||||||
|
<span class="k">except</span> <span class="n">TimeoutExpired</span><span class="p">:</span>
|
||||||
|
<span class="k">pass</span>
|
||||||
|
<span class="k">else</span><span class="p">:</span>
|
||||||
<span class="p">(</span><span class="n">output_string</span><span class="p">,</span> <span class="n">err_string</span><span class="p">)</span> <span class="o">=</span> <span class="n">proc</span><span class="o">.</span><span class="n">communicate</span><span class="p">()</span>
|
<span class="p">(</span><span class="n">output_string</span><span class="p">,</span> <span class="n">err_string</span><span class="p">)</span> <span class="o">=</span> <span class="n">proc</span><span class="o">.</span><span class="n">communicate</span><span class="p">()</span>
|
||||||
<span class="k">if</span> <span class="n">output_string</span><span class="p">:</span>
|
<span class="k">if</span> <span class="n">output_string</span><span class="p">:</span>
|
||||||
<span class="k">if</span> <span class="n">binary_output</span><span class="p">:</span>
|
<span class="k">if</span> <span class="n">binary_output</span><span class="p">:</span>
|
||||||
@ -342,12 +352,14 @@
|
|||||||
<span class="n">program_log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">"Return code: </span><span class="si">%d</span><span class="s">"</span><span class="p">,</span> <span class="n">proc</span><span class="o">.</span><span class="n">returncode</span><span class="p">)</span>
|
<span class="n">program_log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">"Return code: </span><span class="si">%d</span><span class="s">"</span><span class="p">,</span> <span class="n">proc</span><span class="o">.</span><span class="n">returncode</span><span class="p">)</span>
|
||||||
|
|
||||||
<span class="k">if</span> <span class="n">proc</span><span class="o">.</span><span class="n">returncode</span> <span class="ow">and</span> <span class="n">raise_err</span><span class="p">:</span>
|
<span class="k">if</span> <span class="n">proc</span><span class="o">.</span><span class="n">returncode</span> <span class="ow">and</span> <span class="n">raise_err</span><span class="p">:</span>
|
||||||
<span class="k">raise</span> <span class="n">subprocess</span><span class="o">.</span><span class="n">CalledProcessError</span><span class="p">(</span><span class="n">proc</span><span class="o">.</span><span class="n">returncode</span><span class="p">,</span> <span class="n">argv</span><span class="p">)</span>
|
<span class="n">output</span> <span class="o">=</span> <span class="n">output_string</span> <span class="ow">or</span> <span class="s">""</span> <span class="o">+</span> <span class="n">err_string</span> <span class="ow">or</span> <span class="s">""</span>
|
||||||
|
<span class="k">raise</span> <span class="n">subprocess</span><span class="o">.</span><span class="n">CalledProcessError</span><span class="p">(</span><span class="n">proc</span><span class="o">.</span><span class="n">returncode</span><span class="p">,</span> <span class="n">argv</span><span class="p">,</span> <span class="n">output</span><span class="p">)</span>
|
||||||
|
|
||||||
<span class="k">return</span> <span class="p">(</span><span class="n">proc</span><span class="o">.</span><span class="n">returncode</span><span class="p">,</span> <span class="n">output_string</span><span class="p">)</span>
|
<span class="k">return</span> <span class="p">(</span><span class="n">proc</span><span class="o">.</span><span class="n">returncode</span><span class="p">,</span> <span class="n">output_string</span><span class="p">)</span>
|
||||||
|
|
||||||
<div class="viewcode-block" id="execWithRedirect"><a class="viewcode-back" href="../../pylorax.html#pylorax.executils.execWithRedirect">[docs]</a><span class="k">def</span> <span class="nf">execWithRedirect</span><span class="p">(</span><span class="n">command</span><span class="p">,</span> <span class="n">argv</span><span class="p">,</span> <span class="n">stdin</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">stdout</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">root</span><span class="o">=</span><span class="s">'/'</span><span class="p">,</span> <span class="n">env_prune</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
<div class="viewcode-block" id="execWithRedirect"><a class="viewcode-back" href="../../pylorax.html#pylorax.executils.execWithRedirect">[docs]</a><span class="k">def</span> <span class="nf">execWithRedirect</span><span class="p">(</span><span class="n">command</span><span class="p">,</span> <span class="n">argv</span><span class="p">,</span> <span class="n">stdin</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">stdout</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">root</span><span class="o">=</span><span class="s">'/'</span><span class="p">,</span> <span class="n">env_prune</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
||||||
<span class="n">log_output</span><span class="o">=</span><span class="bp">True</span><span class="p">,</span> <span class="n">binary_output</span><span class="o">=</span><span class="bp">False</span><span class="p">,</span> <span class="n">raise_err</span><span class="o">=</span><span class="bp">False</span><span class="p">,</span> <span class="n">callback</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span>
|
<span class="n">log_output</span><span class="o">=</span><span class="bp">True</span><span class="p">,</span> <span class="n">binary_output</span><span class="o">=</span><span class="bp">False</span><span class="p">,</span> <span class="n">raise_err</span><span class="o">=</span><span class="bp">False</span><span class="p">,</span> <span class="n">callback</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
|
||||||
|
<span class="n">env_add</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">reset_handlers</span><span class="o">=</span><span class="bp">True</span><span class="p">,</span> <span class="n">reset_lang</span><span class="o">=</span><span class="bp">True</span><span class="p">):</span>
|
||||||
<span class="sd">""" Run an external program and redirect the output to a file.</span>
|
<span class="sd">""" Run an external program and redirect the output to a file.</span>
|
||||||
|
|
||||||
<span class="sd"> :param command: The command to run</span>
|
<span class="sd"> :param command: The command to run</span>
|
||||||
@ -360,14 +372,18 @@
|
|||||||
<span class="sd"> :param binary_output: whether to treat the output of command as binary data</span>
|
<span class="sd"> :param binary_output: whether to treat the output of command as binary data</span>
|
||||||
<span class="sd"> :param raise_err: whether to raise a CalledProcessError if the returncode is non-zero</span>
|
<span class="sd"> :param raise_err: whether to raise a CalledProcessError if the returncode is non-zero</span>
|
||||||
<span class="sd"> :param callback: method to call while waiting for process to finish, passed Popen object</span>
|
<span class="sd"> :param callback: method to call while waiting for process to finish, passed Popen object</span>
|
||||||
|
<span class="sd"> :param env_add: environment variables to add before execution</span>
|
||||||
|
<span class="sd"> :param reset_handlers: whether to reset to SIG_DFL any signal handlers set to SIG_IGN</span>
|
||||||
|
<span class="sd"> :param reset_lang: whether to set the locale of the child process to C</span>
|
||||||
<span class="sd"> :return: The return code of the command</span>
|
<span class="sd"> :return: The return code of the command</span>
|
||||||
<span class="sd"> """</span>
|
<span class="sd"> """</span>
|
||||||
<span class="n">argv</span> <span class="o">=</span> <span class="p">[</span><span class="n">command</span><span class="p">]</span> <span class="o">+</span> <span class="nb">list</span><span class="p">(</span><span class="n">argv</span><span class="p">)</span>
|
<span class="n">argv</span> <span class="o">=</span> <span class="p">[</span><span class="n">command</span><span class="p">]</span> <span class="o">+</span> <span class="nb">list</span><span class="p">(</span><span class="n">argv</span><span class="p">)</span>
|
||||||
<span class="k">return</span> <span class="n">_run_program</span><span class="p">(</span><span class="n">argv</span><span class="p">,</span> <span class="n">stdin</span><span class="o">=</span><span class="n">stdin</span><span class="p">,</span> <span class="n">stdout</span><span class="o">=</span><span class="n">stdout</span><span class="p">,</span> <span class="n">root</span><span class="o">=</span><span class="n">root</span><span class="p">,</span> <span class="n">env_prune</span><span class="o">=</span><span class="n">env_prune</span><span class="p">,</span>
|
<span class="k">return</span> <span class="n">_run_program</span><span class="p">(</span><span class="n">argv</span><span class="p">,</span> <span class="n">stdin</span><span class="o">=</span><span class="n">stdin</span><span class="p">,</span> <span class="n">stdout</span><span class="o">=</span><span class="n">stdout</span><span class="p">,</span> <span class="n">root</span><span class="o">=</span><span class="n">root</span><span class="p">,</span> <span class="n">env_prune</span><span class="o">=</span><span class="n">env_prune</span><span class="p">,</span>
|
||||||
<span class="n">log_output</span><span class="o">=</span><span class="n">log_output</span><span class="p">,</span> <span class="n">binary_output</span><span class="o">=</span><span class="n">binary_output</span><span class="p">,</span> <span class="n">raise_err</span><span class="o">=</span><span class="n">raise_err</span><span class="p">,</span> <span class="n">callback</span><span class="o">=</span><span class="n">callback</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span>
|
<span class="n">log_output</span><span class="o">=</span><span class="n">log_output</span><span class="p">,</span> <span class="n">binary_output</span><span class="o">=</span><span class="n">binary_output</span><span class="p">,</span> <span class="n">raise_err</span><span class="o">=</span><span class="n">raise_err</span><span class="p">,</span> <span class="n">callback</span><span class="o">=</span><span class="n">callback</span><span class="p">,</span>
|
||||||
|
<span class="n">env_add</span><span class="o">=</span><span class="n">env_add</span><span class="p">,</span> <span class="n">reset_handlers</span><span class="o">=</span><span class="n">reset_handlers</span><span class="p">,</span> <span class="n">reset_lang</span><span class="o">=</span><span class="n">reset_lang</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="viewcode-block" id="execWithCapture"><a class="viewcode-back" href="../../pylorax.html#pylorax.executils.execWithCapture">[docs]</a><span class="k">def</span> <span class="nf">execWithCapture</span><span class="p">(</span><span class="n">command</span><span class="p">,</span> <span class="n">argv</span><span class="p">,</span> <span class="n">stdin</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">root</span><span class="o">=</span><span class="s">'/'</span><span class="p">,</span> <span class="n">log_output</span><span class="o">=</span><span class="bp">True</span><span class="p">,</span> <span class="n">filter_stderr</span><span class="o">=</span><span class="bp">False</span><span class="p">,</span>
|
<div class="viewcode-block" id="execWithCapture"><a class="viewcode-back" href="../../pylorax.html#pylorax.executils.execWithCapture">[docs]</a><span class="k">def</span> <span class="nf">execWithCapture</span><span class="p">(</span><span class="n">command</span><span class="p">,</span> <span class="n">argv</span><span class="p">,</span> <span class="n">stdin</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">root</span><span class="o">=</span><span class="s">'/'</span><span class="p">,</span> <span class="n">log_output</span><span class="o">=</span><span class="bp">True</span><span class="p">,</span> <span class="n">filter_stderr</span><span class="o">=</span><span class="bp">False</span><span class="p">,</span>
|
||||||
<span class="n">raise_err</span><span class="o">=</span><span class="bp">False</span><span class="p">,</span> <span class="n">callback</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span>
|
<span class="n">raise_err</span><span class="o">=</span><span class="bp">False</span><span class="p">,</span> <span class="n">callback</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">env_add</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">reset_handlers</span><span class="o">=</span><span class="bp">True</span><span class="p">,</span> <span class="n">reset_lang</span><span class="o">=</span><span class="bp">True</span><span class="p">):</span>
|
||||||
<span class="sd">""" Run an external program and capture standard out and err.</span>
|
<span class="sd">""" Run an external program and capture standard out and err.</span>
|
||||||
|
|
||||||
<span class="sd"> :param command: The command to run</span>
|
<span class="sd"> :param command: The command to run</span>
|
||||||
@ -376,12 +392,102 @@
|
|||||||
<span class="sd"> :param root: The directory to chroot to before running command.</span>
|
<span class="sd"> :param root: The directory to chroot to before running command.</span>
|
||||||
<span class="sd"> :param log_output: Whether to log the output of command</span>
|
<span class="sd"> :param log_output: Whether to log the output of command</span>
|
||||||
<span class="sd"> :param filter_stderr: Whether stderr should be excluded from the returned output</span>
|
<span class="sd"> :param filter_stderr: Whether stderr should be excluded from the returned output</span>
|
||||||
<span class="sd"> :param raise_err: whether to raise a CalledProcessError if the returncode is non-zero</span>
|
<span class="sd"> :param callback: method to call while waiting for process to finish, passed Popen object</span>
|
||||||
|
<span class="sd"> :param env_add: environment variables to add before execution</span>
|
||||||
|
<span class="sd"> :param reset_handlers: whether to reset to SIG_DFL any signal handlers set to SIG_IGN</span>
|
||||||
|
<span class="sd"> :param reset_lang: whether to set the locale of the child process to C</span>
|
||||||
<span class="sd"> :return: The output of the command</span>
|
<span class="sd"> :return: The output of the command</span>
|
||||||
<span class="sd"> """</span>
|
<span class="sd"> """</span>
|
||||||
<span class="n">argv</span> <span class="o">=</span> <span class="p">[</span><span class="n">command</span><span class="p">]</span> <span class="o">+</span> <span class="nb">list</span><span class="p">(</span><span class="n">argv</span><span class="p">)</span>
|
<span class="n">argv</span> <span class="o">=</span> <span class="p">[</span><span class="n">command</span><span class="p">]</span> <span class="o">+</span> <span class="nb">list</span><span class="p">(</span><span class="n">argv</span><span class="p">)</span>
|
||||||
<span class="k">return</span> <span class="n">_run_program</span><span class="p">(</span><span class="n">argv</span><span class="p">,</span> <span class="n">stdin</span><span class="o">=</span><span class="n">stdin</span><span class="p">,</span> <span class="n">root</span><span class="o">=</span><span class="n">root</span><span class="p">,</span> <span class="n">log_output</span><span class="o">=</span><span class="n">log_output</span><span class="p">,</span> <span class="n">filter_stderr</span><span class="o">=</span><span class="n">filter_stderr</span><span class="p">,</span>
|
<span class="k">return</span> <span class="n">_run_program</span><span class="p">(</span><span class="n">argv</span><span class="p">,</span> <span class="n">stdin</span><span class="o">=</span><span class="n">stdin</span><span class="p">,</span> <span class="n">root</span><span class="o">=</span><span class="n">root</span><span class="p">,</span> <span class="n">log_output</span><span class="o">=</span><span class="n">log_output</span><span class="p">,</span> <span class="n">filter_stderr</span><span class="o">=</span><span class="n">filter_stderr</span><span class="p">,</span>
|
||||||
<span class="n">raise_err</span><span class="o">=</span><span class="n">raise_err</span><span class="p">,</span> <span class="n">callback</span><span class="o">=</span><span class="n">callback</span><span class="p">)[</span><span class="mi">1</span><span class="p">]</span>
|
<span class="n">raise_err</span><span class="o">=</span><span class="n">raise_err</span><span class="p">,</span> <span class="n">callback</span><span class="o">=</span><span class="n">callback</span><span class="p">,</span> <span class="n">env_add</span><span class="o">=</span><span class="n">env_add</span><span class="p">,</span>
|
||||||
|
<span class="n">reset_handlers</span><span class="o">=</span><span class="n">reset_handlers</span><span class="p">,</span> <span class="n">reset_lang</span><span class="o">=</span><span class="n">reset_lang</span><span class="p">)[</span><span class="mi">1</span><span class="p">]</span>
|
||||||
|
</div>
|
||||||
|
<div class="viewcode-block" id="execReadlines"><a class="viewcode-back" href="../../pylorax.html#pylorax.executils.execReadlines">[docs]</a><span class="k">def</span> <span class="nf">execReadlines</span><span class="p">(</span><span class="n">command</span><span class="p">,</span> <span class="n">argv</span><span class="p">,</span> <span class="n">stdin</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">root</span><span class="o">=</span><span class="s">'/'</span><span class="p">,</span> <span class="n">env_prune</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">filter_stderr</span><span class="o">=</span><span class="bp">False</span><span class="p">,</span>
|
||||||
|
<span class="n">callback</span><span class="o">=</span><span class="k">lambda</span> <span class="n">x</span><span class="p">:</span> <span class="bp">True</span><span class="p">,</span> <span class="n">env_add</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">reset_handlers</span><span class="o">=</span><span class="bp">True</span><span class="p">,</span> <span class="n">reset_lang</span><span class="o">=</span><span class="bp">True</span><span class="p">):</span>
|
||||||
|
<span class="sd">""" Execute an external command and return the line output of the command</span>
|
||||||
|
<span class="sd"> in real-time.</span>
|
||||||
|
|
||||||
|
<span class="sd"> This method assumes that there is a reasonably low delay between the</span>
|
||||||
|
<span class="sd"> end of output and the process exiting. If the child process closes</span>
|
||||||
|
<span class="sd"> stdout and then keeps on truckin' there will be problems.</span>
|
||||||
|
|
||||||
|
<span class="sd"> NOTE/WARNING: UnicodeDecodeError will be raised if the output of the</span>
|
||||||
|
<span class="sd"> external command can't be decoded as UTF-8.</span>
|
||||||
|
|
||||||
|
<span class="sd"> :param command: The command to run</span>
|
||||||
|
<span class="sd"> :param argv: The argument list</span>
|
||||||
|
<span class="sd"> :param stdin: The file object to read stdin from.</span>
|
||||||
|
<span class="sd"> :param stdout: Optional file object to redirect stdout and stderr to.</span>
|
||||||
|
<span class="sd"> :param root: The directory to chroot to before running command.</span>
|
||||||
|
<span class="sd"> :param env_prune: environment variable to remove before execution</span>
|
||||||
|
<span class="sd"> :param filter_stderr: Whether stderr should be excluded from the returned output</span>
|
||||||
|
<span class="sd"> :param callback: method to call while waiting for process to finish, passed Popen object</span>
|
||||||
|
<span class="sd"> :param env_add: environment variables to add before execution</span>
|
||||||
|
<span class="sd"> :param reset_handlers: whether to reset to SIG_DFL any signal handlers set to SIG_IGN</span>
|
||||||
|
<span class="sd"> :param reset_lang: whether to set the locale of the child process to C</span>
|
||||||
|
<span class="sd"> :return: Iterator of the lines from the command</span>
|
||||||
|
|
||||||
|
<span class="sd"> Output from the file is not logged to program.log</span>
|
||||||
|
<span class="sd"> This returns an iterator with the lines from the command until it has finished</span>
|
||||||
|
<span class="sd"> """</span>
|
||||||
|
|
||||||
|
<span class="k">class</span> <span class="nc">ExecLineReader</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
|
||||||
|
<span class="sd">"""Iterator class for returning lines from a process and cleaning</span>
|
||||||
|
<span class="sd"> up the process when the output is no longer needed.</span>
|
||||||
|
<span class="sd"> """</span>
|
||||||
|
|
||||||
|
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">proc</span><span class="p">,</span> <span class="n">argv</span><span class="p">,</span> <span class="n">callback</span><span class="p">):</span>
|
||||||
|
<span class="bp">self</span><span class="o">.</span><span class="n">_proc</span> <span class="o">=</span> <span class="n">proc</span>
|
||||||
|
<span class="bp">self</span><span class="o">.</span><span class="n">_argv</span> <span class="o">=</span> <span class="n">argv</span>
|
||||||
|
<span class="bp">self</span><span class="o">.</span><span class="n">_callback</span> <span class="o">=</span> <span class="n">callback</span>
|
||||||
|
|
||||||
|
<span class="k">def</span> <span class="nf">__iter__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||||
|
<span class="k">return</span> <span class="bp">self</span>
|
||||||
|
|
||||||
|
<span class="k">def</span> <span class="nf">__del__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||||
|
<span class="c"># See if the process is still running</span>
|
||||||
|
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">_proc</span><span class="o">.</span><span class="n">poll</span><span class="p">()</span> <span class="ow">is</span> <span class="bp">None</span><span class="p">:</span>
|
||||||
|
<span class="c"># Stop the process and ignore any problems that might arise</span>
|
||||||
|
<span class="k">try</span><span class="p">:</span>
|
||||||
|
<span class="bp">self</span><span class="o">.</span><span class="n">_proc</span><span class="o">.</span><span class="n">terminate</span><span class="p">()</span>
|
||||||
|
<span class="k">except</span> <span class="ne">OSError</span><span class="p">:</span>
|
||||||
|
<span class="k">pass</span>
|
||||||
|
|
||||||
|
<span class="k">def</span> <span class="nf">__next__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||||
|
<span class="c"># Read the next line, blocking if a line is not yet available</span>
|
||||||
|
<span class="n">line</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_proc</span><span class="o">.</span><span class="n">stdout</span><span class="o">.</span><span class="n">readline</span><span class="p">()</span><span class="o">.</span><span class="n">decode</span><span class="p">(</span><span class="s">"utf-8"</span><span class="p">)</span>
|
||||||
|
<span class="k">if</span> <span class="n">line</span> <span class="o">==</span> <span class="s">''</span> <span class="ow">or</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">_callback</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_proc</span><span class="p">):</span>
|
||||||
|
<span class="c"># Output finished, wait for the process to end</span>
|
||||||
|
<span class="bp">self</span><span class="o">.</span><span class="n">_proc</span><span class="o">.</span><span class="n">communicate</span><span class="p">()</span>
|
||||||
|
|
||||||
|
<span class="c"># Check for successful exit</span>
|
||||||
|
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">_proc</span><span class="o">.</span><span class="n">returncode</span> <span class="o"><</span> <span class="mi">0</span><span class="p">:</span>
|
||||||
|
<span class="k">raise</span> <span class="ne">OSError</span><span class="p">(</span><span class="s">"process '</span><span class="si">%s</span><span class="s">' was killed by signal </span><span class="si">%s</span><span class="s">"</span> <span class="o">%</span>
|
||||||
|
<span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_argv</span><span class="p">,</span> <span class="o">-</span><span class="bp">self</span><span class="o">.</span><span class="n">_proc</span><span class="o">.</span><span class="n">returncode</span><span class="p">))</span>
|
||||||
|
<span class="k">elif</span> <span class="bp">self</span><span class="o">.</span><span class="n">_proc</span><span class="o">.</span><span class="n">returncode</span> <span class="o">></span> <span class="mi">0</span><span class="p">:</span>
|
||||||
|
<span class="k">raise</span> <span class="ne">OSError</span><span class="p">(</span><span class="s">"process '</span><span class="si">%s</span><span class="s">' exited with status </span><span class="si">%s</span><span class="s">"</span> <span class="o">%</span>
|
||||||
|
<span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_argv</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">_proc</span><span class="o">.</span><span class="n">returncode</span><span class="p">))</span>
|
||||||
|
<span class="k">raise</span> <span class="ne">StopIteration</span>
|
||||||
|
|
||||||
|
<span class="k">return</span> <span class="n">line</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span>
|
||||||
|
|
||||||
|
<span class="n">argv</span> <span class="o">=</span> <span class="p">[</span><span class="n">command</span><span class="p">]</span> <span class="o">+</span> <span class="n">argv</span>
|
||||||
|
|
||||||
|
<span class="k">if</span> <span class="n">filter_stderr</span><span class="p">:</span>
|
||||||
|
<span class="n">stderr</span> <span class="o">=</span> <span class="n">subprocess</span><span class="o">.</span><span class="n">DEVNULL</span>
|
||||||
|
<span class="k">else</span><span class="p">:</span>
|
||||||
|
<span class="n">stderr</span> <span class="o">=</span> <span class="n">subprocess</span><span class="o">.</span><span class="n">STDOUT</span>
|
||||||
|
|
||||||
|
<span class="k">try</span><span class="p">:</span>
|
||||||
|
<span class="n">proc</span> <span class="o">=</span> <span class="n">startProgram</span><span class="p">(</span><span class="n">argv</span><span class="p">,</span> <span class="n">root</span><span class="o">=</span><span class="n">root</span><span class="p">,</span> <span class="n">stdin</span><span class="o">=</span><span class="n">stdin</span><span class="p">,</span> <span class="n">stdout</span><span class="o">=</span><span class="n">subprocess</span><span class="o">.</span><span class="n">PIPE</span><span class="p">,</span> <span class="n">stderr</span><span class="o">=</span><span class="n">stderr</span><span class="p">,</span> <span class="n">bufsize</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span>
|
||||||
|
<span class="n">env_prune</span><span class="o">=</span><span class="n">env_prune</span><span class="p">,</span> <span class="n">env_add</span><span class="o">=</span><span class="n">env_add</span><span class="p">,</span> <span class="n">reset_handlers</span><span class="o">=</span><span class="n">reset_handlers</span><span class="p">,</span> <span class="n">reset_lang</span><span class="o">=</span><span class="n">reset_lang</span><span class="p">)</span>
|
||||||
|
<span class="k">except</span> <span class="ne">OSError</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
|
||||||
|
<span class="k">with</span> <span class="n">program_log_lock</span><span class="p">:</span>
|
||||||
|
<span class="n">program_log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s">"Error running </span><span class="si">%s</span><span class="s">: </span><span class="si">%s</span><span class="s">"</span><span class="p">,</span> <span class="n">argv</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="n">e</span><span class="o">.</span><span class="n">strerror</span><span class="p">)</span>
|
||||||
|
<span class="k">raise</span>
|
||||||
|
|
||||||
|
<span class="k">return</span> <span class="n">ExecLineReader</span><span class="p">(</span><span class="n">proc</span><span class="p">,</span> <span class="n">argv</span><span class="p">,</span> <span class="n">callback</span><span class="p">)</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="viewcode-block" id="runcmd"><a class="viewcode-back" href="../../pylorax.html#pylorax.executils.runcmd">[docs]</a><span class="k">def</span> <span class="nf">runcmd</span><span class="p">(</span><span class="n">cmd</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
|
<div class="viewcode-block" id="runcmd"><a class="viewcode-back" href="../../pylorax.html#pylorax.executils.runcmd">[docs]</a><span class="k">def</span> <span class="nf">runcmd</span><span class="p">(</span><span class="n">cmd</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
|
||||||
<span class="sd">""" run execWithRedirect with raise_err=True</span>
|
<span class="sd">""" run execWithRedirect with raise_err=True</span>
|
||||||
@ -425,7 +531,7 @@
|
|||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var DOCUMENTATION_OPTIONS = {
|
var DOCUMENTATION_OPTIONS = {
|
||||||
URL_ROOT:'../../',
|
URL_ROOT:'../../',
|
||||||
VERSION:'23.12',
|
VERSION:'24.1',
|
||||||
COLLAPSE_INDEX:false,
|
COLLAPSE_INDEX:false,
|
||||||
FILE_SUFFIX:'.html',
|
FILE_SUFFIX:'.html',
|
||||||
HAS_SOURCE: true
|
HAS_SOURCE: true
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
|
||||||
<title>pylorax.imgutils — Lorax 23.12 documentation</title>
|
<title>pylorax.imgutils — Lorax 24.1 documentation</title>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<link rel="top" title="Lorax 23.12 documentation" href="../../index.html"/>
|
<link rel="top" title="Lorax 24.1 documentation" href="../../index.html"/>
|
||||||
<link rel="up" title="pylorax" href="../pylorax.html"/>
|
<link rel="up" title="pylorax" href="../pylorax.html"/>
|
||||||
|
|
||||||
|
|
||||||
@ -603,7 +603,7 @@
|
|||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var DOCUMENTATION_OPTIONS = {
|
var DOCUMENTATION_OPTIONS = {
|
||||||
URL_ROOT:'../../',
|
URL_ROOT:'../../',
|
||||||
VERSION:'23.12',
|
VERSION:'24.1',
|
||||||
COLLAPSE_INDEX:false,
|
COLLAPSE_INDEX:false,
|
||||||
FILE_SUFFIX:'.html',
|
FILE_SUFFIX:'.html',
|
||||||
HAS_SOURCE: true
|
HAS_SOURCE: true
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
|
||||||
<title>pylorax.ltmpl — Lorax 23.12 documentation</title>
|
<title>pylorax.ltmpl — Lorax 24.1 documentation</title>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<link rel="top" title="Lorax 23.12 documentation" href="../../index.html"/>
|
<link rel="top" title="Lorax 24.1 documentation" href="../../index.html"/>
|
||||||
<link rel="up" title="pylorax" href="../pylorax.html"/>
|
<link rel="up" title="pylorax" href="../pylorax.html"/>
|
||||||
|
|
||||||
|
|
||||||
@ -900,7 +900,7 @@
|
|||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var DOCUMENTATION_OPTIONS = {
|
var DOCUMENTATION_OPTIONS = {
|
||||||
URL_ROOT:'../../',
|
URL_ROOT:'../../',
|
||||||
VERSION:'23.12',
|
VERSION:'24.1',
|
||||||
COLLAPSE_INDEX:false,
|
COLLAPSE_INDEX:false,
|
||||||
FILE_SUFFIX:'.html',
|
FILE_SUFFIX:'.html',
|
||||||
HAS_SOURCE: true
|
HAS_SOURCE: true
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
|
||||||
<title>pylorax.monitor — Lorax 23.12 documentation</title>
|
<title>pylorax.monitor — Lorax 24.1 documentation</title>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<link rel="top" title="Lorax 23.12 documentation" href="../../index.html"/>
|
<link rel="top" title="Lorax 24.1 documentation" href="../../index.html"/>
|
||||||
<link rel="up" title="pylorax" href="../pylorax.html"/>
|
<link rel="up" title="pylorax" href="../pylorax.html"/>
|
||||||
|
|
||||||
|
|
||||||
@ -377,7 +377,7 @@
|
|||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var DOCUMENTATION_OPTIONS = {
|
var DOCUMENTATION_OPTIONS = {
|
||||||
URL_ROOT:'../../',
|
URL_ROOT:'../../',
|
||||||
VERSION:'23.12',
|
VERSION:'24.1',
|
||||||
COLLAPSE_INDEX:false,
|
COLLAPSE_INDEX:false,
|
||||||
FILE_SUFFIX:'.html',
|
FILE_SUFFIX:'.html',
|
||||||
HAS_SOURCE: true
|
HAS_SOURCE: true
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
|
||||||
<title>pylorax.mount — Lorax 23.12 documentation</title>
|
<title>pylorax.mount — Lorax 24.1 documentation</title>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<link rel="top" title="Lorax 23.12 documentation" href="../../index.html"/>
|
<link rel="top" title="Lorax 24.1 documentation" href="../../index.html"/>
|
||||||
<link rel="up" title="pylorax" href="../pylorax.html"/>
|
<link rel="up" title="pylorax" href="../pylorax.html"/>
|
||||||
|
|
||||||
|
|
||||||
@ -282,7 +282,7 @@
|
|||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var DOCUMENTATION_OPTIONS = {
|
var DOCUMENTATION_OPTIONS = {
|
||||||
URL_ROOT:'../../',
|
URL_ROOT:'../../',
|
||||||
VERSION:'23.12',
|
VERSION:'24.1',
|
||||||
COLLAPSE_INDEX:false,
|
COLLAPSE_INDEX:false,
|
||||||
FILE_SUFFIX:'.html',
|
FILE_SUFFIX:'.html',
|
||||||
HAS_SOURCE: true
|
HAS_SOURCE: true
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
|
||||||
<title>pylorax.sysutils — Lorax 23.12 documentation</title>
|
<title>pylorax.sysutils — Lorax 24.1 documentation</title>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<link rel="top" title="Lorax 23.12 documentation" href="../../index.html"/>
|
<link rel="top" title="Lorax 24.1 documentation" href="../../index.html"/>
|
||||||
<link rel="up" title="pylorax" href="../pylorax.html"/>
|
<link rel="up" title="pylorax" href="../pylorax.html"/>
|
||||||
|
|
||||||
|
|
||||||
@ -294,7 +294,7 @@
|
|||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var DOCUMENTATION_OPTIONS = {
|
var DOCUMENTATION_OPTIONS = {
|
||||||
URL_ROOT:'../../',
|
URL_ROOT:'../../',
|
||||||
VERSION:'23.12',
|
VERSION:'24.1',
|
||||||
COLLAPSE_INDEX:false,
|
COLLAPSE_INDEX:false,
|
||||||
FILE_SUFFIX:'.html',
|
FILE_SUFFIX:'.html',
|
||||||
HAS_SOURCE: true
|
HAS_SOURCE: true
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
|
||||||
<title>pylorax.treebuilder — Lorax 23.12 documentation</title>
|
<title>pylorax.treebuilder — Lorax 24.1 documentation</title>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<link rel="top" title="Lorax 23.12 documentation" href="../../index.html"/>
|
<link rel="top" title="Lorax 24.1 documentation" href="../../index.html"/>
|
||||||
<link rel="up" title="pylorax" href="../pylorax.html"/>
|
<link rel="up" title="pylorax" href="../pylorax.html"/>
|
||||||
|
|
||||||
|
|
||||||
@ -180,12 +180,14 @@
|
|||||||
<span class="kn">import</span> <span class="nn">os</span><span class="o">,</span> <span class="nn">re</span>
|
<span class="kn">import</span> <span class="nn">os</span><span class="o">,</span> <span class="nn">re</span>
|
||||||
<span class="kn">from</span> <span class="nn">os.path</span> <span class="kn">import</span> <span class="n">basename</span>
|
<span class="kn">from</span> <span class="nn">os.path</span> <span class="kn">import</span> <span class="n">basename</span>
|
||||||
<span class="kn">from</span> <span class="nn">shutil</span> <span class="kn">import</span> <span class="n">copytree</span><span class="p">,</span> <span class="n">copy2</span>
|
<span class="kn">from</span> <span class="nn">shutil</span> <span class="kn">import</span> <span class="n">copytree</span><span class="p">,</span> <span class="n">copy2</span>
|
||||||
|
<span class="kn">from</span> <span class="nn">pathlib</span> <span class="kn">import</span> <span class="n">Path</span>
|
||||||
|
<span class="kn">import</span> <span class="nn">itertools</span>
|
||||||
|
|
||||||
<span class="kn">from</span> <span class="nn">pylorax.sysutils</span> <span class="kn">import</span> <span class="n">joinpaths</span><span class="p">,</span> <span class="n">remove</span>
|
<span class="kn">from</span> <span class="nn">pylorax.sysutils</span> <span class="kn">import</span> <span class="n">joinpaths</span><span class="p">,</span> <span class="n">remove</span>
|
||||||
<span class="kn">from</span> <span class="nn">pylorax.base</span> <span class="kn">import</span> <span class="n">DataHolder</span>
|
<span class="kn">from</span> <span class="nn">pylorax.base</span> <span class="kn">import</span> <span class="n">DataHolder</span>
|
||||||
<span class="kn">from</span> <span class="nn">pylorax.ltmpl</span> <span class="kn">import</span> <span class="n">LoraxTemplateRunner</span>
|
<span class="kn">from</span> <span class="nn">pylorax.ltmpl</span> <span class="kn">import</span> <span class="n">LoraxTemplateRunner</span>
|
||||||
<span class="kn">import</span> <span class="nn">pylorax.imgutils</span> <span class="kn">as</span> <span class="nn">imgutils</span>
|
<span class="kn">import</span> <span class="nn">pylorax.imgutils</span> <span class="kn">as</span> <span class="nn">imgutils</span>
|
||||||
<span class="kn">from</span> <span class="nn">pylorax.executils</span> <span class="kn">import</span> <span class="n">runcmd</span><span class="p">,</span> <span class="n">runcmd_output</span>
|
<span class="kn">from</span> <span class="nn">pylorax.executils</span> <span class="kn">import</span> <span class="n">runcmd</span><span class="p">,</span> <span class="n">runcmd_output</span><span class="p">,</span> <span class="n">execWithCapture</span>
|
||||||
|
|
||||||
<span class="n">templatemap</span> <span class="o">=</span> <span class="p">{</span>
|
<span class="n">templatemap</span> <span class="o">=</span> <span class="p">{</span>
|
||||||
<span class="s">'i386'</span><span class="p">:</span> <span class="s">'x86.tmpl'</span><span class="p">,</span>
|
<span class="s">'i386'</span><span class="p">:</span> <span class="s">'x86.tmpl'</span><span class="p">,</span>
|
||||||
@ -300,6 +302,54 @@
|
|||||||
<span class="sd">'''Remove unneeded packages and files with runtime-cleanup.tmpl'''</span>
|
<span class="sd">'''Remove unneeded packages and files with runtime-cleanup.tmpl'''</span>
|
||||||
<span class="bp">self</span><span class="o">.</span><span class="n">_runner</span><span class="o">.</span><span class="n">run</span><span class="p">(</span><span class="s">"runtime-cleanup.tmpl"</span><span class="p">)</span>
|
<span class="bp">self</span><span class="o">.</span><span class="n">_runner</span><span class="o">.</span><span class="n">run</span><span class="p">(</span><span class="s">"runtime-cleanup.tmpl"</span><span class="p">)</span>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="viewcode-block" id="RuntimeBuilder.verify"><a class="viewcode-back" href="../../pylorax.html#pylorax.treebuilder.RuntimeBuilder.verify">[docs]</a> <span class="k">def</span> <span class="nf">verify</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||||
|
<span class="sd">'''Ensure that contents of the installroot can run'''</span>
|
||||||
|
<span class="n">status</span> <span class="o">=</span> <span class="bp">True</span>
|
||||||
|
|
||||||
|
<span class="n">ELF_MAGIC</span> <span class="o">=</span> <span class="n">b</span><span class="s">'</span><span class="se">\x7f</span><span class="s">ELF'</span>
|
||||||
|
|
||||||
|
<span class="c"># Iterate over all files in /usr/bin and /usr/sbin</span>
|
||||||
|
<span class="c"># For ELF files, gather them into a list and we'll check them all at</span>
|
||||||
|
<span class="c"># the end. For files with a #!, check them as we go</span>
|
||||||
|
<span class="n">elf_files</span> <span class="o">=</span> <span class="p">[]</span>
|
||||||
|
<span class="n">usr_bin</span> <span class="o">=</span> <span class="n">Path</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">vars</span><span class="o">.</span><span class="n">root</span> <span class="o">+</span> <span class="s">'/usr/bin'</span><span class="p">)</span>
|
||||||
|
<span class="n">usr_sbin</span> <span class="o">=</span> <span class="n">Path</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">vars</span><span class="o">.</span><span class="n">root</span> <span class="o">+</span> <span class="s">'/usr/sbin'</span><span class="p">)</span>
|
||||||
|
<span class="k">for</span> <span class="n">path</span> <span class="ow">in</span> <span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="k">for</span> <span class="n">x</span> <span class="ow">in</span> <span class="n">itertools</span><span class="o">.</span><span class="n">chain</span><span class="p">(</span><span class="n">usr_bin</span><span class="o">.</span><span class="n">iterdir</span><span class="p">(),</span> <span class="n">usr_sbin</span><span class="o">.</span><span class="n">iterdir</span><span class="p">())</span> \
|
||||||
|
<span class="k">if</span> <span class="n">x</span><span class="o">.</span><span class="n">is_file</span><span class="p">()):</span>
|
||||||
|
<span class="k">with</span> <span class="nb">open</span><span class="p">(</span><span class="n">path</span><span class="p">,</span> <span class="s">"rb"</span><span class="p">)</span> <span class="k">as</span> <span class="n">f</span><span class="p">:</span>
|
||||||
|
<span class="n">magic</span> <span class="o">=</span> <span class="n">f</span><span class="o">.</span><span class="n">read</span><span class="p">(</span><span class="mi">4</span><span class="p">)</span>
|
||||||
|
<span class="k">if</span> <span class="n">magic</span> <span class="o">==</span> <span class="n">ELF_MAGIC</span><span class="p">:</span>
|
||||||
|
<span class="c"># Save the path, minus the chroot prefix</span>
|
||||||
|
<span class="n">elf_files</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">path</span><span class="p">[</span><span class="nb">len</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">vars</span><span class="o">.</span><span class="n">root</span><span class="p">):])</span>
|
||||||
|
<span class="k">elif</span> <span class="n">magic</span><span class="p">[:</span><span class="mi">2</span><span class="p">]</span> <span class="o">==</span> <span class="n">b</span><span class="s">'#!'</span><span class="p">:</span>
|
||||||
|
<span class="c"># Reopen the file as text and read the first line.</span>
|
||||||
|
<span class="c"># Open as latin-1 so that stray 8-bit characters don't make</span>
|
||||||
|
<span class="c"># things blow up. We only really care about ASCII parts.</span>
|
||||||
|
<span class="k">with</span> <span class="nb">open</span><span class="p">(</span><span class="n">path</span><span class="p">,</span> <span class="s">"rt"</span><span class="p">,</span> <span class="n">encoding</span><span class="o">=</span><span class="s">"latin-1"</span><span class="p">)</span> <span class="k">as</span> <span class="n">f_text</span><span class="p">:</span>
|
||||||
|
<span class="c"># Remove the #!, split on space, and take the first part</span>
|
||||||
|
<span class="n">shabang</span> <span class="o">=</span> <span class="n">f_text</span><span class="o">.</span><span class="n">readline</span><span class="p">()[</span><span class="mi">2</span><span class="p">:]</span><span class="o">.</span><span class="n">split</span><span class="p">()[</span><span class="mi">0</span><span class="p">]</span>
|
||||||
|
|
||||||
|
<span class="c"># Does the path exist?</span>
|
||||||
|
<span class="k">if</span> <span class="ow">not</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">vars</span><span class="o">.</span><span class="n">root</span> <span class="o">+</span> <span class="n">shabang</span><span class="p">):</span>
|
||||||
|
<span class="n">logger</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s">'</span><span class="si">%s</span><span class="s">, needed by </span><span class="si">%s</span><span class="s">, does not exist'</span><span class="p">,</span> <span class="n">shabang</span><span class="p">,</span> <span class="n">path</span><span class="p">)</span>
|
||||||
|
<span class="n">status</span> <span class="o">=</span> <span class="bp">False</span>
|
||||||
|
|
||||||
|
<span class="c"># Now, run ldd on all the ELF files</span>
|
||||||
|
<span class="c"># Just run ldd once on everything so it isn't logged a million times.</span>
|
||||||
|
<span class="c"># At least one thing in the list isn't going to be a dynamic executable,</span>
|
||||||
|
<span class="c"># so use execWithCapture to ignore the exit code.</span>
|
||||||
|
<span class="n">filename</span> <span class="o">=</span> <span class="s">''</span>
|
||||||
|
<span class="k">for</span> <span class="n">line</span> <span class="ow">in</span> <span class="n">execWithCapture</span><span class="p">(</span><span class="s">'ldd'</span><span class="p">,</span> <span class="n">elf_files</span><span class="p">,</span> <span class="n">root</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">vars</span><span class="o">.</span><span class="n">root</span><span class="p">,</span>
|
||||||
|
<span class="n">log_output</span><span class="o">=</span><span class="bp">False</span><span class="p">,</span> <span class="n">filter_stderr</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s">'</span><span class="se">\n</span><span class="s">'</span><span class="p">):</span>
|
||||||
|
<span class="k">if</span> <span class="n">line</span> <span class="ow">and</span> <span class="ow">not</span> <span class="n">line</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">isspace</span><span class="p">():</span>
|
||||||
|
<span class="c"># New filename header, strip the : at the end and save</span>
|
||||||
|
<span class="n">filename</span> <span class="o">=</span> <span class="n">line</span><span class="p">[:</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span>
|
||||||
|
<span class="k">elif</span> <span class="s">'not found'</span> <span class="ow">in</span> <span class="n">line</span><span class="p">:</span>
|
||||||
|
<span class="n">logger</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s">'</span><span class="si">%s</span><span class="s">, needed by </span><span class="si">%s</span><span class="s">, not found'</span><span class="p">,</span> <span class="n">line</span><span class="o">.</span><span class="n">split</span><span class="p">()[</span><span class="mi">0</span><span class="p">],</span> <span class="n">filename</span><span class="p">)</span>
|
||||||
|
<span class="n">status</span> <span class="o">=</span> <span class="bp">False</span>
|
||||||
|
|
||||||
|
<span class="k">return</span> <span class="n">status</span>
|
||||||
|
</div>
|
||||||
<div class="viewcode-block" id="RuntimeBuilder.writepkgsizes"><a class="viewcode-back" href="../../pylorax.html#pylorax.treebuilder.RuntimeBuilder.writepkgsizes">[docs]</a> <span class="k">def</span> <span class="nf">writepkgsizes</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">pkgsizefile</span><span class="p">):</span>
|
<div class="viewcode-block" id="RuntimeBuilder.writepkgsizes"><a class="viewcode-back" href="../../pylorax.html#pylorax.treebuilder.RuntimeBuilder.writepkgsizes">[docs]</a> <span class="k">def</span> <span class="nf">writepkgsizes</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">pkgsizefile</span><span class="p">):</span>
|
||||||
<span class="sd">'''debugging data: write a big list of pkg sizes'''</span>
|
<span class="sd">'''debugging data: write a big list of pkg sizes'''</span>
|
||||||
<span class="n">fobj</span> <span class="o">=</span> <span class="nb">open</span><span class="p">(</span><span class="n">pkgsizefile</span><span class="p">,</span> <span class="s">"w"</span><span class="p">)</span>
|
<span class="n">fobj</span> <span class="o">=</span> <span class="nb">open</span><span class="p">(</span><span class="n">pkgsizefile</span><span class="p">,</span> <span class="s">"w"</span><span class="p">)</span>
|
||||||
@ -525,7 +575,7 @@
|
|||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var DOCUMENTATION_OPTIONS = {
|
var DOCUMENTATION_OPTIONS = {
|
||||||
URL_ROOT:'../../',
|
URL_ROOT:'../../',
|
||||||
VERSION:'23.12',
|
VERSION:'24.1',
|
||||||
COLLAPSE_INDEX:false,
|
COLLAPSE_INDEX:false,
|
||||||
FILE_SUFFIX:'.html',
|
FILE_SUFFIX:'.html',
|
||||||
HAS_SOURCE: true
|
HAS_SOURCE: true
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
|
||||||
<title>pylorax.treeinfo — Lorax 23.12 documentation</title>
|
<title>pylorax.treeinfo — Lorax 24.1 documentation</title>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<link rel="top" title="Lorax 23.12 documentation" href="../../index.html"/>
|
<link rel="top" title="Lorax 24.1 documentation" href="../../index.html"/>
|
||||||
<link rel="up" title="pylorax" href="../pylorax.html"/>
|
<link rel="up" title="pylorax" href="../pylorax.html"/>
|
||||||
|
|
||||||
|
|
||||||
@ -243,7 +243,7 @@
|
|||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var DOCUMENTATION_OPTIONS = {
|
var DOCUMENTATION_OPTIONS = {
|
||||||
URL_ROOT:'../../',
|
URL_ROOT:'../../',
|
||||||
VERSION:'23.12',
|
VERSION:'24.1',
|
||||||
COLLAPSE_INDEX:false,
|
COLLAPSE_INDEX:false,
|
||||||
FILE_SUFFIX:'.html',
|
FILE_SUFFIX:'.html',
|
||||||
HAS_SOURCE: true
|
HAS_SOURCE: true
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
|
||||||
<title>Index — Lorax 23.12 documentation</title>
|
<title>Index — Lorax 24.1 documentation</title>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -31,7 +31,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<link rel="top" title="Lorax 23.12 documentation" href="index.html"/>
|
<link rel="top" title="Lorax 24.1 documentation" href="index.html"/>
|
||||||
|
|
||||||
|
|
||||||
<script src="_static/js/modernizr.min.js"></script>
|
<script src="_static/js/modernizr.min.js"></script>
|
||||||
@ -172,6 +172,7 @@
|
|||||||
| <a href="#S"><strong>S</strong></a>
|
| <a href="#S"><strong>S</strong></a>
|
||||||
| <a href="#T"><strong>T</strong></a>
|
| <a href="#T"><strong>T</strong></a>
|
||||||
| <a href="#U"><strong>U</strong></a>
|
| <a href="#U"><strong>U</strong></a>
|
||||||
|
| <a href="#V"><strong>V</strong></a>
|
||||||
| <a href="#W"><strong>W</strong></a>
|
| <a href="#W"><strong>W</strong></a>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@ -336,10 +337,14 @@
|
|||||||
<dt><a href="pylorax.html#pylorax.dnfhelper.LoraxRpmCallback.event">event() (pylorax.dnfhelper.LoraxRpmCallback method)</a>
|
<dt><a href="pylorax.html#pylorax.dnfhelper.LoraxRpmCallback.event">event() (pylorax.dnfhelper.LoraxRpmCallback method)</a>
|
||||||
</dt>
|
</dt>
|
||||||
|
|
||||||
|
|
||||||
|
<dt><a href="pylorax.html#pylorax.executils.ExecProduct">ExecProduct (class in pylorax.executils)</a>
|
||||||
|
</dt>
|
||||||
|
|
||||||
</dl></td>
|
</dl></td>
|
||||||
<td style="width: 33%" valign="top"><dl>
|
<td style="width: 33%" valign="top"><dl>
|
||||||
|
|
||||||
<dt><a href="pylorax.html#pylorax.executils.ExecProduct">ExecProduct (class in pylorax.executils)</a>
|
<dt><a href="pylorax.html#pylorax.executils.execReadlines">execReadlines() (in module pylorax.executils)</a>
|
||||||
</dt>
|
</dt>
|
||||||
|
|
||||||
|
|
||||||
@ -933,6 +938,16 @@
|
|||||||
</dl></td>
|
</dl></td>
|
||||||
</tr></table>
|
</tr></table>
|
||||||
|
|
||||||
|
<h2 id="V">V</h2>
|
||||||
|
<table style="width: 100%" class="indextable genindextable"><tr>
|
||||||
|
<td style="width: 33%" valign="top"><dl>
|
||||||
|
|
||||||
|
<dt><a href="pylorax.html#pylorax.treebuilder.RuntimeBuilder.verify">verify() (pylorax.treebuilder.RuntimeBuilder method)</a>
|
||||||
|
</dt>
|
||||||
|
|
||||||
|
</dl></td>
|
||||||
|
</tr></table>
|
||||||
|
|
||||||
<h2 id="W">W</h2>
|
<h2 id="W">W</h2>
|
||||||
<table style="width: 100%" class="indextable genindextable"><tr>
|
<table style="width: 100%" class="indextable genindextable"><tr>
|
||||||
<td style="width: 33%" valign="top"><dl>
|
<td style="width: 33%" valign="top"><dl>
|
||||||
@ -994,7 +1009,7 @@
|
|||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var DOCUMENTATION_OPTIONS = {
|
var DOCUMENTATION_OPTIONS = {
|
||||||
URL_ROOT:'./',
|
URL_ROOT:'./',
|
||||||
VERSION:'23.12',
|
VERSION:'24.1',
|
||||||
COLLAPSE_INDEX:false,
|
COLLAPSE_INDEX:false,
|
||||||
FILE_SUFFIX:'.html',
|
FILE_SUFFIX:'.html',
|
||||||
HAS_SOURCE: true
|
HAS_SOURCE: true
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
|
||||||
<title>Welcome to Lorax’s documentation! — Lorax 23.12 documentation</title>
|
<title>Welcome to Lorax’s documentation! — Lorax 24.1 documentation</title>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<link rel="top" title="Lorax 23.12 documentation" href="#"/>
|
<link rel="top" title="Lorax 24.1 documentation" href="#"/>
|
||||||
<link rel="next" title="Introduction to Lorax" href="intro.html"/>
|
<link rel="next" title="Introduction to Lorax" href="intro.html"/>
|
||||||
|
|
||||||
|
|
||||||
@ -212,7 +212,7 @@
|
|||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var DOCUMENTATION_OPTIONS = {
|
var DOCUMENTATION_OPTIONS = {
|
||||||
URL_ROOT:'./',
|
URL_ROOT:'./',
|
||||||
VERSION:'23.12',
|
VERSION:'24.1',
|
||||||
COLLAPSE_INDEX:false,
|
COLLAPSE_INDEX:false,
|
||||||
FILE_SUFFIX:'.html',
|
FILE_SUFFIX:'.html',
|
||||||
HAS_SOURCE: true
|
HAS_SOURCE: true
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
|
||||||
<title>Introduction to Lorax — Lorax 23.12 documentation</title>
|
<title>Introduction to Lorax — Lorax 24.1 documentation</title>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<link rel="top" title="Lorax 23.12 documentation" href="index.html"/>
|
<link rel="top" title="Lorax 24.1 documentation" href="index.html"/>
|
||||||
<link rel="next" title="lorax" href="lorax.html"/>
|
<link rel="next" title="lorax" href="lorax.html"/>
|
||||||
<link rel="prev" title="Welcome to Lorax’s documentation!" href="index.html"/>
|
<link rel="prev" title="Welcome to Lorax’s documentation!" href="index.html"/>
|
||||||
|
|
||||||
@ -244,7 +244,7 @@ upd-instroot and mk-images* scripts.</p>
|
|||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var DOCUMENTATION_OPTIONS = {
|
var DOCUMENTATION_OPTIONS = {
|
||||||
URL_ROOT:'./',
|
URL_ROOT:'./',
|
||||||
VERSION:'23.12',
|
VERSION:'24.1',
|
||||||
COLLAPSE_INDEX:false,
|
COLLAPSE_INDEX:false,
|
||||||
FILE_SUFFIX:'.html',
|
FILE_SUFFIX:'.html',
|
||||||
HAS_SOURCE: true
|
HAS_SOURCE: true
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
|
||||||
<title>livemedia-creator — Lorax 23.12 documentation</title>
|
<title>livemedia-creator — Lorax 24.1 documentation</title>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<link rel="top" title="Lorax 23.12 documentation" href="index.html"/>
|
<link rel="top" title="Lorax 24.1 documentation" href="index.html"/>
|
||||||
<link rel="next" title="Product and Updates Images" href="product-images.html"/>
|
<link rel="next" title="Product and Updates Images" href="product-images.html"/>
|
||||||
<link rel="prev" title="lorax" href="lorax.html"/>
|
<link rel="prev" title="lorax" href="lorax.html"/>
|
||||||
|
|
||||||
@ -623,7 +623,7 @@ report bugs against the lorax component.</p>
|
|||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var DOCUMENTATION_OPTIONS = {
|
var DOCUMENTATION_OPTIONS = {
|
||||||
URL_ROOT:'./',
|
URL_ROOT:'./',
|
||||||
VERSION:'23.12',
|
VERSION:'24.1',
|
||||||
COLLAPSE_INDEX:false,
|
COLLAPSE_INDEX:false,
|
||||||
FILE_SUFFIX:'.html',
|
FILE_SUFFIX:'.html',
|
||||||
HAS_SOURCE: true
|
HAS_SOURCE: true
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
|
||||||
<title>lorax — Lorax 23.12 documentation</title>
|
<title>lorax — Lorax 24.1 documentation</title>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<link rel="top" title="Lorax 23.12 documentation" href="index.html"/>
|
<link rel="top" title="Lorax 24.1 documentation" href="index.html"/>
|
||||||
<link rel="next" title="livemedia-creator" href="livemedia-creator.html"/>
|
<link rel="next" title="livemedia-creator" href="livemedia-creator.html"/>
|
||||||
<link rel="prev" title="Introduction to Lorax" href="intro.html"/>
|
<link rel="prev" title="Introduction to Lorax" href="intro.html"/>
|
||||||
|
|
||||||
@ -197,7 +197,7 @@
|
|||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var DOCUMENTATION_OPTIONS = {
|
var DOCUMENTATION_OPTIONS = {
|
||||||
URL_ROOT:'./',
|
URL_ROOT:'./',
|
||||||
VERSION:'23.12',
|
VERSION:'24.1',
|
||||||
COLLAPSE_INDEX:false,
|
COLLAPSE_INDEX:false,
|
||||||
FILE_SUFFIX:'.html',
|
FILE_SUFFIX:'.html',
|
||||||
HAS_SOURCE: true
|
HAS_SOURCE: true
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
|
||||||
<title>pylorax — Lorax 23.12 documentation</title>
|
<title>pylorax — Lorax 24.1 documentation</title>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<link rel="top" title="Lorax 23.12 documentation" href="index.html"/>
|
<link rel="top" title="Lorax 24.1 documentation" href="index.html"/>
|
||||||
<link rel="next" title="pylorax package" href="pylorax.html"/>
|
<link rel="next" title="pylorax package" href="pylorax.html"/>
|
||||||
<link rel="prev" title="Product and Updates Images" href="product-images.html"/>
|
<link rel="prev" title="Product and Updates Images" href="product-images.html"/>
|
||||||
|
|
||||||
@ -219,7 +219,7 @@
|
|||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var DOCUMENTATION_OPTIONS = {
|
var DOCUMENTATION_OPTIONS = {
|
||||||
URL_ROOT:'./',
|
URL_ROOT:'./',
|
||||||
VERSION:'23.12',
|
VERSION:'24.1',
|
||||||
COLLAPSE_INDEX:false,
|
COLLAPSE_INDEX:false,
|
||||||
FILE_SUFFIX:'.html',
|
FILE_SUFFIX:'.html',
|
||||||
HAS_SOURCE: true
|
HAS_SOURCE: true
|
||||||
|
Binary file not shown.
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
|
||||||
<title>Product and Updates Images — Lorax 23.12 documentation</title>
|
<title>Product and Updates Images — Lorax 24.1 documentation</title>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<link rel="top" title="Lorax 23.12 documentation" href="index.html"/>
|
<link rel="top" title="Lorax 24.1 documentation" href="index.html"/>
|
||||||
<link rel="next" title="pylorax" href="modules.html"/>
|
<link rel="next" title="pylorax" href="modules.html"/>
|
||||||
<link rel="prev" title="livemedia-creator" href="livemedia-creator.html"/>
|
<link rel="prev" title="livemedia-creator" href="livemedia-creator.html"/>
|
||||||
|
|
||||||
@ -213,7 +213,7 @@ command or the installpkgs paramater of <a class="reference internal" href="pylo
|
|||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var DOCUMENTATION_OPTIONS = {
|
var DOCUMENTATION_OPTIONS = {
|
||||||
URL_ROOT:'./',
|
URL_ROOT:'./',
|
||||||
VERSION:'23.12',
|
VERSION:'24.1',
|
||||||
COLLAPSE_INDEX:false,
|
COLLAPSE_INDEX:false,
|
||||||
FILE_SUFFIX:'.html',
|
FILE_SUFFIX:'.html',
|
||||||
HAS_SOURCE: true
|
HAS_SOURCE: true
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
|
||||||
<title>Python Module Index — Lorax 23.12 documentation</title>
|
<title>Python Module Index — Lorax 24.1 documentation</title>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<link rel="top" title="Lorax 23.12 documentation" href="index.html"/>
|
<link rel="top" title="Lorax 24.1 documentation" href="index.html"/>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -271,7 +271,7 @@
|
|||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var DOCUMENTATION_OPTIONS = {
|
var DOCUMENTATION_OPTIONS = {
|
||||||
URL_ROOT:'./',
|
URL_ROOT:'./',
|
||||||
VERSION:'23.12',
|
VERSION:'24.1',
|
||||||
COLLAPSE_INDEX:false,
|
COLLAPSE_INDEX:false,
|
||||||
FILE_SUFFIX:'.html',
|
FILE_SUFFIX:'.html',
|
||||||
HAS_SOURCE: true
|
HAS_SOURCE: true
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
|
||||||
<title>pylorax package — Lorax 23.12 documentation</title>
|
<title>pylorax package — Lorax 24.1 documentation</title>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<link rel="top" title="Lorax 23.12 documentation" href="index.html"/>
|
<link rel="top" title="Lorax 24.1 documentation" href="index.html"/>
|
||||||
<link rel="up" title="pylorax" href="modules.html"/>
|
<link rel="up" title="pylorax" href="modules.html"/>
|
||||||
<link rel="prev" title="pylorax" href="modules.html"/>
|
<link rel="prev" title="pylorax" href="modules.html"/>
|
||||||
|
|
||||||
@ -289,9 +289,49 @@
|
|||||||
<tt class="descclassname">pylorax.executils.</tt><tt class="descname">augmentEnv</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/pylorax/executils.html#augmentEnv"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.executils.augmentEnv" title="Permalink to this definition">¶</a></dt>
|
<tt class="descclassname">pylorax.executils.</tt><tt class="descname">augmentEnv</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/pylorax/executils.html#augmentEnv"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.executils.augmentEnv" title="Permalink to this definition">¶</a></dt>
|
||||||
<dd></dd></dl>
|
<dd></dd></dl>
|
||||||
|
|
||||||
|
<dl class="function">
|
||||||
|
<dt id="pylorax.executils.execReadlines">
|
||||||
|
<tt class="descclassname">pylorax.executils.</tt><tt class="descname">execReadlines</tt><big>(</big><em>command</em>, <em>argv</em>, <em>stdin=None</em>, <em>root='/'</em>, <em>env_prune=None</em>, <em>filter_stderr=False</em>, <em>callback=<function <lambda> at 0x7f21026ac048></em>, <em>env_add=None</em>, <em>reset_handlers=True</em>, <em>reset_lang=True</em><big>)</big><a class="reference internal" href="_modules/pylorax/executils.html#execReadlines"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.executils.execReadlines" title="Permalink to this definition">¶</a></dt>
|
||||||
|
<dd><p>Execute an external command and return the line output of the command
|
||||||
|
in real-time.</p>
|
||||||
|
<p>This method assumes that there is a reasonably low delay between the
|
||||||
|
end of output and the process exiting. If the child process closes
|
||||||
|
stdout and then keeps on truckin’ there will be problems.</p>
|
||||||
|
<dl class="docutils">
|
||||||
|
<dt>NOTE/WARNING: UnicodeDecodeError will be raised if the output of the</dt>
|
||||||
|
<dd>external command can’t be decoded as UTF-8.</dd>
|
||||||
|
</dl>
|
||||||
|
<table class="docutils field-list" frame="void" rules="none">
|
||||||
|
<col class="field-name" />
|
||||||
|
<col class="field-body" />
|
||||||
|
<tbody valign="top">
|
||||||
|
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
|
||||||
|
<li><strong>command</strong> – The command to run</li>
|
||||||
|
<li><strong>argv</strong> – The argument list</li>
|
||||||
|
<li><strong>stdin</strong> – The file object to read stdin from.</li>
|
||||||
|
<li><strong>stdout</strong> – Optional file object to redirect stdout and stderr to.</li>
|
||||||
|
<li><strong>root</strong> – The directory to chroot to before running command.</li>
|
||||||
|
<li><strong>env_prune</strong> – environment variable to remove before execution</li>
|
||||||
|
<li><strong>filter_stderr</strong> – Whether stderr should be excluded from the returned output</li>
|
||||||
|
<li><strong>callback</strong> – method to call while waiting for process to finish, passed Popen object</li>
|
||||||
|
<li><strong>env_add</strong> – environment variables to add before execution</li>
|
||||||
|
<li><strong>reset_handlers</strong> – whether to reset to SIG_DFL any signal handlers set to SIG_IGN</li>
|
||||||
|
<li><strong>reset_lang</strong> – whether to set the locale of the child process to C</li>
|
||||||
|
</ul>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">Iterator of the lines from the command</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<p>Output from the file is not logged to program.log
|
||||||
|
This returns an iterator with the lines from the command until it has finished</p>
|
||||||
|
</dd></dl>
|
||||||
|
|
||||||
<dl class="function">
|
<dl class="function">
|
||||||
<dt id="pylorax.executils.execWithCapture">
|
<dt id="pylorax.executils.execWithCapture">
|
||||||
<tt class="descclassname">pylorax.executils.</tt><tt class="descname">execWithCapture</tt><big>(</big><em>command</em>, <em>argv</em>, <em>stdin=None</em>, <em>root='/'</em>, <em>log_output=True</em>, <em>filter_stderr=False</em>, <em>raise_err=False</em>, <em>callback=None</em><big>)</big><a class="reference internal" href="_modules/pylorax/executils.html#execWithCapture"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.executils.execWithCapture" title="Permalink to this definition">¶</a></dt>
|
<tt class="descclassname">pylorax.executils.</tt><tt class="descname">execWithCapture</tt><big>(</big><em>command</em>, <em>argv</em>, <em>stdin=None</em>, <em>root='/'</em>, <em>log_output=True</em>, <em>filter_stderr=False</em>, <em>raise_err=False</em>, <em>callback=None</em>, <em>env_add=None</em>, <em>reset_handlers=True</em>, <em>reset_lang=True</em><big>)</big><a class="reference internal" href="_modules/pylorax/executils.html#execWithCapture"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.executils.execWithCapture" title="Permalink to this definition">¶</a></dt>
|
||||||
<dd><p>Run an external program and capture standard out and err.</p>
|
<dd><p>Run an external program and capture standard out and err.</p>
|
||||||
<table class="docutils field-list" frame="void" rules="none">
|
<table class="docutils field-list" frame="void" rules="none">
|
||||||
<col class="field-name" />
|
<col class="field-name" />
|
||||||
@ -304,7 +344,10 @@
|
|||||||
<li><strong>root</strong> – The directory to chroot to before running command.</li>
|
<li><strong>root</strong> – The directory to chroot to before running command.</li>
|
||||||
<li><strong>log_output</strong> – Whether to log the output of command</li>
|
<li><strong>log_output</strong> – Whether to log the output of command</li>
|
||||||
<li><strong>filter_stderr</strong> – Whether stderr should be excluded from the returned output</li>
|
<li><strong>filter_stderr</strong> – Whether stderr should be excluded from the returned output</li>
|
||||||
<li><strong>raise_err</strong> – whether to raise a CalledProcessError if the returncode is non-zero</li>
|
<li><strong>callback</strong> – method to call while waiting for process to finish, passed Popen object</li>
|
||||||
|
<li><strong>env_add</strong> – environment variables to add before execution</li>
|
||||||
|
<li><strong>reset_handlers</strong> – whether to reset to SIG_DFL any signal handlers set to SIG_IGN</li>
|
||||||
|
<li><strong>reset_lang</strong> – whether to set the locale of the child process to C</li>
|
||||||
</ul>
|
</ul>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@ -317,7 +360,7 @@
|
|||||||
|
|
||||||
<dl class="function">
|
<dl class="function">
|
||||||
<dt id="pylorax.executils.execWithRedirect">
|
<dt id="pylorax.executils.execWithRedirect">
|
||||||
<tt class="descclassname">pylorax.executils.</tt><tt class="descname">execWithRedirect</tt><big>(</big><em>command</em>, <em>argv</em>, <em>stdin=None</em>, <em>stdout=None</em>, <em>root='/'</em>, <em>env_prune=None</em>, <em>log_output=True</em>, <em>binary_output=False</em>, <em>raise_err=False</em>, <em>callback=None</em><big>)</big><a class="reference internal" href="_modules/pylorax/executils.html#execWithRedirect"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.executils.execWithRedirect" title="Permalink to this definition">¶</a></dt>
|
<tt class="descclassname">pylorax.executils.</tt><tt class="descname">execWithRedirect</tt><big>(</big><em>command</em>, <em>argv</em>, <em>stdin=None</em>, <em>stdout=None</em>, <em>root='/'</em>, <em>env_prune=None</em>, <em>log_output=True</em>, <em>binary_output=False</em>, <em>raise_err=False</em>, <em>callback=None</em>, <em>env_add=None</em>, <em>reset_handlers=True</em>, <em>reset_lang=True</em><big>)</big><a class="reference internal" href="_modules/pylorax/executils.html#execWithRedirect"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.executils.execWithRedirect" title="Permalink to this definition">¶</a></dt>
|
||||||
<dd><p>Run an external program and redirect the output to a file.</p>
|
<dd><p>Run an external program and redirect the output to a file.</p>
|
||||||
<table class="docutils field-list" frame="void" rules="none">
|
<table class="docutils field-list" frame="void" rules="none">
|
||||||
<col class="field-name" />
|
<col class="field-name" />
|
||||||
@ -334,6 +377,9 @@
|
|||||||
<li><strong>binary_output</strong> – whether to treat the output of command as binary data</li>
|
<li><strong>binary_output</strong> – whether to treat the output of command as binary data</li>
|
||||||
<li><strong>raise_err</strong> – whether to raise a CalledProcessError if the returncode is non-zero</li>
|
<li><strong>raise_err</strong> – whether to raise a CalledProcessError if the returncode is non-zero</li>
|
||||||
<li><strong>callback</strong> – method to call while waiting for process to finish, passed Popen object</li>
|
<li><strong>callback</strong> – method to call while waiting for process to finish, passed Popen object</li>
|
||||||
|
<li><strong>env_add</strong> – environment variables to add before execution</li>
|
||||||
|
<li><strong>reset_handlers</strong> – whether to reset to SIG_DFL any signal handlers set to SIG_IGN</li>
|
||||||
|
<li><strong>reset_lang</strong> – whether to set the locale of the child process to C</li>
|
||||||
</ul>
|
</ul>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@ -400,6 +446,7 @@ last.</p>
|
|||||||
<li><strong>reset_handlers</strong> – whether to reset to SIG_DFL any signal handlers set to SIG_IGN</li>
|
<li><strong>reset_handlers</strong> – whether to reset to SIG_DFL any signal handlers set to SIG_IGN</li>
|
||||||
<li><strong>reset_lang</strong> – whether to set the locale of the child process to C</li>
|
<li><strong>reset_lang</strong> – whether to set the locale of the child process to C</li>
|
||||||
<li><strong>kwargs</strong> – Additional parameters to pass to subprocess.Popen</li>
|
<li><strong>kwargs</strong> – Additional parameters to pass to subprocess.Popen</li>
|
||||||
|
<li><strong>preexec_fn</strong> – A function to run before execution starts.</li>
|
||||||
</ul>
|
</ul>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@ -1242,6 +1289,12 @@ iso’s label.</p>
|
|||||||
<dd><p>Do some post-install setup work with runtime-postinstall.tmpl</p>
|
<dd><p>Do some post-install setup work with runtime-postinstall.tmpl</p>
|
||||||
</dd></dl>
|
</dd></dl>
|
||||||
|
|
||||||
|
<dl class="method">
|
||||||
|
<dt id="pylorax.treebuilder.RuntimeBuilder.verify">
|
||||||
|
<tt class="descname">verify</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/pylorax/treebuilder.html#RuntimeBuilder.verify"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.treebuilder.RuntimeBuilder.verify" title="Permalink to this definition">¶</a></dt>
|
||||||
|
<dd><p>Ensure that contents of the installroot can run</p>
|
||||||
|
</dd></dl>
|
||||||
|
|
||||||
<dl class="method">
|
<dl class="method">
|
||||||
<dt id="pylorax.treebuilder.RuntimeBuilder.writepkglists">
|
<dt id="pylorax.treebuilder.RuntimeBuilder.writepkglists">
|
||||||
<tt class="descname">writepkglists</tt><big>(</big><em>pkglistdir</em><big>)</big><a class="reference internal" href="_modules/pylorax/treebuilder.html#RuntimeBuilder.writepkglists"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.treebuilder.RuntimeBuilder.writepkglists" title="Permalink to this definition">¶</a></dt>
|
<tt class="descname">writepkglists</tt><big>(</big><em>pkglistdir</em><big>)</big><a class="reference internal" href="_modules/pylorax/treebuilder.html#RuntimeBuilder.writepkglists"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.treebuilder.RuntimeBuilder.writepkglists" title="Permalink to this definition">¶</a></dt>
|
||||||
@ -1366,7 +1419,7 @@ image is built with the filename “${prefix}-${kernel.version}.img”</
|
|||||||
<dd><p>Bases: <a class="reference internal" href="#pylorax.base.DataHolder" title="pylorax.base.DataHolder"><tt class="xref py py-class docutils literal"><span class="pre">pylorax.base.DataHolder</span></tt></a></p>
|
<dd><p>Bases: <a class="reference internal" href="#pylorax.base.DataHolder" title="pylorax.base.DataHolder"><tt class="xref py py-class docutils literal"><span class="pre">pylorax.base.DataHolder</span></tt></a></p>
|
||||||
<dl class="attribute">
|
<dl class="attribute">
|
||||||
<dt id="pylorax.ArchData.bcj_arch">
|
<dt id="pylorax.ArchData.bcj_arch">
|
||||||
<tt class="descname">bcj_arch</tt><em class="property"> = {'ppc64': 'powerpc', 'arm': 'arm', 'x86_64': 'x86', 'ppc64le': 'powerpc', 'ppc': 'powerpc', 'armhfp': 'arm', 'i386': 'x86'}</em><a class="headerlink" href="#pylorax.ArchData.bcj_arch" title="Permalink to this definition">¶</a></dt>
|
<tt class="descname">bcj_arch</tt><em class="property"> = {'i386': 'x86', 'arm': 'arm', 'ppc64': 'powerpc', 'ppc': 'powerpc', 'armhfp': 'arm', 'x86_64': 'x86', 'ppc64le': 'powerpc'}</em><a class="headerlink" href="#pylorax.ArchData.bcj_arch" title="Permalink to this definition">¶</a></dt>
|
||||||
<dd></dd></dl>
|
<dd></dd></dl>
|
||||||
|
|
||||||
<dl class="attribute">
|
<dl class="attribute">
|
||||||
@ -1397,7 +1450,7 @@ image is built with the filename “${prefix}-${kernel.version}.img”</
|
|||||||
|
|
||||||
<dl class="method">
|
<dl class="method">
|
||||||
<dt id="pylorax.Lorax.run">
|
<dt id="pylorax.Lorax.run">
|
||||||
<tt class="descname">run</tt><big>(</big><em>dbo</em>, <em>product</em>, <em>version</em>, <em>release</em>, <em>variant=''</em>, <em>bugurl=''</em>, <em>isfinal=False</em>, <em>workdir=None</em>, <em>outputdir=None</em>, <em>buildarch=None</em>, <em>volid=None</em>, <em>domacboot=True</em>, <em>doupgrade=True</em>, <em>remove_temp=False</em>, <em>installpkgs=None</em>, <em>size=2</em>, <em>add_templates=None</em>, <em>add_template_vars=None</em>, <em>add_arch_templates=None</em>, <em>add_arch_template_vars=None</em><big>)</big><a class="reference internal" href="_modules/pylorax.html#Lorax.run"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.Lorax.run" title="Permalink to this definition">¶</a></dt>
|
<tt class="descname">run</tt><big>(</big><em>dbo</em>, <em>product</em>, <em>version</em>, <em>release</em>, <em>variant=''</em>, <em>bugurl=''</em>, <em>isfinal=False</em>, <em>workdir=None</em>, <em>outputdir=None</em>, <em>buildarch=None</em>, <em>volid=None</em>, <em>domacboot=True</em>, <em>doupgrade=True</em>, <em>remove_temp=False</em>, <em>installpkgs=None</em>, <em>size=2</em>, <em>add_templates=None</em>, <em>add_template_vars=None</em>, <em>add_arch_templates=None</em>, <em>add_arch_template_vars=None</em>, <em>verify=True</em><big>)</big><a class="reference internal" href="_modules/pylorax.html#Lorax.run"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.Lorax.run" title="Permalink to this definition">¶</a></dt>
|
||||||
<dd></dd></dl>
|
<dd></dd></dl>
|
||||||
|
|
||||||
</dd></dl>
|
</dd></dl>
|
||||||
@ -1465,7 +1518,7 @@ image is built with the filename “${prefix}-${kernel.version}.img”</
|
|||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var DOCUMENTATION_OPTIONS = {
|
var DOCUMENTATION_OPTIONS = {
|
||||||
URL_ROOT:'./',
|
URL_ROOT:'./',
|
||||||
VERSION:'23.12',
|
VERSION:'24.1',
|
||||||
COLLAPSE_INDEX:false,
|
COLLAPSE_INDEX:false,
|
||||||
FILE_SUFFIX:'.html',
|
FILE_SUFFIX:'.html',
|
||||||
HAS_SOURCE: true
|
HAS_SOURCE: true
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
|
||||||
<title>Search — Lorax 23.12 documentation</title>
|
<title>Search — Lorax 24.1 documentation</title>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<link rel="top" title="Lorax 23.12 documentation" href="index.html"/>
|
<link rel="top" title="Lorax 24.1 documentation" href="index.html"/>
|
||||||
|
|
||||||
|
|
||||||
<script src="_static/js/modernizr.min.js"></script>
|
<script src="_static/js/modernizr.min.js"></script>
|
||||||
@ -190,7 +190,7 @@
|
|||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var DOCUMENTATION_OPTIONS = {
|
var DOCUMENTATION_OPTIONS = {
|
||||||
URL_ROOT:'./',
|
URL_ROOT:'./',
|
||||||
VERSION:'23.12',
|
VERSION:'24.1',
|
||||||
COLLAPSE_INDEX:false,
|
COLLAPSE_INDEX:false,
|
||||||
FILE_SUFFIX:'.html',
|
FILE_SUFFIX:'.html',
|
||||||
HAS_SOURCE: true
|
HAS_SOURCE: true
|
||||||
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user