[gentoo-dev] Last rites: games-action/descent3 and games-action/descent3-demo

2023-06-25 Thread James Le Cuirot
# James Le Cuirot  (2023-06-25)
# Impossible to legally obtain the native full game now. It freezes on keyboard
# input, is incompatible with PipeWire, and requires gamescope to display under
# Wayland. In short, it's a lost cause. Removal in 30 days. Bug #436140.
games-action/descent3
games-action/descent3-demo


signature.asc
Description: This is a digitally signed message part


Re: [gentoo-dev] [PATCH] acct-user.eclass: improve error message when usermod fails

2023-06-25 Thread Florian Schmaus

On 24/06/2023 19.01, Mike Gilbert wrote:

usermod refuses to update the home directory for a user with running
processes. Output a more helpful message and avoid calling die for this.

For other usermod failures, output stderr as an eerror message and die.

Example output:

  * Failed to update user portage
  * This user currently has one or more running processes.
  * Please update this user manually with the following command:
  *   usermod '--comment' 'System user; portage' '--home' 
'/var/lib/portage/home' '--shell' '/bin/bash' '--gid' 'portage' '--groups' '' 
portage

Bug: https://bugs.gentoo.org/888189
Signed-off-by: Mike Gilbert 
---
  eclass/acct-user.eclass | 28 +++-
  1 file changed, 23 insertions(+), 5 deletions(-)

diff --git a/eclass/acct-user.eclass b/eclass/acct-user.eclass
index f8a51ebf9c6b..88d7d354c8e6 100644
--- a/eclass/acct-user.eclass
+++ b/eclass/acct-user.eclass
@@ -432,12 +432,30 @@ acct-user_pkg_postinst() {
fi
  
  	elog "Updating user ${ACCT_USER_NAME}"

-   if ! usermod "${opts[@]}" "${ACCT_USER_NAME}" 
2>"${T}/usermod-error.log"; then
-   # usermod outputs a warning if unlocking the account would 
result in an
-   # empty password. Hide stderr in a text file and display it if 
usermod
-   # fails.
+   # usermod outputs a warning if unlocking the account would result in an
+   # empty password. Hide stderr in a text file and display it if usermod 
fails.
+   usermod "${opts[@]}" "${ACCT_USER_NAME}" 2>"${T}/usermod-error.log"
+   local status=$?
+   if [[ ${status} -ne 0 ]]; then
cat "${T}/usermod-error.log" >&2
-   die "usermod failed"
+   if [[ ${status} -eq 8 ]]; then
+   # usermod refused to update the home directory
+   # for a uid with active processes.
+   eerror "Failed to update user ${ACCT_USER_NAME}"
+   eerror "This user currently has one or more running 
processes."
+   eerror "Please update this user manually with the following 
command:"
+
+   # Surround opts with quotes.
+   # With bash-5 (EAPI 8), we can use "${opts[@]@Q}" 
instead.
+   local q="'"
+   local optsq=( "${opts[@]/#/$q}" )
+   optsq=( "${optsq[@]/%/$q}" )
+
+   eerror "  usermod ${optsq[@]} ${ACCT_USER_NAME}"
+   else
+   eerror "$(<"${T}/usermod-error.log")"
+   die "usermod failed"


No strong opinion, but it is often a good idea to include the exit 
status. For example:


   die "usermod failed (${status})"

Otherwise, lgtm. Thanks!

- Flow


OpenPGP_0x8CAC2A9678548E35.asc
Description: OpenPGP public key


OpenPGP_signature
Description: OpenPGP digital signature


[gentoo-dev] Packages up for grabs per grknight's retirement

2023-06-25 Thread Joonas Niilola
Hey,

these packages are up for grabs:
dev-db/mycli
dev-libs/judy
dev-util/imediff2
lxde-base/lxdm
mail-client/s-nail
mail-filter/amavisd-milter
net-misc/omnisync
sys-power/acpilight

They're in pretty good state. lxdm has bunch of bugs open, some others
were eligible for python-3.12 compatibility bump, but nothing major
stood out.

-- juippis


OpenPGP_signature
Description: OpenPGP digital signature


Re: [gentoo-dev] Packages up for grabs per grknight's retirement

2023-06-25 Thread Michael Orlitzky
On Sun, 2023-06-25 at 16:58 +0300, Joonas Niilola wrote:
> Hey,
> 
> these packages are up for grabs:
> 

Brian was the last member of the PHP project, so most of those packages
are now unmaintained too. I'm co-maintainer on a few of them but Brian
did most of the work.




Re: [gentoo-dev] [PATCH] acct-user.eclass: improve error message when usermod fails

2023-06-25 Thread Mike Gilbert
On Sun, Jun 25, 2023 at 6:54 AM Florian Schmaus  wrote:
> No strong opinion, but it is often a good idea to include the exit
> status. For example:
>
> die "usermod failed (${status})"

That's a really good idea. It could also be applied to the
useradd/groupadd/groupmod commands.



[gentoo-dev] [PATCH] acct-user.eclass: include exit status in death message

2023-06-25 Thread Mike Gilbert
Signed-off-by: Mike Gilbert 
---
 eclass/acct-group.eclass | 2 +-
 eclass/acct-user.eclass  | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/eclass/acct-group.eclass b/eclass/acct-group.eclass
index 8d2d3adb7221..a0ad86066309 100644
--- a/eclass/acct-group.eclass
+++ b/eclass/acct-group.eclass
@@ -179,7 +179,7 @@ acct-group_pkg_preinst() {
fi
 
elog "Adding group ${ACCT_GROUP_NAME}"
-   groupadd "${opts[@]}" "${ACCT_GROUP_NAME}" || die
+   groupadd "${opts[@]}" "${ACCT_GROUP_NAME}" || die "groupadd failed with 
status $?"
 }
 
 fi
diff --git a/eclass/acct-user.eclass b/eclass/acct-user.eclass
index 88d7d354c8e6..b03bf0f1ab28 100644
--- a/eclass/acct-user.eclass
+++ b/eclass/acct-user.eclass
@@ -362,7 +362,7 @@ acct-user_pkg_preinst() {
fi
 
elog "Adding user ${ACCT_USER_NAME}"
-   useradd "${opts[@]}" "${ACCT_USER_NAME}" || die
+   useradd "${opts[@]}" "${ACCT_USER_NAME}" || die "useradd failed 
with status $?"
_ACCT_USER_ADDED=1
fi
 
@@ -454,7 +454,7 @@ acct-user_pkg_postinst() {
eerror "  usermod ${optsq[@]} ${ACCT_USER_NAME}"
else
eerror "$(<"${T}/usermod-error.log")"
-   die "usermod failed"
+   die "usermod failed with status ${status}"
fi
fi
 }
@@ -502,7 +502,7 @@ acct-user_pkg_prerm() {
fi
 
elog "Locking user ${ACCT_USER_NAME}"
-   usermod "${opts[@]}" "${ACCT_USER_NAME}" || die
+   usermod "${opts[@]}" "${ACCT_USER_NAME}" || die "usermod failed with 
status $?"
 }
 
 fi
-- 
2.41.0




Re: [gentoo-dev] [PATCH] acct-user.eclass: include exit status in death message

2023-06-25 Thread Michał Górny
I think a better approach would be to always include $? in die messages
in Portage.


-- 
Best regards,
Michał Górny




Re: [gentoo-dev] [PATCH] acct-user.eclass: include exit status in death message

2023-06-25 Thread Oskari Pirhonen
On Sun, Jun 25, 2023 at 20:52:53 +0200, Michał Górny wrote:
> I think a better approach would be to always include $? in die messages
> in Portage.
> 

I'm not sure the exit code is useful in the general case. Something like
rm(1) seems to give the same exit code despite failing for different
reasons:

$ rm /tmp/root_owned 
rm: remove write-protected regular empty file '/tmp/root_owned'? y
rm: cannot remove '/tmp/root_owned': Operation not permitted
$ echo $?
1
$ rm /tmp/nonexistent
rm: cannot remove '/tmp/nonexistent': No such file or directory
$ echo $?
1

On the other hand, groupadd(8) (at least) seems to have useful exit
codes. From the man page:

EXIT VALUES
   The groupadd command exits with the following values:

   0
   success

   2
   invalid command syntax

   3
   invalid argument to option

   4
   GID is already used (when called without -o)

   9
   group name is already used

   10
   can't update group file

- Oskari


signature.asc
Description: PGP signature


Re: [gentoo-dev] [PATCH] acct-user.eclass: include exit status in death message

2023-06-25 Thread Mike Gilbert
On Sun, Jun 25, 2023 at 2:52 PM Michał Górny  wrote:
>
> I think a better approach would be to always include $? in die messages
> in Portage.

It's a nice idea, but will not work in the case where die is not
called immediately after the failing command.

A couple of possible workarounds that could be used to reset $? before
calling die:

1. Exit in a subshell: (exit ${status})
2. Return from a function: set_status() { return $1; }; set_status ${status}

In any case, I would like to apply the acct-user.eclass patch soonish
to help with debugging an error during stage building that releng
reported to me in IRC. We can revisit changing the die function and
possibly revert this patch later.



[gentoo-dev] Announcing a utility for updating metadata.xml files

2023-06-25 Thread Anna (cybertailor) Vyalkova
Hi lists,

You might know about the `app-portage/metagen` utility that generates
metadata.xml files with your name and email. But there was no tool that
autofilled upstream information, so I wrote it.

Using it is as simple as:

$ gentle foo-0.1.ebuild

You can install it as `app-portage/gentle` from the ::guru repository or
download it from PyPI: https://pypi.org/project/gentle-mxml/

The tool uses Portage API to unpack source code into a temporary
directory and guess from that data. Pkgcraft will be supported once its
bindings gain ability to call phase functions. There are problems with
Pkgcore, so it's not supported.

Contributions (especially fixing bugs and adding new generators) are
welcome!


P.S. There's a similar project called upstream-ontologist[0]. I didn't
know about it when I started the project and now it's too late.

[0]: https://pypi.org/project/upstream-ontologist/



Re: [gentoo-dev] Announcing a utility for updating metadata.xml files

2023-06-25 Thread Sam James

"Anna (cybertailor) Vyalkova"  writes:

> Hi lists,
>
> You might know about the `app-portage/metagen` utility that generates
> metadata.xml files with your name and email. But there was no tool that
> autofilled upstream information, so I wrote it.
>
> Using it is as simple as:
>
>   $ gentle foo-0.1.ebuild
>
> You can install it as `app-portage/gentle` from the ::guru repository or
> download it from PyPI: https://pypi.org/project/gentle-mxml/

Thanks, this sounds pretty useful. I might look at adding Perl (and
maybe Ruby) support if nobody else does.

Feel free to submit it to ::gentoo.



signature.asc
Description: PGP signature


Re: [gentoo-dev] [PATCH] acct-user.eclass: include exit status in death message

2023-06-25 Thread Sam James

Mike Gilbert  writes:

> On Sun, Jun 25, 2023 at 2:52 PM Michał Górny  wrote:
>>
>> I think a better approach would be to always include $? in die messages
>> in Portage.
>
> It's a nice idea, but will not work in the case where die is not
> called immediately after the failing command.
>
> A couple of possible workarounds that could be used to reset $? before
> calling die:
>
> 1. Exit in a subshell: (exit ${status})
> 2. Return from a function: set_status() { return $1; }; set_status ${status}
>
> In any case, I would like to apply the acct-user.eclass patch soonish
> to help with debugging an error during stage building that releng
> reported to me in IRC. We can revisit changing the die function and
> possibly revert this patch later.

lgtm then


signature.asc
Description: PGP signature