debian/bin/genorig.py: mkdir ../orig
authorHans van Kranenburg <hans@knorrie.org>
Fri, 26 Jan 2018 02:38:52 +0000 (03:38 +0100)
committerHans van Kranenburg <hans@knorrie.org>
Sat, 27 Jan 2018 23:35:09 +0000 (00:35 +0100)
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>
debian/bin/genorig.py

index 8b4614028dd0328c882f0f818e8c6e0664b08275..5a0d435f69cf4a9a2129b0d92affee4be972e9ec 100755 (executable)
@@ -52,6 +52,11 @@ class Main(object):
             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)