Support copying already installed files to another location
authorRalf Jung <post@ralfj.de>
Sun, 29 Jul 2012 21:03:46 +0000 (23:03 +0200)
committerRalf Jung <post@ralfj.de>
Sun, 29 Jul 2012 21:03:46 +0000 (23:03 +0200)
auto_debuild.py

index c2744125659bf3071c6bbbb6e97767f97989b835..cb2d840039af595a7a6f79ae545cb78e08b3294a 100755 (executable)
@@ -1,5 +1,5 @@
 #!/usr/bin/python
-import os, stat, time, subprocess, sys
+import os, shutil, stat, time, subprocess, sys
 from collections import OrderedDict
 
 # some utility functions
@@ -149,6 +149,8 @@ def createDebianFiles(config):
        # install file
        with open('debian/'+binaryName+'.install', 'w') as f:
                for line in config.get('binaryInstall', []):
+                       if line.startswith('/'): # a file from within the package, not from the source tree
+                               line = 'debian/'+binaryName+line
                        print >>f, line
        # rules file: build system specific
        with open('debian/rules', 'w') as f:
@@ -181,7 +183,7 @@ def createDebianFiles(config):
                r.write(f)
        mode = os.stat('debian/rules').st_mode
        os.chmod('debian/rules', mode | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH)
-       # return list of files affected
+       # return list of files that will be created
        return files
 
 def buildDebianPackage(config):
@@ -193,7 +195,7 @@ def buildDebianPackage(config):
 ###################################################################
 # if we are called directly as script
 if __name__ == "__main__":
-       import imp, shutil
+       import imp
        # get config
        config = imp.load_source('config', 'auto-debuild.conf').__dict__
        os.remove('auto-debuild.confc')