feat(makechrootpkg): use meaningful machine name
While running a longer makechrootpkg session that involves many packages, looking at the terminal output is not always sufficient to tell which package makechrootpkg is currently processing.
The latest major release of systemd, version 256, has introduced a feature in systemd-nspawn
that sets the window title from the container name:
To improve makechrootpkg’s UX, this MR takes advantage of systemd-nspawn’s new feature by setting the machine name (and thus, the terminal title) to one of the following values, depending on the step makechrootpkg is at:
-
makechrootpkg.building.pkg1.pkg2.pkg3-git
makechrootpkg.building.mypkg
(the pkgbase, thanks @gromit for the suggestion) -
makechrootpkg.downloading.pkg1.pkg2.pkg3-git
-
makechrootpkg.installing.pkg1.pkg2.pkg3-git
-
makechrootpkg.updating
followed by a dot and the shell process ID a random number with up to five digits, instead of the generic instead of the generic arch-nspawn-123456
title that systemd-nspawn prints by default.arch-nspawn-SHELLPID
title that arch-nspawn uses by default.
Special case for the inspection step
As a special case, use a shorter title for the inspection step, because it spawns a shell, which in turn usually sets the terminal title itself, so its title would override the one set by systemd-nspawn.
Fortunately, the shell happens to use the first subdomain of the machine name for its window title, so use a machine name of inspecting
here, followed by a hyphen and the shell PID.