Skip to content
GitLab
Explore
Sign in
Register
Commits on Source (2)
Use the changes sourceful wrapper property instead of architectures property
· 0180d7b9
Paul Wise
authored
Nov 30, 2019
It is shorter and more readable.
0180d7b9
Merge remote-tracking branch 'origin/merge-requests/164'
· 836c56aa
Ansgar
authored
Nov 30, 2019
836c56aa
Show whitespace changes
Inline
Side-by-side
dak/process_upload.py
View file @
836c56aa
...
...
@@ -271,7 +271,7 @@ def accept(directory, upload):
upload
.
transaction
.
fs
,
Logger
)
accepted_to_real_suite
=
any
(
suite
.
policy_queue
is
None
for
suite
in
upload
.
final_suites
)
sourceful_upload
=
'
source
'
in
upload
.
changes
.
architectures
sourceful_upload
=
upload
.
changes
.
sourceful
control
=
upload
.
changes
.
changes
if
sourceful_upload
and
not
Options
[
'
No-Action
'
]:
...
...
daklib/archive.py
View file @
836c56aa
...
...
@@ -1140,7 +1140,7 @@ class ArchiveUpload(object):
changelog_id
=
None
# Only add changelog for sourceful uploads and binNMUs
if
'
source
'
in
self
.
changes
.
architectures
or
re_bin_only_nmu
.
search
(
control
[
'
Version
'
]):
if
self
.
changes
.
sourceful
or
re_bin_only_nmu
.
search
(
control
[
'
Version
'
]):
query
=
'
INSERT INTO changelogs_text (changelog) VALUES (:changelog) RETURNING id
'
changelog_id
=
session
.
execute
(
query
,
{
'
changelog
'
:
control
[
'
Changes
'
]}).
scalar
()
assert
changelog_id
is
not
None
...
...
daklib/checks.py
View file @
836c56aa
...
...
@@ -261,9 +261,9 @@ class ChangesCheck(Check):
if
not
re_field_package
.
match
(
bn
):
raise
Reject
(
'
{0}: Invalid binary package name {1}
'
.
format
(
fn
,
bn
))
if
'
source
'
in
changes
.
architectures
and
changes
.
source
is
None
:
if
changes
.
sourceful
and
changes
.
source
is
None
:
raise
Reject
(
"
Changes has architecture source, but no source found.
"
)
if
changes
.
source
is
not
None
and
'
source
'
not
in
changes
.
architectures
:
if
changes
.
source
is
not
None
and
not
changes
.
sourceful
:
raise
Reject
(
"
Upload includes source, but changes does not say so.
"
)
try
:
...
...
@@ -565,11 +565,11 @@ class SourceCheck(Check):
def
check
(
self
,
upload
):
if
upload
.
changes
.
source
is
None
:
if
"
source
"
in
upload
.
changes
.
architectures
:
if
upload
.
changes
.
sourceful
:
raise
Reject
(
"
{}: Architecture field includes source, but no source package is included in the upload
"
.
format
(
upload
.
changes
.
filename
))
return
True
if
"
source
"
not
in
upload
.
changes
.
architectures
:
if
not
upload
.
changes
.
sourceful
:
raise
Reject
(
"
{}: Architecture field does not include source, but a source package is included in the upload
"
.
format
(
upload
.
changes
.
filename
))
changes
=
upload
.
changes
.
changes
...
...
@@ -721,7 +721,7 @@ class TransitionCheck(Check):
"""
check for a transition
"""
def
check
(
self
,
upload
):
if
'
source
'
not
in
upload
.
changes
.
architectures
:
if
not
upload
.
changes
.
sourceful
:
return
True
transitions
=
self
.
get_transitions
()
...
...
daklib/upload.py
View file @
836c56aa
...
...
@@ -467,7 +467,7 @@ class Changes(object):
return
(
self
.
changes
.
get
(
'
Source
'
),
AptVersion
(
self
.
changes
.
get
(
'
Version
'
,
''
)),
'
source
'
not
in
self
.
architectures
,
not
self
.
sourceful
,
self
.
filename
)
...
...