Merge lp:~laney/ubuntu-archive-tools/generate-freeze-block into lp:ubuntu-archive-tools

Proposed by Iain Lane
Status: Merged
Merged at revision: 1383
Proposed branch: lp:~laney/ubuntu-archive-tools/generate-freeze-block
Merge into: lp:ubuntu-archive-tools
Diff against target: 59 lines (+16/-6)
1 file modified
generate-freeze-block (+16/-6)
To merge this branch: bzr merge lp:~laney/ubuntu-archive-tools/generate-freeze-block
Reviewer Review Type Date Requested Status
Stéphane Graber Pending
Ubuntu Package Archive Administrators Pending
Review via email: mp+235316@code.launchpad.net

Description of the change

Add a new -n/--not-unique mode to generate a block for packages which FLAVOURS seed in common with other flavours.

I just re-confused myself about the semantics of this option, but it's what we wanted near trusty-release combined with the auto accept script. Read

  http://irclogs.ubuntu.com/2014/04/11/%23ubuntu-release.html#t08:58

onwards to see what was going on at the time. I just found it uncommitted in my home directory. :(

The second commit is a bugfix to -u mode. Currently -u <flavours> and -u <flavours> <more flavours> can have some packages in the first set but not the second, which should never happen.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'generate-freeze-block'
--- generate-freeze-block 2014-02-24 18:37:45 +0000
+++ generate-freeze-block 2014-09-19 17:12:26 +0000
@@ -78,12 +78,18 @@
78 help='Block only packages unique to FLAVOURS')78 help='Block only packages unique to FLAVOURS')
79 parser.add_argument('--debug', '-d', action='store_true',79 parser.add_argument('--debug', '-d', action='store_true',
80 help='Output some extra debugging')80 help='Output some extra debugging')
81 parser.add_argument('--not-unique','-n', action='store_true',
82 help='Block only packages also seeded outside of FLAVOURS')
81 args = parser.parse_args()83 args = parser.parse_args()
8284
83 logging.basicConfig(stream=sys.stderr,85 logging.basicConfig(stream=sys.stderr,
84 level=(logging.DEBUG if args.debug86 level=(logging.DEBUG if args.debug
85 else logging.WARNING))87 else logging.WARNING))
8688
89 if args.not_unique and args.only_unique:
90 LOGGER.error("Cannot specify --not-unique and --only-unique at the same time.")
91 sys.exit(1)
92
87 packages = GetPackage()93 packages = GetPackage()
8894
89 output = set()95 output = set()
@@ -97,27 +103,31 @@
97 source_pkg = packages.getsourcepackage(k)103 source_pkg = packages.getsourcepackage(k)
98 seeding_flavours = set([x[0] for x in v if x[1] != "supported"])104 seeding_flavours = set([x[0] for x in v if x[1] != "supported"])
99105
106 if source_pkg and source_pkg in skip:
107 continue
108
100 # If you don't get to freeze others' packages109 # If you don't get to freeze others' packages
101 if args.only_unique:110 if args.only_unique or args.not_unique:
102 not_releasing_seeding_flavours = seeding_flavours - flavours111 not_releasing_seeding_flavours = seeding_flavours - flavours
103 else:112 else:
104 not_releasing_seeding_flavours = None113 not_releasing_seeding_flavours = None
105114
106 if not_releasing_seeding_flavours:115 if not_releasing_seeding_flavours and args.only_unique:
107 LOGGER.debug(("Skipping %s (%s binary package) because it's"116 LOGGER.debug(("Skipping %s (%s binary package) because it's"
108 + " seeded on %s") % (source_pkg, k, v))117 + " seeded on %s") % (source_pkg, k, v))
109 output.discard(source_pkg)118 output.discard(source_pkg)
110 skip.add(source_pkg)119 skip.add(source_pkg)
111 continue120 continue
112121 elif source_pkg and flavours < seeding_flavours and not_releasing_seeding_flavours and args.not_unique:
113 if source_pkg and source_pkg in skip:122 LOGGER.debug("Adding %s (%s binary package) due to %s (non-unique)"
123 % (source_pkg, k, v))
124 output.add(source_pkg)
114 continue125 continue
115126
116 if seeding_flavours.intersection(flavours) and source_pkg:127 if not args.not_unique and seeding_flavours.intersection(flavours) and source_pkg:
117 LOGGER.debug("Adding %s (%s binary package) due to %s"128 LOGGER.debug("Adding %s (%s binary package) due to %s"
118 % (source_pkg, k, v))129 % (source_pkg, k, v))
119 output.add(source_pkg)130 output.add(source_pkg)
120 skip.add(source_pkg)
121131
122 print ("block", " ".join(sorted(output)))132 print ("block", " ".join(sorted(output)))
123133

Subscribers

People subscribed via source and target branches