Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maintaining a list of supported FreeBSD releases #612

Open
dlangille opened this issue Dec 14, 2024 · 16 comments
Open

Maintaining a list of supported FreeBSD releases #612

dlangille opened this issue Dec 14, 2024 · 16 comments

Comments

@dlangille
Copy link
Contributor

FreshPorts has a need to know the supported both the stable & release branches on #FreeBSD

I don’t want to parse https://www.freebsd.org/security/#sup (for example, I predict errors, often). However, that does seem to be the source of truth.

Perhaps there ports tree has something…

FreshPorts already gets the list of supported ABI from https://pkg.freebsd.org/index.html (details on that at #505 (comment))

I'm hoping for an equally reliable solution. Perhaps I should use freebsd.org/security/#sup after all.

@dlangille
Copy link
Contributor Author

Let's try this:

[21:04 mydev dvl ~/tmp] % fetch -o release https://www.freebsd.org/security/#sup
fetch: https://www.freebsd.org/security/#sup: size of remote file is not known
release                                                 19 kB 3039 kBps    00s

[21:06 mydev dvl ~/tmp] % egrep -e '(releng/|stable/)' release
<li><a href="https://www.freebsd.org/releng/">Release
<p>The -STABLE branch tags have names like <code>stable/13</code>.
Security Branch tags have names like <code>releng/13.2</code>. The
<p class="tableblock">stable/14</p>
<p class="tableblock">releng/14.2</p>
<p class="tableblock">releng/14.1</p>
<p class="tableblock">stable/13</p>
<p class="tableblock">releng/13.4</p>
<p class="tableblock">releng/13.3</p>

@dlangille
Copy link
Contributor Author

I don't know enough sed:

[21:16 mydev dvl ~/tmp] % egrep -e 'tableblock.*(releng/|stable/)' release | sed -e 's@.*\((releng|stable)/[^ <]*\).*@\1@' | sort
<p class="tableblock">releng/13.3</p>
<p class="tableblock">releng/13.4</p>
<p class="tableblock">releng/14.1</p>
<p class="tableblock">releng/14.2</p>
<p class="tableblock">stable/13</p>
<p class="tableblock">stable/14</p>

@dlangille
Copy link
Contributor Author

If only I could combine the two:

[21:33 mydev dvl ~/tmp] % egrep -e 'tableblock.*(releng/|stable/)' release | sed -e 's@.*\(stable/[^ <]*\).*@\1@'         
stable/14
<p class="tableblock">releng/14.2</p>
<p class="tableblock">releng/14.1</p>
stable/13
<p class="tableblock">releng/13.4</p>
<p class="tableblock">releng/13.3</p>
[21:33 mydev dvl ~/tmp] % egrep -e 'tableblock.*(releng/|stable/)' release | sed -e 's@.*\(releng/[^ <]*\).*@\1@'
<p class="tableblock">stable/14</p>
releng/14.2
releng/14.1
<p class="tableblock">stable/13</p>
releng/13.4
releng/13.3

@dlangille
Copy link
Contributor Author

Darius (via slack) helped me along with this.

[22:00 mydev dvl ~/tmp] % egrep -e 'tableblock.*(releng/|stable/)' release | sed -nEe 's@.*>((releng|stable)/[.0-9]+)<.*@\1@p'
stable/14
releng/14.2
releng/14.1
stable/13
releng/13.4
releng/13.3

From that, I just manually add stable/15 I think, to get CURRENT

@dlangille
Copy link
Contributor Author

Next up:

[22:10 mydev dvl ~/tmp] % fetch "https://raw.githubusercontent.com/freebsd/freebsd-doc/43ac80d1c4f1e141721c12a3054130b480e93f17/website/content/en/security/_index.adoc"
_index.adoc                                           6619  B   28 MBps    00s
[22:16 mydev dvl ~/tmp] % egrep -e '^\|(releng|stable)/.*' _index.adoc                                                    
|stable/14 |n/a |n/a |November 30, 2028
|releng/14.2 |14.2-RELEASE |December 3, 2024 |September 30, 2025
|releng/14.1 |14.1-RELEASE |June 4, 2024 |March 31, 2025
|stable/13 |n/a |n/a |April 30, 2026
|releng/13.4 |13.4-RELEASE |September 17, 2024 |June 30, 2025
|releng/13.3 |13.3-RELEASE |March 5, 2024 |December 31, 2024

