|
|
# include <sys/time.h> | # include <sys/time.h> |
#endif | #endif |
| |
#define QLOP_DEFAULT_LOGFILE "/var/log/emerge.log" |
#define QLOP_DEFAULT_LOGFILE "/var/log/paludis.log" |
| |
| |
| |
#define QLOP_FLAGS "gtluscf:F:H" COMMON_FLAGS |
#define QLOP_FLAGS "gtluso:cf:F:H" COMMON_FLAGS |
static struct option const qlop_long_opts[] = { | static struct option const qlop_long_opts[] = { |
{"gauge", no_argument, NULL, 'g'}, | {"gauge", no_argument, NULL, 'g'}, |
{"time", no_argument, NULL, 't'}, | {"time", no_argument, NULL, 't'}, |
|
Lines 33-38
static struct option const qlop_long_opt
|
Link Here
|
|---|
|
{"list", no_argument, NULL, 'l'}, | {"list", no_argument, NULL, 'l'}, |
{"unlist", no_argument, NULL, 'u'}, | {"unlist", no_argument, NULL, 'u'}, |
{"sync", no_argument, NULL, 's'}, | {"sync", no_argument, NULL, 's'}, |
|
{"overlay", a_argument, NULL, 'o'}, |
{"current", no_argument, NULL, 'c'}, | {"current", no_argument, NULL, 'c'}, |
{"logfile", a_argument, NULL, 'f'}, | {"logfile", a_argument, NULL, 'f'}, |
COMMON_LONG_OPTS | COMMON_LONG_OPTS |
|
Lines 44-49
static const char *qlop_opts_help[] = {
|
Link Here
|
|---|
|
"Show merge history", | "Show merge history", |
"Show unmerge history", | "Show unmerge history", |
"Show sync history", | "Show sync history", |
|
"Do only consider the <arg> repository", |
"Show current emerging packages", | "Show current emerging packages", |
"Read emerge logfile instead of " QLOP_DEFAULT_LOGFILE, | "Read emerge logfile instead of " QLOP_DEFAULT_LOGFILE, |
COMMON_OPTS_HELP | COMMON_OPTS_HELP |
|
Lines 79-108
static const char *chop_ctime(time_t t)
|
Link Here
|
|---|
|
return ctime_out; | return ctime_out; |
} | } |
| |
unsigned long show_merge_times(char *package, const char *logfile, int average, char human_readable); |
unsigned long show_merge_times(char *package, const short repo, const char repo_search[], const char *logfile, int average, char human_readable); |
unsigned long show_merge_times(char *package, const char *logfile, int average, char human_readable) |
unsigned long show_merge_times(char *package, const short repo, const char repo_search[], const char *logfile, int average, char human_readable) |
{ | { |
FILE *fp; | FILE *fp; |
char cat[126], buf[2][BUFSIZ]; |
char catPN[BUFSIZ], buf[2][BUFSIZ], matched; |
char *pkg, *p; |
char *p, *q; |
unsigned long count, merge_time; | unsigned long count, merge_time; |
time_t t[2]; | time_t t[2]; |
depend_atom *atom; |
depend_atom *atom,*search; |
|
int l; |
|
long pos; |
| |
t[0] = t[1] = 0UL; | t[0] = t[1] = 0UL; |
count = merge_time = 0; | count = merge_time = 0; |
cat[0] = 0; |
matched = 0; |
|
pos = 0; |
| |
if ((p = strchr(package, '/')) != NULL) { |
if ((search = atom_explode(package)) == NULL ) |
pkg = p + 1; |
err("%s is not a valid atom", package); |
strncpy(cat, package, sizeof(cat)); |
if (!search->CATEGORY && !search->PN && !search->OVERLAY) |
if ((p = strchr(cat, '/')) != NULL) |
err("You need to specify at least an overlay, a category, or a package name"); |
*p = 0; |
|
} else { |
|
pkg = package; |
|
} |
|
| |
DBG("Searching for %s in %s\n", pkg, logfile); |
DBG("Searching for %s in %s\n", package, logfile); |
| |
if ((fp = fopen(logfile, "r")) == NULL) { | if ((fp = fopen(logfile, "r")) == NULL) { |
warnp("Could not open logfile '%s'", logfile); | warnp("Could not open logfile '%s'", logfile); |
|
Lines 110-116
unsigned long show_merge_times(char *pac
|
Link Here
|
|---|
|
} | } |
| |
while ((fgets(buf[0], sizeof(buf[0]), fp)) != NULL) { | while ((fgets(buf[0], sizeof(buf[0]), fp)) != NULL) { |
if (strstr(buf[0], pkg) == NULL) |
if (matched) { |
|
matched = 0; |
|
continue; |
|
} |
|
/* len( time:{starting,finished} install of package ) = 41 */ |
|
if (search->CATEGORY && !strstr(&buf[0][40], search->CATEGORY)) |
|
continue; |
|
|
|
if (search->PN && !strstr(&buf[0][40], search->PN)) |
|
continue; |
|
|
|
if (search->OVERLAY && !strstr(&buf[0][40], search->OVERLAY)) |
continue; | continue; |
| |
if ((p = strchr(buf[0], '\n')) != NULL) | if ((p = strchr(buf[0], '\n')) != NULL) |
|
Lines 121-200
unsigned long show_merge_times(char *pac
|
Link Here
|
|---|
|
t[0] = atol(buf[0]); | t[0] = atol(buf[0]); |
strcpy(buf[1], p + 1); | strcpy(buf[1], p + 1); |
rmspace(buf[1]); | rmspace(buf[1]); |
if ((strncmp(buf[1], ">>> emerge (", 12)) == 0) { |
if ((strncmp(buf[1], "starting install of package", 26)) == 0) { |
char matched = 0; |
p = &buf[1][28]; |
if ((p = strchr(buf[1], ')')) == NULL) |
if (repo && !strstr(p, repo_search)) |
continue; | continue; |
*p = 0; |
|
strcpy(buf[0], p + 1); |
if ((q = strchr(p, ' ')) == NULL) |
rmspace(buf[0]); |
|
if ((p = strchr(buf[0], ' ')) == NULL) |
|
continue; | continue; |
*p = 0; |
*q = 0; |
|
|
|
strcpy(buf[0], p); |
|
rmspace(buf[0]); |
if ((atom = atom_explode(buf[0])) == NULL) | if ((atom = atom_explode(buf[0])) == NULL) |
continue; | continue; |
| |
if (*cat) { |
if (search->CATEGORY && strcmp(atom->CATEGORY, search->CATEGORY)) { |
if ((strcmp(cat, atom->CATEGORY) == 0) && (strcmp(pkg, atom->PN) == 0)) |
atom_implode(atom); |
matched = 1; |
continue; |
} else if (strcmp(pkg, atom->PN) == 0) |
} |
matched = 1; |
|
|
if (search->PN && *search->PN && strcmp(atom->PN, search->PN)) { |
|
atom_implode(atom); |
|
continue; |
|
} |
|
|
|
if (search->PV && strcmp(atom->PV, search->PV)) { |
|
atom_implode(atom); |
|
continue; |
|
} |
|
|
|
if (search->PR_int && atom->PR_int!=search->PR_int) { |
|
atom_implode(atom); |
|
continue; |
|
} |
|
|
|
if (search->OVERLAY && strcmp(atom->OVERLAY, search->OVERLAY)) { |
|
atom_implode(atom); |
|
continue; |
|
} |
|
pos = ftell(fp); |
|
matched = 1; |
| |
if (matched) { | if (matched) { |
while ((fgets(buf[0], sizeof(buf[0]), fp)) != NULL) { |
/* In case of simultaneous install, we search the corresponding */ |
|
/* "finished install of package" pkg up to 20 lines after the 'starting line' */ |
|
l=0; |
|
snprintf(catPN, sizeof(catPN), "%s/%s-%s::%s", atom->CATEGORY, atom->PN, (atom->PR_int ? atom->PVR : atom->PV), atom->OVERLAY); |
|
while ((fgets(buf[0], sizeof(buf[0]), fp)) != NULL && l++ < 20) { |
|
if ((p = strchr(buf[0],':')) == NULL) |
|
continue; |
|
p = p+2; |
|
|
|
/* Stop the search in case the package is already being reinstalled even in a different version/revision */ |
|
if (!strncmp(p, "starting", 8) && strcmp(p+28, catPN)) |
|
break; |
|
|
|
if (strncmp(p, "finished install of package", 26) != 0) |
|
continue; |
|
if (!strcmp(p+28, catPN)) |
|
continue; |
|
|
if ((p = strchr(buf[0], '\n')) != NULL) | if ((p = strchr(buf[0], '\n')) != NULL) |
*p = 0; | *p = 0; |
if ((p = strchr(buf[0], ':')) == NULL) | if ((p = strchr(buf[0], ':')) == NULL) |
continue; |
*p = 0; |
*p = 0; |
|
t[1] = atol(buf[0]); | t[1] = atol(buf[0]); |
strcpy(buf[1], p + 1); | strcpy(buf[1], p + 1); |
rmspace(buf[1]); | rmspace(buf[1]); |
if (*buf[1] == '*') |
|
break; |
if (!average) { |
if ((strncmp(buf[1], "::: completed emerge (", 22)) == 0) { |
strcpy(buf[1], ""); |
if (!average) { |
if (verbose) |
strcpy(buf[1], ""); |
snprintf(buf[1], sizeof(buf[1]), "-%s%s::%s ", (atom->PR_int ? atom->PVR : atom->PV), YELLOW, atom->OVERLAY); |
if (verbose) { |
|
if (atom->PR_int) |
printf("%s%s/%s%s%s%s: %s: ", GREEN, atom->CATEGORY, BLUE, atom->PN, buf[1], NORM, chop_ctime(t[0])); |
snprintf(buf[1], sizeof(buf[1]), "-%s-r%i", atom->PV, atom->PR_int); |
if (human_readable) |
else |
print_seconds_for_earthlings(t[1] - t[0]); |
snprintf(buf[1], sizeof(buf[1]), "-%s", atom->PV); |
else |
} |
printf("%s%lu%s seconds", GREEN, (t[1] - t[0]), NORM); |
printf("%s%s%s%s: %s: ", BLUE, atom->PN, buf[1], NORM, chop_ctime(t[0])); |
puts(""); |
if (human_readable) |
|
print_seconds_for_earthlings(t[1] - t[0]); |
|
else |
|
printf("%s%lu%s seconds", GREEN, (t[1] - t[0]), NORM); |
|
puts(""); |
|
} |
|
merge_time += (t[1] - t[0]); |
|
count++; |
|
break; |
|
} | } |
|
merge_time += (t[1] - t[0]); |
|
count++; |
|
break; |
|
|
} | } |
} | } |
atom_implode(atom); | atom_implode(atom); |
|
/* time to go back where we were */ |
|
fseek(fp, pos, SEEK_SET); |
} | } |
} | } |
fclose(fp); | fclose(fp); |
if (count == 0) | if (count == 0) |
return 0; | return 0; |
if (average == 1) { | if (average == 1) { |
printf("%s%s%s: ", BLUE, pkg, NORM); |
printf("%s%s%s%s%s%s%s%s%s%s%s : ", GREEN, (search->CATEGORY? search->CATEGORY : ""), (search->CATEGORY ? "/": ""), |
|
BLUE, search->PN, (search->PV ? "-" : ""), (search->PV ? (search->PR_int ? search->PVR : search->PV) : ""), |
|
YELLOW, (search->OVERLAY ? "::" : ""), (search->OVERLAY ? search->OVERLAY : ""), NORM); |
if (human_readable) | if (human_readable) |
print_seconds_for_earthlings(merge_time / count); | print_seconds_for_earthlings(merge_time / count); |
else | else |
printf("%s%lu%s seconds average", GREEN, merge_time / count, NORM); |
printf("%s%lu%s seconds", GREEN, merge_time / count, NORM); |
printf(" for %s%lu%s merges\n", GREEN, count, NORM); |
printf(" average for %s%lu%s merges%s", GREEN, count, NORM, (verbose ? ", for a total time of " : "")); |
|
|
|
if (verbose) { |
|
if (human_readable) |
|
print_seconds_for_earthlings(merge_time); |
|
else |
|
printf("%s%lu%s seconds", GREEN, merge_time, NORM); |
|
} |
|
fputc('\n', stdout); |
} else { | } else { |
printf("%s%s%s: %s%lu%s times\n", BLUE, pkg, NORM, GREEN, count, NORM); |
printf("%s%s%s%s%s%s%s%s%s%s%s : %s%lu%s times%s", GREEN, (search->CATEGORY ? search->CATEGORY : ""), (search->CATEGORY ? "/": ""), |
|
BLUE, (search->PN ? search->PN : ""), (search->PV ? "-" : ""), (search->PV ? (search->PR_int ? search->PVR : search->PV) : ""), |
|
YELLOW, (search->OVERLAY ? "::" : ""), (search->OVERLAY ? search->OVERLAY : ""), |
|
NORM, GREEN, count, NORM, |
|
(verbose ? ", for a total time of " : "")); |
|
if (verbose) { |
|
if (human_readable) |
|
print_seconds_for_earthlings(merge_time); |
|
else |
|
printf("%s%lu%s seconds", GREEN, merge_time, NORM); |
|
} |
|
fputc('\n', stdout); |
} | } |
|
atom_implode(search); |
return 0; | return 0; |
} | } |
| |
void show_emerge_history(char listflag, int argc, char **argv, const char *logfile); |
void show_emerge_history(char listflag, const short repo, const char repo_search[], int argc, char **argv, const char *logfile); |
void show_emerge_history(char listflag, int argc, char **argv, const char *logfile) |
void show_emerge_history(char listflag, const short repo, const char repo_search[], int argc, char **argv, const char *logfile) |
{ | { |
FILE *fp; | FILE *fp; |
char buf[BUFSIZ], merged; | char buf[BUFSIZ], merged; |
|
Lines 222-244
void show_emerge_history(char listflag,
|
Link Here
|
|---|
|
if ((p = strchr(buf, ':')) == NULL) | if ((p = strchr(buf, ':')) == NULL) |
continue; | continue; |
*p = 0; | *p = 0; |
q = p + 3; |
q = p + 2; |
| |
t = (time_t) atol(buf); | t = (time_t) atol(buf); |
| |
if ((listflag & QLOP_LIST) && !strncmp(q, "::: completed emerge (", 22)) { |
if ((listflag & QLOP_LIST) && !strncmp(q, "finished install of package", 25)) { |
merged = 1; | merged = 1; |
if ((p = strchr(q, ')')) == NULL) |
p = strstr(q, "package"); |
continue; |
q = p + 1; |
q = p + 2; |
|
if ((p = strchr(q, ' ')) == NULL) | if ((p = strchr(q, ' ')) == NULL) |
continue; | continue; |
*p = 0; |
q = p + 1; |
} else if ((listflag & QLOP_UNLIST) && !strncmp(q, ">>> unmerge success: ", 21)) { |
if (repo) { |
|
if ((p = strstr(q, "::")) && strncmp(p+2, repo_search, sizeof(repo_search))) |
|
continue; |
|
} |
|
} else if ((listflag & QLOP_UNLIST) && !strncmp(q, "finished uninstall of package", 29)) { |
merged = 0; | merged = 0; |
if ((p = strchr(q, ':')) == NULL) |
p = strstr(q, "package"); |
|
q = p + 1; |
|
if ((p = strchr(q, ' ')) == NULL) |
continue; | continue; |
q = p + 2; |
q = p + 1; |
|
if ((p = strchr(p, ':')) != NULL) |
|
*p = 0; |
} | } |
else | else |
continue; | continue; |
|
Lines 258-265
void show_emerge_history(char listflag,
|
Link Here
|
|---|
|
fclose(fp); | fclose(fp); |
} | } |
| |
void show_sync_history(const char *logfile); |
void show_sync_history(const char *logfile, const short repo, char repo_search[]); |
void show_sync_history(const char *logfile) |
void show_sync_history(const char *logfile, const short repo, char repo_search[]) |
{ | { |
FILE *fp; | FILE *fp; |
char buf[BUFSIZ]; | char buf[BUFSIZ]; |
|
Lines 274-280
void show_sync_history(const char *logfi
|
Link Here
|
|---|
|
while ((fgets(buf, sizeof(buf), fp)) != NULL) { | while ((fgets(buf, sizeof(buf), fp)) != NULL) { |
if (strlen(buf) < 35) | if (strlen(buf) < 35) |
continue; | continue; |
if (strncmp(buf+12, "=== Sync completed with", 23) != 0) |
if (strncmp(buf+12, "finished sync", 13) != 0) |
|
continue; |
|
|
|
if (repo && strstr(buf, repo_search) == NULL) |
continue; | continue; |
| |
if ((p = strchr(buf, '\n')) != NULL) | if ((p = strchr(buf, '\n')) != NULL) |
|
Lines 282-294
void show_sync_history(const char *logfi
|
Link Here
|
|---|
|
if ((p = strchr(buf, ':')) == NULL) | if ((p = strchr(buf, ':')) == NULL) |
continue; | continue; |
*p = 0; | *p = 0; |
q = p+2; |
q = p+1; |
| |
t = (time_t)atol(buf); | t = (time_t)atol(buf); |
| |
if ((p = strstr(q, "with")) == NULL) |
if ((p = strstr(q, "repository")) == NULL) |
continue; | continue; |
q = p + 5; |
q = p + 11; |
| |
printf("%s >>> %s%s%s\n", chop_ctime(t), GREEN, q, NORM); | printf("%s >>> %s%s%s\n", chop_ctime(t), GREEN, q, NORM); |
} | } |
|
Lines 304-313
void show_current_emerge(void)
|
Link Here
|
|---|
|
pid_t pid; | pid_t pid; |
char buf[BUFSIZE], bufstat[300]; | char buf[BUFSIZE], bufstat[300]; |
char path[50]; | char path[50]; |
char *p, *q; |
char *p, *q, *cat, *pnv; |
unsigned long long start_time = 0; | unsigned long long start_time = 0; |
double uptime_secs; | double uptime_secs; |
time_t start_date; | time_t start_date; |
|
overlay_t *overlay_tmp; |
| |
if ((proc = opendir("/proc")) == NULL) { | if ((proc = opendir("/proc")) == NULL) { |
warnp("Could not open /proc"); | warnp("Could not open /proc"); |
|
Lines 319-333
void show_current_emerge(void)
|
Link Here
|
|---|
|
if ((pid = (pid_t)atol(de->d_name)) == 0) | if ((pid = (pid_t)atol(de->d_name)) == 0) |
continue; | continue; |
| |
/* portage renames the cmdline so the package name is first */ |
|
snprintf(path, sizeof(path), "/proc/%i/cmdline", pid); | snprintf(path, sizeof(path), "/proc/%i/cmdline", pid); |
if (!eat_file(path, buf, sizeof(buf))) | if (!eat_file(path, buf, sizeof(buf))) |
continue; | continue; |
| |
if (buf[0] == '[' && (p = strchr(buf, ']')) != NULL && strstr(buf, "sandbox") != NULL) { |
if (! strncmp(buf, "sandbox", 7)) { |
*p = '\0'; |
/* 0123456789012345678 */ |
p = buf+1; |
if (!(p = strstr(&buf[8],"paludis/ebuild.bash"))) |
q = p + strlen(p) + 1; |
continue; |
|
|
|
q = p + 20; |
|
if (*q != '/') |
|
continue; |
|
|
|
/* |
|
* ex: /var/paludis/repositories/local/category/package_name/package_name_version.ebuild |
|
* expected: |
|
* q cat 0 pnv |
|
*/ |
|
if (q == (pnv=strrchr(q, '/'))) |
|
continue; |
|
*pnv = 0; |
|
pnv++; |
|
if (q == (cat=strrchr(q, '/'))) |
|
continue; |
|
*cat = 0; |
|
if (q == (cat=strrchr(q, '/'))) |
|
continue; |
|
*cat = 0; |
|
cat++; |
|
overlay_tmp=first_overlay; |
|
do { |
|
if (!strcmp(q, overlay_tmp->path)) |
|
break; |
|
} while ((overlay_tmp=overlay_tmp->next)); |
|
|
|
if (NULL == overlay_tmp) |
|
continue; |
| |
/* open the stat file to figure out how long we have been running */ | /* open the stat file to figure out how long we have been running */ |
snprintf(path, sizeof(path), "/proc/%i/stat", pid); | snprintf(path, sizeof(path), "/proc/%i/stat", pid); |
|
Lines 356-365
void show_current_emerge(void)
|
Link Here
|
|---|
|
/* figure out when this thing started and then show it */ | /* figure out when this thing started and then show it */ |
start_date = time(0) - (uptime_secs - (start_time / HZ)); | start_date = time(0) - (uptime_secs - (start_time / HZ)); |
printf( | printf( |
" %s*%s %s%s%s\n" |
" %s*%s %s::%s%s%s/%s%s\n" |
" started: %s%s%s\n" | " started: %s%s%s\n" |
" elapsed: ", /*%s%llu%s seconds\n",*/ | " elapsed: ", /*%s%llu%s seconds\n",*/ |
BOLD, NORM, BLUE, p, NORM, |
BOLD, YELLOW, overlay_tmp->name, NORM, BLUE, cat, pnv, NORM, |
GREEN, chop_ctime(start_date), NORM); | GREEN, chop_ctime(start_date), NORM); |
print_seconds_for_earthlings(uptime_secs - (start_time / HZ)); | print_seconds_for_earthlings(uptime_secs - (start_time / HZ)); |
puts(NORM); | puts(NORM); |
|
Lines 380-385
void show_current_emerge(void)
|
Link Here
|
|---|
|
char *p, *q; | char *p, *q; |
time_t start_date = 0; | time_t start_date = 0; |
| |
|
/* this would need to be written for paludis, but I don't really know *BSD */ |
|
warn("You need to adapt the show_current_emerge(void) function for __FreeBSD__\n" |
|
"this may be trivial, just do as in the __linux__ one, but as I can't test it, I didn't make it"); |
|
|
if (! (kd = kvm_open("/dev/null", "/dev/null", "/dev/null", O_RDONLY, "kvm_open"))) { | if (! (kd = kvm_open("/dev/null", "/dev/null", "/dev/null", O_RDONLY, "kvm_open"))) { |
warnp("Could not open kvm: %s", kvm_geterr(kd)); | warnp("Could not open kvm: %s", kvm_geterr(kd)); |
return; | return; |
|
Lines 433-444
int qlop_main(int argc, char **argv)
|
Link Here
|
|---|
|
int i, average = 1; | int i, average = 1; |
char do_time, do_list, do_unlist, do_sync, do_current, do_human_readable = 0; | char do_time, do_list, do_unlist, do_sync, do_current, do_human_readable = 0; |
char *opt_logfile; | char *opt_logfile; |
|
short repo; |
|
char repo_search[64]; |
const char *logfile = QLOP_DEFAULT_LOGFILE; | const char *logfile = QLOP_DEFAULT_LOGFILE; |
|
overlay_t *overlay_tmp; |
| |
DBG("argc=%d argv[0]=%s argv[1]=%s", | DBG("argc=%d argv[0]=%s argv[1]=%s", |
argc, argv[0], argc > 1 ? argv[1] : "NULL?"); | argc, argv[0], argc > 1 ? argv[1] : "NULL?"); |
| |
opt_logfile = NULL; | opt_logfile = NULL; |
|
repo = 0; |
|
repo_search[0] = 0; |
do_time = do_list = do_unlist = do_sync = do_current = 0; | do_time = do_list = do_unlist = do_sync = do_current = 0; |
| |
while ((i = GETOPT_LONG(QLOP, qlop, "")) != -1) { | while ((i = GETOPT_LONG(QLOP, qlop, "")) != -1) { |
|
Lines 448-454
int qlop_main(int argc, char **argv)
|
Link Here
|
|---|
|
case 't': do_time = 1; break; | case 't': do_time = 1; break; |
case 'l': do_list = 1; break; | case 'l': do_list = 1; break; |
case 'u': do_unlist = 1; break; | case 'u': do_unlist = 1; break; |
case 's': do_sync = 1; break; |
case 's': |
|
if (do_sync) err("Only use -s or -S once"); |
|
do_sync = 1; |
|
break; |
|
case 'o': |
|
repo = 1; |
|
strncpy(repo_search, optarg, sizeof(repo_search)); |
|
break; |
case 'c': do_current = 1; break; | case 'c': do_current = 1; break; |
case 'g': do_time = 1; average = 0; break; | case 'g': do_time = 1; average = 0; break; |
case 'H': do_human_readable = 1; break; | case 'H': do_human_readable = 1; break; |
|
Lines 458-463
int qlop_main(int argc, char **argv)
|
Link Here
|
|---|
|
break; | break; |
} | } |
} | } |
|
if (repo) { |
|
overlay_tmp = first_overlay; |
|
do { |
|
if (!strncmp(overlay_tmp->name, repo_search, sizeof(overlay_tmp->name))) |
|
break; |
|
} while ((overlay_tmp=overlay_tmp->next)); |
|
if (NULL == overlay_tmp) |
|
err("%s : Unknown overlay, try 'q --ls-overlays'", repo_search); |
|
} |
|
|
if (!do_list && !do_unlist && !do_time && !do_sync && !do_current) | if (!do_list && !do_unlist && !do_time && !do_sync && !do_current) |
qlop_usage(EXIT_FAILURE); | qlop_usage(EXIT_FAILURE); |
if (opt_logfile != NULL) | if (opt_logfile != NULL) |
|
Lines 467-485
int qlop_main(int argc, char **argv)
|
Link Here
|
|---|
|
argv += optind; | argv += optind; |
| |
if (do_list && do_unlist) | if (do_list && do_unlist) |
show_emerge_history(QLOP_LIST | QLOP_UNLIST, argc, argv, logfile); |
show_emerge_history(QLOP_LIST | QLOP_UNLIST, repo, repo_search,argc, argv, logfile); |
else if (do_list) | else if (do_list) |
show_emerge_history(QLOP_LIST, argc, argv, logfile); |
show_emerge_history(QLOP_LIST, repo, repo_search, argc, argv, logfile); |
else if (do_unlist) | else if (do_unlist) |
show_emerge_history(QLOP_UNLIST, argc, argv, logfile); |
show_emerge_history(QLOP_UNLIST, repo, repo_search, argc, argv, logfile); |
if (do_current) | if (do_current) |
show_current_emerge(); | show_current_emerge(); |
if (do_sync) | if (do_sync) |
show_sync_history(logfile); |
show_sync_history(logfile, repo, repo_search); |
| |
if (do_time) { | if (do_time) { |
for (i = 0; i < argc; ++i) | for (i = 0; i < argc; ++i) |
show_merge_times(argv[i], logfile, average, do_human_readable); |
show_merge_times(argv[i], repo, repo_search, logfile, average, do_human_readable); |
} | } |
| |
if (opt_logfile) free(opt_logfile); | if (opt_logfile) free(opt_logfile); |
|
Lines 490-492
int qlop_main(int argc, char **argv)
|
Link Here
|
|---|
|
#else | #else |
DEFINE_APPLET_STUB(qlop) | DEFINE_APPLET_STUB(qlop) |
#endif | #endif |
|
/* vim: set noet sts=8 sw=8 : */ |
|
|