Public bug reported:

A simple parts stenza with:
    organize:
      '*': foo

will lead to this error message:
Trying to organize file '*' to 'foo', but 'foo' already exists

Which isn't the case (foo doesn't exists in stage/ nor prime/).

I guess triggering situation is that * is a directory content with
multiple items and destination is what looks like a filename to
snapcraft. My bet is that the first item copy happens, and when trying
to copy the second file/directory, we thus already have a "foo" file or
directory corresponding to the first item to copy. Then, the error makes
sense :)

However, this is confusing to the user.
The fix is of course to tell snapcraft to copy to a directory by appending /:
    organize:
      '*': foo/

My feeling is that the final / shouldn't be needed though and we should,
in case of having a blob regexp, treat the right parts of the expression
as a directory if there is more than one item matched.

ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: snapcraft 2.26
ProcVersionSignature: Ubuntu 4.4.0-62.83-generic 4.4.40
Uname: Linux 4.4.0-62-generic x86_64
NonfreeKernelModules: zfs zunicode zcommon znvpair zavl
ApportVersion: 2.20.1-0ubuntu2.5
Architecture: amd64
CurrentDesktop: Unity
Date: Thu Feb  9 14:09:30 2017
InstallationDate: Installed on 2012-05-28 (1717 days ago)
InstallationMedia: Ubuntu 12.04 LTS "Precise Pangolin" - Release amd64 
(20120425)
PackageArchitecture: all
SourcePackage: snapcraft
UpgradeStatus: Upgraded to xenial on 2014-10-31 (832 days ago)

** Affects: snapcraft
     Importance: Undecided
         Status: New

** Affects: snapcraft (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: amd64 apport-bug xenial

** Also affects: snapcraft
   Importance: Undecided
       Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1663233

Title:
  Confusing error message for "organize" when source refers to multiples
  items and destination doesn't end up with /

To manage notifications about this bug go to:
https://bugs.launchpad.net/snapcraft/+bug/1663233/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to