e2b7c84
diff -ur fontpackages-1.44.orig/bin/repo-font-audit fontpackages-1.44/bin/repo-font-audit
e2b7c84
--- fontpackages-1.44.orig/bin/repo-font-audit	2010-06-13 16:43:19.000000000 +0200
e2b7c84
+++ fontpackages-1.44/bin/repo-font-audit	2015-06-16 13:51:53.739107822 +0200
e2b7c84
@@ -1,5 +1,5 @@
e2b7c84
 #!/bin/sh
e2b7c84
-# Quick and dirty script to audit font use in a yum package repository
e2b7c84
+# Quick and dirty script to audit font use in a package repository
e2b7c84
 #
e2b7c84
 # It is slow, it is ugly, and it requires a good network connection
e2b7c84
 
e2b7c84
@@ -332,7 +332,7 @@
e2b7c84
 
e2b7c84
 echo "Looking for packages:"
e2b7c84
 echo "— with font metadata…"
e2b7c84
-repoquery --repofrompath=$REPOID,$FREPOURL --repoid=$REPOID \
e2b7c84
+$REPOQUERY --repofrompath=$REPOID,$FREPOURL --repoid=$REPOID \
e2b7c84
           --qf "%{sourcerpm}|%{name}|%{epoch}:%{version}-%{release}|%{arch}|%{packagesize}|M" \
e2b7c84
           --whatprovides "font(*)" --quiet \
e2b7c84
           | sort | uniq \
e2b7c84
@@ -340,7 +340,7 @@
e2b7c84
           > "$FPL"
e2b7c84
 
e2b7c84
 echo "— that include files with common font extensions…"
e2b7c84
-repoquery --repofrompath=$REPOID,$FREPOURL --repoid=$REPOID \
e2b7c84
+$REPOQUERY --repofrompath=$REPOID,$FREPOURL --repoid=$REPOID \
e2b7c84
           --qf "%{sourcerpm}|%{name}|%{epoch}:%{version}-%{release}|%{arch}|%{packagesize}|E" \
e2b7c84
           -f '*.ttf' -f '*.otf' -f '*.ttc' \
e2b7c84
           -f '*.pfb' -f '*.pfa' \
e2b7c84
@@ -350,7 +350,7 @@
e2b7c84
           > "$PWFL"
e2b7c84
 
e2b7c84
 echo "— that use the core X11 protocol…"
e2b7c84
-repoquery --repofrompath=$REPOID,$FREPOURL --repoid=$REPOID \
e2b7c84
+$REPOQUERY --repofrompath=$REPOID,$FREPOURL --repoid=$REPOID \
e2b7c84
           --qf "%{sourcerpm}|%{name}|%{epoch}:%{version}-%{release}|%{arch}|%{packagesize}|X" \
e2b7c84
           --whatrequires 'libX11.so*' \
e2b7c84
           | sort | uniq \
e2b7c84
@@ -386,7 +386,7 @@
e2b7c84
   echo -n "– $rpm ◔"
e2b7c84
   mkdir "$rpmd"
e2b7c84
   cd "$rpmd"
e2b7c84
-  rpm_loc=$(repoquery --repofrompath=$REPOID,$REPOURL --repoid=$REPOID \
e2b7c84
+  rpm_loc=$($REPOQUERY --repofrompath=$REPOID,$REPOURL --repoid=$REPOID \
e2b7c84
                       --location "$rpm" 2>/dev/null \
e2b7c84
               | fix_url)
e2b7c84
   if $(echo "$rpm_loc" | grep -q -e '^[\./~]') ; then
e2b7c84
@@ -1018,12 +1018,12 @@
e2b7c84
    text library such as pango, pango-cairo, harfbuzz, or QT)
e2b7c84
 
e2b7c84
 You can self-check your packages at any time by:
e2b7c84
-1. installing createrepo and fontpackages-tools:
e2b7c84
-# yum install createrepo fontpackages-tools
e2b7c84
+1. installing $CREATEREPO and fontpackages-tools:
e2b7c84
+# $YUM install $CREATEREPO fontpackages-tools
e2b7c84
 2. putting your packages and any font package they depends on in a
e2b7c84
    test directory
e2b7c84
-3. indexing this directory with createrepo:
e2b7c84
-$ createrepo path-to-test-directory
e2b7c84
+3. indexing this directory with $CREATEREPO:
e2b7c84
+$ $CREATEREPO path-to-test-directory
e2b7c84
 4. running repo-font-audit:
e2b7c84
 $ repo-font-audit test absolute-path-to-test-directory
e2b7c84
 
e2b7c84
@@ -1163,6 +1163,15 @@
e2b7c84
 SRES="repo-font-audit-$ID-$TIMESTAMP-short"
e2b7c84
 SPAM="repo-font-audit-$ID-$TIMESTAMP-mail"
e2b7c84
 
e2b7c84
+if [ -x /usr/bin/dnf ] ; then
e2b7c84
+    CREATEREPO='createrepo_c'
e2b7c84
+    REPOQUERY='dnf repoquery'
e2b7c84
+    YUM='dnf'
e2b7c84
+else
e2b7c84
+    CREATEREPO='createrepo'
e2b7c84
+    REPOQUERY='repoquery'
e2b7c84
+    YUM='yum'
e2b7c84
+fi
e2b7c84
 TMPDIR=$(mktemp -d --tmpdir=/tmp $RES-XXXXXXXXXX)
e2b7c84
 cd $TMPDIR
e2b7c84