Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 717450 - net-misc/asterisk USE=-samples broken on all recent versions
Summary: net-misc/asterisk USE=-samples broken on all recent versions
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Jaco Kroon
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2020-04-14 15:25 UTC by James Cloos
Modified: 2020-04-21 08:17 UTC (History)
3 users (show)

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 James Cloos 2020-04-14 15:25:03 UTC
with -samples the ebuilds try to rm(1) non-extant files and the die.

the ||die after the calls to rm(1) should be deleted.

or perhaps it should rm -f?

the ebuilds are unusable as is.
Comment 1 Jonas Stein gentoo-dev 2020-04-14 16:07:25 UTC
Thank you for the report. We need to have all information at hand before ticket assignment. That is why I ask you to 
* attach the logs and 
* paste the emerge info 
as described on 
https://wiki.gentoo.org/wiki/Attach_the_logs_to_the_bug_ticket
Comment 2 Jaco Kroon 2020-04-14 19:15:42 UTC
It used to be rm -rf, I was specifically told not to do that.  I'll look into this ASAP.
Comment 3 James Cloos 2020-04-14 21:21:21 UTC
deleting the rm calls got it to succeed.

in any case, there should not be any need to die in those cases.

some sort of ||echo ... or the like should be ok if an || is required.
Comment 4 Joonas Niilola gentoo-dev 2020-04-15 06:20:07 UTC
In my eyes the '|| die' here has achieved its purpose and spotted a fault in the ebuild.
Comment 5 Georgy Yakovlev archtester gentoo-dev 2020-04-15 07:50:56 UTC
^^ this.

also you should use || die even with rm -f, but also should avoid -f is possible.

while -f makes rm return 0 on non-existent files, it's still possible to catch other type of errors (permission, general filesystem errors and some other)
Comment 6 Alex Glazunov 2020-04-15 12:45:29 UTC
It seems "rm or die" fails on some unimportant folders like MOH folders. May be "or die" is too strong condition in this case.
Comment 7 Jaco Kroon 2020-04-19 19:31:24 UTC
Frankly, the || die here directed me at a slightly bigger issue.

The rm -r's with USE=sample just removed 90% of make samples anyway ... so switched to just calling the correct target that installs that which remains behind.  Needed some coaxing with extra arguments to make since the build system uses some internal macro's, and make samples just happen to have the right defaults to this macro whereas mak install-configs bombs out due to no defaults.  Personally I consider this a bug to upstream's implementation but that's not an argument I'll manage to pass.

Should have a PR in less than 30 minutes up, just going through final testing on my side.

And a heads up:  based on the above I'm going to remove USE=samples on the next version, and configs will be installed by default, if you really don't want that, use INSTALL_MASK="/etc/asterisk/*" in make.conf, or applicable environment.
Comment 8 James Cloos 2020-04-20 07:43:33 UTC
eliminating the samples use flag is extremely harmful.

it is /imperative/ that an an asterisk upgrade leave /etc/asterisk untouched.

doing otherwise will break many systems.

portage may not change existing files w/o etc-update, but it will insert fils which should not exist at all.

the samples should only go under /usr/share/doc.  never in /etc.

the use flag MUST NOT be removed.
Comment 9 James Cloos 2020-04-20 07:45:28 UTC
also, any such change MUST be announced to *everyone* before they encounter the new ebuild, so that they can prepare.

a note in  bug is insufficient.
Comment 10 Larry the Git Cow gentoo-dev 2020-04-21 08:17:46 UTC
The bug has been closed via the following commit(s):

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

commit 3ac41e02f79acc131daf0d305adac6b703de91ef
Author:     Jaco Kroon <jaco@uls.co.za>
AuthorDate: 2020-04-19 19:40:25 +0000
Commit:     Joonas Niilola <juippis@gentoo.org>
CommitDate: 2020-04-21 08:17:21 +0000

    net-misc/asterisk: fix USE=-samples.
    
    Note: USE=samples only really install default configs into
    /etc/asterisk, as such, IUSE=samples is going away on the next bump, so
    default configs will be installed.  Use INSTALL_MASK to prevent this if
    you don't want this:
    
    INSTALL_MASK=/etc/asterisk/* in make.conf
    
    Closes: https://bugs.gentoo.org/717450
    Package-Manager: Portage-2.3.89, Repoman-2.3.20
    Signed-off-by: Jaco Kroon <jaco@uls.co.za>
    Closes: https://github.com/gentoo/gentoo/pull/15416
    Signed-off-by: Joonas Niilola <juippis@gentoo.org>

 net-misc/asterisk/asterisk-13.32.0-r1.ebuild | 10 +---------
 net-misc/asterisk/asterisk-16.9.0.ebuild     | 10 +---------
 2 files changed, 2 insertions(+), 18 deletions(-)