Blame SOURCES/dnf.patch

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