Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 687416 - app-portage/portage-utils-0.80_pre20190530: "qatom -F" perhaps broken behavior
Summary: app-portage/portage-utils-0.80_pre20190530: "qatom -F" perhaps broken behavior
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Fabian Groffen
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-06-05 08:59 UTC by Lars Wendler (Polynomial-C) (RETIRED)
Modified: 2019-06-06 07:27 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2019-06-05 08:59:58 UTC
I am using the following string in one of my scripts to copy/rename ebuilds:

  qatom -F "%{CATEGORY}/%{PN}/%{PN}-${TARGET_VERSION}.ebuild" ${CATEGORY}/${PF}


practical example:

TARGET_VERSION="1.4.1"
qatom -F "%{CATEGORY}/%{PN}/%{PN}-${TARGET_VERSION}.ebuild" media-sound/bluez-alsa

Result:

  media-sound/bluez-alsa/bluez-alsa-1.4.1.ebuild


This used to work nicely until portage-utils-0.80_pre20190530. Now it just prints an empty line.


When I reduce the string to this:

  qatom -F "%{CATEGORY}/%{PN}/%{PN}" media-sound/bluez-alsa

I get:

  media-sound/bluez-alsa/bluez-alsa


But as soon as I add a single character to the format instruction, the output is empty again:

  qatom -F "%{CATEGORY}/%{PN}/%{PN}-" media-sound/bluez-alsa
Comment 1 Fabian Groffen gentoo-dev 2019-06-05 09:04:33 UTC
Yes, bug.

% ./qatom -F "%{CATEGORY}/%{PN}/%{PN}-%{X}" media-sound/bluez-alsa
media-sound/bluez-alsa/bluez-alsa-<BAD:X>

seems to suggest it incorrectly stops after no longer finding any expandos
Comment 2 Larry the Git Cow gentoo-dev 2019-06-05 09:15:24 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=85c445dbc0d3526ff2df263f1d48dbc67433cd10

commit 85c445dbc0d3526ff2df263f1d48dbc67433cd10
Author:     Fabian Groffen <grobian@gentoo.org>
AuthorDate: 2019-06-05 09:14:19 +0000
Commit:     Fabian Groffen <grobian@gentoo.org>
CommitDate: 2019-06-05 09:14:19 +0000

    libq/atom: retain all input in atom_format_r
    
    Copy the remainder, as well as data before and inbetween expandos.
    
    Bug: https://bugs.gentoo.org/687416
    Signed-off-by: Fabian Groffen <grobian@gentoo.org>

 libq/atom.c | 3 +--
 qatom.c     | 5 +++--
 2 files changed, 4 insertions(+), 4 deletions(-)
Comment 3 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2019-06-05 11:26:26 UTC
I installed portage-utils-9999 after your commit but "qatom -F" is still broken in the exact same way.
Comment 4 Fabian Groffen gentoo-dev 2019-06-05 13:08:37 UTC
man I feel stupid, sorry
Comment 5 Larry the Git Cow gentoo-dev 2019-06-05 13:11:39 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=e39cbfcefe03f6160894201df6174cec4b4e7946

commit e39cbfcefe03f6160894201df6174cec4b4e7946
Author:     Fabian Groffen <grobian@gentoo.org>
AuthorDate: 2019-06-05 13:09:51 +0000
Commit:     Fabian Groffen <grobian@gentoo.org>
CommitDate: 2019-06-05 13:09:51 +0000

    libq/atom: really fix retaining input in atom_format_r
    
    return the start of the buffer, not the end (= empty)
    add tests this time that show the bug is now fixed
    
    Bug: https://bugs.gentoo.org/687416
    Signed-off-by: Fabian Groffen <grobian@gentoo.org>

 libq/atom.c        | 2 +-
 tests/qatom/dotest | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)
Comment 6 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2019-06-05 13:37:38 UTC
Now it's fixed. Thank you very much.  :)
Comment 7 Larry the Git Cow gentoo-dev 2019-06-06 07:27:19 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=aba4a67be6bd97dcbb9b6fdeb61c25cefba48e86

commit aba4a67be6bd97dcbb9b6fdeb61c25cefba48e86
Author:     Fabian Groffen <grobian@gentoo.org>
AuthorDate: 2019-06-06 07:26:17 +0000
Commit:     Fabian Groffen <grobian@gentoo.org>
CommitDate: 2019-06-06 07:27:05 +0000

    app-portage/portage-utils: version bump 0.80 pre
    
    Closes: https://bugs.gentoo.org/687416
    Closes: https://bugs.gentoo.org/687374
    Closes: https://bugs.gentoo.org/687372
    Signed-off-by: Fabian Groffen <grobian@gentoo.org>
    Package-Manager: Portage-2.3.66, Repoman-2.3.11

 app-portage/portage-utils/Manifest                                      | 2 +-
 ...ls-0.80_pre20190530.ebuild => portage-utils-0.80_pre20190605.ebuild} | 0
 2 files changed, 1 insertion(+), 1 deletion(-)