Re: About freebsd-automerge — An automated upgrade assistant for FreeBSD

Mario Marietto <[email protected]>
Newsgroups gmane.os.freebsd.devel.hackers
Message-ID <CA+1FSijkMSS-t=DW8v72q23X42_Z_-8YcotpUEcaMrvdWAhQCw@mail.gmail.com>
Thanks for the suggestions. Following structural fixes suggested applied to
the script :

*1. Architecture* Use uname -m/uname -p correctly instead of the pointless
case switch
*2. die() *Use printf instead of echo to properly handle \n escape sequences
*3. Editor* open_editor() respects $VISUAL/$EDITOR env vars, falls back to
ee then vi (both always present in FreeBSD base)
*4. ASCII boxes *All Unicode box-drawing characters replaced with plain
ASCII +, =, |
*5. grep -c *Fixed "bad number" error by explicitly initializing counters
to 0 before grep
*6. Tag file parsing *Use `awk -F'
*7. upgrade_type()* New function that properly distinguishes MAJOR / MINOR
/ STABLE / CURRENT upgrades
*8. STABLE warning *Menu marks STABLE entries with (*) and warns that
snapshots may be temporarily unavailable on the mirror

Try it if you can and everybody can for sure give more suggestions to
improve it....

On Tue, May 5, 2026 at 10:34 PM <[email protected]> wrote:

> 1. There are multiple references to nano when it's not in base. You may
> want to save the user's EDITOR before overriding it or fall back to either
> vi or ee instead.
>
> 2. The architecture detection code is wrong. The FreeBSD download URL is
> organized as "$machine/$arch" but the code does "$arch/$arch". What you
> want is "$(uname -m)/$(uname -p)". The code as it is doesn't even make
> sense: do a case switch on a value only to set the variable to the same
> value!
>
> 3. The "\n" escape sequences in the argument to die on line 504 don't
> actually insert line breaks.
>
> > **1. Is using `$EDITOR` the right hook into freebsd-update?**
> > Is there a cleaner, more supported way to intercept freebsd-update's
> merge
> > phase? I am essentially abusing the EDITOR variable — it works, but it
> feels
> > fragile. Is there an official API or hook mechanism I am missing?
>
> To my understanding, freebsd-update is being phased out so you probably
> shouldn't be writing new scripts depending on it.
>
> > **3. Handling STABLE and CURRENT upgrades**
> > Upgrading to a -STABLE or -CURRENT branch is fundamentally different from
> > a RELEASE upgrade — freebsd-update behaves differently, and the base.txz
> > download path is different. Has anyone automated this reliably?
>
> The snapshot assets (-STABLE & -CURRENT) are not reliable. I've noticed
> -CURRENT stuff disappear for days even.
>


-- 
Mario.
freebsd-automerge.sh.7z (application/x-7z-compressed, 7.3 KB) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.