Skip to content

Commit

Permalink
Replace vars where possible (#98)
Browse files Browse the repository at this point in the history
* Remove the package name from SRC_URI where possible.

* Mirror change for yocto.
  • Loading branch information
allenh1 authored Dec 1, 2017
1 parent 8e4eb0a commit 092abce
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions superflore/generators/bitbake/yocto_recipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ def get_recipe_text(self, distributor, license_text, die_msg=None):
ret += '"\n'

# SRC_URI
self.src_uri = self.src_uri.replace(self.name, '${PN}')
ret += 'SRC_URI = "' + self.src_uri + ';'
ret += 'downloadfilename=${ROS_SP}.tar.gz"\n\n'
ret += 'SRC_URI[md5sum] = "' + self.src_md5 + '"\n'
Expand Down
1 change: 1 addition & 0 deletions superflore/generators/ebuild/ebuild.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ def get_ebuild_text(self, distributor, license_text):
self.description = trim_string(self.description)
ret += "DESCRIPTION=\"" + self.description + "\"\n"
ret += "HOMEPAGE=\"" + self.homepage + "\"\n"
self.src_uri = self.src_uri.replace(self.name, '${PN}')
ret += "SRC_URI=\"" + self.src_uri
ret += " -> ${PN}-" + self.distro + "-release-${PV}.tar.gz\"\n\n"
# license -- only add if valid
Expand Down
2 changes: 1 addition & 1 deletion tests/ebuild/simple_expected.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ inherit ros-cmake

DESCRIPTION="an ebuild"
HOMEPAGE="https://www.website.com"
SRC_URI="https://www.website.com/download/stuff.tar.gz -> ${PN}-lunar-release-${PV}.tar.gz"
SRC_URI="https://www.website.com/download/${PN}/archive/${PN}/release/lunar/0.0.0.tar.gz -> ${PN}-lunar-release-${PV}.tar.gz"

LICENSE="LGPL-2"

Expand Down
3 changes: 2 additions & 1 deletion tests/test_ebuild.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ def get_ebuild(self):
ebuild = Ebuild()
ebuild.homepage = 'https://www.website.com'
ebuild.description = 'an ebuild'
ebuild.src_uri = 'https://www.website.com/download/stuff.tar.gz'
ebuild.src_uri = 'https://www.website.com/download/foo/archive/foo/release/lunar/0.0.0.tar.gz'
ebuild.name = 'foo'
ebuild.distro = 'lunar'
return ebuild

Expand Down

0 comments on commit 092abce

Please sign in to comment.