public inbox for gentoo-portage-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Alec Warner <antarus@gentoo.org>
To: gentoo-portage-dev@lists.gentoo.org
Subject: Re: [gentoo-portage-dev] [PATCH] econf: update configure/config.{sub,guess} atomically to avoid races
Date: Tue, 17 Dec 2013 17:58:18 -0800	[thread overview]
Message-ID: <CAAr7Pr-9s-_6UYQY_Wx+kn_1ktCD6ZfxSbF4WWiVXwX1u0VJaQ@mail.gmail.com> (raw)
In-Reply-To: <CA+VB3NTneievD=s-Rm7zpVuW0A4JPH-mcfMZ=YjHsCTaoBmiXg@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2441 bytes --]

On Tue, Dec 17, 2013 at 5:41 PM, Greg Turner <gmt@malth.us> wrote:

> On Tue, Dec 17, 2013 at 3:28 PM, Mike Frysinger <vapier@gentoo.org> wrote:
> > +                       sed -i \
> > +                               -e
> "1s:^#![[:space:]]*/bin/sh:#!$CONFIG_SHELL:" \
> > +                               "${ECONF_SOURCE}/configure" \
> > +                               || die "Substition of shebang in
> '${ECONF_SOURCE}/configure' failed"
>
> Shouldn't we take the same copy, ${pid}-suffix, move approach, here
> that we've done with config.{sub,guess}?  Otherwise, what's to stop
> these sed's from trampling each other's work-in-progress (the fact
> that ebuilds don't crash left and right does suggest that some
> mechanism actually does prevent this, already -- but it's a mystery to
> me, and I worry it could be some kind of linux-specific filesystem
> quirk).
>

Sed is already atomic

antarus@goats5 /tmp/test $ cat foo
Debian Rocks!
antarus@goats5 /tmp/test $ strace -e trace=file sed -i -e
's/Debian/Gentoo/g' foo
execve("/bin/sed", ["sed", "-i", "-e", "s/Debian/Gentoo/g", "foo"], [/* 39
vars */]) = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or
directory)
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or
directory)
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or
directory)
open("/lib/x86_64-linux-gnu/libselinux.so.1", O_RDONLY|O_CLOEXEC) = 3
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or
directory)
open("/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or
directory)
open("/lib/x86_64-linux-gnu/libdl.so.2", O_RDONLY|O_CLOEXEC) = 3
statfs("/selinux", {f_type="EXT2_SUPER_MAGIC", f_bsize=4096,
f_blocks=5419717, f_bfree=920598, f_bavail=645285, f_files=1379040,
f_ffree=885151, f_fsid={-495840576, 2082046975}, f_namelen=255,
f_frsize=4096}) = 0
open("/proc/filesystems", O_RDONLY)     = 3
open("/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3
open("//lib/charset.alias", O_RDONLY)   = -1 ENOENT (No such file or
directory)
open("/usr/lib/x86_64-linux-gnu/gconv/gconv-modules.cache", O_RDONLY) = 3
open("foo", O_RDONLY)                   = 3
open("/proc/filesystems", O_RDONLY)     = 4
open("./sedfDxBxl", O_RDWR|O_CREAT|O_EXCL, 0600) = 4
rename("./sedfDxBxl", "foo")            = 0

-A


> -gmt
>
>

[-- Attachment #2: Type: text/html, Size: 3837 bytes --]

  reply	other threads:[~2013-12-18  1:58 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-17 23:23 [gentoo-portage-dev] [PATCH] econf: update config.{sub,guess} atomically to avoid races Mike Frysinger
2013-12-17 23:28 ` [gentoo-portage-dev] [PATCH] econf: update configure/config.{sub,guess} " Mike Frysinger
2013-12-18  0:26   ` Brian Dolbec
2013-12-18  1:08     ` Alec Warner
2013-12-18  1:41   ` Greg Turner
2013-12-18  1:58     ` Alec Warner [this message]
2013-12-18  2:53       ` Greg Turner
2013-12-18  5:16         ` Alec Warner
2013-12-21  3:07   ` [gentoo-portage-dev] " Ryan Hill
2013-12-21  9:23     ` Mike Frysinger
2013-12-21  9:49     ` [gentoo-portage-dev] [PATCH] add a __bashpid helper for <bash-4.0 versions Mike Frysinger

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=CAAr7Pr-9s-_6UYQY_Wx+kn_1ktCD6ZfxSbF4WWiVXwX1u0VJaQ@mail.gmail.com \
    --to=antarus@gentoo.org \
    --cc=gentoo-portage-dev@lists.gentoo.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