First time someone does this the directory does not exist and you get an
ugly error. I copied this from the debian kernel genorig.py.
Note: currently my biggest annoyance with the placement of the orig file
in ../orig and the symlink to it is that if I run pbuilder, I will end
up with a symlink pointing nowhere in my pbuilder result location
instead of the actual orig, which makes including it into reprepro bork
of course.
For now, I'm making minimal changes to this. We can improve and change
it later. But this change prevents more lines in the README.source for
now.
Signed-off-by: Hans van Kranenburg <hans@knorrie.org>
raise RuntimeError("Destination already exists")
except OSError: pass
+ try:
+ os.mkdir("../orig")
+ except OSError:
+ pass
+
try:
with open(out, 'wb') as f:
_cmd = ('git', 'archive', '--prefix', '%s/' % self.orig_dir, treeish)