mirror of
https://github.com/moparisthebest/pacman
synced 2024-12-23 00:08:50 -05:00
New alpm_version function
Now pacman frontend uses this function instead of the compile-time libalpm version number. Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu> [Dan: fix one more spot where LIB_VERSION was used] Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
parent
73ac9f7b27
commit
49197b7492
@ -81,4 +81,9 @@ int SYMEXPORT alpm_release(void)
|
|||||||
* @brief Various libalpm functions
|
* @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: */
|
/* vim: set ts=2 sw=2 noet: */
|
||||||
|
@ -58,6 +58,7 @@ typedef struct __pmfileconflict_t pmfileconflict_t;
|
|||||||
|
|
||||||
int alpm_initialize(void);
|
int alpm_initialize(void);
|
||||||
int alpm_release(void);
|
int alpm_release(void);
|
||||||
|
const char *alpm_version(void);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Logging facilities
|
* Logging facilities
|
||||||
|
@ -154,7 +154,7 @@ static void usage(int op, const char * const myname)
|
|||||||
static void version(void)
|
static void version(void)
|
||||||
{
|
{
|
||||||
printf("\n");
|
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("/ _.-' .-. .-. .-. Copyright (C) 2002-2008 Judd Vinet <jvinet@zeroflux.org>\n");
|
||||||
printf("\\ '-. '-' '-' '-'\n");
|
printf("\\ '-. '-' '-' '-'\n");
|
||||||
printf(" '--'\n");
|
printf(" '--'\n");
|
||||||
@ -187,8 +187,8 @@ static void setuseragent(void)
|
|||||||
struct utsname un;
|
struct utsname un;
|
||||||
|
|
||||||
uname(&un);
|
uname(&un);
|
||||||
snprintf(agent, 100, "pacman/" PACKAGE_VERSION " (%s %s) libalpm/" LIB_VERSION,
|
snprintf(agent, 100, "pacman/%s (%s %s) libalpm/%s",
|
||||||
un.sysname, un.machine);
|
PACKAGE_VERSION, un.sysname, un.machine, alpm_version());
|
||||||
setenv("HTTP_USER_AGENT", agent, 0);
|
setenv("HTTP_USER_AGENT", agent, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user