Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 796263 - sys-apps/openrc-0.42.1-r1: preinst/postinst errors
Summary: sys-apps/openrc-0.42.1-r1: preinst/postinst errors
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: OpenRC Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-06-15 22:44 UTC by Joakim Tjernlund
Modified: 2022-03-23 21:40 UTC (History)
2 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 Joakim Tjernlund 2021-06-15 22:44:24 UTC
merging a binary openrc pkg where hostname/rc.conf files has been
PKG_INSTALL_MASK:ed prints errors:
sed: can't read /var/tmp/qmerge/sys-apps/openrc-0.42.1-r1/image///etc/conf.d/hostname: No such file or directory
sed: can't read /var/tmp/qmerge/sys-apps/openrc-0.42.1-r1/image///etc/rc.conf: No such file or directory

During postinst there is this error msg:
cp: '//lib/rc' and '//lib/rc' are the same file

This is on a 32 bits ppc machine I think openrc should not even
try doing the above cp cmd.
Comment 1 Ionen Wolkens gentoo-dev 2021-06-15 23:41:06 UTC
(In reply to Joakim Tjernlund from comment #0)
[...]
> During postinst there is this error msg:
> cp: '//lib/rc' and '//lib/rc' are the same file
> 
> This is on a 32 bits ppc machine I think openrc should not even
> try doing the above cp cmd.
Do you still get this with portage?

Haven't tried yet, but rather than openrc's ebuild (which doesn't do this cp if the directory exists), I suspect it's a qmerge issue.

Maybe related to different variable handling, this // notably implies EROOT=/ when it should be EROOT= with EAPI-7.
Comment 2 Ionen Wolkens gentoo-dev 2021-06-15 23:49:38 UTC
(In reply to Ionen Wolkens from comment #1)
> Haven't tried yet, but rather than openrc's ebuild (which doesn't do this cp
> if the directory exists), [...]
Scratch the last bit, you're right, basically it seem to skip checking if $(get_libdir) == lib

Not that I get these sed errors merging a binary package of openrc with portage still.
Comment 3 Joakim Tjernlund 2021-06-16 09:29:55 UTC
(In reply to Ionen Wolkens from comment #2)
> (In reply to Ionen Wolkens from comment #1)
> > Haven't tried yet, but rather than openrc's ebuild (which doesn't do this cp
> > if the directory exists), [...]
> Scratch the last bit, you're right, basically it seem to skip checking if
> $(get_libdir) == lib
> 
> Not that I get these sed errors merging a binary package of openrc with
> portage still.

You only get them if you also have PKG_INSTALL_MASK:ed /etc/conf.d/hostname and
/etc/rc.conf so these files are excluded from the bin pkg.
Comment 4 Ionen Wolkens gentoo-dev 2021-06-16 21:47:45 UTC
(In reply to Joakim Tjernlund from comment #3)
> You only get them if you also have PKG_INSTALL_MASK:ed /etc/conf.d/hostname
> and
> /etc/rc.conf so these files are excluded from the bin pkg.
Oh okay, I get it now (hadn't realized what PKG_ really did). It'd be hard to consider every PKG_INSTALL_MASK situations, and it's a scarcely used feature from what I can tell. If anything it'd make sense for the ebuild to do '|| die' if still in "pre"inst when these unexpected things happen.

Any reason even using that for small config files? Inclusion in binpkgs seem trivial.

Either way, the cp command without proper checks does kind of bother me, will see what maintainer(s) think.

That qmerge does EROOT=/ in eapi-7 (when some ebuilds do check like [[ $EROOT ]] expecting it means not /) also bothers me, but it's unrelated to this.
Comment 5 Joakim Tjernlund 2021-07-15 13:32:36 UTC
ping?
Comment 6 William Hubbs gentoo-dev 2021-08-20 17:52:23 UTC
I haven't formed an opinion one way or another on this yet.
I'm not sure how I feel about dying in postinst (the cp is in postinst,
not preinst), so the package is already installed at this point.
Comment 7 Ionen Wolkens gentoo-dev 2021-08-20 21:56:16 UTC
For the postinst cp it'd more about not running it when it's not needed (aka get_libdir == lib), but ultimately the error is benign and is just something that give the wrong impression something might've went wrong.
Comment 8 Joakim Tjernlund 2021-08-22 13:09:08 UTC
(In reply to Ionen Wolkens from comment #7)
> For the postinst cp it'd more about not running it when it's not needed (aka
> get_libdir == lib), but ultimately the error is benign and is just something
> that give the wrong impression something might've went wrong.

Exactly, it is just the msgs that look scary. It is working correctly.
For the sed errors, test if there is file first and then run sed on them.
Comment 9 Joakim Tjernlund 2021-10-05 09:49:18 UTC
I figure this patch fixes the first 2 errors:

# set_config <file> <option name> <yes value> <no value> test
 # a value of "#" will just comment out the option
 set_config() {
 	local file="${ED}/$1" var=$2 val com
+	[[ -e "${file}" ]] || return # Skip if no file
 	eval "${@:5}" && val=$3 || val=$4
 	[[ ${val} == "#" ]] && com="#" && val='\2'
 	sed -i -r -e "/^#?${var}=/{s:=([\"'])?([^ ]*)\1?:=\1${val}\1:;s:^#?:${com}:}" "${file}"
 }

The last 
  cp: '//lib/rc' and '//lib/rc' are the same file
error I am not sure how solve as I don't quite get what you are trying
to do in the fist place.
Comment 10 Joakim Tjernlund 2021-11-02 21:59:44 UTC
(In reply to William Hubbs from comment #6)
> I haven't formed an opinion one way or another on this yet.
> I'm not sure how I feel about dying in postinst (the cp is in postinst,
> not preinst), so the package is already installed at this point.

Ping?
Comment 11 Joakim Tjernlund 2022-03-23 21:40:01 UTC
(In reply to William Hubbs from comment #6)
> I haven't formed an opinion one way or another on this yet.
> I'm not sure how I feel about dying in postinst (the cp is in postinst,
> not preinst), so the package is already installed at this point.

Ping ?

You are not dying in postinst, you are just creating a scary msg
as cp cannot copy a dir to itself.