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=-0.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HTML_MESSAGE,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 8598 invoked from network); 25 Jul 2020 15:20:46 -0000 Received: from minnie.tuhs.org (45.79.103.53) by inbox.vuxu.org with ESMTPUTF8; 25 Jul 2020 15:20:46 -0000 Received: by minnie.tuhs.org (Postfix, from userid 112) id BDAEE9C9F0; Sun, 26 Jul 2020 01:20:45 +1000 (AEST) Received: from minnie.tuhs.org (localhost [127.0.0.1]) by minnie.tuhs.org (Postfix) with ESMTP id 691309C8B1; Sun, 26 Jul 2020 01:19:46 +1000 (AEST) Authentication-Results: minnie.tuhs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=bsdimp-com.20150623.gappssmtp.com header.i=@bsdimp-com.20150623.gappssmtp.com header.b="xVGfB+0w"; dkim-atps=neutral Received: by minnie.tuhs.org (Postfix, from userid 112) id 508079C8B1; Sun, 26 Jul 2020 01:19:44 +1000 (AEST) Received: from mail-qv1-f51.google.com (mail-qv1-f51.google.com [209.85.219.51]) by minnie.tuhs.org (Postfix) with ESMTPS id 638069BA4F for ; Sun, 26 Jul 2020 01:19:43 +1000 (AEST) Received: by mail-qv1-f51.google.com with SMTP id u8so5481295qvj.12 for ; Sat, 25 Jul 2020 08:19:43 -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=y3eEy8eEL4U6GNwTrLEjxIFFYc3M4GNVUbQeMrRvIyc=; b=xVGfB+0wPVuBceTep4srxyzsigtxlU34QVklZ0sl6lfpzb1Il+BwtqHFKyNB8OFGqA fAvppboxmCwvnSruorXF3YP3aI1mYBmS7GnmimrcU7fYnBQFdzjTMmlTLO13gEUI2kEU T4i7W1fUGNZWguNDX6EjC5s4EhC+8SJfkZkWerZNCOhQtSwaXcDgL560nhBcBuCZgtJQ ip4jVpqluKd1rAQTm1YoHBzNdVUjJz096xs+mp0ITtbu+PLyktyloL09jSH+C3hNkiGB 4Ivl5Cn3Sg1lxYsePU1j8l1Q9kh2JIgIxaXj2f5Ws6bEflqTuG3vLHSjt2iIAFiNpFtV a5Mg== 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=y3eEy8eEL4U6GNwTrLEjxIFFYc3M4GNVUbQeMrRvIyc=; b=N8v7/8cU/hmHkVHRMkxXLWXDALxLo1q7iPVLlODVRxZiu2EOXfXhGOUH1IdJDrb8IU VCH/CmVWMDn56PBWhmwn7e98eFKYtUnwA1CuojgC77evBvFNU3IKpQcICoJ1h+CaEVG3 rTyFyVqK+JrkgThgU8CLFb27DQ7MiQPQi5PUIDR6p6A/LfWjS7tdrgUq/MY77PzP3btz qGe7fcTz0sjkBze/KE9OrZYzE5C9hdF1s+IgVjCp9gvMrk6Sm1aKEE8WSHXvXTYdIFHF rqaV/vdxBRvvszkRjUvpbZFDWHPyluJQ7+Dgd1rJkiXIfaC6rYQmEZv8hIsMOBS91WQC aMHg== X-Gm-Message-State: AOAM532iKVaix9fDlyx4uriwkq3QQzQiqXmtZK4SyF5fOSvwAT5YEJ1e sarNpJm6y7Q4IMcvZpEltL4FBHiA+CY8sELu4UQQdg== X-Google-Smtp-Source: ABdhPJzuRwiHKzAVKAjRXHRP+FDuzta4np9Rul/w+dIwXovHhR4Zah5MStoHOLa8STA6K0YDVLIBSNRtxcg4woX1lW0= X-Received: by 2002:a05:6214:d4d:: with SMTP id 13mr14573551qvr.22.1595690382486; Sat, 25 Jul 2020 08:19:42 -0700 (PDT) MIME-Version: 1.0 References: <878sf7adz3.fsf@vuxu.org> In-Reply-To: From: Warner Losh Date: Sat, 25 Jul 2020 09:19:31 -0600 Message-ID: To: Clem Cole Content-Type: multipart/alternative; boundary="0000000000006b845305ab459ee7" Subject: Re: [TUHS] Diff and Patch on v7 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 , Leah Neukirchen Errors-To: tuhs-bounces@minnie.tuhs.org Sender: "TUHS" --0000000000006b845305ab459ee7 Content-Type: text/plain; charset="UTF-8" On Sat, Jul 25, 2020 at 8:41 AM Clem Cole wrote: > Will that is the output that would have go into patch(1). As Leah says, > the old days we used diff -e to create the patch and then ed file > That said, when Larry wrote patch, V7 was still very much alive and > kicking and Larry had come from that world/his code would be likely to be > fairly clean of vax-isms. I bet if you can find a version that will > compile and run on V7. V6 is likely to be more difficult since the > language changes for stdio. But patch(1) is small and simple so I bet even > that would be pretty straight forward. > I'd start with the last larry wall version of patch, before gnu took it up. It likely will compile there out of the box. There's a copy in 2.11BSD that's version 2 that at least fits into a PDP-11 with separate I&D space. It's also on the 2.10.1BSD tape as well. configure will almost certainly work on the V7 shell. Not sure about v6, unlikely. It will compile under V7's c compiler as well, since it's pure K&R. It also runs well enough to apply all the diffs 2.11BSD has produced over the years. It looks like it doesn't require separate I&D space to load, but it's big enough that it helps a lot. V7 had separate i&D space, so you're good there. However, it will only accept context diffs, not unified diffs. You may have to convert newer unified diffs to context diffs. Well, it also accepts normal diffs and ed scripts too :) Looking at the size of FreeBSD's patch, it's only 53kB text and 8kB data on amd64, so there's a chance newer versions will fit (this is the last BSD-licensed version, with bug fixes). It groks everything that gnu patch groks. gnu patch is 175k of text and 8k of data and is quite likely a lost cause on the pdp-11 (with overlays, 176k is the absolute max, but 150k is where it gets hard... but V7 didn't have an overlay linker). Warner > > On Sat, Jul 25, 2020 at 10:29 AM Will Senn wrote: > >> On 7/25/20 9:03 AM, Leah Neukirchen wrote: >> > Will Senn writes: >> > >> >> I got a diff for adding actual backspace and delete to v7, linked off >> >> of gunkies... Anyhow, I can manually edit the referenced files and >> >> rebuild, but I would rather do it canonically. I don't see patch >> >> anywhere, so did v7 users use diffs to patch source and if so what's >> >> the magic? >> > patch(1) was written by Larry Wall in 1985, and released over Usenet. >> > >> > v7 users likely used diff -e, and piped to ed to apply it. >> > >> That makes sense. So, if that's how it went then I'm wondering if my >> diff is meant to run against source on the host and the results placed >> into v7, rather than run in v7. Does this look like a modern diff vs the >> old stuff?: >> >> --- usr/src/cmd/getty.c 1979-05-05 08:19:21.000000000 +0100 >> +++ usr.fix/src/cmd/getty.c 2018-01-09 11:07:37.157953044 +0100 >> @@ -5,11 +5,11 @@ >> >> #include >> #include >> -#define ERASE '#' >> -#define KILL '@' >> +#define ERASE '\177' >> +#define KILL '\025' >> >> struct sgttyb tmode; >> -struct tchars tchars = { '\177', '\034', '\021', '\023', '\004', '\377' >> }; >> +struct tchars tchars = { '\003', '\034', '\021', '\023', '\004', '\377' >> }; >> >> struct tab { >> char tname; /* this table name */ >> >> >> Will >> >> -- >> GPG Fingerprint: 68F4 B3BD 1730 555A 4462 7D45 3EAA 5B6D A982 BAAF >> >> --0000000000006b845305ab459ee7 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Sat, Jul 25, 2020 at 8:41 AM Clem = Cole <clemc@ccc.com> wrote:
<= /div>
Will that is the output that would have go int= o patch(1).=C2=A0 As Leah says,= the old days we used dif= f -e to create the=C2=A0= patch and then ed file &l= t;diff_output
That said, when Larry wrote patch, V7 was still very much alive and ki= cking and Larry had come from that world/his code would be likely to be fai= rly clean of vax-isms.=C2=A0 I bet if you can find a version that will comp= ile and run on V7.=C2=A0 =C2=A0V6 is likely to be more difficult since the = language changes for stdio.=C2=A0 But patch(1) is small and simple so I bet= even that would be pretty straight forward.
<= br>
I'd start with the last larry wall version of patch, befo= re gnu took it up. It likely will compile there out of the box. There's= a copy in 2.11BSD that's version 2 that at least fits into a PDP-11 wi= th separate I&D space. It's also on the 2.10.1BSD tape as well. con= figure will almost certainly work on the V7 shell. Not sure about v6, unlik= ely. It will compile under V7's c compiler as well, since it's pure= K&R. It also runs well enough to apply all the diffs 2.11BSD has produ= ced over the years. It looks like it doesn't require separate I&D s= pace to load, but it's big enough that it helps a lot. V7 had separate = i&D space, so you're good there.

However, = it will only accept context diffs, not unified diffs. You may have to conve= rt newer unified diffs to context diffs. Well, it also accepts normal diffs= and ed scripts too :)

Looking at the size of Free= BSD's patch, it's only 53kB text and 8kB data on amd64, so there= 9;s a chance newer versions will fit (this is the last BSD-licensed version= , with bug fixes). It groks everything that gnu patch groks. gnu patch is 1= 75k of text and 8k of data and is quite likely a lost cause on the pdp-11 (= with overlays, 176k is the absolute max, but 150k is where it gets hard... = but V7 didn't have an overlay linker).

Warner<= br>

On Sat, Jul 25, 2020= at 10:29 AM Will Senn <will.senn@gmail.com> wrote:
On 7/25/20 9:03 AM, Leah Neukirchen wrote:
> Will Senn <will.senn@gmail.com> writes:
>
>> I got a diff for adding actual backspace and delete to v7, linked = off
>> of gunkies... Anyhow, I can manually edit the referenced files and=
>> rebuild, but I would rather do it canonically. I don't see pat= ch
>> anywhere, so did v7 users use diffs to patch source and if so what= 's
>> the magic?
> patch(1) was written by Larry Wall in 1985, and released over Usenet.<= br> >
> v7 users likely used diff -e, and piped to ed to apply it.
>
That makes sense. So, if that's how it went then I'm wondering if m= y
diff is meant to run against source on the host and the results placed
into v7, rather than run in v7. Does this look like a modern diff vs the old stuff?:

--- usr/src/cmd/getty.c=C2=A0=C2=A0=C2=A0 1979-05-05 08:19:21.000000000 +01= 00
+++ usr.fix/src/cmd/getty.c=C2=A0=C2=A0=C2=A0 2018-01-09 11:07:37.157953044= +0100
@@ -5,11 +5,11 @@

=C2=A0=C2=A0#include <sgtty.h>
=C2=A0=C2=A0#include <signal.h>
-#define ERASE=C2=A0=C2=A0=C2=A0 '#'
-#define KILL=C2=A0=C2=A0=C2=A0 '@'
+#define ERASE=C2=A0=C2=A0=C2=A0 '\177'
+#define KILL=C2=A0=C2=A0=C2=A0 '\025'

=C2=A0=C2=A0struct sgttyb tmode;
-struct tchars tchars =3D { '\177', '\034', '\021',= '\023', '\004', '\377' };
+struct tchars tchars =3D { '\003', '\034', '\021',= '\023', '\004', '\377' };

=C2=A0=C2=A0struct=C2=A0=C2=A0=C2=A0 tab {
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 char=C2=A0=C2=A0=C2=A0 tname;=C2=A0=C2=A0=C2= =A0 =C2=A0=C2=A0=C2=A0 /* this table name */


Will

--
GPG Fingerprint: 68F4 B3BD 1730 555A 4462=C2=A0 7D45 3EAA 5B6D A982 BAAF
--0000000000006b845305ab459ee7--