summaryrefslogtreecommitdiffstats
path: root/files/scripts/update-fullfiletimelist
diff options
context:
space:
mode:
authorAdam Williamson <awilliam@redhat.com>2016-11-18 16:34:38 -0800
committerAdam Williamson <awilliam@redhat.com>2016-11-19 15:15:53 -0800
commit45d8ea3f89db0b10f580703ffa4354acf2ee4368 (patch)
tree3f506f2ec19ffafd59480bd1d6e3ba2a54033fde /files/scripts/update-fullfiletimelist
parent77e47ec39bee3f35380f1c66887e6520d4971f68 (diff)
downloadansible-45d8ea3f89db0b10f580703ffa4354acf2ee4368.tar.gz
ansible-45d8ea3f89db0b10f580703ffa4354acf2ee4368.tar.xz
ansible-45d8ea3f89db0b10f580703ffa4354acf2ee4368.zip
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.
Diffstat (limited to 'files/scripts/update-fullfiletimelist')
-rwxr-xr-xfiles/scripts/update-fullfiletimelist19
1 files changed, 17 insertions, 2 deletions
diff --git a/files/scripts/update-fullfiletimelist b/files/scripts/update-fullfiletimelist
index 016ca8ed6..f6c225a3e 100755
--- a/files/scripts/update-fullfiletimelist
+++ b/files/scripts/update-fullfiletimelist
@@ -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