~ubuntu-branches/ubuntu/trusty/dput-ng/trusty-proposed

« back to all changes in this revision

Viewing changes to dput/uploader.py

  • Committer: Package Import Robot
  • Author(s): Paul Tagliamonte, Paul Tagliamonte, Arno Töll
  • Date: 2013-11-14 09:20:03 UTC
  • mfrom: (6.1.2 sid)
  • Revision ID: package-import@ubuntu.com-20131114092003-831f18k6vurot64b
Tags: 1.7
* The "Get two birds stoned at once." release

[ Paul Tagliamonte ]
* Fix up default host argument. This caused the first block with the
  default_host_main argument set to be considered the default host, rather
  than the value of default_host_main. (Closes: #729280)
* Add experimental support for `dud` files, for Debile.

[ Arno Töll ]
* Be more explicit how to override dcut dm's UID check

Show diffs side-by-side

added added

removed removed

Lines of Context:
187
187
 
188
188
    # XXX: Correct --force behavior
189
189
    logfile = changes.get_changes_file()  # XXX: Check for existing one
190
 
    xtn = ".changes"
191
 
    if logfile.endswith(xtn):
192
 
        logfile = "%s.%s.upload" % (logfile[:-len(xtn)], conf['name'])
 
190
    xtns = [".changes", ".dud"]
 
191
 
 
192
    for xtn in xtns:
 
193
        if logfile.endswith(xtn):
 
194
            logfile = "%s.%s.upload" % (logfile[:-len(xtn)], conf['name'])
 
195
            break
193
196
    else:
194
197
        raise UploadException("File %s does not look like a .changes file" % (
195
198
            changes.get_filename()
301
304
        profile['incoming']
302
305
    ))
303
306
 
304
 
    if 'hooks' in profile:
305
 
        run_pre_hooks(changes, profile)
306
 
    else:
307
 
        logger.trace(profile)
308
 
        logger.warning("No hooks defined in the profile. "
309
 
                       "Not checking upload.")
 
307
    if changes.get_changes_file().endswith(".changes"):
 
308
        if 'hooks' in profile:
 
309
            run_pre_hooks(changes, profile)
 
310
        else:
 
311
            logger.trace(profile)
 
312
            logger.warning("No hooks defined in the profile. "
 
313
                           "Not checking upload.")
310
314
 
311
315
    # check only is a special case of -s
312
316
    if args.check_only:
337
341
        if args.simulate:
338
342
            return
339
343
 
340
 
        if 'hooks' in profile:
341
 
            run_post_hooks(changes, profile)
342
 
        else:
343
 
            logger.trace(profile)
344
 
            logger.warning("No hooks defined in the profile. "
345
 
                           "Not post-processing upload.")
 
344
        if changes.get_changes_file().endswith(".changes"):
 
345
            if 'hooks' in profile:
 
346
                run_post_hooks(changes, profile)
 
347
            else:
 
348
                logger.trace(profile)
 
349
                logger.warning("No hooks defined in the profile. "
 
350
                               "Not post-processing upload.")
346
351
    if should_write_logfile(args):
347
352
        tmp_logfile.flush()
348
353
        shutil.copy(tmp_logfile.name, logfile)