Skip to content

Fix ubuntu 22 #41

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

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions dist/main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -62353,6 +62353,13 @@ async function lsb_release() {
}
return _lsb_release;
}
let _lsb_release_id;
async function lsb_release_id() {
if (!_lsb_release_id) {
_lsb_release_id = capture('lsb_release -i -s', { silent: true });
}
return _lsb_release_id;
}
let _httpc;
async function http_get(url) {
if (!_httpc) {
Expand Down Expand Up @@ -62425,7 +62432,9 @@ function construct_base_url() {
}
async function available_versions(version_prefix) {
const baseUrl = construct_base_url();
const repo = baseUrl + '/ubuntu/dists/' + (await lsb_release());
const distro = await lsb_release();
const distro_id = (await lsb_release_id()).toLowerCase();
const repo = baseUrl + '/' + distro_id + '/dists/' + distro;
// Don't return 1.10.10, when the version prefix is 1.10.1.
const prefix = version_prefix ? version_prefix + '.' : '';
return http_get(`${repo}/main/binary-amd64/Packages`)
Expand Down Expand Up @@ -62465,6 +62474,7 @@ exports.latest_version = latest_version;
async function run_linux() {
try {
const distro = await lsb_release();
const distro_id = (await lsb_release_id()).toLowerCase();
const cache_dir = 'cache-tarantool';
const baseUrl = construct_base_url();
core.startGroup(`Checking latest tarantool ${tarantool_version} version`);
Expand Down Expand Up @@ -62496,7 +62506,7 @@ async function run_linux() {
});
await core.group('Setting up repository', async () => {
await exec.exec('sudo tee /etc/apt/sources.list.d/tarantool.list', [], {
input: Buffer.from(`deb ${baseUrl}/ubuntu/ ${distro} main\n`)
input: Buffer.from(`deb ${baseUrl}/${distro_id}/ ${distro} main\n`)
});
});
await core.group('Running apt-get update', async () => {
Expand Down
16 changes: 14 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,15 @@ async function lsb_release(): Promise<string> {
return _lsb_release
}

let _lsb_release_id: Promise<string>
async function lsb_release_id(): Promise<string> {
if (!_lsb_release_id) {
_lsb_release_id = capture('lsb_release -i -s', {silent: true})
}

return _lsb_release_id
}

let _httpc: httpm.HttpClient
async function http_get(url: string): Promise<httpm.HttpClientResponse> {
if (!_httpc) {
Expand Down Expand Up @@ -119,7 +128,9 @@ async function available_versions(
version_prefix: string
): Promise<Array<string>> {
const baseUrl = construct_base_url()
const repo = baseUrl + '/ubuntu/dists/' + (await lsb_release())
const distro = await lsb_release()
const distro_id = (await lsb_release_id()).toLowerCase()
const repo = baseUrl + '/' + distro_id + '/dists/' + distro

// Don't return 1.10.10, when the version prefix is 1.10.1.
const prefix = version_prefix ? version_prefix + '.' : ''
Expand Down Expand Up @@ -162,6 +173,7 @@ export async function latest_version(version_prefix: string): Promise<string> {
async function run_linux(): Promise<void> {
try {
const distro = await lsb_release()
const distro_id = (await lsb_release_id()).toLowerCase()
const cache_dir = 'cache-tarantool'
const baseUrl = construct_base_url()

Expand Down Expand Up @@ -197,7 +209,7 @@ async function run_linux(): Promise<void> {

await core.group('Setting up repository', async () => {
await exec.exec('sudo tee /etc/apt/sources.list.d/tarantool.list', [], {
input: Buffer.from(`deb ${baseUrl}/ubuntu/ ${distro} main\n`)
input: Buffer.from(`deb ${baseUrl}/${distro_id}/ ${distro} main\n`)
Copy link
Member

@Totktonada Totktonada Jul 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I vote up this enhancement, but it doesn't look related to the pull request title: it is not about Ubuntu 22.04.

Since the pull request is more about docker container jobs rather than specific to Ubuntu 22.04 I would rephrase the pull request title/description.

})
})

Expand Down