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 835970 Details for
Bug 1041577
hy_package_get_hdr_chksum() fails for some installed packages
[?]
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.
small reproducer
hy.c (text/x-csrc), 1.59 KB, created by
Richard Hughes
on 2013-12-12 17:57:12 UTC
(
hide
)
Description:
small reproducer
Filename:
MIME Type:
Creator:
Richard Hughes
Created:
2013-12-12 17:57:12 UTC
Size:
1.59 KB
patch
obsolete
>//gcc -o hy hy.c `pkg-config --cflags --libs hawkey` && ./hy > >#include <hawkey/packagelist.h> >#include <hawkey/query.h> >#include <hawkey/sack.h> >#include <hawkey/package.h> >#include <hawkey/util.h> >#include <stdio.h> > >int >main (int argc, char *argv[]) >{ > HyPackage pkg; > HyPackageList pkglist = NULL; > HyQuery query = NULL; > HySack sack = NULL; > char *checksum_str; > const char *cachedir = "/var/cache/PackageKit/hawkey"; > const char *package = "rhythmbox"; > const unsigned char *checksum; > int checksum_type; > int i; > int rc; > > /* create empty sack */ > sack = hy_sack_create (cachedir, NULL, NULL, HY_MAKE_CACHE_DIR); > if (sack == NULL) { > printf ("NO SACK\n"); > goto out; > } > > rc = hy_sack_load_system_repo (sack, NULL, HY_BUILD_CACHE); > if (rc) { > printf ("NO SYSTEM REPO\n"); > goto out; > } > > query = hy_query_create (sack); > printf ("LOOKING FOR %s\n", package); > hy_query_filter (query, HY_PKG_NAME, HY_EQ, package); > pkglist = hy_query_run (query); > if (!pkglist) { > printf ("NO PKGLIST\n"); > goto out; > } > > FOR_PACKAGELIST(pkg, pkglist, i) { > /* we're supposed to have a hdr checksum as the package is > * installed and originated from the rpmdb */ > checksum = hy_package_get_hdr_chksum (pkg, &checksum_type); > if (checksum == NULL) { > printf ("NO HDR CHECKSUM for %s\n", > hy_package_get_name (pkg)); > continue; > } > checksum_str = hy_chksum_str (checksum, checksum_type); > printf ("CHECKSUM %s\n", checksum_str); > hy_free (checksum_str); > > } >out: > if (pkglist != NULL) > hy_packagelist_free (pkglist); > if (query != NULL) > hy_query_free (query); > if (sack != NULL) > hy_sack_free (sack); > return 0; >}
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 Raw
Actions:
View
Attachments on
bug 1041577
: 835970