From dd34fe6449e020952e5a2894d3679eed51751dae Mon Sep 17 00:00:00 2001 From: Mathias Klette Date: Thu, 2 May 2013 12:28:54 +0200 Subject: [PATCH] debian_build: cleanup #2 --- debian_build.py | 54 ++++--------------------------------------------- 1 file changed, 4 insertions(+), 50 deletions(-) diff --git a/debian_build.py b/debian_build.py index 9d47b83..2ddfd00 100755 --- a/debian_build.py +++ b/debian_build.py @@ -6,13 +6,10 @@ # # wirklich. wirklich. wirklich. # -# # mehr kommentare waeren auch gut. wirklich gut. # import standards -import atexit import datetime -import errno import fileinput import fnmatch import git @@ -25,10 +22,7 @@ import shutil import subprocess import sys import time -import urllib from ConfigParser import SafeConfigParser -from ftplib import FTP -from glob import glob from multiprocessing import cpu_count # import local modules @@ -36,6 +30,7 @@ from add_liveboot_request import add_liveboot_request from cidb import * from common_code import * from db_add import * +from lib import dput from lib import git_buildpackage from lib import git_helper @@ -80,13 +75,7 @@ GIT_TARGET_DIR = os.path.join( ) DPUT_OPTIONS_DEFAULT = { - 'fqdn': 'alexandria.pb.local', - 'method': 'scp', - 'login': 'reprepro', - 'incoming': '/srv/profitbricks-repository/incoming/profitbricks', - 'allow_unsigned_uploads': 1, - 'post_upload_command': 'ssh reprepro@alexandria.pb.local /srv/profitbricks-repository/bin/pb_processincoming', - } + # FIXME: i went to lib/dput.py DPUT_OPTIONS_DEV = { 'fqdn': 'alexandria.pb.local', 'method': 'scp', @@ -99,45 +88,10 @@ DPUT_CF = os.path.join(CWD, '..', 'dput.cf') def dput_package_upload(changes_path): - try: - cmd = [BIN_DPUT, - '-c', - '%s' %(DPUT_CF), - '--no-upload-log', - 'profitbricks', - '%s' %(changes_path), - ] - - logger.debug( 'Trying to execute: "%s"' %(cmd)) - cmd_obj = subprocess.Popen( - cmd, - shell=False, - stdout=sys.stdout, - stderr=subprocess.STDOUT, - close_fds=True, - cwd=os.path.dirname(DPUT_CF) - ) - result = cmd_obj.wait() - logger.debug('Exit status: %d' %( result )) - - if not result: - raise Exception(message) - - except Exception, error: - logger.exception('%s' %(error)) - - return True + # FIXME: i went to lib/dput.py def create_dput_cfg(): - fh = open(DPUT_CF, 'w') - config = SafeConfigParser() - config.add_section('profitbricks') - for option, value in DPUT_OPTIONS.iteritems(): - config.set('profitbricks', '%s' %(option), '%s' %(value)) - config.write(fh) - fh.close() - return True - + # FIXME: i went to lib/dput.py def getopts(): usage = '%prog [options]' -- 2.39.5