Browse Source

Ok Linuxmint ulyana, si procede per... vediamo!

tags/v7.8.10
Piero Proietti 10 months ago
parent
commit
0c648c0f67
2 changed files with 24 additions and 61 deletions
  1. +23
    -60
      src/classes/incubation/calamares-modules/scripts/automirror.ts
  2. +1
    -1
      src/classes/incubation/focal.ts

+ 23
- 60
src/classes/incubation/calamares-modules/scripts/automirror.ts View File

@@ -1,7 +1,7 @@
/**
*
*/
export function automirror(): string {
export function automirror(versionId=''): string {
let text = ''
text += `#!/usr/bin/env python3\n`
text += `# Copyright (C) 2018 Simon Quigley <tsimonq2@ubuntu.com>\n`
@@ -30,66 +30,22 @@ export function automirror(): string {
text += `from lsb_release import get_distro_information\n`
text += `\n`
text += `global sources\n`

text += `sources = """# Automatically generated by Calamares on DATE.\n`
text += `# Lines starting with "deb" are mandatory, while lines starting with "deb-src"\n`
text += `# are for more detailed package information.\n`
text += `\n`
text += `## repo per linuxmint ulyana\n`
text += `deb http://packages.linuxmint.com ulyana main upstream import backport #id:linuxmint_main\n`
text += `\n`
text += `## See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to\n`
text += `## newer versions of DISTRIBUTION.\n`
text += `deb URL/ubuntu/ CODENAME main restricted\n`
text += `# deb-src URL/ubuntu/ CODENAME main restricted\n`
text += `\n`
text += `## Major bug fix updates produced after the final release of DISTRIBUTION.\n`
text += `## Have you noticed a regression? Please report it!\n`
text += `## https://wiki.ubuntu.com/StableReleaseUpdates#Regressions\n`
text += `deb URL/ubuntu/ CODENAME-updates main restricted\n`
text += `# deb-src URL/ubuntu/ CODENAME-updates main restricted\n`
text += `\n`
text += `## Software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu team.\n`
text += `## Also, please note that software in Universe WILL NOT receive any review or\n`
text += `## updates from the Ubuntu security team directly. Updates in this repository\n`
text += `## are provided by volunteers, but most come from Debian.\n`
text += `deb URL/ubuntu/ CODENAME universe\n`
text += `# deb-src URL/ubuntu/ CODENAME universe\n`
text += `deb URL/ubuntu/ CODENAME-updates universe\n`
text += `# deb-src URL/ubuntu/ CODENAME-updates universe\n`
text += `\n`
text += `## Software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu team,\n`
text += `## and may not be under a free licence. Please satisfy yourself as your rights\n`
text += `## to use the software. Also, please note that software in Multiverse WILL NOT\n`
text += `## receive any review or updates from the Ubuntu security team directly.\n`
text += `deb URL/ubuntu/ CODENAME multiverse\n`
text += `# deb-src URL/ubuntu/ CODENAME multiverse\n`
text += `deb URL/ubuntu/ CODENAME-updates multiverse\n`
text += `# deb-src URL/ubuntu/ CODENAME-updates multiverse\n`
text += `\n`
text += `## Software from this repository contains tested security updates from the\n`
text += `## Ubuntu security team.\n`
text += `deb http://security.ubuntu.com/ubuntu CODENAME-security main restricted\n`
text += `# deb-src http://security.ubuntu.com/ubuntu CODENAME-security main restricted\n`
text += `deb http://security.ubuntu.com/ubuntu CODENAME-security universe\n`
text += `# deb-src http://security.ubuntu.com/ubuntu CODENAME-security universe\n`
text += `deb http://security.ubuntu.com/ubuntu CODENAME-security multiverse\n`
text += `# deb-src http://security.ubuntu.com/ubuntu CODENAME-security multiverse\n`
text += `\n`
text += `## Software from this repository may not have been tested as extensively as\n`
text += `## software contained in the main release, although it includes newer versions\n`
text += `## of some applications which may provide useful features. Also, please note\n`
text += `## that software in Backports WILL NOT receive any review or updates from the\n`
text += `## Ubuntu security team.\n`

/**
* LINUXMINT 20
*/
if (versionId === 'ulyana'){
text += `deb http://packages.linuxmint.com ulyana main upstream import backport #id:linuxmint_main\n`
text += `\n`
}
text += `deb URL/ubuntu/ CODENAME main restricted universe multiverse\n`
text += `deb URL/ubuntu/ CODENAME-updates main restricted universe multiverse\n`
text += `deb URL/ubuntu/ CODENAME-backports main restricted universe multiverse\n`
text += `# deb-src URL/ubuntu/ CODENAME-backports main restricted universe multiverse\n`
text += `\n`
text += `## Uncomment the following two lines to add software from Canonical's\n`
text += `## "partner" repository.\n`
text += `## This software is not part of Ubuntu, but is offered by Canonical and the\n`
text += `## respective vendors as a service to Ubuntu users.\n`
text += `# deb http://archive.canonical.com/ubuntu CODENAME partner\n`
text += `# deb-src http://archive.canonical.com/ubuntu CODENAME partner"""\n`
text += `deb http://security.ubuntu.com/ubuntu/ CODENAME-security main restricted universe multiverse\n`
text += `deb http://archive.canonical.com/ubuntu CODENAME partner"""\n`
text += `\n`
text += `SUBDOMAINS_BY_COUNTRY_CODE = {"US": "us.",\n`
@@ -142,7 +98,11 @@ export function automirror(): string {
text += `\n`
text += `def getcodename():\n`
text += ` """Return the codename of the distribution, similar to lsb_release -cs"""\n`
text += ` return get_distro_information()["CODENAME"]\n`
if (versionId='ulyana'){
text += ` return "focal"\n`
} else {
text += ` return get_distro_information()["CODENAME"]\n`
}
text += `\n`
text += `def changesources(subdomain):\n`
text += ` """Replace the placeholders and then create the sources.list"""\n`
@@ -157,8 +117,11 @@ export function automirror(): string {
text += ` sources = sources.replace("DATE", strftime("%Y-%m-%d"))\n`
text += `\n`
text += ` filepath = libcalamares.globalstorage.value("rootMountPoint")\n`
// text += ` filepath += "/etc/apt/sources.list"\n`
text += ` filepath += "/etc/apt/sources.list.d/official-package-repositories.list"\n`
if (versionId === 'ulyana'){
text += ` filepath += "/etc/apt/sources.list.d/official-package-repositories.list"\n`
} else {
text += ` filepath += "/etc/apt/sources.list"\n`
}
text += ` with open(filepath, "r+") as sourcesfile:\n`
text += ` sourcesfile.seek(0)\n`
text += ` sourcesfile.write(sources)\n`


+ 1
- 1
src/classes/incubation/focal.ts View File

@@ -520,7 +520,7 @@ export class Focal {
// py
const scriptAutomirror = require('./calamares-modules/scripts/automirror').automirror
const scriptFile = dirModule + 'main.py'
write(scriptFile, scriptAutomirror(), this.verbose)
write(scriptFile, scriptAutomirror(this.distro.versionId), this.verbose)
await exec(`chmod +x ${scriptFile}`)
}



Loading…
Cancel
Save