# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301, USA.
"""Helpers for the git-buildpackage OBS source service"""
-
-import gbp.log as gbplog
-
-
-# Setup logging
-LOGGER = gbplog.getLogger('source_service')
-LOGGER.setLevel(gbplog.INFO)
-
import sys
+import obs_service_gbp
+import obs_service_gbp.command
from repocache_adm.adm import MainCommand as BaseCommand
-from obs_service_gbp.command import read_config
class MainCommand(BaseCommand):
"""Class for the command line script"""
def add_arguments(parser):
"""Add arguments"""
# Parse config files
- config = read_config()
+ config = obs_service_gbp.command.read_config()
# Add arguments
parser.set_defaults(cache_dir=config['repo-cache-dir'])
+ @classmethod
+ def main(cls, argv=None):
+ """Main entry point"""
+
+ super(MainCommand, cls).main(argv)
if __name__ == '__main__':
sys.exit(MainCommand.main())
import os
import argparse
+import logging
import shutil
import tempfile
from ConfigParser import SafeConfigParser
+import gbp.log as gbplog
from gbp.rpm import guess_spec, NoSpecError
from gbp.scripts.buildpackage import main as gbp_deb
from gbp.scripts.buildpackage_rpm import main as gbp_rpm
-from obs_service_gbp import LOGGER, gbplog
from obs_service_gbp_utils import (GbpServiceError, GbpChildBTError, fork_call,
sanitize_uid_gid, write_treeish_meta, str_to_bool)
from gbp_repocache import CachedRepo, CachedRepoError
import gbp_repocache
+
+# Setup logging
+LOGGER = logging.getLogger('source_service')
+LOGGER.setLevel(logging.INFO)
+
def have_spec(directory):
"""Find if the package has spec files"""
try:
args = parse_args(argv)
+ logging.basicConfig()
LOGGER.info('Starting git-buildpackage source service')
if args.verbose == 'yes':
- gbplog.setup(color='auto', verbose=True)
- LOGGER.setLevel(gbplog.DEBUG)
- gbp_repocache.LOGGER.setLevel(gbplog.DEBUG)
+ #gbplog.setup(color='auto', verbose=True)
+ LOGGER.setLevel(logging.DEBUG)
+ gbp_repocache.LOGGER.setLevel(logging.DEBUG)
config = read_config(args.config)