-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add rpmexpand, rpmexpandnumeric to retrieve rpm macro value
add rpmdefine to set rpm macro value
- Loading branch information
1 parent
deb0dd4
commit 8997cc9
Showing
6 changed files
with
115 additions
and
5 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
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
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
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
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
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,25 @@ | ||
--TEST-- | ||
Check for rpmdefine, rpmexpand, rpmexpandnumeric | ||
--SKIPIF-- | ||
<?php if (!extension_loaded("rpminfo")) print "skip"; ?> | ||
--FILE-- | ||
<?php | ||
var_dump(is_dir(rpmexpand("%{_dbpath}"))); | ||
|
||
var_dump(rpmexpandnumeric("%__isa_bits") === PHP_INT_SIZE * 8); | ||
var_dump(rpmexpandnumeric("0%{?fedora}%{?rhel}") > 0); | ||
|
||
$name = "_my_test_macro_for_rpminfo_"; | ||
$val = __FILE__; | ||
var_dump(rpmexpand("%$name") === "%$name" ); | ||
var_dump(rpmdefine("$name $val")); | ||
var_dump(rpmexpand("%$name") === __FILE__); | ||
?> | ||
--EXPECT-- | ||
bool(true) | ||
bool(true) | ||
bool(true) | ||
bool(true) | ||
bool(true) | ||
bool(true) | ||
|