Skip to content

Commit

Permalink
Fix missing export sources and error on no conandata.
Browse files Browse the repository at this point in the history
  • Loading branch information
grafikrobot committed Oct 13, 2021
1 parent f2d4021 commit 6f0f9bb
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
5 changes: 5 additions & 0 deletions HISTORY.adoc
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
= History

== 0.1.1

* Fixes not including recipe exported sources in upload.
* Fixes errors when recipe does not have a `conandata.yml` specification file.

== 0.1

Initial release of `barbarian` tool to manage Conan packages for the Barbarian
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from setuptools import setup, find_namespace_packages
import os

VERSION = '0.1'
VERSION = '0.1.1'

print("TEST_VERSION:", os.getenv('TEST_VERSION'))
if os.getenv('GHA_TEST_VERSION'):
Expand Down
11 changes: 10 additions & 1 deletion src/barbarians/barbarian.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,16 @@ def command_upload(self, args):
conan_export_tgz = os.path.join(
self.recipe_revision_pub_dir, "files", "conan_export.tgz")
with tarfile.open(conan_export_tgz, 'w|gz') as tgz:
tgz.add(conandata_yml, os.path.basename(conandata_yml))
if os.path.exists(conandata_yml):
tgz.add(conandata_yml, os.path.basename(conandata_yml))
# Generate the conan_sources.tgz.
export_source_dir = os.path.join(
self.recipe_export_dir, "export_source")
conan_sources_tgz = os.path.join(
self.recipe_revision_pub_dir, "files", "conan_sources.tgz")
with tarfile.open(conan_sources_tgz, 'w|gz') as tgz:
for source in os.listdir(export_source_dir):
tgz.add(os.path.join(export_source_dir, source), source)
# Generate snapshot.json (v1), and files.json (v2).
snapshot = {}
files = {'files': {}}
Expand Down

0 comments on commit 6f0f9bb

Please sign in to comment.