git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] add simple install replacement

From
Robert Schiele <rschiele@gmail.com>
Date
Oct 12, 2007, 15:07 UTC
Message-ID
<20071012150739.GJ20753@schiele.dyndns.org>
In-Reply-To
<20071012140647.GC7865@efreet.light.src>
On Fri, Oct 12, 2007 at 04:06:47PM +0200, Jan Hudec wrote:
Show 6 quoted lines
> On Thu, Oct 11, 2007 at 23:52:37 +0200, Robert Schiele wrote:
> > This patch adds a very simple install replacement script to git.
> > This allows more easy installation on systems that don't have a
> > compatible install.
> 
> Do you have a particular case where you need it?

We have some machines here where no compatible install was installed. Sure I could have built GNU coreutils on all of them but writing this script was just more convenient for me.

Show 8 quoted lines
> No such thing here:
> zsh$ /bin/sh
> $ which getopts
> $
> 
> Yes, bash and zsh do have that, but my (and I suspect many git users')
> /bin/sh is neither of those. Git scripts should use just POSIX shell
> features for portability.

I just used it because the shells on my machines had it. My idea was that if someone has a shell with less features we could still replace parts with even more basic ways of doing things.

> You may want to have a look at /usr/share/automake-1.9/install-sh (or
> /usr/share/automake<something>/install-sh). It shows how to portably process
> options in shell and since it's in fact covered by the MIT/X license (and FSF
> changes are public domain), git could just use it if necessary.

Oh, forgot about that implementation. Since this version is definitely more advanced I retract my patch and propose to use that one instead.

Show 7 quoted lines
> Are you sure reall install would do this? The maual (install(1)) states
> following usage variants:
> 
>     install [OPTION]... [-T] SOURCE DEST
>     install [OPTION]... SOURCE... DIRECTORY
>     install [OPTION]... -t DIRECTORY SOURCE...
>     install [OPTION]... -d DIRECTORY...

I did not intend to write a full replacement for install but cover only the cases needed to install git.

Show 9 quoted lines
> Now however there is nothing saying that SOURCE... is at least two, so is
> 
>     install git /usr/bin
> 
> a case of the first or second usage? I would say the second, but your code
> would:
> 
>     rm -rf /usr/bin
>     cp git /usr/bin
No, in your example /usr/bin is a directory and thus this is:

rm -rf /usr/bin/git cp git /usr/bin

Show 6 quoted lines
>     touch "foo*bar" "a b c"
>     ./gitinstall "b*c" "a b c" /tmp
> 
> ... will copy a lot of files to /tmp (presuming we are in git source
> directory, where tons of files are called builtin-<something>.c) and complain
> that there is no 'a', no 'b' and no 'c'.

There are no files with special characters in git to be installed. Again this was meant a _simple_ replacement for install on systems without a compatible install just to install _git_, not to reinvent the wheel.

Robert
-- 
Robert Schiele
Dipl.-Wirtsch.informatiker	mailto:rschiele@gmail.com

"Quidquid latine dictum sit, altum sonatur."
Previous: Jan Hudec
Message 3 of 3 in “add simple install replacement”
  1. add simple install replacementRobert Schiele, Oct 11, 2007
  2. Jan HudecOct 12, 2007
  3. Robert SchieleOct 12, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.