diff --git a/bin/swh-hashdir b/bin/swh-hashdir deleted file mode 100755 index f3f30cc..0000000 --- a/bin/swh-hashdir +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/python3 - -# Copyright (C) 2015 The Software Heritage developers -# See the AUTHORS file at the top-level directory of this distribution -# License: GNU General Public License version 3, or any later version -# See top-level LICENSE file for more information - -import os -import sys - -from swh.core.hashutil import hashfile, hash_to_hex - -if __name__ == '__main__': - dirname = sys.argv[1] - - hashes = {} - for root, _dirs, files in os.walk(dirname): - for name in files: - path = os.path.join(root, name) - hashes[path] = { - algo: hash_to_hex(checksum) - for algo, checksum in hashfile(path).items() - } - hashes[path]['length'] = os.path.getsize(path) - - for (path, checksums) in hashes.items(): - print("\\\\x%(sha1)s\t\\\\x%(sha1_git)s\t\\\\x%(sha256)s\t%(length)d\tvisible" % # NOQA - checksums) diff --git a/bin/swh-hashfile b/bin/swh-hashfile deleted file mode 100755 index d7692aa..0000000 --- a/bin/swh-hashfile +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/python3 - -# Copyright (C) 2015 The Software Heritage developers -# See the AUTHORS file at the top-level directory of this distribution -# License: GNU General Public License version 3, or any later version -# See top-level LICENSE file for more information - -import sys - -from swh.core.hashutil import hashfile, hash_to_hex - -if __name__ == '__main__': - fname = sys.argv[1] - for (algo, checksum) in sorted(hashfile(fname).items()): - print('%s\t%s' % (algo, hash_to_hex(checksum)))