%PDF- %PDF-
| Direktori : /proc/self/root/proc/thread-self/root/lib/python2.7/site-packages/salt/states/ |
| Current File : //proc/self/root/proc/thread-self/root/lib/python2.7/site-packages/salt/states/pkgbuild.pyc |
�
���^c @@ s� d Z d d l m Z m Z d d l Z d d l Z d d l Z d d l m Z e j e
� Z d � Z d d d d e d d d � Z d d e d d
d d � Z d S(
sy
The pkgbuild state is the front of Salt package building backend. It
automatically builds DEB and RPM packages from specified sources
.. versionadded:: 2015.8.0
.. code-block:: yaml
salt_2015.5.2:
pkgbuild.built:
- runas: thatch
- results:
- salt-2015.5.2-2.el7.centos.noarch.rpm
- salt-api-2015.5.2-2.el7.centos.noarch.rpm
- salt-cloud-2015.5.2-2.el7.centos.noarch.rpm
- salt-master-2015.5.2-2.el7.centos.noarch.rpm
- salt-minion-2015.5.2-2.el7.centos.noarch.rpm
- salt-ssh-2015.5.2-2.el7.centos.noarch.rpm
- salt-syndic-2015.5.2-2.el7.centos.noarch.rpm
- dest_dir: /tmp/pkg
- spec: salt://pkg/salt/spec/salt.spec
- template: jinja
- deps:
- salt://pkg/salt/sources/required_dependency.rpm
- tgt: epel-7-x86_64
- sources:
- salt://pkg/salt/sources/logrotate.salt
- salt://pkg/salt/sources/README.fedora
- salt://pkg/salt/sources/salt-2015.5.2.tar.gz
- salt://pkg/salt/sources/salt-2015.5.2-tests.patch
- salt://pkg/salt/sources/salt-api
- salt://pkg/salt/sources/salt-api.service
- salt://pkg/salt/sources/salt-master
- salt://pkg/salt/sources/salt-master.service
- salt://pkg/salt/sources/salt-minion
- salt://pkg/salt/sources/salt-minion.service
- salt://pkg/salt/sources/saltpkg.sls
- salt://pkg/salt/sources/salt-syndic
- salt://pkg/salt/sources/salt-syndic.service
- salt://pkg/salt/sources/SaltTesting-2015.5.8.tar.gz
/tmp/pkg:
pkgbuild.repo
i ( t absolute_importt print_functionN( t sixc C@ s� y t t j | � � } Wnr t k
r� } | j t j k rV t j d j | � � n+ | j t j k r� t j
d j | � � n t � } n Xt t | � j | � � S( sz
Return a list of the filenames specified in the ``results`` argument, which
are not present in the dest_dir.
s- pkgbuild.built: dest_dir '{0}' does not exists, pkgbuilt.built: cannot access dest_dir '{0}'(
t sett ost listdirt OSErrort errnot ENOENTt logt debugt formatt EACCESt errort sortedt
difference( t resultst dest_dirt presentt exc( ( s8 /usr/lib/python2.7/site-packages/salt/states/pkgbuild.pyt _get_missing_results9 s
t bases /var/log/salt/pkgbuildc
C@ s� i | d 6i d 6d d 6t d 6}
| s@ d |
d <t |
d <|
St | t j � rd | j d � } n t | | � } |
r� | r� d |
d <|
St d r� d |
d <|
r� d
|
d <n# d |
d <|
d c d j | � 7<|
S| d k rt | t
� rd
|
d <t |
d <|
Sd } t j d t � d k r\x* | D] } | j
d � r6d } Pq6q6Wn t | | | | | | | | | | | �
|
d <t | | � } | r�d |
d <|
d c d j | � 7<t |
d <n
d |
d <|
S( s�
Ensure that the named package is built and exists in the named directory
name
The name to track the build, the name value is otherwise unused
runas
The user to run the build process as
dest_dir
The directory on the minion to place the built package(s)
spec
The location of the spec file (used for rpms)
sources
The list of package sources
tgt
The target platform to run the build on
template
Run the spec file through a templating engine
.. versionchanged:: 2015.8.2
This argument is now optional, allowing for no templating engine to
be used if none is desired.
deps
Packages required to ensure that the named package is built
can be hosted on either the salt master server or on an HTTP
or FTP server. Both HTTPS and HTTP are supported as well as
downloading directly from Amazon S3 compatible URLs with both
pre-configured and automatic IAM credentials
env
A dictionary of environment variables to be set prior to execution.
Example:
.. code-block:: yaml
- env:
DEB_BUILD_OPTIONS: 'nocheck'
.. warning::
The above illustrates a common PyYAML pitfall, that **yes**,
**no**, **on**, **off**, **true**, and **false** are all loaded as
boolean ``True`` and ``False`` values, and must be enclosed in
quotes to be used as strings. More info on this (and other) PyYAML
idiosyncrasies can be found :ref:`here <yaml-idiosyncrasies>`.
results
The names of the expected rpms that will be built
force : False
If ``True``, packages will be built even if they already exist in the
``dest_dir``. This is useful when building a package for continuous or
nightly package builds.
.. versionadded:: 2015.8.2
saltenv
The saltenv to use for files downloaded from the salt filesever
log_dir : /var/log/salt/rpmbuild
Root directory for log files created from the build. Logs will be
organized by package name, version, OS release, and CPU architecture
under this directory.
.. versionadded:: 2015.8.2
t namet changest t commentt results 'results' argument is requiredt ,s All needed packages existt tests Packages will be force-builts) The following packages need to be built: s , s7 Invalidly-formatted 'env' parameter. See documentation.s pkgbuild.buildt os_familyt RedHatt Suses .rpms rpmbuild.builds'