andrewgregory / pacutils

Helper library for libalpm based programs.
MIT License
107 stars 17 forks source link

False positives with pacreport --missing-files for java. #52

Closed VorpalBlade closed 2 years ago

VorpalBlade commented 2 years ago

pacreport --missing-files reports the following files are missing:

Missing Package Files:
  java-environment-common       /usr/bin/javah
  java-environment-common       /usr/bin/rmic
  java-environment-common       /usr/bin/schemagen
  java-environment-common       /usr/bin/wsgen
  java-environment-common       /usr/bin/wsimport
  java-environment-common       /usr/bin/xjc
  java-runtime-common           /usr/bin/orbd
  java-runtime-common           /usr/bin/pack200
  java-runtime-common           /usr/bin/rmid
  java-runtime-common           /usr/bin/servertool
  java-runtime-common           /usr/bin/tnameserv
  java-runtime-common           /usr/bin/unpack200

However these are there, but are broken symlinks. For example:

$ ls -l /usr/bin/pack200 /usr/lib/jvm/default-runtime/bin/pack200
ls: cannot access '/usr/lib/jvm/default-runtime/bin/pack200': No such file or directory
lrwxrwxrwx 1 root root 40 May 16  2020 /usr/bin/pack200 -> /usr/lib/jvm/default-runtime/bin/pack200

This appears to be due to the selected java version not providing those binaries:

$ archlinux-java status
Available Java environments:
  java-17-openjdk (default)
$ archlinux-java get
java-17-openjdk

Presumably some other java version does provide one or more of these binaries. The command-not-found zsh shell function also seems to think so:

$ pack200            
pack200 may be found in the following packages:
  extra/java-runtime-common 3-3                 /usr/bin/pack200
  extra/jdk8-openjdk 8.u312-2                   /usr/lib/jvm/java-8-openjdk/bin/pack200
  extra/jre11-openjdk-headless 11.0.13.u8-1     /usr/lib/jvm/java-11-openjdk/bin/pack200
  extra/jre8-openjdk-headless 8.u312-2          /usr/lib/jvm/java-8-openjdk/jre/bin/pack200

Anyway, it seems that the broken symlinks should not be reported as missing files, at least not for java. And I can't really think of a reason to ever do so, since presumably if it is a problem the pointed to file would turn up in the missing list.