public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/portage-utils:master commit in: /, tests/qlop/
@ 2016-02-17  7:13 Mike Frysinger
  0 siblings, 0 replies; 4+ messages in thread
From: Mike Frysinger @ 2016-02-17  7:13 UTC (permalink / raw
  To: gentoo-commits

commit:     61a961b295ff529961d0a29356a02465d0808790
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Wed Feb 17 07:12:02 2016 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Wed Feb 17 07:12:02 2016 +0000
URL:        https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=61a961b2

qlop: fix default -l/-u match behavior

Adding atom parsing support accidentally broke the default behavior
of matching all packages.  Restore that edge case and add tests.

URL: https://bugs.gentoo.org/574832
Reported-by: Nikos Chantziaras <realnc <AT> gmail.com>

 qlop.c                 | 14 +++++++++++---
 tests/qlop/dotest      | 14 +++++++++++++-
 tests/qlop/list02.good |  3 +++
 tests/qlop/list03.good |  4 ++++
 tests/qlop/list04.good |  1 +
 tests/qlop/list05.good |  1 +
 tests/qlop/sync.log    | 46 ++++++++++++++++++++++++++++++++++++++++++++++
 tests/qlop/test04.good |  0
 8 files changed, 79 insertions(+), 4 deletions(-)

diff --git a/qlop.c b/qlop.c
index 8a89fba..dbbae06 100644
--- a/qlop.c
+++ b/qlop.c
@@ -241,6 +241,7 @@ show_emerge_history(int listflag, array_t *atoms, const char *logfile)
 	size_t buflen, linelen;
 	char *buf, merged;
 	char *p, *q;
+	bool showit;
 	size_t i;
 	time_t t;
 	depend_atom *atom, *logatom;
@@ -283,10 +284,17 @@ show_emerge_history(int listflag, array_t *atoms, const char *logfile)
 			continue;
 
 		logatom = atom_explode(q);
-		array_for_each(atoms, i, atom) {
-			if (atom_compare(atom, logatom) != EQUAL)
-				continue;
+		if (array_cnt(atoms)) {
+			showit = false;
+			array_for_each(atoms, i, atom)
+				if (atom_compare(atom, logatom) == EQUAL) {
+					showit = true;
+					break;
+				}
+		} else
+			showit = true;
 
+		if (showit) {
 			if (!quiet)
 				printf("%s %s %s%s%s\n", chop_ctime(t), (merged ? ">>>" : "<<<"), (merged ? GREEN : RED), q, NORM);
 			else {

diff --git a/tests/qlop/dotest b/tests/qlop/dotest
index 6525594..fad6011 100755
--- a/tests/qlop/dotest
+++ b/tests/qlop/dotest
@@ -22,9 +22,21 @@ test() {
 # We output dates, so make sure it matches our logs.
 export LC_TIME="C"
 
-# simple install check
+# simple sync check
 test 01 0 "qlop -s -f ${as}/sync.log"
 
+# check all installed pkgs
+test 02 0 "qlop -l -f ${as}/sync.log"
+
+# check all uninstalled pkgs
+test 03 0 "qlop -u -f ${as}/sync.log"
+
+# verify atom parsing works (and not partial strings)
+test 04 0 "qlop -l gcc -f ${as}/sync.log"
+
+# verify atom version parsing works
+test 05 0 "qlop -l '<gcc-5' -f ${as}/sync.log"
+
 cleantmpdir
 
 end

diff --git a/tests/qlop/list02.good b/tests/qlop/list02.good
new file mode 100644
index 0000000..a00a3f6
--- /dev/null
+++ b/tests/qlop/list02.good
@@ -0,0 +1,3 @@
+Thu Oct 28 06:49:14 2004 >>> dev-util/ccache-2.3
+Thu Jan 27 05:56:39 2005 >>> sys-devel/gcc-config-1.3.9
+Thu Jan 27 06:17:10 2005 >>> sys-devel/gcc-3.4.3-r1

diff --git a/tests/qlop/list03.good b/tests/qlop/list03.good
new file mode 100644
index 0000000..add774a
--- /dev/null
+++ b/tests/qlop/list03.good
@@ -0,0 +1,4 @@
+Thu Jan 27 05:56:39 2005 <<< sys-devel/gcc-config-1.3.6-r3
+Thu Jan 27 05:58:04 2005 <<< sys-apps/pam-login-3.14
+Thu Jan 27 05:58:06 2005 <<< sys-libs/pam-0.77-r1
+Thu Jan 27 05:58:16 2005 <<< sys-fs/devfsd-1.3.25-r8

diff --git a/tests/qlop/list04.good b/tests/qlop/list04.good
new file mode 100644
index 0000000..c3de519
--- /dev/null
+++ b/tests/qlop/list04.good
@@ -0,0 +1 @@
+Thu Jan 27 06:17:10 2005 >>> sys-devel/gcc-3.4.3-r1

diff --git a/tests/qlop/list05.good b/tests/qlop/list05.good
new file mode 100644
index 0000000..c3de519
--- /dev/null
+++ b/tests/qlop/list05.good
@@ -0,0 +1 @@
+Thu Jan 27 06:17:10 2005 >>> sys-devel/gcc-3.4.3-r1

diff --git a/tests/qlop/sync.log b/tests/qlop/sync.log
index fc31edb..8979b23 100644
--- a/tests/qlop/sync.log
+++ b/tests/qlop/sync.log
@@ -1,3 +1,49 @@
+1098946153: Started emerge on: Oct 28, 2004 06:49:13
+1098946153:  *** emerge --buildpkg --usepkg --oneshot --nodeps ccache
+1098946153:  >>> emerge (1 of 1) dev-util/ccache-2.3 to /
+1098946153:  === (1 of 1) Merging Binary (dev-util/ccache-2.3::/usr/portage/packages/All/ccache-2.3.tbz2)
+1098946154:  >>> AUTOCLEAN: dev-util/ccache
+1098946154:  --- AUTOCLEAN: Nothing unmerged.
+1098946154:  ::: completed emerge (1 of 1) dev-util/ccache-2.3 to /
+1098946154:  *** Finished. Cleaning up...
+1098946154:  *** exiting successfully.
+1098946154:  *** terminating.
+
+1106805388: Started emerge on: Jan 27, 2005 05:56:28
+1106805388:  *** emerge  gcc
+1106805388:  >>> emerge (1 of 2) sys-devel/gcc-config-1.3.9 to /
+1106805388:  === (1 of 2) Cleaning (sys-devel/gcc-config-1.3.9::/usr/portage/sys-devel/gcc-config/gcc-config-1.3.9.ebuild)
+1106805388:  === (1 of 2) Compiling/Merging (sys-devel/gcc-config-1.3.9::/usr/portage/sys-devel/gcc-config/gcc-config-1.3.9.ebuild)
+1106805393:  === (1 of 2) Post-Build Cleaning (sys-devel/gcc-config-1.3.9::/usr/portage/sys-devel/gcc-config/gcc-config-1.3.9.ebuild)
+1106805393:  >>> AUTOCLEAN: sys-devel/gcc-config
+1106805398: === Unmerging... (sys-devel/gcc-config-1.3.6-r3)
+1106805399:  >>> unmerge success: sys-devel/gcc-config-1.3.6-r3
+1106805399:  ::: completed emerge (1 of 2) sys-devel/gcc-config-1.3.9 to /
+1106805399:  >>> emerge (2 of 2) sys-devel/gcc-3.4.3-r1 to /
+1106805399:  === (2 of 2) Cleaning (sys-devel/gcc-3.4.3-r1::/usr/portage/sys-devel/gcc/gcc-3.4.3-r1.ebuild)
+1106805399:  === (2 of 2) Compiling/Merging (sys-devel/gcc-3.4.3-r1::/usr/portage/sys-devel/gcc/gcc-3.4.3-r1.ebuild)
+1106805477: Started emerge on: Jan 27, 2005 05:57:57
+1106805477:  *** emerge  unmerge pam pam-login
+1106805482: === Unmerging... (sys-apps/pam-login-3.14)
+1106805484:  >>> unmerge success: sys-apps/pam-login-3.14
+1106805484: === Unmerging... (sys-libs/pam-0.77-r1)
+1106805486:  >>> unmerge success: sys-libs/pam-0.77-r1
+1106805487:  *** exiting successfully.
+1106805487:  *** terminating.
+1106805490: Started emerge on: Jan 27, 2005 05:58:10
+1106805490:  *** emerge  unmerge devfsd
+1106805495: === Unmerging... (sys-fs/devfsd-1.3.25-r8)
+1106805496:  >>> unmerge success: sys-fs/devfsd-1.3.25-r8
+1106805497:  *** exiting successfully.
+1106805497:  *** terminating.
+1106806630:  === (2 of 2) Post-Build Cleaning (sys-devel/gcc-3.4.3-r1::/usr/portage/sys-devel/gcc/gcc-3.4.3-r1.ebuild)
+1106806630:  >>> AUTOCLEAN: sys-devel/gcc
+1106806630:  --- AUTOCLEAN: Nothing unmerged.
+1106806630:  ::: completed emerge (2 of 2) sys-devel/gcc-3.4.3-r1 to /
+1106806630:  *** Finished. Cleaning up...
+1106806630:  *** exiting successfully.
+1106806630:  *** terminating.
+
 1106804103: Started emerge on: Jan 27, 2005 05:35:03
 1106804103:  *** emerge  sync
 1106804103:  === sync

diff --git a/tests/qlop/test04.good b/tests/qlop/test04.good
new file mode 100644
index 0000000..e69de29


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [gentoo-commits] proj/portage-utils:master commit in: /, tests/qlop/
@ 2018-03-31 18:31 Fabian Groffen
  0 siblings, 0 replies; 4+ messages in thread
From: Fabian Groffen @ 2018-03-31 18:31 UTC (permalink / raw
  To: gentoo-commits

commit:     d5ad743480ae05fcfb6e92d29007402a7d7554ef
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Sat Mar 31 18:28:17 2018 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Sat Mar 31 18:28:17 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=d5ad7434

qlop: fix false detection of end for aborted merge, bug #470168

When a merge gets aborted, ensure we forget about it if we find about
that same package later in another merge run.

Bug: https://bugs.gentoo.org/470168

 qlop.c            | 1 +
 tests/qlop/dotest | 3 +++
 2 files changed, 4 insertions(+)

diff --git a/qlop.c b/qlop.c
index c7ad42f..464a488 100644
--- a/qlop.c
+++ b/qlop.c
@@ -200,6 +200,7 @@ show_merge_times(char *package, const char *logfile, int average, char human_rea
 							parallel_emerge--;
 							/* update the main emerge reference data */
 							snprintf(ep, BUFSIZ, "completed %s", &buf[1][4]);
+							t[0] = t[1];
 							continue;
 						}
 					}

diff --git a/tests/qlop/dotest b/tests/qlop/dotest
index ea4052d..ac30924 100755
--- a/tests/qlop/dotest
+++ b/tests/qlop/dotest
@@ -43,6 +43,9 @@ test 06 0 "qlop -l -f ${as}/sync.log -d 2005-01-01"
 test 07 0 "qlop -l -f ${as}/sync.log -d '%d %Y %m|01 2005 01'"
 test 08 0 "qlop -l -f ${as}/sync.log -d 1104898893"
 
+# deal with aborted merges
+test 09 0 "qlop -Htgv automake -f ${as}/aborts.log"
+
 cleantmpdir
 
 end


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [gentoo-commits] proj/portage-utils:master commit in: /, tests/qlop/
@ 2019-10-20  9:08 Fabian Groffen
  0 siblings, 0 replies; 4+ messages in thread
From: Fabian Groffen @ 2019-10-20  9:08 UTC (permalink / raw
  To: gentoo-commits

commit:     e526bb8f26e2065bf990a0783ef3b1a9ad1fdb3d
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Sun Oct 20 09:07:31 2019 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Sun Oct 20 09:07:31 2019 +0000
URL:        https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=e526bb8f

qlop: don't "forget" merges when a parallel merge finishes

Stop seeing finishing emerge processes double, thereby wrongly
calculating the current parallel merges.

Bug: https://bugs.gentoo.org/697068
Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>

 qlop.c                  |  3 +--
 tests/qlop/dotest       |  4 ++++
 tests/qlop/parallel.log | 53 +++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 58 insertions(+), 2 deletions(-)

diff --git a/qlop.c b/qlop.c
index 4347699..7a93656 100644
--- a/qlop.c
+++ b/qlop.c
@@ -474,8 +474,7 @@ static int do_emerge_log(
 		 * finished without knowledge of another instance */
 		if (flags->do_running &&
 				(strncmp(p, "  *** emerge ", 13) == 0 ||
-				 strncmp(p, "  *** terminating.", 18) == 0 ||
-				 strncmp(p, "  *** exiting ", 14) == 0))
+				 strncmp(p, "  *** terminating.", 18) == 0))
 		{
 			if (p[7] == 'm') {
 				parallel_emerge++;

diff --git a/tests/qlop/dotest b/tests/qlop/dotest
index 51cdb8a..bf5edc0 100755
--- a/tests/qlop/dotest
+++ b/tests/qlop/dotest
@@ -46,6 +46,10 @@ test 08 0 "qlop -mv -f ${as}/sync.log -d 1104898893"
 # deal with aborted merges
 test 09 0 "qlop -Hacv automake -f ${as}/aborts.log"
 
+# https://bugs.gentoo.org/697068: a parallel emerge finishing should
+# wipe the outstanding emerges from other emerges
+test 10 0 "qlop -r -f ${as}/parallel.log"
+
 cleantmpdir
 
 end

diff --git a/tests/qlop/parallel.log b/tests/qlop/parallel.log
new file mode 100644
index 0000000..0841097
--- /dev/null
+++ b/tests/qlop/parallel.log
@@ -0,0 +1,53 @@
+1568976528: Started emerge on: Sep 20, 2019 12:48:48
+1568976528:  *** emerge --autounmask-continue --autounmask-write --backtrack=100 --jobs=2 --load-average=8.0 --with-bdeps=y --sync
+1568976528:  === sync
+1568976528: >>> Syncing repository 'gentoo' into '/usr/portage'...
+1568976547: === Sync completed for gentoo
+1568976570:  *** terminating.
+1568976571: Started emerge on: Sep 20, 2019 12:49:31
+1568976571:  *** emerge --newuse --update --ask --autounmask-continue --autounmask-write --backtrack=100 --deep --jobs=2 --load-average=8.0 --with-bdeps=y --verbose @world
+1568982446:  >>> emerge (95 of 129) kde-frameworks/qqc2-desktop-style-5.62.0 to /
+1568982460:  >>> emerge (96 of 129) dev-qt/qtmultimedia-5.12.5 to /
+1568982460:  === (96 of 129) Cleaning (dev-qt/qtmultimedia-5.12.5::/usr/portage/dev-qt/qtmultimedia/qtmultimedia-5.12.5.ebuild)
+1568982460:  === (96 of 129) Compiling/Merging (dev-qt/qtmultimedia-5.12.5::/usr/portage/dev-qt/qtmultimedia/qtmultimedia-5.12.5.ebuild)
+1568982446:  === (95 of 129) Cleaning (kde-frameworks/qqc2-desktop-style-5.62.0::/usr/portage/kde-frameworks/qqc2-desktop-style/qqc2-desktop-style-5.62.0.ebuild)
+1568982446:  === (95 of 129) Compiling/Merging (kde-frameworks/qqc2-desktop-style-5.62.0::/usr/portage/kde-frameworks/qqc2-desktop-style/qqc2-desktop-style-5.62.0.ebuild)
+1568982462:  === (95 of 129) Merging (kde-frameworks/qqc2-desktop-style-5.62.0::/usr/portage/kde-frameworks/qqc2-desktop-style/qqc2-desktop-style-5.62.0.ebuild)
+1568982480:  === (95 of 129) Post-Build Cleaning (kde-frameworks/qqc2-desktop-style-5.62.0::/usr/portage/kde-frameworks/qqc2-desktop-style/qqc2-desktop-style-5.62.0.ebuild)
+1568982480:  ::: completed emerge (95 of 129) kde-frameworks/qqc2-desktop-style-5.62.0 to /
+1568982686:  === (96 of 129) Merging (dev-qt/qtmultimedia-5.12.5::/usr/portage/dev-qt/qtmultimedia/qtmultimedia-5.12.5.ebuild)
+1568982695:  >>> AUTOCLEAN: dev-qt/qtmultimedia:5
+1568982695:  === Unmerging... (dev-qt/qtmultimedia-5.12.4)
+1568982700:  >>> unmerge success: dev-qt/qtmultimedia-5.12.4
+1568982708:  === (96 of 129) Post-Build Cleaning (dev-qt/qtmultimedia-5.12.5::/usr/portage/dev-qt/qtmultimedia/qtmultimedia-5.12.5.ebuild)
+1568982708:  XXX completed emerge (96 of 129) dev-qt/qtmultimedia-5.12.5 to /
+1568988624: Started emerge on: Sep 20, 2019 16:10:23
+1568988624:  *** emerge --ask --autounmask-continue --autounmask-write --backtrack=100 --jobs=2 --load-average=8.0 --with-bdeps=y --verbose ktouch
+1568991194:  >>> emerge (1 of 2) kde-apps/kqtquickcharts-19.08.1 to /
+1568991195:  === (1 of 2) Cleaning (kde-apps/kqtquickcharts-19.08.1::/usr/portage/kde-apps/kqtquickcharts/kqtquickcharts-19.08.1.ebuild)
+1568991196:  === (1 of 2) Compiling/Merging (kde-apps/kqtquickcharts-19.08.1::/usr/portage/kde-apps/kqtquickcharts/kqtquickcharts-19.08.1.ebuild)
+1568991249:  === (1 of 2) Merging (kde-apps/kqtquickcharts-19.08.1::/usr/portage/kde-apps/kqtquickcharts/kqtquickcharts-19.08.1.ebuild)
+1568991259:  >>> AUTOCLEAN: kde-apps/kqtquickcharts:5
+1568991266:  === (1 of 2) Post-Build Cleaning (kde-apps/kqtquickcharts-19.08.1::/usr/portage/kde-apps/kqtquickcharts/kqtquickcharts-19.08.1.ebuild)
+1568991266:  ::: completed emerge (1 of 2) kde-apps/kqtquickcharts-19.08.1 to /
+1568991266:  >>> emerge (2 of 2) kde-apps/ktouch-19.08.1 to /
+1568991266:  === (2 of 2) Cleaning (kde-apps/ktouch-19.08.1::/usr/portage/kde-apps/ktouch/ktouch-19.08.1.ebuild)
+1568991266:  === (2 of 2) Compiling/Merging (kde-apps/ktouch-19.08.1::/usr/portage/kde-apps/ktouch/ktouch-19.08.1.ebuild)
+1568991378:  === (2 of 2) Merging (kde-apps/ktouch-19.08.1::/usr/portage/kde-apps/ktouch/ktouch-19.08.1.ebuild)
+1568991391:  >>> AUTOCLEAN: kde-apps/ktouch:5
+1568991400:  === (2 of 2) Updating world file (kde-apps/ktouch-19.08.1)
+1568991400:  === (2 of 2) Post-Build Cleaning (kde-apps/ktouch-19.08.1::/usr/portage/kde-apps/ktouch/ktouch-19.08.1.ebuild)
+1568991400:  ::: completed emerge (2 of 2) kde-apps/ktouch-19.08.1 to /
+1568991400:  *** Finished. Cleaning up...
+1568991404:  *** exiting successfully.
+1568991406:  *** terminating.
+1568996270:  >>> emerge (98 of 129) kde-frameworks/kxmlgui-5.62.0 to /
+1568996270:  === (98 of 129) Cleaning (kde-frameworks/kxmlgui-5.62.0::/usr/portage/kde-frameworks/kxmlgui/kxmlgui-5.62.0.ebuild)
+1568996271:  === (98 of 129) Compiling/Merging (kde-frameworks/kxmlgui-5.62.0::/usr/portage/kde-frameworks/kxmlgui/kxmlgui-5.62.0.ebuild)
+1568996308:  === (98 of 129) Merging (kde-frameworks/kxmlgui-5.62.0::/usr/portage/kde-frameworks/kxmlgui/kxmlgui-5.62.0.ebuild)
+1568996308:  >>> emerge (99 of 129) net-analyzer/wireshark-3.0.4 to /
+1568996308:  === (99 of 129) Cleaning (net-analyzer/wireshark-3.0.4::/usr/portage/net-analyzer/wireshark/wireshark-3.0.4.ebuild)
+1568996308:  === (99 of 129) Compiling/Merging (net-analyzer/wireshark-3.0.4::/usr/portage/net-analyzer/wireshark/wireshark-3.0.4.ebuild)
+1568996311:  >>> AUTOCLEAN: kde-frameworks/kxmlgui:5
+1568996311:  === Unmerging... (kde-frameworks/kxmlgui-5.61.0)
+1568996313:  >>> unmerge success: kde-frameworks/kxmlgui-5.61.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [gentoo-commits] proj/portage-utils:master commit in: /, tests/qlop/
@ 2019-10-27 12:47 Fabian Groffen
  0 siblings, 0 replies; 4+ messages in thread
From: Fabian Groffen @ 2019-10-27 12:47 UTC (permalink / raw
  To: gentoo-commits

commit:     27f35b8a59b2afcc090c5e576a69ad7f1eb14b12
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Sun Oct 27 12:46:06 2019 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Sun Oct 27 12:46:06 2019 +0000
URL:        https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=27f35b8a

qlop: allow forcing non-proc running mode using -rr for testing

Adapt test to use -rr to force falling back to scanning emerge.log, and
give -d to the data range in which things happen, such that the 10-day
cutoff can be calculated based on that for deterministic output.

Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>

 qlop.c                 | 25 ++++++++++++++-----------
 tests/qlop/dotest      |  4 ++--
 tests/qlop/list10.good |  6 +++---
 3 files changed, 19 insertions(+), 16 deletions(-)

diff --git a/qlop.c b/qlop.c
index 6cb2c04..7083ea7 100644
--- a/qlop.c
+++ b/qlop.c
@@ -344,7 +344,6 @@ New format:
 1550953125:  *** exiting successfully.
 1550953125:  *** terminating.
 
-
 Currently running merges can be found in the /proc filesystem:
 - Linux: readlink(/proc/<pid>/fd/X)
 - Solaris: readlink(/proc/<pid>/path/X)
@@ -846,16 +845,18 @@ static int do_emerge_log(
 	if (flags->do_running) {
 		time_t cutofftime;
 
+		tstart = time(NULL);
+
 		/* emerge.log can be interrupted, incorrect and hopelessly lost,
 		 * so to eliminate some unfinished crap from there, we just
 		 * ignore anything that's > cutofftime, 10 days for now. */
 		cutofftime = 10 * 24 * 60 * 60;  /* when we consider entries stale */
+		cutofftime = (tbegin > 0 ? tbegin : tstart) - cutofftime;
 
 		/* can't report endtime for non-finished operations */
 		flags->do_endtime = 0;
-		tstart = time(NULL);
 		sync_time /= sync_cnt;
-		if (sync_start >= tstart - cutofftime) {
+		if (sync_start >= cutofftime) {
 			elapsed = tstart - sync_start;
 			if (elapsed >= sync_time)
 				sync_time = 0;
@@ -878,7 +879,7 @@ static int do_emerge_log(
 			time_t maxtime = 0;
 			bool isMax = false;
 
-			if (pkgw->tbegin < tstart - cutofftime)
+			if (pkgw->tbegin < cutofftime)
 				continue;
 
 			snprintf(afmt, sizeof(afmt), "%s/%s",
@@ -925,7 +926,7 @@ static int do_emerge_log(
 			time_t maxtime = 0;
 			bool isMax = false;
 
-			if (pkgw->tbegin < tstart - cutofftime)
+			if (pkgw->tbegin < cutofftime)
 				continue;
 
 			snprintf(afmt, sizeof(afmt), "%s/%s",
@@ -1140,6 +1141,7 @@ int qlop_main(int argc, char **argv)
 	char *q;
 	depend_atom *atom;
 	DECLARE_ARRAY(atoms);
+	int runningmode = 0;
 
 	start_time = 0;
 	end_time = LONG_MAX;
@@ -1173,7 +1175,8 @@ int qlop_main(int argc, char **argv)
 					  m.show_lastmerge = 1;
 					  m.show_emerge = 1;
 					  verbose = 1;          break;
-			case 'r': m.do_running = 1;     break;
+			case 'r': m.do_running = 1;
+					  runningmode++;        break;
 			case 'a': m.do_average = 1;     break;
 			case 'c': m.do_summary = 1;     break;
 			case 'H': m.do_human = 1;       break;
@@ -1312,14 +1315,14 @@ int qlop_main(int argc, char **argv)
 	if (m.do_running) {
 		array_t *new_atoms = probe_proc(atoms);
 
-		if (new_atoms != NULL && array_cnt(new_atoms) == 0) {
-			/* proc supported, found nothing running */
-			start_time = LONG_MAX;
-		} else {
+		if (runningmode > 1 || new_atoms == NULL) {
 			warn("/proc not available, deducing running "
 					"merges from emerge.log");
+		} else if (array_cnt(new_atoms) == 0) {
+			/* proc supported, found nothing running */
+			start_time = LONG_MAX;
 		}
-
+		/* NOTE: new_atoms == atoms when new_atoms != NULL */
 	}
 
 	if (start_time < LONG_MAX)

diff --git a/tests/qlop/dotest b/tests/qlop/dotest
index bf5edc0..321f7d2 100755
--- a/tests/qlop/dotest
+++ b/tests/qlop/dotest
@@ -10,7 +10,7 @@ test() {
 	local num=$1 exp=$2 ret=0
 	shift 2
 	eval "$@" > list || ret=$?
-	if ! diff -u list ${as}/list${num}.good ; then
+	if ! diff -u ${as}/list${num}.good list ; then
 		tfail "output does not match"
 	fi
 	if [[ ${exp} -ne ${ret} ]] ; then
@@ -48,7 +48,7 @@ test 09 0 "qlop -Hacv automake -f ${as}/aborts.log"
 
 # https://bugs.gentoo.org/697068: a parallel emerge finishing should
 # wipe the outstanding emerges from other emerges
-test 10 0 "qlop -r -f ${as}/parallel.log"
+test 10 0 "qlop -Mrr -f ${as}/parallel.log" -d 1568976528
 
 cleantmpdir
 

diff --git a/tests/qlop/list10.good b/tests/qlop/list10.good
index 845573f..348992a 100644
--- a/tests/qlop/list10.good
+++ b/tests/qlop/list10.good
@@ -1,3 +1,3 @@
-2019-09-20T12:27:40 >>> dev-qt/qtmultimedia... (96 of 129) ETA: unknown
-2019-09-20T16:17:50 >>> kde-frameworks/kxmlgui... (98 of 129) ETA: unknown
-2019-09-20T16:18:28 >>> net-analyzer/wireshark... (99 of 129) ETA: unknown
+1568982460 >>> dev-qt/qtmultimedia... (96 of 129) ETA: unknown
+1568996270 >>> kde-frameworks/kxmlgui... (98 of 129) ETA: unknown
+1568996308 >>> net-analyzer/wireshark... (99 of 129) ETA: unknown


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-10-27 12:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-31 18:31 [gentoo-commits] proj/portage-utils:master commit in: /, tests/qlop/ Fabian Groffen
  -- strict thread matches above, loose matches on Subject: below --
2019-10-27 12:47 Fabian Groffen
2019-10-20  9:08 Fabian Groffen
2016-02-17  7:13 Mike Frysinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox