The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
From: Warner Losh <imp@bsdimp.com>
To: Will Senn <will.senn@gmail.com>
Cc: TUHS main list <tuhs@minnie.tuhs.org>
Subject: Re: [TUHS] Traditional method of dealing with embedded shar files
Date: Mon, 20 Jul 2020 11:55:27 -0600	[thread overview]
Message-ID: <CANCZdfouoVidk9q2vhXVcGM3ha5ZkK0_2smxLwQ8C_KTGR8nsQ@mail.gmail.com> (raw)
In-Reply-To: <78041442-c5e5-1b5c-8565-b6d31f23ec1b@gmail.com>

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

On Mon, Jul 20, 2020 at 11:25 AM Will Senn <will.senn@gmail.com> wrote:

> As y'all know, I'm a relative latecomer to the world of Unix, but I do try
> to figure out how y'all did it back when. So, sometimes, as in this case, I
> can figure out how to do something, but I'm curious how it was done back in
> the day, moreso than how I can get it done today. I'm looking at the
> patching of my shiny new 2.11 BSD pl 431 system running on my speedy little
> virtual PDP-11/70, so I grabbed patch 432 (here's a portion of the patch):
> ...
>     To install the update cut where indicated below and save to a file
>     (/tmp/432) and then:
>
>         cd /tmp
>         sh 432
>         ./432.sh
>         ./432.rm
>         sh 432.shar
>         patch -p0 < 432.patch
>
>     Watch carefully for any rejected parts of the patch.   Failure of a
>     patch typically means the system was not current on all preceeding
>     updates _or_ that local modifications have been made.
> ...
> ====== cut here
> #! /bin/sh
> # This is a shell archive, meaning:
> # 1. Remove everything above the #! /bin/sh line.
> # 2. Save the resulting text in a file.
> # 3. Execute the file with /bin/sh (not csh) to create:
> #    432.rm
> #    432.sh
> #    432.shar
> #    432.patch
> ...
> #    End of shell archive
>
> This seems straightforward. Just follow the directions et voila magic
> happens.
>
> My questions for y'all are how would you go about doing this? Use vi to
> delete everything through the ==== cut here line? Use some combination of
> standard unix tools to chop it up? What was your workflow for patching up
> the system using these files?
>

sed -e '1,/---cut here---/d' < $patch | sh -x

is what I use, but there's a wide variety of 'cut here' lines in the
2.11BSD patches, so I have had to taylor to each patch.


> In my world, if I screw something up, it's 15 seconds to run a restore
> script in my simh directory and I can try again, so my level of concern for
> a mistake is pretty low. If I was doing this in 1980, on real hardware, I
> would have had many concerns, as I'm sure some of y'all can remember, how
> did you prepare and protect yourselves so a patch was successful.
>

Yea, it was always a crap-shoot back in the day on slow hardware. Backups
on tape were your best bet :(.


> BTW, I thought .shar was an archive format, so when I saw the patch was a
> shar file, I was worried it would be in some binary form, lo and behold, it
> looks like text to me... not even b64. So much to learn, so little time.
>

It is and it isn't. Mostly isn't for these patches. libarchive supports it,
but there's no standard and what libarchive supports is quite limited.

Warner


> Thanks,
>
> Will
>
> --
> GPG Fingerprint: 68F4 B3BD 1730 555A 4462  7D45 3EAA 5B6D A982 BAAF
>
>

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

  parent reply	other threads:[~2020-07-20 18:58 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-20 17:23 Will Senn
2020-07-20 17:44 ` Clem Cole
2020-07-20 17:52 ` Clem Cole
2020-07-20 17:56   ` Warner Losh
2020-07-20 18:08     ` Richard Salz
2020-07-20 18:07   ` Will Senn
2020-07-24 18:29     ` Random832
2020-07-24 18:46       ` Will Senn
2020-07-24 18:57         ` Clem Cole
2020-07-24 19:21           ` Will Senn
2020-07-25  2:00       ` Dave Horsfall
2020-07-20 17:55 ` Warner Losh [this message]
2020-07-20 18:11   ` Will Senn
2020-07-20 18:41     ` Clem Cole

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=CANCZdfouoVidk9q2vhXVcGM3ha5ZkK0_2smxLwQ8C_KTGR8nsQ@mail.gmail.com \
    --to=imp@bsdimp.com \
    --cc=tuhs@minnie.tuhs.org \
    --cc=will.senn@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).