From: Ralf Jung Date: Sun, 29 Jul 2012 21:03:46 +0000 (+0200) Subject: Support copying already installed files to another location X-Git-Url: https://git.ralfj.de/auto-debuild.git/commitdiff_plain/e2ba60734fa52dacdf59203b09af6324b0014922 Support copying already installed files to another location --- diff --git a/auto_debuild.py b/auto_debuild.py index c274412..cb2d840 100755 --- a/auto_debuild.py +++ b/auto_debuild.py @@ -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')