Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mpsl2-00057e-7G for pgsql-www@arkaria.postgresql.org; Wed, 24 Nov 2021 13:56:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mpsl1-0006UP-4x for pgsql-www@arkaria.postgresql.org; Wed, 24 Nov 2021 13:56:19 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mpsl0-0006UG-RP for pgsql-www@lists.postgresql.org; Wed, 24 Nov 2021 13:56:18 +0000 Received: from mail-lj1-x231.google.com ([2a00:1450:4864:20::231]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mpsky-0007sa-HQ for pgsql-www@lists.postgresql.org; Wed, 24 Nov 2021 13:56:18 +0000 Received: by mail-lj1-x231.google.com with SMTP id k23so5709070lje.1 for ; Wed, 24 Nov 2021 05:56:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hagander-net.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=YcfBB/APL791BMx0t+WimDNqmFWyhkimaDRZXhNULDM=; b=s9/6jkyc+MoCIalFPmciRkjQCC+2/NoGQbNpX3GwJni6Ux8b607XOGSTQPA0avythl tYb/+l/rJVJZAcNMWoWTrmExSFtJDgwzyjJGcR7LmPjsWzVjtz3SOWyK1hPv9AHFSsF6 of3Ihd5vn9FkX0p0/ZaSe9LjtNhxZrdK+6/f9lhwmWpHvJxvxl/knUttd6GrrQryUq22 +XwKE12QgUaTN5zd+Uf3vt7U0rDHpurgK9A/LY1PDrTnzyjwCiYf7H03eG+9I9Lx6MgV TUUAiLB3U82hEGw18vfOKJKLb4U4/651wHyWXqstVNaeRBN+7a6SlldWLMGHledN/Y3u 5PAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=YcfBB/APL791BMx0t+WimDNqmFWyhkimaDRZXhNULDM=; b=Q+Cehi+zdr2uw9AvQPZCUfhld4GXxU75hYp6z2TjMjCe+5q2dfs8AaPklhT6Ds/OvG DmCompQvWL7CCi6AFRgD5pDsDddb/qUn0axJjcPl68QpI3aDjKuMjWKAPk23RN2tInsZ FRqxE0ujfDxB56OGa80/MOzqYrpdwrn5Trnm7TAmMbTQsd0jB5V+AFkl1FwRflwpnea1 R3+nWfOufe7ZzUbpm3iGDw4iOMGCxT4ky5gPysYOPfCqK1Xcm4SOuWneGOcvAi91f1jF rlTNMvrr4jDQINwsSIEc7rXB5X1jUjrFtDtmZQiOXdm/BSsfDX+igJVL4UeazMT9hE4s djaQ== X-Gm-Message-State: AOAM5306xRoDPVYMh3M0EVvn/Q+H/2lJjgnuI/gP36Z4ruEU94RkZm2V IZWg17F7XzIUpbTnfy5/ZYkiZgP+9iTE1tw4vkjtq7yWubk= X-Google-Smtp-Source: ABdhPJwfETOrvuuF5wBLK9Bor1i3zAnts/k5kwuoZzyG7kRflzDw8Q1s0XaDpPNYH3oYCupn1u0PmQLbV7A5hqTrNrQ= X-Received: by 2002:a2e:7805:: with SMTP id t5mr15276916ljc.507.1637762174519; Wed, 24 Nov 2021 05:56:14 -0800 (PST) MIME-Version: 1.0 References: <20211107164951.wxcyp7iar2s4mjkn@nixos> <20211109225734.7evav44x7nf5c5jb@nixos> In-Reply-To: <20211109225734.7evav44x7nf5c5jb@nixos> From: Magnus Hagander Date: Wed, 24 Nov 2021 14:56:03 +0100 Message-ID: Subject: Re: [PATCH] Improve portability of pgweb/load_initial_data.sh To: Nils Andre Cc: pgsql-www@lists.postgresql.org Content-Type: multipart/alternative; boundary="000000000000a3a10005d1893829" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000a3a10005d1893829 Content-Type: text/plain; charset="UTF-8" On Tue, Nov 9, 2021 at 11:57 PM Nils Andre wrote: > Hi, > > On Mon, Nov 08, 2021 at 10:03:50AM +0100, Magnus Hagander wrote: > > Yeah, I think the fact that it says bash is just a "knee-jerk default" > and > > not that it ever did either. So I have no problem changing that to sh. > I'm > > a bit curious though, as to in which scenario this actually causes a > > problem? > > This causes problems on [NixOS][1] which only has `/bin/sh` and > `/usr/bin/env` in the location one would "expect" them. > Hmm. Interesting. Anyway, this part seems perfectly fine to fix. > The second change I'm less sure about. There are many different things you > > could change to break a script. This is one of them. You could change > PATH, > > or you could replace "find" or "xargs" with commands that don't work the > > same way. CDPATH is not a variable that should, I believe, ever be > exported > > into non-interactive scripts in the first place. > > I didn't realise I was exporting CDPATH, which is ~~probably~~ a mistake > (and would have prevented previous painful and long headaches). > I'm pretty sure that one will break a lot of other things... For what it's worth, I use a program I have written that makes use of > CDPATH (and hence requires it to be exported (but I think I will > reconsider the program's usage of CDPATH)). > I would recommend that :) However I do understand this is an issue with my particular setup. > > Attached, is the patch amended without the CDPATH change. > > Thanks, applied as such! //Magnus --000000000000a3a10005d1893829 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Tue, Nov 9, 2021 at 11:57 PM Nils Andr= e <nils@nilsand.re> wrote:
=
Hi,

On Mon, Nov 08, 2021 at 10:03:50AM +0100, Magnus Hagander wrote:
> Yeah, I think the fact that it says bash is just a "knee-jerk def= ault" and
> not that it ever did either. So I have no problem changing that to sh.= I'm
> a bit curious though, as to in which scenario this actually causes a > problem?

This causes problems on [NixOS][1] which only has `/bin/sh` and
`/usr/bin/env` in the location one would "expect" them.

Hmm. Interesting. Anyway, this part seems perfec= tly fine to fix.=C2=A0


> The second change I'm less sure about. There are many different th= ings you
> could change to break a script. This is one of them. You could change = PATH,
> or you could replace "find" or "xargs" with comman= ds that don't work the
> same way. CDPATH is not a variable that should, I believe, ever be exp= orted
> into non-interactive scripts in the first place.

I didn't realise I was exporting CDPATH, which is ~~probably~~ a mistak= e
(and would have prevented previous painful and long headaches).

I'm pretty sure that one will break a lot of o= ther things...=C2=A0


For what it's worth, I use a program I have written that makes use of CDPATH (and hence requires it to be exported (but I think I will
reconsider the program's usage of CDPATH)).

I would recommend that :)


However I do understand this is an issue with my particular setup.

Attached, is the patch amended without the CDPATH change.


Thanks, applied as such!

//= Magnus
=C2=A0
--000000000000a3a10005d1893829--