Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

shed_upload include with strip_components and '..' in paths #196

Merged
merged 2 commits into from
May 12, 2015

Conversation

peterjc
Copy link
Contributor

@peterjc peterjc commented May 12, 2015

In order to handle include source paths combining .. and strip_components, the path manipulation must be done before calculating relative paths (which drops the .. entries). The easiest way to do this seemed to me to move all the path realisation out of the RealizedFile object, thus the refactoring.

(This is a corner case I missed while working on #185)

Motivating example peterjc/pico_galaxy@1029aa9 which wasn't working as expected.

i.e. With this .shed.yml include block:

$ tail ~/repositories/pico_galaxy/tools/venn_list/.shed.yml
include:
- strip_components: 2
  source:
  - ../../tools/venn_list/README.rst
  - ../../tools/venn_list/tool_dependencies.xml
  - ../../tools/venn_list/venn_list.py
  - ../../tools/venn_list/venn_list.xml
  - ../../test-data/magic.pdf
  - ../../test-data/venn_list.tabular
  - ../../test-data/rhodopsin_proteins.fasta

Before this fix:

$ planemo shed_upload --tar_only ~/repositories/pico_galaxy/tools/venn_list/ && tar -tzf shed_upload.tar.gz
cp '/tmp/tmpdjKBhQ' 'shed_upload.tar.gz'
README.rst
test-data/magic.pdf
test-data/rhodopsin_proteins.fasta
test-data/venn_list.tabular
tool_dependencies.xml
venn_list.py
venn_list.xml

With this fix:

$ planemo shed_upload --tar_only ~/repositories/pico_galaxy/tools/venn_list/ && tar -tzf  shed_upload.tar.gz
cp '/tmp/tmpvOdqFl' 'shed_upload.tar.gz'
test-data/magic.pdf
test-data/rhodopsin_proteins.fasta
test-data/venn_list.tabular
tools/venn_list/README.rst
tools/venn_list/tool_dependencies.xml
tools/venn_list/venn_list.py
tools/venn_list/venn_list.xml

Note: The test case may well be not quite as @jmchilton would write it - I was attempting to model it after the existing complex repository examples.

@jmchilton
Copy link
Member

Wonderful @peterjc - this is great! I will do a new release with this today.

jmchilton added a commit that referenced this pull request May 12, 2015
shed_upload include with strip_components and '..' in paths
@jmchilton jmchilton merged commit acb7b4d into galaxyproject:master May 12, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants