From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HTML_MESSAGE,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 4133 invoked from network); 20 Jul 2020 18:58:49 -0000 Received: from minnie.tuhs.org (45.79.103.53) by inbox.vuxu.org with ESMTPUTF8; 20 Jul 2020 18:58:49 -0000 Received: by minnie.tuhs.org (Postfix, from userid 112) id 26E689BA4B; Tue, 21 Jul 2020 04:58:48 +1000 (AEST) Received: from minnie.tuhs.org (localhost [127.0.0.1]) by minnie.tuhs.org (Postfix) with ESMTP id C5E939BA2A; Tue, 21 Jul 2020 04:58:13 +1000 (AEST) Authentication-Results: minnie.tuhs.org; dkim=pass (2048-bit key; unprotected) header.d=bsdimp-com.20150623.gappssmtp.com header.i=@bsdimp-com.20150623.gappssmtp.com header.b="TkByepBm"; dkim-atps=neutral Received: by minnie.tuhs.org (Postfix, from userid 112) id A41369BA30; Tue, 21 Jul 2020 03:55:39 +1000 (AEST) Received: from mail-qv1-f42.google.com (mail-qv1-f42.google.com [209.85.219.42]) by minnie.tuhs.org (Postfix) with ESMTPS id 19E4C9BA2A for ; Tue, 21 Jul 2020 03:55:39 +1000 (AEST) Received: by mail-qv1-f42.google.com with SMTP id h17so7908733qvr.0 for ; Mon, 20 Jul 2020 10:55:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=NCV1w3QLMbqJb1OFGQv9Xcnle8FS+OgLN2Y8Njo/gOg=; b=TkByepBmhLFCe1vLTB8lCu5bMmx2ODJ8zpODteBDMCHl9eVYdtzRT/LgGDMVX0GKoI hXmU74UyBlQnMHxHmiEoWMEvJx3Jfa9CKS83LOkZRl309dP9h5DbFtYRD/cry//h5TZz NCjF/mqLC4wn7LQKntOHkscZjig2KxbNHDsdeegzX4iB+T6b6lcRCQNadPK9X4PwWD5h CC2J8zzF6uvvAN3eC2vgKALDuo/RC8OZRriFrgzHH0ymtnil+JutoL1VBIEUCkV5y+dZ 91IAHaflYcc+OeDA7768kwxZLDbwvy8XQaH2RYJJ44lz3Lv/R9MUVtpHiSfmDN8CeY4o YBuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=NCV1w3QLMbqJb1OFGQv9Xcnle8FS+OgLN2Y8Njo/gOg=; b=awODYVzuGyc+Ie3JZ+b33FbxY/ac5xho6+ytbTqrILrwsXmI0Yc6d1cVdgPiLX0md5 8D6MEUYrdA4iiMKeORarYINmzjA8HN1hCd+JZR1Xbo/vhlb9kol3kN3z/KH7FTeddyG2 2hzKTgFEUgGK/J+OF3Fr8gJ0D360sFn+0NeFqQ2PTSxxObN2Sx2V33IXfY2/Jc/WaKqv PDORjDfyfSzcDcWUksthnSJxguup+DVmKsJn+qZaKFcEsg++p7IEEmK0+a6blEK8QqT/ zLfWEfan+/bfT0iyra7biO9Qv9gpvKIAfFJ8RTpW0YQZ6IxJ5iHXmE7INbULJ44p7ZJD m8Ww== X-Gm-Message-State: AOAM533U7VPm5DopLKE6dJEL9jj/hf17rrEN7YXGbsspZ5Dn10AXe2r0 DegKwmEhNdUSlSR5/7h3jaXPX1SCAiP0N82RIA20aA== X-Google-Smtp-Source: ABdhPJyy/McmwAqUCiDKk4vcBN4RIOJcbs8p9UAvUQLzBoI1K2u6VI+DVHjB4ZuTGzQ9BMBVcE7fA/V7jTbYNjT8ghA= X-Received: by 2002:a05:6214:d4d:: with SMTP id 13mr22074331qvr.22.1595267738202; Mon, 20 Jul 2020 10:55:38 -0700 (PDT) MIME-Version: 1.0 References: <78041442-c5e5-1b5c-8565-b6d31f23ec1b@gmail.com> In-Reply-To: <78041442-c5e5-1b5c-8565-b6d31f23ec1b@gmail.com> From: Warner Losh Date: Mon, 20 Jul 2020 11:55:27 -0600 Message-ID: To: Will Senn Content-Type: multipart/alternative; boundary="000000000000db8fad05aae33601" Subject: Re: [TUHS] Traditional method of dealing with embedded shar files X-BeenThere: tuhs@minnie.tuhs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: The Unix Heritage Society mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: TUHS main list Errors-To: tuhs-bounces@minnie.tuhs.org Sender: "TUHS" --000000000000db8fad05aae33601 Content-Type: text/plain; charset="UTF-8" On Mon, Jul 20, 2020 at 11:25 AM Will Senn 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 > > --000000000000db8fad05aae33601 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Mon, Jul 20, 2020 at 11:25 AM Will= Senn <will.senn@gmail.com>= ; wrote:
=20 =20 =20
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):
...
=C2=A0=C2=A0=C2=A0 To install the update cut where indicated below an= d save to a file
=C2=A0=C2=A0=C2=A0 (/tmp/432) and then:

=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 cd /tmp
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 sh 432
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 ./432.sh
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 ./432.rm
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 sh 432.shar
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 patch -p0 < 432.patch

=C2=A0=C2=A0=C2=A0 Watch carefully for any rejected parts of the patc= h.=C2=A0=C2=A0 Failure of a
=C2=A0=C2=A0=C2=A0 patch typically means the system was not current o= n all preceeding
=C2=A0=C2=A0=C2=A0 updates _or_ that local modifications have been ma= de.
...
=3D=3D=3D=3D=3D=3D 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:
#=C2=A0=C2=A0=C2=A0 432.rm
#=C2=A0=C2=A0=C2=A0 432.sh
#=C2=A0=C2=A0=C2=A0 432.shar
#=C2=A0=C2=A0=C2=A0 432.patch
...
#=C2=A0=C2=A0=C2=A0 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 =3D=3D=3D=3D cut here line? Use s= ome 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 h= ave had to taylor to each patch.
=C2=A0
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 h= ardware. Backups on tape were your best bet :(.
=C2=A0
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. liba= rchive supports it, but there's no standard and what libarchive support= s is quite limited.

Warner
=C2=A0
<= blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-l= eft:1px solid rgb(204,204,204);padding-left:1ex">
Thanks,

Will
--=20
GPG Fingerprint: 68F4 B3BD 1730 555A 4462  7D45 3EAA 5B6D A982 BAAF
--000000000000db8fad05aae33601--