organize should at least warn when you use absolute paths

Bug #1671212 reported by Evan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Snapcraft
Triaged
Low
Unassigned

Bug Description

If you try to:

organize:
 /usr/bin/python3.5: "/usr/bin/python"

You'll get:

Trying to organize file '/usr/bin/python3.5' to '../../../../../../../../../usr/bin/python', but '../../../../../../../../../usr/bin/python' already exists

If instead you try:

organize:
 /usr/bin/python3.5: "python"

You'll get:

[Errno 13] Permission denied: '/usr/bin/python3.5'

The correct approach is to use relative paths:

organize:
  usr/bin/python3.5: "usr/bin/python"

I can't imagine why you'd want to organise absolute paths. Maybe we should disallow it altogether? Failing that, can we warn?

Revision history for this message
Sergio Schvezov (sergiusens) wrote : Re: [Bug 1671212] [NEW] organize should at least warn when you use absolute paths

On Wed, 8 Mar 2017 19:26:04 +0000, Evan wrote:
> Public bug reported:
>
> If you try to:
>
> organize:
> /usr/bin/python3.5: "/usr/bin/python"
>
> You'll get:
>
> Trying to organize file '/usr/bin/python3.5' to
> '../../../../../../../../../usr/bin/python', but
> '../../../../../../../../../usr/bin/python' already exists
>
> If instead you try:
>
> organize:
> /usr/bin/python3.5: "python"
>
> You'll get:
>
> [Errno 13] Permission denied: '/usr/bin/python3.5'
>
> The correct approach is to use relative paths:
>
> organize:
> usr/bin/python3.5: "usr/bin/python"
>
> I can't imagine why you'd want to organise absolute paths. Maybe we
> should disallow it altogether? Failing that, can we warn?

Removing support for absolute paths seems totally reasonable for `organize`. It was only in place to have some sort of semantic compatibility with the `copy` plugin (/me raises fist at the plugin).

--
Sent using Dekko from my Ubuntu device

Changed in snapcraft:
status: New → Triaged
importance: Undecided → Low
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.