Re: [dev] [sbase][PATCH] install

From: Dimitris Papastamos <sin_AT_2f30.org>
Date: Thu, 11 Feb 2016 13:38:51 +0000

On Thu, Feb 11, 2016 at 01:57:00PM +0100, Mattias Andrée wrote:
> It cannot be `install` because it conflicts with
> install rule. So I decided to append .out (like in a.out)
> to make it work.

Duh, of course.

> > > +static void
> > > +make_dir(char *dir, int was_missing)
> > > +{
> > > + if (!mkdir(dir, was_missing ? 0755 : mode)) {
> > > + if (!was_missing && (lchown(dir,
> > > owner, group) < 0))
> > > + eprintf("lchmod %s:", dir);
> > > + } else if (errno != EEXIST) {
> > > + eprintf("mkdir %s:", dir);
> > > + }
> > > +}
> > > +
> > > +static void
> > > +make_dirs(char *dir, int was_missing)
> > > +{
> > > + char *p;
> > > + for (p = strchr(dir + (dir[0] == '/'), '/');
> > > p; p = strchr(p + 1, '/')) {
> > > + *p = '\0';
> > > + make_dir(dir, was_missing);
> > > + *p = '/';
> > > + }
> > > + make_dir(dir, was_missing);
> > > +}
> >
> > Can we use mkdirp() from libutil?
>
> mkdirp has to be change to allow custom
> mode, but it also has to be change to
> optioanlly do lchown. I though this was
> better because other utilities will probably
> not need this.

Makes sense to keep it as is then.
Received on Thu Feb 11 2016 - 14:38:51 CET

This archive was generated by hypermail 2.3.0 : Thu Feb 11 2016 - 14:48:11 CET