Rename multimc directory to polymc

This commit is contained in:
txtsd 2022-01-29 07:56:44 +00:00
parent 6a1b9402ec
commit b185771861
No known key found for this signature in database
GPG Key ID: 8E0D55E9A2557BB5
9 changed files with 24 additions and 24 deletions

2
.gitignore vendored
View File

@ -1,5 +1,5 @@
http_cache http_cache
multimc polymc
upstream upstream
forgemaven forgemaven
forge_cache forge_cache

View File

@ -1,6 +1,6 @@
export UPSTREAM_DIR=upstream export UPSTREAM_DIR=upstream
export UPSTREAM_REPO=git@github.com:PolyMC/meta-upstream.git export UPSTREAM_REPO=git@github.com:PolyMC/meta-upstream.git
export PMC_DIR=multimc export PMC_DIR=polymc
export PMC_REPO=git@github.com:PolyMC/meta-polymc.git export PMC_REPO=git@github.com:PolyMC/meta-polymc.git
export BRANCH_master=master export BRANCH_master=master
export BRANCH_develop=develop export BRANCH_develop=develop

View File

@ -13,7 +13,7 @@ import requests
from cachecontrol import CacheControl from cachecontrol import CacheControl
from cachecontrol.caches import FileCache from cachecontrol.caches import FileCache
#with open('multimc/index.json', 'r', encoding='utf-8') as index: #with open('polymc/index.json', 'r', encoding='utf-8') as index:
#packages = MultiMCPackageIndex(json.load(index)) #packages = MultiMCPackageIndex(json.load(index))
#for entry in packages.packages: #for entry in packages.packages:
@ -86,14 +86,14 @@ def GetLibraryDownload (library : MultiMCLibrary):
return DownloadEntry(url, kind, name) return DownloadEntry(url, kind, name)
with open('multimc/net.minecraftforge/index.json', 'r', encoding='utf-8') as forgeIndex: with open('polymc/net.minecraftforge/index.json', 'r', encoding='utf-8') as forgeIndex:
forgeVersions = MultiMCVersionIndex(json.load(forgeIndex)) forgeVersions = MultiMCVersionIndex(json.load(forgeIndex))
urlSet = set() urlSet = set()
for entry in forgeVersions.versions: for entry in forgeVersions.versions:
versionString = entry.version versionString = entry.version
versionPath = "multimc/net.minecraftforge/%s.json" % versionString versionPath = "polymc/net.minecraftforge/%s.json" % versionString
with open(versionPath, 'r') as infile: with open(versionPath, 'r') as infile:
forgeVersion = MultiMCVersionFile(json.load(infile)) forgeVersion = MultiMCVersionFile(json.load(infile))
if forgeVersion.libraries: if forgeVersion.libraries:

View File

@ -15,8 +15,8 @@ def mkdirs(path):
if not os.path.exists(path): if not os.path.exists(path):
os.makedirs(path) os.makedirs(path)
mkdirs("multimc/net.fabricmc.fabric-loader") mkdirs("polymc/net.fabricmc.fabric-loader")
mkdirs("multimc/net.fabricmc.intermediary") mkdirs("polymc/net.fabricmc.intermediary")
def loadJarInfo(mavenKey): def loadJarInfo(mavenKey):
with open("upstream/fabric/jars/" + mavenKey.replace(":", ".") + ".json", 'r', encoding='utf-8') as jarInfoFile: with open("upstream/fabric/jars/" + mavenKey.replace(":", ".") + ".json", 'r', encoding='utf-8') as jarInfoFile:
@ -72,7 +72,7 @@ with open("upstream/fabric/meta-v2/intermediary.json", 'r', encoding='utf-8') as
processIntermediaryVersion(it) processIntermediaryVersion(it)
for version in loaderVersions: for version in loaderVersions:
outFilepath = "multimc/net.fabricmc.fabric-loader/%s.json" % version.version outFilepath = "polymc/net.fabricmc.fabric-loader/%s.json" % version.version
with open(outFilepath, 'w') as outfile: with open(outFilepath, 'w') as outfile:
json.dump(version.to_json(), outfile, sort_keys=True, indent=4) json.dump(version.to_json(), outfile, sort_keys=True, indent=4)
@ -84,7 +84,7 @@ sharedData.authors = ["Fabric Developers"]
sharedData.write() sharedData.write()
for version in intermediaryVersions: for version in intermediaryVersions:
outFilepath = "multimc/net.fabricmc.intermediary/%s.json" % version.version outFilepath = "polymc/net.fabricmc.intermediary/%s.json" % version.version
with open(outFilepath, 'w') as outfile: with open(outFilepath, 'w') as outfile:
json.dump(version.to_json(), outfile, sort_keys=True, indent=4) json.dump(version.to_json(), outfile, sort_keys=True, indent=4)

View File

@ -17,7 +17,7 @@ def loadMcVersionFilter(version):
if version in mcVersionCache: if version in mcVersionCache:
return mcVersionCache[version] return mcVersionCache[version]
libSet = set() libSet = set()
with open("multimc/net.minecraft/%s.json" % version, 'r', encoding='utf-8') as mcFile: with open("polymc/net.minecraft/%s.json" % version, 'r', encoding='utf-8') as mcFile:
mcVersion = MultiMCVersionFile(json.load(mcFile)) mcVersion = MultiMCVersionFile(json.load(mcFile))
for lib in mcVersion.libraries: for lib in mcVersion.libraries:
libSet.add(lib.name) libSet.add(lib.name)
@ -374,7 +374,7 @@ for id, entry in remoteVersionlist.versions.items():
recommendedVersions.append(version.rawVersion) recommendedVersions.append(version.rawVersion)
# If we do not have the corresponding Minecraft version, we ignore it # If we do not have the corresponding Minecraft version, we ignore it
if not os.path.isfile("multimc/net.minecraft/%s.json" % version.mcversion_sane): if not os.path.isfile("polymc/net.minecraft/%s.json" % version.mcversion_sane):
eprint ("Skipping %s with no corresponding Minecraft version %s" % (id, version.mcversion_sane)) eprint ("Skipping %s with no corresponding Minecraft version %s" % (id, version.mcversion_sane))
continue continue
@ -415,7 +415,7 @@ for id, entry in remoteVersionlist.versions.items():
outVersion = versionFromLegacy(version, legacyinfolist.number[build]) outVersion = versionFromLegacy(version, legacyinfolist.number[build])
outFilepath = "multimc/net.minecraftforge/%s.json" % outVersion.version outFilepath = "polymc/net.minecraftforge/%s.json" % outVersion.version
with open(outFilepath, 'w') as outfile: with open(outFilepath, 'w') as outfile:
json.dump(outVersion.to_json(), outfile, sort_keys=True, indent=4) json.dump(outVersion.to_json(), outfile, sort_keys=True, indent=4)

View File

@ -76,7 +76,7 @@ recommended.sort()
allVersions.sort(key=lambda x: x.releaseTime, reverse=True) allVersions.sort(key=lambda x: x.releaseTime, reverse=True)
for version in allVersions: for version in allVersions:
outFilepath = "multimc/com.mumfrey.liteloader/%s.json" % version.version outFilepath = "polymc/com.mumfrey.liteloader/%s.json" % version.version
with open(outFilepath, 'w') as outfile: with open(outFilepath, 'w') as outfile:
json.dump(version.to_json(), outfile, sort_keys=True, indent=4) json.dump(version.to_json(), outfile, sort_keys=True, indent=4)

View File

@ -246,7 +246,7 @@ for filename in os.listdir('upstream/mojang/versions'):
# process 1.13 arguments into previous version # process 1.13 arguments into previous version
if not mojangVersionFile.minecraftArguments and mojangVersionFile.arguments: if not mojangVersionFile.minecraftArguments and mojangVersionFile.arguments:
versionFile.minecraftArguments = adaptNewStyleArguments(mojangVersionFile.arguments) versionFile.minecraftArguments = adaptNewStyleArguments(mojangVersionFile.arguments)
filenameOut = "multimc/net.minecraft/%s.json" % versionFile.version filenameOut = "polymc/net.minecraft/%s.json" % versionFile.version
if versionFile.version in staticVersionlist.versions: if versionFile.version in staticVersionlist.versions:
ApplyLegacyOverride (versionFile, staticVersionlist.versions[versionFile.version]) ApplyLegacyOverride (versionFile, staticVersionlist.versions[versionFile.version])
with open(filenameOut, 'w') as outfile: with open(filenameOut, 'w') as outfile:
@ -256,12 +256,12 @@ def processSingleVariant(lwjglVariant):
lwjglVersion = lwjglVariant.version lwjglVersion = lwjglVariant.version
versionObj = copy.deepcopy(lwjglVariant) versionObj = copy.deepcopy(lwjglVariant)
if lwjglVersion[0] == '2': if lwjglVersion[0] == '2':
filename = "multimc/org.lwjgl/%s.json" % lwjglVersion filename = "polymc/org.lwjgl/%s.json" % lwjglVersion
versionObj.name = 'LWJGL 2' versionObj.name = 'LWJGL 2'
versionObj.uid = 'org.lwjgl' versionObj.uid = 'org.lwjgl'
versionObj.conflicts = [DependencyEntry(uid='org.lwjgl3')] versionObj.conflicts = [DependencyEntry(uid='org.lwjgl3')]
elif lwjglVersion[0] == '3': elif lwjglVersion[0] == '3':
filename = "multimc/org.lwjgl3/%s.json" % lwjglVersion filename = "polymc/org.lwjgl3/%s.json" % lwjglVersion
versionObj.name = 'LWJGL 3' versionObj.name = 'LWJGL 3'
versionObj.uid = 'org.lwjgl3' versionObj.uid = 'org.lwjgl3'
versionObj.conflicts = [DependencyEntry(uid='org.lwjgl')] versionObj.conflicts = [DependencyEntry(uid='org.lwjgl')]

