Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 699498 Details for
Bug 910757
New function rlAssertBinaryOrigin
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
proposed patch
0001-src-add-rlAssertRpm-all-and-rlAssertBinaryOrigin.patch (text/plain), 3.66 KB, created by
Martin Kyral
on 2013-02-19 15:28:41 UTC
(
hide
)
Description:
proposed patch
Filename:
MIME Type:
Creator:
Martin Kyral
Created:
2013-02-19 15:28:41 UTC
Size:
3.66 KB
patch
obsolete
>From 09a85e8df9f815edf012e847315c424f7397e7c2 Mon Sep 17 00:00:00 2001 >From: Martin Kyral <mkyral@redhat.com> >Date: Fri, 15 Feb 2013 16:27:24 +0100 >Subject: [PATCH] src: add rlAssertRpm --all and rlAssertBinaryOrigin > >BZ#772622 >BZ#910757 >--- > src/rpms.sh | 89 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- > 1 file changed, 88 insertions(+), 1 deletion(-) > >diff --git a/src/rpms.sh b/src/rpms.sh >index 6819be5..4923168 100644 >--- a/src/rpms.sh >+++ b/src/rpms.sh >@@ -147,6 +147,7 @@ rlRpmPresent() { > Assertion making sure that a package is installed. > > rlAssertRpm name [version] [release] [arch]> >+ rlAssertRpm --all > > =over > >@@ -166,6 +167,10 @@ Package release like C<55.fc9> > > Package architucture like C<i386> > >+=item --all >+ >+Asserts all packages listed in the $PACKAGES $REQUIRES $COLLECTIONS env variables >+ > =back > > Returns 0 and asserts PASS if the specified package is installed. >@@ -173,7 +178,13 @@ Returns 0 and asserts PASS if the specified package is installed. > =cut > > rlAssertRpm() { >- __INTERNAL_RpmPresent assert $1 $2 $3 $4 >+ if [ "$1" = "--all" ] ; then >+ for package in $PACKAGES $REQUIRES $COLLECTIONS ; do >+ rlAssertRpm $package >+ done >+ else >+ __INTERNAL_RpmPresent assert $1 $2 $3 $4 >+ fi > } > > # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >@@ -228,6 +239,82 @@ rlAssertNotRpm() { > __INTERNAL_RpmPresent assert_inverted $1 $2 $3 $4 > } > >+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >+# rlAssertBinaryOrigin >+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >+: <<'=cut' >+=pod >+ >+=head3 rlAssertNotRpm >+ >+Assertion making sure that given binary is owned by (one of) the given package(s). >+ >+ rlAssertBinaryOrigin binary package [package2 [...]] >+ rlAssertBinaryOrigin binary $PACKAGES >+ >+=over >+ >+=item binary >+ >+Binary name like C<ksh> or C</bin/ksh> >+ >+=item package >+ >+Package name like C<ksh> >+ >+=item $PACKAGES >+ >+List of packages like C<ksh mksh> >+ >+=back >+ >+Returns 0 and asserts PASS if the specified binary belongs to (one of) the given package(s). >+Returns 1 and asserts FAIL if the specified binary does not belong to (any of) the given package(s). >+Returns 2 and asserts FAIL if the specified binary is not found. >+ >+=head3 Example >+ >+Function C<rlAssertBinaryOrigin> is useful especially in prepare phase >+where it causes abort if a binary is missing or is owned by different package: >+ >+rlAssertBinaryOrigin ksh mksh >+ >+Returns true if ksh is owned by the mksh package (in this case: /bin/ksh is a symlink pointing to /bin/mksh) >+ >+=cut >+ >+rlAssertBinaryOrigin() { >+ CMD=$1 >+ shift >+ PACKAGES=$@ >+ >+ local status=2 >+ which $CMD &>/dev/null && \ >+ { >+ status=1 >+ BINARY=$(ls -l $(which $CMD) | awk '{ print $NF }') >+ >+ # if the binary is a symlink to symlink in /etc/alternatives, we need to expand it to >+ # the real binary >+ echo $BINARY | grep 'alternatives' >/dev/null && \ >+ BINARY=$(ls -l $(echo $BINARY) | awk '{ print $NF }') >+ >+ # get the rpm owning the binary >+ BINARY_RPM=$(rpm -qf $BINARY) >+ >+ for rpm in $PACKAGES ; do >+ rpm -q $rpm &>/dev/null && \ >+ if [ $(rpm -q $rpm) = "$BINARY_RPM" ] ; then >+ status=0 >+ echo $BINARY_RPM >+ break >+ fi >+ done >+ } >+ [ $status -eq 2 ] && echo "$CMD: command not found" >+ >+ __INTERNAL_ConditionalAssert "Checking if binary $CMD belongs to rpm from: $PACKAGES" $status >+ return $status >+} > > # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > # AUTHORS >-- >1.8.1.2 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 910757
:
697868
|
699387
|
699498
|
699499
|
700562
|
702794
|
704988