Skip to content

feat(makechrootpkg): use meaningful machine name

Claudia Pellegrino requested to merge auerhuhn/devtools:machine-name into master

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:

swappy-20240618_230754

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:

  1. makechrootpkg.building.pkg1.pkg2.pkg3-git
    makechrootpkg.building.mypkg (the pkgbase, thanks @gromit for the suggestion)

  2. makechrootpkg.downloading.pkg1.pkg2.pkg3-git

  3. makechrootpkg.installing.pkg1.pkg2.pkg3-git

  4. makechrootpkg.updating

followed by a dot and the shell process ID a random number with up to five digits, instead of the generic arch-nspawn-123456 title that systemd-nspawn prints by default. instead of the generic arch-nspawn-SHELLPID title that arch-nspawn uses by default.

swappy-20240619_092824

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.

Edited by Claudia Pellegrino

Merge request reports

Loading