mirror of
https://github.com/moparisthebest/pacman
synced 2025-01-09 04:57:59 -05:00
Coding style cleanups
Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
parent
86bc36412e
commit
5b5b250443
@ -1043,19 +1043,19 @@ void print_packages(const alpm_list_t *packages)
|
|||||||
char *string = strdup(config->print_format);
|
char *string = strdup(config->print_format);
|
||||||
char *temp = string;
|
char *temp = string;
|
||||||
/* %n : pkgname */
|
/* %n : pkgname */
|
||||||
if(strstr(temp,"%n")) {
|
if(strstr(temp, "%n")) {
|
||||||
string = strreplace(temp, "%n", alpm_pkg_get_name(pkg));
|
string = strreplace(temp, "%n", alpm_pkg_get_name(pkg));
|
||||||
free(temp);
|
free(temp);
|
||||||
temp = string;
|
temp = string;
|
||||||
}
|
}
|
||||||
/* %v : pkgver */
|
/* %v : pkgver */
|
||||||
if(strstr(temp,"%v")) {
|
if(strstr(temp, "%v")) {
|
||||||
string = strreplace(temp, "%v", alpm_pkg_get_version(pkg));
|
string = strreplace(temp, "%v", alpm_pkg_get_version(pkg));
|
||||||
free(temp);
|
free(temp);
|
||||||
temp = string;
|
temp = string;
|
||||||
}
|
}
|
||||||
/* %l : location */
|
/* %l : location */
|
||||||
if(strstr(temp,"%l")) {
|
if(strstr(temp, "%l")) {
|
||||||
char *pkgloc = pkg_get_location(pkg);
|
char *pkgloc = pkg_get_location(pkg);
|
||||||
string = strreplace(temp, "%l", pkgloc);
|
string = strreplace(temp, "%l", pkgloc);
|
||||||
free(pkgloc);
|
free(pkgloc);
|
||||||
@ -1063,7 +1063,7 @@ void print_packages(const alpm_list_t *packages)
|
|||||||
temp = string;
|
temp = string;
|
||||||
}
|
}
|
||||||
/* %r : repo */
|
/* %r : repo */
|
||||||
if(strstr(temp,"%r")) {
|
if(strstr(temp, "%r")) {
|
||||||
const char *repo = "local";
|
const char *repo = "local";
|
||||||
alpm_db_t *db = alpm_pkg_get_db(pkg);
|
alpm_db_t *db = alpm_pkg_get_db(pkg);
|
||||||
if(db) {
|
if(db) {
|
||||||
@ -1074,7 +1074,7 @@ void print_packages(const alpm_list_t *packages)
|
|||||||
temp = string;
|
temp = string;
|
||||||
}
|
}
|
||||||
/* %s : size */
|
/* %s : size */
|
||||||
if(strstr(temp,"%s")) {
|
if(strstr(temp, "%s")) {
|
||||||
char *size;
|
char *size;
|
||||||
pm_asprintf(&size, "%jd", (intmax_t)pkg_get_size(pkg));
|
pm_asprintf(&size, "%jd", (intmax_t)pkg_get_size(pkg));
|
||||||
string = strreplace(temp, "%s", size);
|
string = strreplace(temp, "%s", size);
|
||||||
|
Loading…
Reference in New Issue
Block a user