Blame SOURCES/dnf.patch

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