X-Git-Url: https://git.ralfj.de/auto-debuild.git/blobdiff_plain/07e101d3ec702bb92eb0efe2143147409f98a094..6762f33b883a0b089196cbb5fa0bb26eea947e14:/auto_debuild.py diff --git a/auto_debuild.py b/auto_debuild.py index 94c7c14..8dfdef5 100755 --- a/auto_debuild.py +++ b/auto_debuild.py @@ -16,7 +16,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -import os, shutil, stat, time, subprocess, sys, shlex, tempfile +import os, shutil, stat, time, subprocess, sys, shlex, tempfile, argparse from collections import OrderedDict # a dict with some useful additional getters which can convert types and handle one-element lists like their single member @@ -229,11 +229,14 @@ def createDebianFiles(config): files = [] # create folders if os.path.exists('debian') or os.path.islink('debian'): raise Exception('debian folder already exists?') - tempdir = tempfile.mkdtemp(prefix='auto-debuild-') - os.mkdir(tempdir+'/source') - os.symlink(tempdir, 'debian') + if config.getbool('useTmp', True): + tempdir = tempfile.mkdtemp(prefix='auto-debuild-') + os.symlink(tempdir, 'debian') + else: + os.mkdir('debian') if not os.path.exists(debDir): os.makedirs(debDir) # source format file + os.mkdir('debian/source') with open('debian/source/format', 'w') as f: print >>f, "3.0 (native)" # compat file @@ -383,8 +386,15 @@ def buildDebianPackage(config): # if we are called directly as script if __name__ == "__main__": try: + # read command-line arguments + parser = argparse.ArgumentParser(description='Automatic Generation of Debian Packages') + parser.add_argument("-w", "--wait-after-config", + action="store_true", dest="wait_after_config", + help="Wait for user confirmation after configuration is finished") + args = parser.parse_args() # get config config = loadConfigFile('auto-debuild.conf') + config['waitAfterConfig'] = args.wait_after_config # generate debian files if os.path.exists('debian') or os.path.islink('debian'): if raw_input("A debian folder already exists, do you want to remove it and whatever it links to (y/N)? ").lower() != "y":