Generate filtered file lists for fedfind to use

This adds `filterlist` files alongside the `fullfilelist` and
`fullfiletimelist` files. These are much, much shorter lists
which skip the entries for packages, ARM device tree boot files
and directories. They are intended for consumption by fedfind,
so it can stop using rync scraping to discover the image files
it looks for. To enable this, we update to a newer version of
`create-filelist` from upstream `quick-fedora-mirror` and make
`update-fullfiletimelist` create the filterlist files as well.

We also delete a couple of old copies of `create-filelist`;
nirik made the two roles that use it share a common copy a few
months back, but missed deleting the copy each role had in its
`files` directory.
This commit is contained in:
Adam Williamson 2016-11-18 16:34:38 -08:00
parent 77e47ec39b
commit 45d8ea3f89
4 changed files with 26 additions and 75 deletions

View file

@ -25,6 +25,7 @@ CREATE=/usr/local/bin/create-filelist
# context.
FILELIST=fullfilelist
TIMELIST='fullfiletimelist-$mod'
FILTERLIST='filterlist-$mod'
usage () {
echo
@ -107,12 +108,14 @@ cd $tmpd
for mod in $MODS; do
currentfl=$TOPD/$mod/${FILELIST/'$mod'/$mod}
currenttl=$TOPD/$mod/${TIMELIST/'$mod'/$mod}
currentsl=$TOPD/$mod/${FILTERLIST/'$mod'/$mod}
flname=$(basename $currentfl)
tlname=$(basename $currenttl)
slname=$(basename $currentsl)
$CREATE -c -s -d $TOPD/$mod -f $flname -t $tlname
$CREATE -c -s -d $TOPD/$mod -f $flname -t $tlname -F $slname
# If a file list exsts and doesn't differ from what we just generated,
# If a file list exists and doesn't differ from what we just generated,
# delete the latter.
if [[ -f $currentfl ]] && diff -q $currentfl $flname > /dev/null; then
rm -f $flname
@ -120,6 +123,9 @@ cd $tmpd
if [[ -f $currenttl ]] && diff -q $currenttl $tlname > /dev/null; then
rm -f $tlname
fi
if [[ -f $currentsl ]] && diff -q $currentsl $slname > /dev/null; then
rm -f $slname
fi
done
# Now we have the new file lists but in a temporary directory which
@ -128,10 +134,13 @@ cd $tmpd
for mod in $MODS; do
currentfl=$TOPD/$mod/${FILELIST/'$mod'/$mod}
currenttl=$TOPD/$mod/${TIMELIST/'$mod'/$mod}
currentsl=$TOPD/$mod/${FILTERLIST/'$mod'/$mod}
flname=$(basename $currentfl)
fldir=$(dirname $currentfl)
tlname=$(basename $currenttl)
tldir=$(dirname $currenttl)
slname=$(basename $currentsl)
sldir=$(dirname $currentsl)
if [[ -f $flname ]]; then
tmpf=$(mktemp -p $fldir $flname.XXXXXXXXXX)
@ -145,6 +154,12 @@ cd $tmpd
chmod 644 $tmpf
mv $tmpf $currenttl
fi
if [[ -f $slname ]]; then
tmpf=$(mktemp -p $sldir $slname.XXXXXXXXXX)
cp -p $slname $tmpf
chmod 644 $tmpf
mv $tmpf $currentsl
fi
done
) 9>$LOCKFILE