-
Notifications
You must be signed in to change notification settings - Fork 752
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4ae1987
commit fda48b4
Showing
4 changed files
with
307 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- $Revision$ --> | ||
|
||
<refentry xml:id="function.rpmdefine" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> | ||
<refnamediv> | ||
<refname>rpmdefine</refname> | ||
<refpurpose>Define or change a RPM macro value</refpurpose> | ||
</refnamediv> | ||
|
||
<refsect1 role="description"> | ||
&reftitle.description; | ||
<methodsynopsis> | ||
<type>bool</type><methodname>rpmdefine</methodname> | ||
<methodparam><type>string</type><parameter>text</parameter></methodparam> | ||
</methodsynopsis> | ||
<para> | ||
Define or change a RPM macro value. | ||
</para> | ||
<para> | ||
This can be used to select the database path and backend to use | ||
instead of system default one. | ||
</para> | ||
|
||
</refsect1> | ||
|
||
<refsect1 role="parameters"> | ||
&reftitle.parameters; | ||
<variablelist> | ||
<varlistentry> | ||
<term><parameter>text</parameter></term> | ||
<listitem> | ||
<para> | ||
Macro name, options, body. | ||
</para> | ||
</listitem> | ||
</varlistentry> | ||
</variablelist> | ||
</refsect1> | ||
|
||
<refsect1 role="returnvalues"> | ||
&reftitle.returnvalues; | ||
<para> | ||
&return.success; | ||
</para> | ||
</refsect1> | ||
|
||
<refsect1 role="examples"> | ||
&reftitle.examples; | ||
<para> | ||
<example> | ||
<title>A <function>rpmdefine</function> example</title> | ||
<programlisting role="php"> | ||
<![CDATA[ | ||
<?php | ||
// use an old database (bdb) from an EL-8 chroot | ||
rpmdefine("_dbpath /var/lib/mock/almalinux-8-x86_64/root/var/lib/rpm"); | ||
rpmdefine("_db_backend bdb_ro"); | ||
print_r(rpmdbinfo("almalinux-release")[0]["Summary"]); | ||
// use a new database (sqlite) from a Fedora-41 chroot | ||
rpmdefine("_dbpath /var/lib/mock/fedora-41-x86_64/root/usr/lib/sysimage/rpm"); | ||
rpmdefine("_db_backend sqlite"); | ||
print_r(rpmdbinfo("fedora-release")[0]["Summary"]); | ||
?> | ||
]]> | ||
</programlisting> | ||
&example.outputs; | ||
<screen> | ||
<![CDATA[ | ||
AlmaLinux release file | ||
Fedora release files | ||
]]> | ||
</screen> | ||
</example> | ||
</para> | ||
</refsect1> | ||
|
||
<refsect1 role="seealso"> | ||
&reftitle.seealso; | ||
<para> | ||
<simplelist> | ||
<member><function>rpmexpand</function></member> | ||
<member><function>rpmdbinfo</function></member> | ||
</simplelist> | ||
</para> | ||
</refsect1> | ||
|
||
</refentry> | ||
|
||
<!-- Keep this comment at the end of the file | ||
Local variables: | ||
mode: sgml | ||
sgml-omittag:t | ||
sgml-shorttag:t | ||
sgml-minimize-attributes:nil | ||
sgml-always-quote-attributes:t | ||
sgml-indent-step:1 | ||
sgml-indent-data:t | ||
indent-tabs-mode:nil | ||
sgml-parent-document:nil | ||
sgml-default-dtd-file:"~/.phpdoc/manual.ced" | ||
sgml-exposed-tags:nil | ||
sgml-local-catalogs:nil | ||
sgml-local-ecat-files:nil | ||
End: | ||
vim600: syn=xml fen fdm=syntax fdl=2 si | ||
vim: et tw=78 syn=sgml | ||
vi: ts=1 sw=1 | ||
--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- $Revision$ --> | ||
|
||
<refentry xml:id="function.rpmexpand" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> | ||
<refnamediv> | ||
<refname>rpmexpand</refname> | ||
<refpurpose>Retrieve expanded value of a RPM macro</refpurpose> | ||
</refnamediv> | ||
|
||
<refsect1 role="description"> | ||
&reftitle.description; | ||
<methodsynopsis> | ||
<type>string</type><methodname>rpmexpand</methodname> | ||
<methodparam><type>string</type><parameter>text</parameter></methodparam> | ||
</methodsynopsis> | ||
<para> | ||
Retrieve expanded value of a RPM macro. | ||
</para> | ||
|
||
</refsect1> | ||
|
||
<refsect1 role="parameters"> | ||
&reftitle.parameters; | ||
<variablelist> | ||
<varlistentry> | ||
<term><parameter>text</parameter></term> | ||
<listitem> | ||
<para> | ||
Text with RPM macros to expand. | ||
</para> | ||
</listitem> | ||
</varlistentry> | ||
</variablelist> | ||
</refsect1> | ||
|
||
<refsect1 role="returnvalues"> | ||
&reftitle.returnvalues; | ||
<para> | ||
A <type>string</type> with concatenated macro expansion(s). | ||
</para> | ||
</refsect1> | ||
|
||
<refsect1 role="examples"> | ||
&reftitle.examples; | ||
<para> | ||
<example> | ||
<title>A <function>rpmexpand</function> example</title> | ||
<programlisting role="php"> | ||
<![CDATA[ | ||
<?php | ||
$distro = rpmexpand("%{?fedora:Fedora %{fedora}}%{?rhel:Enterprise Linux %{rhel}}"); | ||
print_r($distro); | ||
?> | ||
]]> | ||
</programlisting> | ||
&example.outputs; | ||
<screen> | ||
<![CDATA[ | ||
Fedora 41 | ||
]]> | ||
</screen> | ||
</example> | ||
</para> | ||
</refsect1> | ||
|
||
<refsect1 role="seealso"> | ||
&reftitle.seealso; | ||
<para> | ||
<simplelist> | ||
<member><function>rpmexpandnumeric</function></member> | ||
</simplelist> | ||
</para> | ||
</refsect1> | ||
|
||
</refentry> | ||
|
||
<!-- Keep this comment at the end of the file | ||
Local variables: | ||
mode: sgml | ||
sgml-omittag:t | ||
sgml-shorttag:t | ||
sgml-minimize-attributes:nil | ||
sgml-always-quote-attributes:t | ||
sgml-indent-step:1 | ||
sgml-indent-data:t | ||
indent-tabs-mode:nil | ||
sgml-parent-document:nil | ||
sgml-default-dtd-file:"~/.phpdoc/manual.ced" | ||
sgml-exposed-tags:nil | ||
sgml-local-catalogs:nil | ||
sgml-local-ecat-files:nil | ||
End: | ||
vim600: syn=xml fen fdm=syntax fdl=2 si | ||
vim: et tw=78 syn=sgml | ||
vi: ts=1 sw=1 | ||
--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- $Revision$ --> | ||
|
||
<refentry xml:id="function.rpmexpandnumeric" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> | ||
<refnamediv> | ||
<refname>rpmexpandnumeric</refname> | ||
<refpurpose>Retrieve numerical value of a RPM macro</refpurpose> | ||
</refnamediv> | ||
|
||
<refsect1 role="description"> | ||
&reftitle.description; | ||
<methodsynopsis> | ||
<type>int</type><methodname>rpmexpandnumeric</methodname> | ||
<methodparam><type>string</type><parameter>text</parameter></methodparam> | ||
</methodsynopsis> | ||
<para> | ||
Retrieve numerical value of a RPM macro. | ||
</para> | ||
|
||
</refsect1> | ||
|
||
<refsect1 role="parameters"> | ||
&reftitle.parameters; | ||
<variablelist> | ||
<varlistentry> | ||
<term><parameter>text</parameter></term> | ||
<listitem> | ||
<para> | ||
Text with RPM macros to expand. | ||
</para> | ||
</listitem> | ||
</varlistentry> | ||
</variablelist> | ||
</refsect1> | ||
|
||
<refsect1 role="returnvalues"> | ||
&reftitle.returnvalues; | ||
<para> | ||
Macro expansion as a <type>int</type>. | ||
Boolean values (<literal>Y</literal> or <literal>y</literal> returns 1, | ||
<literal>N</literal> or <literal>n</literal> returns <literal>0</literal>) | ||
are permitted as well. An undefined macro returns <literal>0</literal>. | ||
</para> | ||
</refsect1> | ||
|
||
<refsect1 role="examples"> | ||
&reftitle.examples; | ||
<para> | ||
<example> | ||
<title>A <function>rpmexpandnumeric</function> example</title> | ||
<programlisting role="php"> | ||
<![CDATA[ | ||
<?php | ||
$bits = rpmexpandnumeric("%__isa_bits"); | ||
print_r($bits); | ||
?> | ||
]]> | ||
</programlisting> | ||
&example.outputs; | ||
<screen> | ||
<![CDATA[ | ||
64 | ||
]]> | ||
</screen> | ||
</example> | ||
</para> | ||
</refsect1> | ||
|
||
<refsect1 role="seealso"> | ||
&reftitle.seealso; | ||
<para> | ||
<simplelist> | ||
<member><function>rpmexpand</function></member> | ||
</simplelist> | ||
</para> | ||
</refsect1> | ||
|
||
</refentry> | ||
|
||
<!-- Keep this comment at the end of the file | ||
Local variables: | ||
mode: sgml | ||
sgml-omittag:t | ||
sgml-shorttag:t | ||
sgml-minimize-attributes:nil | ||
sgml-always-quote-attributes:t | ||
sgml-indent-step:1 | ||
sgml-indent-data:t | ||
indent-tabs-mode:nil | ||
sgml-parent-document:nil | ||
sgml-default-dtd-file:"~/.phpdoc/manual.ced" | ||
sgml-exposed-tags:nil | ||
sgml-local-catalogs:nil | ||
sgml-local-ecat-files:nil | ||
End: | ||
vim600: syn=xml fen fdm=syntax fdl=2 si | ||
vim: et tw=78 syn=sgml | ||
vi: ts=1 sw=1 | ||
--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters