Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
mentors.debian.net
debexpo
Commits
b1914def
Commit
b1914def
authored
Sep 11, 2011
by
Arno Töll
Browse files
Accept native packages. Those have erroneously rejected as they don't contain a orig.tar.gz
parent
d27dd355
Changes
3
Hide whitespace changes
Inline
Side-by-side
debexpo/lib/filesystem.py
View file @
b1914def
...
@@ -87,6 +87,22 @@ class CheckFiles(object):
...
@@ -87,6 +87,22 @@ class CheckFiles(object):
return
True
return
True
def
is_native_package
(
self
,
changes_file
):
"""
Guess based on the changes file and files being uploaded, whether a package
is considered native of not
```changes_file```
The changes file to parse for the orig.tar (note the dsc file referenced must exist)
"""
for
file
in
changes_file
[
'Files'
]:
if
file
[
'name'
].
endswith
(
'.diff.gz'
):
return
False
if
file
[
'name'
].
endswith
((
'.debian.tar.gz'
,
'.debian.tar.bz2'
,
'.debian.tar.xz'
)):
return
False
return
True
def
find_orig_tarball
(
self
,
changes_file
):
def
find_orig_tarball
(
self
,
changes_file
):
"""
"""
Look to see whether there is an orig tarball present, if the dsc refers to one.
Look to see whether there is an orig tarball present, if the dsc refers to one.
...
...
debexpo/plugins/native.py
View file @
b1914def
...
@@ -37,7 +37,7 @@ __license__ = 'MIT'
...
@@ -37,7 +37,7 @@ __license__ = 'MIT'
import
logging
import
logging
from
debexpo.lib
import
constants
from
debexpo.lib
import
constants
,
filesystem
from
debexpo.plugins
import
BasePlugin
from
debexpo.plugins
import
BasePlugin
log
=
logging
.
getLogger
(
__name__
)
log
=
logging
.
getLogger
(
__name__
)
...
@@ -49,13 +49,9 @@ class NativePlugin(BasePlugin):
...
@@ -49,13 +49,9 @@ class NativePlugin(BasePlugin):
Test to see whether the package is a native package.
Test to see whether the package is a native package.
"""
"""
log
.
debug
(
'Checking whether the package is native or not'
)
log
.
debug
(
'Checking whether the package is native or not'
)
filecheck
=
filesystem
.
CheckFiles
()
native
=
True
native
=
filecheck
.
is_native_package
(
self
.
changes
)
for
file
in
self
.
changes
[
'Files'
]:
if
file
[
'name'
].
endswith
(
'.diff.gz'
):
native
=
False
if
file
[
'name'
].
endswith
((
'.debian.tar.gz'
,
'.debian.tar.bz2'
,
'.debian.tar.xz'
)):
native
=
False
if
native
:
if
native
:
# Most uploads will not be native, and especially on mentors, a native
# Most uploads will not be native, and especially on mentors, a native
...
...
debexpo/scripts/debexpo_importer.py
View file @
b1914def
...
@@ -442,11 +442,11 @@ class Importer(object):
...
@@ -442,11 +442,11 @@ class Importer(object):
sys
.
exit
(
1
)
sys
.
exit
(
1
)
# Check whether a post-upload plugin has got the orig tarball from somewhere.
# Check whether a post-upload plugin has got the orig tarball from somewhere.
if
not
orig_file_found
:
if
not
orig_file_found
and
not
filecheck
.
is_native_package
(
self
.
changes
)
:
(
orig
,
orig_file_found
)
=
filecheck
.
find_orig_tarball
(
self
.
changes
)
(
orig
,
orig_file_found
)
=
filecheck
.
find_orig_tarball
(
self
.
changes
)
if
not
orig_file_found
:
if
not
orig_file_found
:
# When coming here it means:
# When coming here it means:
# a) The uploade
d
did not include a orig.tar.gz in his upload
# a) The uploade
r
did not include a orig.tar.gz in his upload
# b) We couldn't find a orig.tar.gz in our repository
# b) We couldn't find a orig.tar.gz in our repository
# c) No plugin could get the orig.tar.gz
# c) No plugin could get the orig.tar.gz
# ... time to give up
# ... time to give up
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment