projects
/
auto-debuild.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
3c40b0a
)
add a function for configuration-building-installation
author
Ralf Jung
<post@ralfj.de>
Wed, 18 Jul 2012 20:04:43 +0000
(22:04 +0200)
committer
Ralf Jung
<post@ralfj.de>
Wed, 18 Jul 2012 20:04:43 +0000
(22:04 +0200)
auto_debuild.py
patch
|
blob
|
history
diff --git
a/auto_debuild.py
b/auto_debuild.py
index 6b7a84b7fc19450dde59b32a35027aa3cc344f17..36cef6db343c3806c39cea22e459621f1b570e45 100755
(executable)
--- a/
auto_debuild.py
+++ b/
auto_debuild.py
@@
-151,19
+151,26
@@
def buildDebianPackage(config):
command = ['bash', '-c', ' && '.join(commands)]
subprocess.check_call(commandInBuildEnv(config, command))
command = ['bash', '-c', ' && '.join(commands)]
subprocess.check_call(commandInBuildEnv(config, command))
-#
if we are called directly as script
-
if __name__ == "__main__"
:
+#
all at once
+
def createAndInstall(config, overwriteCheck = False)
:
# generate debian files
# generate debian files
- import imp
- config = imp.load_source('config', 'debian/auto-debuild.conf').__dict__
- os.remove('debian/auto-debuild.confc')
files = createDebianFiles(config)
# check if a file is overwritten
files = createDebianFiles(config)
# check if a file is overwritten
- for file in files:
- if os.path.exists(file):
- if raw_input("Do you want to overwrite %s (y/N)? " % file).lower() != "y":
- sys.exit(1)
+ if overwriteCheck:
+ for file in files:
+ if os.path.exists(file):
+ if raw_input("Do you want to overwrite %s (y/N)? " % file).lower() != "y":
+ sys.exit(1)
# run compilation
buildDebianPackage(config)
# install files
subprocess.check_call(['sudo', 'dpkg', '--install'] + files)
# run compilation
buildDebianPackage(config)
# install files
subprocess.check_call(['sudo', 'dpkg', '--install'] + files)
+
+# if we are called directly as script
+if __name__ == "__main__":
+ # get config
+ import imp
+ config = imp.load_source('config', 'debian/auto-debuild.conf').__dict__
+ os.remove('debian/auto-debuild.confc')
+ # and go for it
+ createAndInstall(config, overwriteCheck=True)