<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Mon, Nov 14, 2016 at 10:34 AM Didier Roche <<a href="mailto:didrocks@ubuntu.com">didrocks@ubuntu.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Le 14/11/2016 à 10:55, Stephen Stewart a écrit :<br class="gmail_msg">
> Hi,<br class="gmail_msg">
><br class="gmail_msg">
> While looking into a nodejs/yarn plugin I wondered if I could make a<br class="gmail_msg">
> yarn snap (not plugin), and simply define nodejs and yarn as parts,<br class="gmail_msg">
> use dump plugin and be done, no plugin required:<br class="gmail_msg">
><br class="gmail_msg">
> "Parts 'yarn' and 'node' have the following file paths in common which<br class="gmail_msg">
> have different contents:"<br class="gmail_msg">
><br class="gmail_msg">
> <a href="https://pastebin.canonical.com/170573/" rel="noreferrer" class="gmail_msg" target="_blank">https://pastebin.canonical.com/170573/</a><br class="gmail_msg">
><br class="gmail_msg">
> So I am wondering why doesn't this just work?<br class="gmail_msg">
<br class="gmail_msg">
Hey Stephen,<br class="gmail_msg"></blockquote><div><br></div><div>Hi Didier,</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br class="gmail_msg">
It doesn't work simply because snapcraft doesn't know which file from<br class="gmail_msg">
which part to ship. You have common files between parts with different<br class="gmail_msg">
contents (as the error message underline). Which one of yarn's or node's<br class="gmail_msg">
README.md should be included for instance?<br class="gmail_msg"></blockquote><div><br></div><div>Fair enough, but ...</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
><br class="gmail_msg">
> It seems like name collisions in parts might be a common enough thing,<br class="gmail_msg">
> and I couldn't quite understand the help docs around filesets and<br class="gmail_msg">
> organise to see a nice way to make this work for me across projects.<br class="gmail_msg">
<br class="gmail_msg">
I guess <a href="http://snapcraft.io/docs/build-snaps/advanced-features" rel="noreferrer" class="gmail_msg" target="_blank">http://snapcraft.io/docs/build-snaps/advanced-features</a> will be a<br class="gmail_msg">
better example.<br class="gmail_msg">
Basically, you define in one parts a fileset with:<br class="gmail_msg">
filesets:<br class="gmail_msg">
exclude:<br class="gmail_msg">
- -README.md<br class="gmail_msg">
- - LICENSE<br class="gmail_msg">
- -lib/constants.js<br class="gmail_msg">
(note the - to say to exclude those 3 files).<br class="gmail_msg"></blockquote><div><br></div><div>... sure, but both parts need `lib/constants.js`; I can't exclude lib/constants for one part and hope that my snap will work, can I?</div><div><br></div><div>I feel like I'm missing something really obvious here :(</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br class="gmail_msg">
then, in the same part you want to exclude those files:<br class="gmail_msg">
stage: [$exclude]<br class="gmail_msg">
snap: [$exclude]<br class="gmail_msg">
<br class="gmail_msg">
And you should be done!<br class="gmail_msg">
Didier<br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
--<br class="gmail_msg">
Snapcraft mailing list<br class="gmail_msg">
<a href="mailto:Snapcraft@lists.snapcraft.io" class="gmail_msg" target="_blank">Snapcraft@lists.snapcraft.io</a><br class="gmail_msg">
Modify settings or unsubscribe at: <a href="https://lists.ubuntu.com/mailman/listinfo/snapcraft" rel="noreferrer" class="gmail_msg" target="_blank">https://lists.ubuntu.com/mailman/listinfo/snapcraft</a><br class="gmail_msg">
</blockquote></div></div>