Skip to content

Commit

Permalink
fix: minor fixes for license file
Browse files Browse the repository at this point in the history
  • Loading branch information
Pro committed Sep 22, 2021
1 parent 7dc143f commit 3723652
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions recipes/ua-nodeset/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,28 @@ class UaNodeSetConan(ConanFile):

no_copy_source = True

@property
def _source_subfolder(self):
return "source_subfolder"

def _extract_license(self):
content = tools.load(os.path.join(self.source_folder, self._source_subfolder, "AnsiC", "opcua_clientapi.c"))
license_contents = content[2:content.find("*/", 1)]
tools.save("LICENSE", license_contents)

def source(self):
tools.get(**self.conan_data["sources"][self.version])
os.rename("{}-{}".format("UA-Nodeset", "PADIM-1.02-2021-07-21"), "source_subfolder")
os.rename("{}-{}".format("UA-Nodeset", "PADIM-1.02-2021-07-21"), self._source_subfolder)
self._extract_license()

def _extract_license(self):
content = tools.load(os.path.join(self.source_folder, self._source_subfolder, "UA-Nodeset", "AnsiC", "opcua_clientapi.c"))
license_contents = content[2:content.find("*/", 1)]
tools.save("LICENSE", license_contents)


def build(self):
pass


def package(self):
self.copy("*", dst="res", src="source_subfolder")
self.copy("*", dst="res", src=self._source_subfolder)
self.copy("LICENSE", dst="licenses")


Expand Down

0 comments on commit 3723652

Please sign in to comment.