[Git][reproducible-builds/diffoscope][master] 2 commits: Drop .travis.yml -- prefer to use Salsa instead.
Chris Lamb
gitlab at salsa.debian.org
Wed May 13 10:47:24 UTC 2020
Chris Lamb pushed to branch master at Reproducible Builds / diffoscope
Commits:
591ea6e1 by Chris Lamb at 2020-05-13T09:15:27+01:00
Drop .travis.yml -- prefer to use Salsa instead.
- - - - -
1756a48d by Chris Lamb at 2020-05-13T11:41:24+01:00
Don't print a traceback if we pass a single, missing argument to diffoscope (eg. a JSON diff to re-load).
- - - - -
4 changed files:
- − .travis.yml
- diffoscope/comparators/utils/compare.py
- diffoscope/readers/__init__.py
- diffoscope/utils.py
Changes:
=====================================
.travis.yml deleted
=====================================
@@ -1,13 +0,0 @@
-sudo: required
-language: generic
-
-services:
- - docker
-
-script:
- - wget -O- http://travis.debian.net/script.sh | sh -
-
-branches:
- except:
- - /^debian\/\d/
- - /^\d+$/
=====================================
diffoscope/comparators/utils/compare.py
=====================================
@@ -19,7 +19,6 @@
import io
import os
-import sys
import shlex
import logging
import binascii
@@ -27,6 +26,7 @@ import subprocess
from diffoscope.tools import tool_required
from diffoscope.exc import RequiredToolNotFound
+from diffoscope.utils import bail_if_non_existing
from diffoscope.config import Config
from diffoscope.excludes import any_excluded
from diffoscope.profiling import profile
@@ -147,16 +147,6 @@ def call_difftool(file1, file2):
subprocess.call(cmd, shell=True)
-def bail_if_non_existing(*paths):
- if not all(map(os.path.lexists, paths)):
- for path in paths:
- if not os.path.lexists(path):
- sys.stderr.write(
- '%s: %s: No such file or directory\n' % (sys.argv[0], path)
- )
- sys.exit(2)
-
-
def compare_binary_files(file1, file2, source=None):
try:
if source is None:
=====================================
diffoscope/readers/__init__.py
=====================================
@@ -3,7 +3,7 @@
# diffoscope: in-depth comparison of files, archives, and directories
#
# Copyright © 2017 Ximin Luo <infinity0 at debian.org>
-# Copyright © 2017 Chris Lamb <lamby at debian.org>
+# Copyright © 2017, 2020 Chris Lamb <lamby at debian.org>
#
# diffoscope is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -20,10 +20,13 @@
import codecs
+from diffoscope.utils import bail_if_non_existing
+
from .json import JSONReaderV1
def load_diff_from_path(path):
+ bail_if_non_existing(path)
with open(path, 'rb') as fp:
return load_diff(codecs.getreader('utf-8')(fp), path)
=====================================
diffoscope/utils.py
=====================================
@@ -17,6 +17,9 @@
# You should have received a copy of the GNU General Public License
# along with diffoscope. If not, see <https://www.gnu.org/licenses/>.
+import os
+import sys
+
def format_cmdline(cmd, replace=(), truncate=None):
def fn(x):
@@ -44,3 +47,13 @@ def format_bytes(size, decimal_places=2):
size /= 1024.0
return f"{size:.{decimal_places}f} {unit}"
+
+
+def bail_if_non_existing(*paths):
+ if not all(map(os.path.lexists, paths)):
+ for path in paths:
+ if not os.path.lexists(path):
+ sys.stderr.write(
+ '%s: %s: No such file or directory\n' % (sys.argv[0], path)
+ )
+ sys.exit(2)
View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/-/compare/e779fe60ab94f0cb8cc094e827f2626e41e76ee1...1756a48dc37f4395eeaf106eea7a0ade9a5cf26b
--
View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/-/compare/e779fe60ab94f0cb8cc094e827f2626e41e76ee1...1756a48dc37f4395eeaf106eea7a0ade9a5cf26b
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.reproducible-builds.org/pipermail/rb-commits/attachments/20200513/4ef79034/attachment.htm>
More information about the rb-commits
mailing list