summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/libalpm/alpm.c5
-rw-r--r--lib/libalpm/alpm.h1
-rw-r--r--src/pacman/pacman.c6
3 files changed, 9 insertions, 3 deletions
diff --git a/lib/libalpm/alpm.c b/lib/libalpm/alpm.c
index 473993a0..fb19d076 100644
--- a/lib/libalpm/alpm.c
+++ b/lib/libalpm/alpm.c
@@ -81,4 +81,9 @@ int SYMEXPORT alpm_release(void)
* @brief Various libalpm functions
*/
+/* Get the version of library */
+const char SYMEXPORT *alpm_version(void) {
+ return(LIB_VERSION);
+}
+
/* vim: set ts=2 sw=2 noet: */
diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h
index 4e2c2219..7a16772a 100644
--- a/lib/libalpm/alpm.h
+++ b/lib/libalpm/alpm.h
@@ -58,6 +58,7 @@ typedef struct __pmfileconflict_t pmfileconflict_t;
int alpm_initialize(void);
int alpm_release(void);
+const char *alpm_version(void);
/*
* Logging facilities
diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c
index f1853203..331cbe91 100644
--- a/src/pacman/pacman.c
+++ b/src/pacman/pacman.c
@@ -154,7 +154,7 @@ static void usage(int op, const char * const myname)
static void version(void)
{
printf("\n");
- printf(" .--. Pacman v%s - libalpm v%s\n", PACKAGE_VERSION, LIB_VERSION);
+ printf(" .--. Pacman v%s - libalpm v%s\n", PACKAGE_VERSION, alpm_version());
printf("/ _.-' .-. .-. .-. Copyright (C) 2002-2008 Judd Vinet <jvinet@zeroflux.org>\n");
printf("\\ '-. '-' '-' '-'\n");
printf(" '--'\n");
@@ -187,8 +187,8 @@ static void setuseragent(void)
struct utsname un;
uname(&un);
- snprintf(agent, 100, "pacman/" PACKAGE_VERSION " (%s %s) libalpm/" LIB_VERSION,
- un.sysname, un.machine);
+ snprintf(agent, 100, "pacman/%s (%s %s) libalpm/%s",
+ PACKAGE_VERSION, un.sysname, un.machine, alpm_version());
setenv("HTTP_USER_AGENT", agent, 0);
}