-
-
Notifications
You must be signed in to change notification settings - Fork 576
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into purls-only-v2
Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
- Loading branch information
Showing
88 changed files
with
3,340 additions
and
13,964 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -588,7 +588,10 @@ def parse_debian_files_list(location, datasource_id, package_type): | |
name, _, arch = filename.partition(':') | ||
qualifiers['arch'] = arch | ||
else: | ||
name = filename | ||
name = None | ||
# For DebianMd5sumFilelistInPackageHandler we cannot infer name | ||
if not name == "md5sums": | ||
name = filename | ||
|
||
file_references = [] | ||
with open(location) as info_file: | ||
|
@@ -650,12 +653,14 @@ def build_package_data(debian_data, datasource_id, package_type='deb', distro=No | |
|
||
maintainer = debian_data.get('maintainer') | ||
if maintainer: | ||
party = models.Party(role='maintainer', name=maintainer) | ||
maintainer_name, maintainer_email = parse_debian_maintainers(maintainer) | ||
party = models.Party(role='maintainer', name=maintainer_name, email=maintainer_email) | ||
parties.append(party) | ||
|
||
orig_maintainer = debian_data.get('original_maintainer') | ||
if orig_maintainer: | ||
party = models.Party(role='original_maintainer', name=orig_maintainer) | ||
maintainer_name, maintainer_email = parse_debian_maintainers(orig_maintainer) | ||
party = models.Party(role='maintainer', name=maintainer_name, email=maintainer_email) | ||
parties.append(party) | ||
|
||
keywords = [] | ||
|
@@ -716,6 +721,26 @@ def build_package_data(debian_data, datasource_id, package_type='deb', distro=No | |
return models.PackageData.from_data(package_data, package_only) | ||
|
||
|
||
def parse_debian_maintainers(maintainer): | ||
""" | ||
Get name and email values from a debian maintainer string. | ||
Example string: | ||
Debian systemd Maintainers <[email protected]> | ||
""" | ||
email_wrappers = ["<", ">"] | ||
has_email = "@" in maintainer and all([ | ||
True | ||
for char in email_wrappers | ||
if char in maintainer | ||
]) | ||
if not has_email: | ||
return maintainer, None | ||
|
||
name, _, email = maintainer.rpartition("<") | ||
return name.rstrip(" "), email.rstrip(">") | ||
|
||
|
||
def populate_debian_namespace(packages): | ||
""" | ||
For an iterable of debian `packages`, populate the | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.