~sil2100/cupstream2distro/additional_check_full_sync

« back to all changes in this revision

Viewing changes to citrain/build

  • Committer: Tarmac
  • Author(s): Łukasz 'sil2100' Zemczak
  • Date: 2014-09-11 17:37:54 UTC
  • mfrom: (724.1.2 cu2d-syncfixes)
  • Revision ID: tarmac-20140911173754-ecyilxcyaaelm1g8
Add the option to not rewrite the version number. Add a check to retarget to ubuntu in cases where the silo is in the middle of cleaning. Also, make sure we don't sync from an empty silo.

Approved by PS Jenkins bot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
46
46
TAKE_WHOLE_COMMIT_MESSAGE
47
47
    Use whole commit message in changelog, not just the brief part.
48
48
 
 
49
SYNC_DO_NOT_REWRITE_VERSION
 
50
    Only useful for sync silos. Do not rewrite the package version
 
51
    (e.g. do not add the ~rtm to the upstream part)
 
52
 
49
53
DEBUG
50
54
    Enable debug infos
51
55
"""
579
583
                    os.path.join(
580
584
                        SILOS_DIR, "ubuntu", silo_name))
581
585
                if (not source_silo_config or
582
 
                        source_silo_config["requestid"] != request_id):
 
586
                        source_silo_config["requestid"] != request_id or
 
587
                        source_silo_config["global"]["status"]["state"] ==
 
588
                        silomanager.SILO_STATE_CLEANING):
583
589
                    logging.info(
584
590
                        "Warning! /!\ The source silo has been removed, "
585
591
                        "retargetting to the ubuntu archive instead")
596
602
                                       source_archive.getPublishedSources(
597
603
                                           distro_series=source_series_object,
598
604
                                           status="Published")]
 
605
 
 
606
                    if not sources_to_sync:
 
607
                        logging.error(
 
608
                            "The silo sync generates an empty list of packages"
 
609
                            " - please make sure the sync is fetching sources "
 
610
                            "from the right place. Contact the landing team "
 
611
                            "in case of any inconsistencies.")
 
612
                        silomanager.set_config_status(
 
613
                            silo_config,
 
614
                            silomanager.SILO_STATE_BUILD_FAILED,
 
615
                            "Build failed: silo sync generates an empty "
 
616
                            "sources list. Check configuration.")
 
617
                        sys.exit(1)
 
618
 
599
619
                    silo_config["sources"] = sources_to_sync
600
620
                    silomanager.save_config(silo_config)
601
621
 
626
646
            # TODO: handle the case of direct-uploads that do not bump the
627
647
            #  upstream version, only the ubuntu number.
628
648
            #  The ~rtm bits need to be then added after the ubuntu bits then
629
 
            if (source_archive.distribution.name == "ubuntu" and
 
649
            if (env.SYNC_DO_NOT_REWRITE_VERSION != "true" and
 
650
                    source_archive.distribution.name == "ubuntu" and
630
651
                    dest.distribution.name == "ubuntu-rtm"):
631
652
                split_version = current_version.split("-")
632
653
                if len(split_version) > 1: