898835da98
The generator will generate a Requires on filesystem(unmerged-sbin-symlinks), i.e. effectively on a new-enough version of _this_ package. This is needed to solve the following problem: as packages are rebuilt in a merged-sbin environment, their payload paths change from /usr/sbin to /usr/bin. In all the cases where there were other packages that dependended on the old paths via explicit Requires, compat Provides on the old path was added along with Requires:filesystem(unmerged-sbin-symlinks). This means that those packages will not be installed with an older filesystem.rpm. But for packages that didn't need this special treatment, no dependency is generated. When they are installed into an upgraded environment which still has split-sbin and has an older copy of filesystem, the file is moved without the compat symlink being created. Thus, any scripts, or systemd service files, etc., referring to the old path are now broken. We need to require a new-enough filesystem.rpm to be installed so avoid breakage on such partially upgraded systems.
19 lines
583 B
Bash
Executable File
19 lines
583 B
Bash
Executable File
#!/usr/bin/bash
|
|
|
|
# Generate Requires: filesystem(unmerged-sbin-symlinks) if any
|
|
# of the filenames were known to reside in /usr/sbin.
|
|
# When the package with the files is being built, it's possible that
|
|
# %_sbindir==/usr/bin, so we cannot rely on the location to figure
|
|
# this out and we need a hardcoded list.
|
|
|
|
sbin_filenames=${1:?}
|
|
declare -A "filenames=($(sed 's/.*/["\0"]=1/' <"${sbin_filenames}"))"
|
|
|
|
while read -r path; do
|
|
filename="$(basename "$path")"
|
|
if [ -n "${filenames[$filename]}" ]; then
|
|
echo ";$path"
|
|
echo "filesystem(unmerged-sbin-symlinks)"
|
|
fi
|
|
done
|