but:

[22:23 mydev dvl ~/tmp] % egrep -e '^\|(releng|stable)/.*' _index.adoc | sed -nEe 's@.*\|>((releng|stable)/[.0-9]+)<.*@\1@p'
[22:29 mydev dvl ~/tmp] % 

@dlangille
Copy link
Contributor Author

Here we go, by fetching head. Thanks to Piotr Smyrak re https://bsd.network/web/@piero/113653532439615939

[22:29 mydev dvl ~/tmp] % fetch https://raw.githubusercontent.com/freebsd/freebsd-doc/HEAD/website/content/en/security/_index.adoc
_index.adoc                                           6619  B   25 MBps    00s

[22:44 mydev dvl ~/tmp] % egrep -e '^\|(releng|stable)/.*' _index.adoc | egrep '^.(releng|stable)/' | cut -d '|' -f 2 
stable/14 
releng/14.2 
releng/14.1 
stable/13 
releng/13.4 
releng/13.3 

@dlangille
Copy link
Contributor Author

-- Table: public.supported_releases

-- DROP TABLE IF EXISTS public.supported_releases;

CREATE TABLE IF NOT EXISTS public.supported_releases
(
    id integer NOT NULL GENERATED ALWAYS AS IDENTITY ( INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 2147483647 CACHE 1 ),
    name text COLLATE pg_catalog."default" NOT NULL,
    enabled boolean NOT NULL DEFAULT true,
    CONSTRAINT supported_releases_pkey PRIMARY KEY (id)
)

TABLESPACE pg_default;

ALTER TABLE IF EXISTS public.supported_releases
    OWNER to postgres;

COMMENT ON TABLE public.supported_releases
    IS 'A list of support FreeBSD releases.

See https://github.com/FreshPorts/freshports/issues/612';

insert into supported_releases (name) values
('stable/14'),
('releng/14.2'),
('releng/14.1'),
('stable/13'),
('releng/13.4'),
('releng/13.3');

@dlangille
Copy link
Contributor Author

for sorting:

freshports.dvl=# select *, split_part(name, '/', 2), split_part(name, '/', 1)
from supported_releases order by split_part(name, '/', 2) DESC;
 id |    name     | enabled | split_part | split_part 
----+-------------+---------+------------+------------
  2 | releng/14.2 | t       | 14.2       | releng
  3 | releng/14.1 | t       | 14.1       | releng
  1 | stable/14   | t       | 14         | stable
  5 | releng/13.4 | t       | 13.4       | releng
  6 | releng/13.3 | t       | 13.3       | releng
  4 | stable/13   | t       | 13         | stable
(6 rows)

freshports.dvl=# 

@calebpower
Copy link

I'm not sure if this is helpful at all, but I tossed this together if you wanted the scrape to be a little more dynamic and to kick out JSON. But if you're just dropping it into your db, maybe it's not needed. Just kind of built it as a quick distraction from other work, so grain of salt.

gist

But I totally get wanting to have an API-based SoT and not one you'd have to scrape.

@dlangille
Copy link
Contributor Author

dlangille commented Dec 15, 2024

I'm not sure if this is helpful at all, but I tossed this together if you wanted the scrape to be a little more dynamic and to kick out JSON. But if you're just dropping it into your db, maybe it's not needed. Just kind of built it as a quick distraction from other work, so grain of salt.

gist

But I totally get wanting to have an API-based SoT and not one you'd have to scrape.

Thank you for doing this. After building & installing htmlq, it worked for me.

How about we provide this file for all to use? Please create a new issue and we'll add this to the website so others can use it. There will be some more work to do. Thank you.

[13:22 mydev dvl ~/tmp] % fetch -o getsup "https://gist.githubusercontent.com/calebpower/1430dc6d0dc02ea8c2215ac20e068ca9/raw/53c058297e1e57f8ac9846eb5c5ff64e92aa2a17/getsup.sh"
getsup                                                 809  B 5414 kBps    00s
[13:27 mydev dvl ~/tmp] % sudo chmod +x getsup 
[13:28 mydev dvl ~/tmp] % ~/tmp/getsup 
[
  {
    "branch": "stable/14",
    "release": "n/a",
    "release_date": "n/a",
    "expected_eol": "November 30, 2028"
  },
  {
    "branch": "releng/14.2",
    "release": "14.2-RELEASE",
    "release_date": "December 3, 2024",
    "expected_eol": "September 30, 2025"
  },
  {
    "branch": "releng/14.1",
    "release": "14.1-RELEASE",
    "release_date": "June 4, 2024",
    "expected_eol": "March 31, 2025"
  },
  {
    "branch": "stable/13",
    "release": "n/a",
    "release_date": "n/a",
    "expected_eol": "April 30, 2026"
  },
  {
    "branch": "releng/13.4",
    "release": "13.4-RELEASE",
    "release_date": "September 17, 2024",
    "expected_eol": "June 30, 2025"
  },
  {
    "branch": "releng/13.3",
    "release": "13.3-RELEASE",
    "release_date": "March 5, 2024",
    "expected_eol": "December 31, 2024"
  }
]
[13:28 mydev dvl ~/tmp] % sudo chmod +x getsup

@dlangille
Copy link
Contributor Author

dlangille commented Dec 15, 2024

How about we provide this file for all to use? Please create a new issue and we'll add this to the website so others can use it. There will be some more work to do. Thank you.

@calebpower:

I mention that 'create a new issue' only if you want to do some more work. I can help you through it. It would be a completely self-contained project if you wanted to do it.

  • the script
  • a periodic script to invoke it
  • a switch to turn that periodic script on/off

While we're at it, the subversion repo for the periodic scripts needs to be converted to git and added to https://github.com/FreshPorts

@calebpower
Copy link

How about we provide this file for all to use? Please create a new issue and we'll add this to the website so others can use it. There will be some more work to do. Thank you.

@calebpower:

I mention that 'create a new issue' only if you want to do some more work. I can help you through it. It would be a completely self-contained project if you wanted to do it.

  • the script
  • a periodic script to invoke it
  • a switch to turn that periodic script on/off

While we're at it, the subversion repo for the periodic scripts needs to be converted to git and added to https://github.com/FreshPorts

I'd be happy to!

@dlangille
Copy link
Contributor Author

How about we provide this file for all to use? Please create a new issue and we'll add this to the website so others can use it. There will be some more work to do. Thank you.

@calebpower:

I mention that 'create a new issue' only if you want to do some more work. I can help you through it. It would be a completely self-contained project if you wanted to do it.

  • the script
  • a periodic script to invoke it
  • a switch to turn that periodic script on/off

While we're at it, the subversion repo for the periodic scripts needs to be converted to git and added to https://github.com/FreshPorts

I'd be happy to!

Great. I just created https://github.com/FreshPorts/periodics and I'm firing up a subversion web server. It'll be ready this week.

@calebpower
Copy link

How about we provide this file for all to use? Please create a new issue and we'll add this to the website so others can use it. There will be some more work to do. Thank you.

@calebpower:

I mention that 'create a new issue' only if you want to do some more work. I can help you through it. It would be a completely self-contained project if you wanted to do it.

  • the script
  • a periodic script to invoke it
  • a switch to turn that periodic script on/off

While we're at it, the subversion repo for the periodic scripts needs to be converted to git and added to https://github.com/FreshPorts

I'd be happy to!

Great. I just created https://github.com/FreshPorts/periodics and I'm firing up a subversion web server. It'll be ready this week.

Awesome, thanks. I created an issue in FreshPorts/freshports but I'm wondering if you'd prefer that I instead create it over at FreshPorts/periodics... happy to close/move it if preferred.

@dlangille
Copy link
Contributor Author

That issue is the first step in getting all the non-public repositories into GitHub and out of my basement. They are mostly subversion and I won't be sad to see the moved to git.

@dlangille
Copy link
Contributor Author

How about we provide this file for all to use? Please create a new issue and we'll add this to the website so others can use it. There will be some more work to do. Thank you.

@calebpower:

I mention that 'create a new issue' only if you want to do some more work. I can help you through it. It would be a completely self-contained project if you wanted to do it.

  • the script
  • a periodic script to invoke it
  • a switch to turn that periodic script on/off

While we're at it, the subversion repo for the periodic scripts needs to be converted to git and added to https://github.com/FreshPorts

I'd be happy to!

Great. I just created https://github.com/FreshPorts/periodics and I'm firing up a subversion web server. It'll be ready this week.

Awesome, thanks. I created an issue in FreshPorts/freshports but I'm wondering if you'd prefer that I instead create it over at FreshPorts/periodics... happy to close/move it if preferred.

Yes, please move it over. It will fall under that project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants