public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Michał Górny" <mgorny@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Cc: sam@gentoo.org, soap@gentoo.org
Subject: Re: [gentoo-dev] rfc: usrmerge script
Date: Tue, 23 Mar 2021 10:23:11 +0100	[thread overview]
Message-ID: <ed90c147e997cad745bbf98849260385a8f04e4c.camel@gentoo.org> (raw)
In-Reply-To: <YFeE39Zn4WWC9Mtv@linux1.home>

On Sun, 2021-03-21 at 12:39 -0500, William Hubbs wrote:
> All,
> 
> the following is a script which will migrate a Gentoo system to the usr
> merge layout. This is similar to the unsymlink-lib tool used to migrate
> a system  from the 17.0 to the 17.1 profiles.
> 
> I'm attaching it here to get some comments before I package it, so
> please let me know if I have missed something.

To be honest, I don't think critical system modifications should be done
in shell script, and especially not via a fringe non-standards complaint
shell implementation in busybox.  Even if you can assume you make no
mistakes, shell is unreliable by design.  For example, your script may
start behaving in unexpected ways if you run out of space.

You don't seem to be handling file collisions at all.  Even today we
have files like /bin/bzip2 and /usr/bin/bzip2, not to mention shared
libraries.  Silently ignoring the problem or requiring the users to
manually ensure their system is clean is not going to solve it.

You don't seem to provide any helpful messages.  When things fail, user
will be left in the blue with an error message from some system tool (or
rather, cheap-ass busybox rewrite, I guess).

Also, have you verified that busybox's cp(1) actually preserves all file
properties (including xattrs, ACLs, caps...)?

Please don't forget to include tests with it.  Docker's good for testing
stuff like this.

-- 
Best regards,
Michał Górny




  parent reply	other threads:[~2021-03-23  9:23 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-21 17:39 [gentoo-dev] rfc: usrmerge script William Hubbs
2021-03-21 18:00 ` Matthias Maier
2021-03-21 19:08   ` Luigi Mantellini
2021-03-21 19:27     ` William Hubbs
2021-03-21 19:22   ` William Hubbs
2021-03-23  9:23 ` Michał Górny [this message]
2021-03-24  5:20   ` William Hubbs
2021-03-24  7:48     ` Michał Górny
2021-03-24 15:09       ` William Hubbs
2021-03-24 17:09         ` Rich Freeman
2021-03-24 18:37           ` William Hubbs

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=ed90c147e997cad745bbf98849260385a8f04e4c.camel@gentoo.org \
    --to=mgorny@gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    --cc=sam@gentoo.org \
    --cc=soap@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