Skip to content

Commit 7855f00

Browse files
tfootepeci1cottsay
authored
Default the homepage in the packaging metadata if not otherwise declared by the package (#754)
* Default the homepage in the packaging metadata if not otherwise declared by the package. Co-authored-by: Martin Pecka <[email protected]> Co-authored-by: Scott K Logan <[email protected]>
1 parent 6199b2a commit 7855f00

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

bloom/generators/debian/generator.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -326,9 +326,9 @@ def generate_substitutions_from_package(
326326
data['Description'] = format_description(package.description)
327327
# Websites
328328
websites = [str(url) for url in package.urls if url.type == 'website']
329-
homepage = websites[0] if websites else ''
330-
if homepage == '':
331-
warning("No homepage set, defaulting to ''")
329+
homepage = websites[0] if websites else 'https://index.ros.org/p/%s/#%s' % (package.name, ros_distro)
330+
if not websites:
331+
warning("No homepage set, defaulting to %s" % homepage)
332332
data['Homepage'] = homepage
333333
repositories = [str(url) for url in package.urls if url.type == 'repository']
334334
repository = repositories[0] if repositories else ''

bloom/generators/rpm/generator.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -220,9 +220,10 @@ def generate_substitutions_from_package(
220220
data['LicenseFiles'] = sorted(set(l.file for l in package.licenses if l.file))
221221
# Websites
222222
websites = [str(url) for url in package.urls if url.type == 'website']
223-
data['Homepage'] = websites[0] if websites else ''
224-
if data['Homepage'] == '':
225-
warning("No homepage set")
223+
homepage = websites[0] if websites else 'https://index.ros.org/p/%s/#%s' % (package.name, ros_distro)
224+
if not websites:
225+
warning("No homepage set, defaulting to %s" % homepage)
226+
data['Homepage'] = homepage
226227
# RPM Increment Number
227228
data['RPMInc'] = rpm_inc
228229
# Package name

0 commit comments

Comments
 (0)