Browse Source

vendor/getinfo: Iterate through vendors in lexicographic order

find(1) works in readdir() order, which isn't guaranteed to be sorted.
If the current vendor is not an exact match for any subdirectory in
vendor/, and is somehow a derivative of more than one of them, we should
at least produce a deterministic answer.

Closes: #924662
Signed-off-by: Simon McVittie <smcv@collabora.com>
tags/devuan/2.0.1+devuan1
Simon McVittie Simon McVittie 1 year ago
parent
commit
e6633f03b2
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      vendor/getinfo

+ 1
- 1
vendor/getinfo View File

@@ -6,7 +6,7 @@ BASEDIR="$(readlink -f "$(dirname $0)")"
getcurrent() {
# search for an exact match to use the correct sources.list example
cd $BASEDIR
DISTROS="$(find . -mindepth 1 -maxdepth 1 -type d | cut -d'/' -f 2)"
DISTROS="$(find . -mindepth 1 -maxdepth 1 -type d | cut -d'/' -f 2 | LC_ALL=C sort)"
for DISTRO in $DISTROS; do
if dpkg-vendor --is $DISTRO; then
echo $DISTRO


Loading…
Cancel
Save