Skip to content
Snippets Groups Projects
Commit 54af52f8 authored by Nagy Gabor's avatar Nagy Gabor Committed by Dan McGee
Browse files

New alpm_version function


Now pacman frontend uses this function instead of the compile-time libalpm
version number.

Signed-off-by: default avatarNagy Gabor <ngaba@bibl.u-szeged.hu>
[Dan: fix one more spot where LIB_VERSION was used]
Signed-off-by: default avatarDan McGee <dan@archlinux.org>
(cherry picked from commit 49197b74)
parent 7c3f6feb
No related branches found
Tags 20191011
No related merge requests found
......@@ -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: */
......@@ -60,6 +60,7 @@ typedef struct __pmgraph_t pmgraph_t;
int alpm_initialize(void);
int alpm_release(void);
const char *alpm_version(void);
/*
* Logging facilities
......
......@@ -150,7 +150,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");
......@@ -183,8 +183,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);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment