Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib/libalpm/package.c
diff options
context:
space:
mode:
authorJudd Vinet <judd@archlinux.org>2005-10-09 06:09:57 +0000
committerJudd Vinet <judd@archlinux.org>2005-10-09 06:09:57 +0000
commita36ded25eb9bdea5b73c33f993820b657f9e6623 (patch)
treecd1fede1bf2400edee18bd8542f4a426354550aa /lib/libalpm/package.c
parent9a4719d3c5e7d75fda485e3251edba0fb96b5b27 (diff)
added conversation callback support for transactions
Diffstat (limited to 'lib/libalpm/package.c')
-rw-r--r--lib/libalpm/package.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/libalpm/package.c b/lib/libalpm/package.c
index 3b0669fc..93f234e7 100644
--- a/lib/libalpm/package.c
+++ b/lib/libalpm/package.c
@@ -132,6 +132,27 @@ void pkg_free(pmpkg_t *pkg)
return;
}
+/* Create a dummy package struct that only contains the package
+ * name and version. This is useful when we're only passing
+ * name/version data, but it needs to be wrapped in a pmpkg_t
+ */
+pmpkg_t* pkg_dummy(const char *name, const char *version)
+{
+ pmpkg_t *pkg = pkg_new();
+ if(pkg == NULL) {
+ return(NULL);
+ }
+
+ if(name) {
+ STRNCPY(pkg->name, name, PKG_NAME_LEN-1);
+ }
+ if(version) {
+ STRNCPY(pkg->version, version, PKG_VERSION_LEN-1);
+ }
+
+ return(pkg);
+}
+
/* Parses the package description file for the current package
*
* Returns: 0 on success, 1 on error