Commits (4)
diffoscope (160) UNRELEASED; urgency=medium
diffoscope (160) unstable; urgency=medium
* WIP (generated upon release).
* Check that pgpdump is actually installed before attempting to run it.
Thanks to Gianfranco Costamagna (locutusofborg). (Closes: #969753)
* Add some documentation for the EXTERNAL_TOOLS dictionary.
* Ensure we check FALLBACK_FILE_EXTENSION_SUFFIX, otherwise we run pgpdump
against all files that are recognised by file(1) as "data".
-- Chris Lamb <lamby@debian.org> Fri, 04 Sep 2020 11:25:57 +0100
-- Chris Lamb <lamby@debian.org> Fri, 11 Sep 2020 10:08:38 +0100
diffoscope (159) unstable; urgency=medium
......
......@@ -18,4 +18,4 @@
# You should have received a copy of the GNU General Public License
# along with diffoscope. If not, see <https://www.gnu.org/licenses/>.
VERSION = "159"
VERSION = "160"
......@@ -22,7 +22,7 @@ import re
import logging
import subprocess
from diffoscope.tools import tool_required
from diffoscope.tools import tool_required, tool_check_installed
from diffoscope.tempfiles import get_temporary_directory
from diffoscope.difference import Difference
......@@ -91,7 +91,12 @@ class PgpFile(File):
@classmethod
def fallback_recognizes(cls, file):
if file.magic_file_type == "data":
# Ensure we check FALLBACK_FILE_EXTENSION_SUFFIX, otherwise we run
# pgpdump against all files that are recognised by file(1) as "data"
if not super().fallback_recognizes(file):
return False
if file.magic_file_type == "data" and tool_check_installed("pgpdump"):
try:
output = our_check_output(
("pgpdump", file.path), stderr=subprocess.DEVNULL
......
......@@ -34,16 +34,14 @@ TEST_FILE2_PATH = data("text_ascii2")
def test_no_differences():
difference = compare_directories(
os.path.dirname(__file__), os.path.dirname(__file__)
)
x = os.path.dirname(__file__)
difference = compare_directories(x, x)
assert difference is None
def test_no_differences_with_extra_slash():
difference = compare_directories(
os.path.dirname(__file__) + "/", os.path.dirname(__file__)
)
x = os.path.dirname(__file__)
difference = compare_directories(x + "/", x)
assert difference is None
......