Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement slave alternative manpages #12

Open
2 tasks
stapelberg opened this issue Jan 10, 2017 · 11 comments
Open
2 tasks

Implement slave alternative manpages #12

stapelberg opened this issue Jan 10, 2017 · 11 comments
Assignees
Labels

Comments

@stapelberg
Copy link
Contributor

stapelberg commented Jan 10, 2017

A large number of packages makes manpages available via slave alternatives. See https://codesearch.debian.net/search?q=path%3Adebian%2F+update-alternatives+--install for an upper bound.

This is tricky to implement, because slave alternatives are configured in the postinst maintainer script, i.e. via update-alternatives calls in arbitrary shell script. It would be brittle to parse that shell script without running it, not to mention that its behavior might depend on the package actually being installed.

It seems like the only solution is to actually install the package and then introspect the alternatives database, e.g. /var/lib/dpkg/alternatives/vi.

A few test cases are:

  • vi
  • pg_dump
@stapelberg
Copy link
Contributor Author

One thing worth investigating is whether one could install packages in a Linux user namespace to reasonably well sandbox the installation.

@stapelberg
Copy link
Contributor Author

I’ve filed a feature request against piuparts: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=850917

@stapelberg
Copy link
Contributor Author

stapelberg commented Apr 17, 2017

The patch is now live in piuparts and reflected in a number of (but not all) logfiles, see e.g. /srv/piuparts.debian.org/htdocs/sid/pass/vim-nox_2:8.0.0197-3.log:

LOG-ALTERNATIVES: dpkg=vim-nox: piuparts=vim-nox=2:8.0.0197-3: /usr/bin/update-alternatives --install /usr/bin/vi vi /usr/bin/vim.nox 40 --slave /usr/share/man/fr/man1/vi.1.gz vi.fr.1.gz /usr/share/man/fr/man1/vim.1.gz --slave /usr/share/man/it/man1/vi.1.gz vi.it.1.gz /usr/share/man/it/man1/vim.1.gz --slave /usr/share/man/pl/man1/vi.1.gz vi.pl.1.gz /usr/share/man/pl/man1/vim.1.gz --slave /usr/share/man/ru/man1/vi.1.gz vi.ru.1.gz /usr/share/man/ru/man1/vim.1.gz --slave /usr/share/man/ja/man1/vi.1.gz vi.ja.1.gz /usr/share/man/ja/man1/vim.1.gz --slave /usr/share/man/man1/vi.1.gz vi.1.gz /usr/share/man/man1/vim.1.gz

Next up: making Debiman read these logs and parse the command lines.

@stapelberg
Copy link
Contributor Author

I implemented support and verified my changes by running debiman with and without the new -alternatives_dir flag, then generating rwmaps and diffing them:

debiman-idx2rwmap -index=before/auxserver.idx -output_dir=before/rwmap/
debiman-idx2rwmap -index=after/auxserver.idx -output_dir=after/rwmap/
(cd before/rwmap && LC_ALL=C sort * > output)
(cd after/rwmap && LC_ALL=C sort * > output)
diff --speed-large-files -u before/rwmap/output after/rwmap/output

The diff only contains expected additions, which verifies the change works as expected.

I’ll try cleaning up, pushing and deploying this tomorrow.

@stapelberg
Copy link
Contributor Author

I made a mistake yesterday by only specifying -force_rerender, but what we needed was -force_reextract, as the links are created when extracting packages.

I’m currently doing another run with -force_reextract, which should finish today and then be distributed to the static mirrors. I’ll check back in tomorrow morning.

stapelberg added a commit that referenced this issue May 20, 2017
@stapelberg
Copy link
Contributor Author

This is now live. I’ll still need to set up automated updates of the piuparts data files.

@jeffmcjunkin
Copy link

Should README.me be updated to reflect this issue being closed?

Currently, there is one known bug with regards to completeness (#12).

@stapelberg
Copy link
Contributor Author

Thanks for the hint. The automated updates of the data files aren’t done yet. Let me reopen the bug until this is fixed, then also update the README.

@stapelberg stapelberg reopened this Aug 19, 2017
@stapelberg
Copy link
Contributor Author

Status update: automated updates are now in place.

https://piuparts.debian.org/for-manpages.d.o/ is still missing buster.json.gz (I’ve asked Holger to pull a corresponding change).

Once that file appears, I’ll push a change to update the README.

@TobiX
Copy link

TobiX commented Jul 19, 2018

Is this why psql is missing? https://manpages.debian.org/stretch/postgresql-client-9.6/index.html (Or is that a new bug?)

@stapelberg
Copy link
Contributor Author

Is this why psql is missing? https://manpages.debian.org/stretch/postgresql-client-9.6/index.html (Or is that a new bug?)

Thanks for the report. psql(1) is missing because of a logic bug in that infrastructure. I filed #106 for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants