From 4619c1a0ffc127c8f645077f5c322663d8b9b2b3 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 28 Apr 2024 16:29:59 +0200 Subject: Adding debian version 86.0.1-1. Signed-off-by: Daniel Baumann --- debian/import-tar.py | 97 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100755 debian/import-tar.py (limited to 'debian/import-tar.py') diff --git a/debian/import-tar.py b/debian/import-tar.py new file mode 100755 index 0000000000..36772f81f1 --- /dev/null +++ b/debian/import-tar.py @@ -0,0 +1,97 @@ +#!/usr/bin/env python3 + +import glob +import tarfile +import sys +from optparse import OptionParser +import os + +class GitImportTar(object): + def __init__(self, filename, head): + self.mark = 1 + self.git = sys.stdout + self.files = {} + self.name = filename + self.mtime = 0 + self.head = head + + def addfile(self, info, prefix = '', file = None): + if info.isdir(): + return + self.git.write("blob\n" + + "mark :%d\n" % self.mark) + mode = info.mode + if info.issym(): + self.git.write("data %d\n" % len(info.linkname) + + info.linkname) + mode = 0o120000 + elif file: + self.git.write("data %d\n" % (info.size)) + self.git.flush() + self.git.buffer.write(file.read(info.size)) + + self.git.write("\n") + if not prefix in self.files: + self.files[prefix] = {} + self.files[prefix][info.name] = (self.mark, mode) + self.mark += 1 + if info.mtime > self.mtime: + self.mtime = info.mtime + + def close(self): + self.git.write("commit refs/heads/%s\n" % (self.head) + + "author T Ar Creator' %d +0000\n" % (self.mtime) + + "committer T Ar Creator' %d +0000\n" % (self.mtime) + + "data <