Skip to content

Commit

Permalink
20-files-present-and-referenced: Check for files in *.obscpio
Browse files Browse the repository at this point in the history
.obscpio files are extracted before build and the contents can be used as
sources.

As .obscpio files can be quite large, only look through them when needed.
  • Loading branch information
Vogtinator committed Aug 1, 2023
1 parent feb4fdc commit cadff38
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions 20-files-present-and-referenced
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,20 @@ if [ -x $(type -p xmllint) ]; then
done
fi

obscpio_file_list()
{
if ! [ -e "$TMPDIR/obcspio_sources" ]; then
touch "$TMPDIR/obcspio_sources"
for i in "$DIR_TO_CHECK/"*.obscpio; do
if [ -e "$i" ]; then
cpio --list --quiet < "$i" >> "$TMPDIR/obcspio_sources"
fi
done
fi

cat "$TMPDIR/obcspio_sources"
}

check_tracked()
{
local file=${1##*/}
Expand All @@ -132,6 +146,9 @@ check_tracked()
if grep -qsFx "$file" "$DESTINATIONDIR/_to_be_added"; then
return 0
fi
if obscpio_file_list | grep -qFx "$file"; then
return 0
fi
echo "ERROR: $file mentioned in spec file is not tracked."
return 1
fi
Expand All @@ -140,6 +157,9 @@ check_tracked()
# assume it will generated on builtime based of the archive
return 0
fi
if obscpio_file_list | grep -qFx "$file"; then
return 0
fi
echo "ERROR: $file mentioned in spec file does not exist."
return 1
fi
Expand Down

0 comments on commit cadff38

Please sign in to comment.