Blame SOURCES/dnf.patch

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