Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Ed Bartosh <ed.bartosh@linux.intel.com>
To: Kristian Amlie <kristian.amlie@mender.io>
Cc: openembedded-core@lists.openembedded.org
Subject: Re: [PATCH v1] wic: Add --exclude-path option to rootfs source plugin.
Date: Fri, 25 Nov 2016 18:31:03 +0200	[thread overview]
Message-ID: <20161125163103.GA4830@linux.intel.com> (raw)
In-Reply-To: <f1699a69-1949-9cb3-8bef-adf9b68f385b@mender.io>

On Fri, Nov 25, 2016 at 01:07:34PM +0100, Kristian Amlie wrote:
> On 25/11/16 11:33, Patrick Ohly wrote:
> > On Fri, 2016-11-25 at 11:15 +0100, Kristian Amlie wrote:
> >> +            if os.stat(real_rootfs_dir).st_dev ==
> >> os.stat(cr_workdir).st_dev:
> >> +                # Optimization if both directories are on the same
> >> file system:
> >> +                # copy using hardlinks.
> >> +                cp_args = "-al"
> >> +            else:
> >> +                cp_args = "-a"
> >> +            exec_cmd("cp %s %s %s" % (cp_args, real_rootfs_dir,
> >> new_rootfs))
> > 
> > Not a full review (I'll leave that to Ed), just one thing which caught
> > my eye: when the rootfs contains xattrs, they get lost here.
> > 
> > Use oe.path.copyhardlinktree() instead, it also does the hardlinking
> > trick.
> 
> Thanks, that's a good tip! I'll include that in the next patchset.
> 

Thank you for so fast implementation!

Sorry for not answering on original e-mail. I've lost it somehow.

My comments so far:

What's the reason of insisting that path must be absolute?
May be it's just me, but I find it a bit scaring to use absolute path in .wks
The patch is relative to the rootfs directory from my point of view.

It also looks quite strange in the code to insist on absolute path
+                if not os.path.isabs(path):
+                    msger.error("Must be absolute: --exclude-path=%s" %

and then immediately making it relative:
+
+                while os.path.isabs(path):
+                    path = path[1:]


I know, this is just a matter of taste, but I'd not use brackets around
head, tail here. They're redundant and the code looks better without
them from my point of view.
+                    (head, tail) = os.path.split(remaining)

This causes rmtree to throw NotADirectoryError on files:
+                    for entry in os.listdir(full_path):
+                        shutil.rmtree(os.path.join(full_path, entry))

--
Regards,
Ed


  reply	other threads:[~2016-11-25 16:31 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-25 10:15 [PATCH v1] wic: Add --exclude-path option to rootfs source plugin Kristian Amlie
2016-11-25 10:33 ` Patrick Ohly
2016-11-25 12:07   ` Kristian Amlie
2016-11-25 16:31     ` Ed Bartosh [this message]
2016-11-28  7:15       ` Kristian Amlie
2016-11-28 10:52         ` Ed Bartosh
2016-11-28 11:01           ` Kristian Amlie
2016-11-28 11:18             ` Ed Bartosh
2016-11-30 13:30               ` Kristian Amlie
2016-11-30 13:37                 ` Maciej Borzęcki
2016-11-30 15:29                 ` Ed Bartosh
2016-11-30 19:29                   ` Paul Eggleton
2016-12-02 14:36                   ` Kristian Amlie
2016-12-02 15:05                     ` Ed Bartosh
2016-12-05 10:23                       ` Kristian Amlie
2016-12-14 16:28               ` [PATCH v2] " Kristian Amlie
2016-12-14 16:28                 ` [PATCH v2 1/3] " Kristian Amlie
2016-12-14 16:28                 ` [PATCH v2 2/3] Add e2tools recipe, in order to test contents of images Kristian Amlie
2016-12-14 16:28                 ` [PATCH v2 3/3] selftest/wic: Add tests for --exclude-dir option Kristian Amlie
2016-12-16 14:44                   ` Ed Bartosh
2016-12-19  9:09                     ` Kristian Amlie
2016-12-19  9:09                       ` [PATCH v3 1/3] wic: Add --exclude-path option to rootfs source plugin Kristian Amlie
2016-12-19  9:09                       ` [PATCH v3 2/3] Add e2tools recipe, in order to test contents of images Kristian Amlie
2016-12-19  9:09                       ` [PATCH v3 3/3] selftest/wic: Add tests for --exclude-dir option Kristian Amlie
2016-12-19 20:49                         ` Burton, Ross
2016-12-20  9:20                           ` Kristian Amlie
2016-12-29 10:05                           ` Kristian Amlie
2016-12-29 10:05                             ` [PATCH v4 1/2] wic: Add --exclude-path option to rootfs source plugin Kristian Amlie
2016-12-29 10:05                             ` [PATCH v4 2/2] selftest/wic: Add tests for --exclude-dir option Kristian Amlie
2016-12-29 10:23                               ` Kristian Amlie
2016-12-29 14:03                                 ` Kristian Amlie
2016-12-29 14:03                                   ` [PATCH v5 1/2] wic: Add --exclude-path option to rootfs source plugin Kristian Amlie
2016-12-29 14:03                                   ` [PATCH v5 2/2] selftest/wic: Add tests for --exclude-dir option Kristian Amlie
2017-01-16  9:05                                   ` [PATCH v4 " Kristian Amlie
2017-02-06 16:16                                     ` Kristian Amlie
2017-02-06 16:16                                       ` [PATCH 1/2] wic: Add --exclude-path option to rootfs source plugin Kristian Amlie
2017-02-06 16:16                                       ` [PATCH 2/2] selftest/wic: Add tests for --exclude-dir option Kristian Amlie
2017-02-06 16:38                                       ` [PATCH v4 " Ed Bartosh
2016-12-19 11:57                       ` [PATCH v2 3/3] " Ed Bartosh
2016-11-25 12:28 ` [PATCH v1] wic: Add --exclude-path option to rootfs source plugin Maciej Borzęcki
2016-11-25 12:35   ` Kristian Amlie
2016-11-25 16:33     ` Ed Bartosh
2016-11-28  7:07       ` Kristian Amlie
2016-11-28 10:46         ` Ed Bartosh
2016-11-28 11:00           ` Kristian Amlie
2017-02-06 16:29 ` ✗ patchtest: failure for wic: Add --exclude-path option to rootfs source plugin. (rev10) Patchwork
2017-02-06 16:29 ` ✗ patchtest: failure for wic: Add --exclude-path option to rootfs source plugin. (rev11) Patchwork
2017-02-07  7:23   ` Kristian Amlie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161125163103.GA4830@linux.intel.com \
    --to=ed.bartosh@linux.intel.com \
    --cc=kristian.amlie@mender.io \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox