~xnox/ubuntu-archive-tools/sru-report-autopkgtest-vomit

« back to all changes in this revision

Viewing changes to promote-to-release

  • Committer: Colin Watson
  • Date: 2014-12-09 16:35:55 UTC
  • Revision ID: cjwatson@canonical.com-20141209163555-lg50der1wp6r7c1v
promote-to-release: handle new delta output format introduced in britney2 691bda4bd82074a6d40a2d2de78c76653b7a0d40

Show diffs side-by-side

added added

removed removed

Lines of Context:
115
115
def promote_all(options, delta):
116
116
    with open(delta) as delta_file:
117
117
        for line in delta_file:
 
118
            if line.startswith("#"):
 
119
                continue
118
120
            words = line.rstrip("\n").split(" ")
119
121
            if len(words) == 1:
120
122
                name = words[0]
122
124
                continue
123
125
            elif len(words) == 2:
124
126
                name = words[0]
125
 
                if "/" in name:
 
127
                if name.startswith("-"):
 
128
                    print("Cannot handle removal: %s" % name[1:],
 
129
                          file=sys.stderr)
 
130
                    continue
 
131
                elif "/" in name:
126
132
                    name, architecture = name.split("/", 1)
127
133
                else:
128
134
                    architecture = None
133
139
                    # copying is from start to finish, and skipping one is
134
140
                    # more likely to cause problems than aborting.
135
141
                    return False
 
142
            elif len(words) == 3:
 
143
                name = words[0]
 
144
                if name.startswith("-"):
 
145
                    print("Cannot handle removal: %s" % name[1:],
 
146
                          file=sys.stderr)
 
147
                    continue
 
148
                version = words[1]
 
149
                architecture = words[2]
 
150
                if not promote(options, name, version, architecture):
 
151
                    # Stop on any single failure.  Britney's output delta
 
152
                    # should be ordered such that the optimal order of
 
153
                    # copying is from start to finish, and skipping one is
 
154
                    # more likely to cause problems than aborting.
 
155
                    return False
136
156
    return True
137
157
 
138
158