johnmehr / gitup

A minimalist, dependency-free FreeBSD program to clone/pull Git repositories.
BSD 2-Clause "Simplified" License
50 stars 9 forks source link

releng/13.2 in gitup.conf and gitup.conf.sample #91

Open grahamperrin opened 1 year ago

grahamperrin commented 1 year ago

Follow-up to #77

Forcing reinstallation of gitup-0.98.2 on FreeBSD 13.2-RELEASE creates a .conf file that contains releng/13.1, not releng/13.2.

root@fuji:~ # rm /usr/local/etc/gitup.conf
rm: /usr/local/etc/gitup.conf: No such file or directory
root@fuji:~ # cat /usr/local/etc/gitup.conf
cat: /usr/local/etc/gitup.conf: No such file or directory
root@fuji:~ # pkg iinfo gitup
gitup-0.98.2
root@fuji:~ # pkg upgrade --force --quiet --yes gitup
You may need to manually remove /usr/local/etc/gitup.conf if it is no longer needed.
root@fuji:~ # grep releng/13 /usr/local/etc/gitup.conf
                "branch"           : "releng/13.1",
root@fuji:~ # 
nunotexbsd commented 1 year ago

This means that gitup was build on 13.1 (pkg builders):

post-patch:
        @${REINPLACE_CMD} -e 's|stable\/12|stable\/${OSREL:R}| ; \
                s|releng\/11.4|releng\/${OSREL}|' \
                ${WRKSRC}/gitup.conf

Any sugestions to improve this check?

grahamperrin commented 1 year ago

Ah, OK. Determined at build time, that makes perfect sense.

So (I don't know how to express this in script/code):

  1. take the number that is currently determined at build time – for example, 13.1
  2. increment the minor part – for example, 13.2
  3. fetch, to /tmp, a relevant file – for example, sys/conf/newvers.sh?h=releng/13.2
  4. grep what was fetched to tell whether the value for BRANCH begins with RELEASE
  5. if the value fits the criterion, then use – for example – releng/13.2 in the .conf and .conf.sample files.

https://cgit.freebsd.org/src/tree/sys/conf/newvers.sh?h=releng/13.2


Re: https://cgit.freebsd.org/src/commit/?h=releng/13.2&id=525ecfdad597980ea4cd59238e24c8530dbcd31d, you might do something fancier with UPDATING or with crtbrand.S, but I guess that newvers.sh is the more obvious choice (if the approach above is feasible).

nunotexbsd commented 1 year ago

I've opened a PR at https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=270911

Cheers

grahamperrin commented 1 year ago

Thanks, and (note to self) at https://github.com/johnmehr/gitup/issues/91#issuecomment-1510722625 I did not think through all possible scenarios …

nunotexbsd commented 1 year ago

Committed https://cgit.freebsd.org/ports/commit/?id=574c5c9142f39aea9da2ffccce25bbd8401242f9

grahamperrin commented 1 year ago

Bug 270911 is Closed FIXED, should we also close this issue?