View File

@ -22,7 +22,7 @@ ignore = set(["index.json", "package.json", ".git"])
packages = MultiMCPackageIndex() packages = MultiMCPackageIndex()
# walk thorugh all the package folders # walk thorugh all the package folders
for package in sorted(os.listdir('multimc')): for package in sorted(os.listdir('polymc')):
if package in ignore: if package in ignore:
continue continue
@ -37,12 +37,12 @@ for package in sorted(os.listdir('multimc')):
versionList.name = sharedData.name versionList.name = sharedData.name
# walk through all the versions of the package # walk through all the versions of the package
for filename in os.listdir("multimc/%s" % (package)): for filename in os.listdir("polymc/%s" % (package)):
if filename in ignore: if filename in ignore:
continue continue
# parse and hash the version file # parse and hash the version file
filepath = "multimc/%s/%s" % (package, filename) filepath = "polymc/%s/%s" % (package, filename)
filehash = HashFile(hashlib.sha256, filepath) filehash = HashFile(hashlib.sha256, filepath)
versionFile = None versionFile = None
with open(filepath) as json_file: with open(filepath) as json_file:
@ -65,7 +65,7 @@ for package in sorted(os.listdir('multimc')):
versionList.versions = sorted(versionList.versions, key=itemgetter('releaseTime'), reverse=True) versionList.versions = sorted(versionList.versions, key=itemgetter('releaseTime'), reverse=True)
# write the version index for the package # write the version index for the package
outFilePath = "multimc/%s/index.json" % (package) outFilePath = "polymc/%s/index.json" % (package)
with open(outFilePath, 'w') as outfile: with open(outFilePath, 'w') as outfile:
json.dump(versionList.to_json(), outfile, sort_keys=True, indent=4) json.dump(versionList.to_json(), outfile, sort_keys=True, indent=4)
@ -80,5 +80,5 @@ for package in sorted(os.listdir('multimc')):
packages.packages.append(packageEntry) packages.packages.append(packageEntry)
# write the repository package index # write the repository package index
with open("multimc/index.json", 'w') as outfile: with open("polymc/index.json", 'w') as outfile:
json.dump(packages.to_json(), outfile, sort_keys=True, indent=4) json.dump(packages.to_json(), outfile, sort_keys=True, indent=4)

View File

@ -337,7 +337,7 @@ class MultiMCSharedPackageData(VersionedJsonObject):
def write(self): def write(self):
try: try:
with open("multimc/%s/package.json" % self.uid, 'w') as file: with open("polymc/%s/package.json" % self.uid, 'w') as file:
json.dump(self.to_json(), file, sort_keys=True, indent=4) json.dump(self.to_json(), file, sort_keys=True, indent=4)
except EnvironmentError as e: except EnvironmentError as e:
print("Error while trying to save shared packaged data for %s:" % self.uid, e) print("Error while trying to save shared packaged data for %s:" % self.uid, e)
@ -347,11 +347,11 @@ def writeSharedPackageData(uid, name):
'name': name, 'name': name,
'uid': uid 'uid': uid
}) })
with open("multimc/%s/package.json" % uid, 'w') as file: with open("polymc/%s/package.json" % uid, 'w') as file:
json.dump(desc.to_json(), file, sort_keys=True, indent=4) json.dump(desc.to_json(), file, sort_keys=True, indent=4)
def readSharedPackageData(uid): def readSharedPackageData(uid):
with open("multimc/%s/package.json" % uid, 'r') as file: with open("polymc/%s/package.json" % uid, 'r') as file:
return MultiMCSharedPackageData(json.load(file)) return MultiMCSharedPackageData(json.load(file))
class MultiMCVersionIndexEntry(JsonObject): class MultiMCVersionIndexEntry(JsonObject):