Permalink
Browse files

fpmprobe: add check for uncompressed file paths

  • Loading branch information...
1 parent ff161ad commit 5da9d3659e81c6a486ff567b05ed6db4b514ed71 James Buren committed Jan 7, 2013
Showing with 29 additions and 0 deletions.
  1. +29 −0 tools/fpmprobe
View
@@ -6,6 +6,7 @@ TMPDIR=$(mktemp -d)
cd "$TMPDIR"
+# Probe for unusual permissions for a path.
permission_probe()
{
local p
@@ -21,6 +22,7 @@ permission_probe()
fi
}
+# Probe for paths which should never exist in a package.
paths_probe()
{
local error
@@ -40,6 +42,32 @@ paths_probe()
fi
}
+# Probe for uncompressed file paths in packages.
+compressed_probe()
+{
+ local error
+
+ if echo "$2" | grep -q -E '\b(gzip|XZ|directory)\b'; then
+ return
+ fi
+
+ case "$1" in
+ ./usr/share/consolefonts/*.fon) error=1 ;;
+ ./usr/share/consolefonts/*.psf) error=1 ;;
+ ./usr/share/consolefonts/*.psfu) error=1 ;;
+ ./usr/share/fonts/X11/*/*.pcf) error=1 ;;
+ ./usr/share/fonts/X11/*/*.bdf) error=1 ;;
+ ./usr/share/man/*) error=1 ;;
+ ./usr/man/*) error=1 ;;
+ ./lib/modules/*/kernel/*.ko) error=1 ;;
+ *) error=0 ;;
+ esac
+
+ if [ "$error" -eq 1 ]; then
+ echo "$1: uncompressed file"
+ fi
+}
+
for i in /pub/frugalware/frugalware-current/frugalware-x86_64/*.fpm; do
if [ ! -f "$i" ]; then
continue
@@ -53,6 +81,7 @@ for i in /pub/frugalware/frugalware-current/frugalware-x86_64/*.fpm; do
k=$(file "$j")
k=${k#*: }
paths_probe "$j" "$k"
+ compressed_probe "$j" $k"
done
echo "End: $i"
rm -rf .* * 2>&1

0 comments on commit 5da9d36

Please sign in to comment.