diff --git a/aurweb/scripts/mkpkglists.py b/aurweb/scripts/mkpkglists.py index 16fe752e1c6fdd4dcdb451d2f774212427cc4ff8..f2095a20b96c5a97fa35040f71908880b16a8c89 100755 --- a/aurweb/scripts/mkpkglists.py +++ b/aurweb/scripts/mkpkglists.py @@ -7,15 +7,14 @@ Archives: packages.gz | A line-separated list of package names packages-meta-v1.json | A type=search RPC-formatted JSON dataset - packages-meta-ext-v1.json | An --extended or --all archive + packages-meta-ext-v1.json | An --extended archive pkgbase.gz | A line-separated list of package base names users.gz | A line-separated list of user names -This script takes an optional argument: --extended or --all. Based +This script takes an optional argument: --extended. Based on the following, right-hand side fields are added to each item. - --extended | License, Keywords, Groups - --all | License, Keywords, Groups, relations and dependencies + --extended | License, Keywords, Groups, relations and dependencies """ @@ -131,34 +130,12 @@ def get_extended_dict(query: str): if "Keywords" not in data[pkgid]: data[pkgid]["Keywords"] = [] - if "Groups" not in data[pkgid]: - data[pkgid]["Groups"] = [] - data[pkgid][key].append(output) conn.close() return data -def get_limited_extended_fields(): - # Returns: [ID, Type, Name, Cond] - query = """ - SELECT PackageGroups.PackageID AS ID, 'Groups' AS Type, - Groups.Name, '' AS Cond - FROM Groups INNER JOIN PackageGroups - ON PackageGroups.GroupID = Groups.ID - UNION SELECT PackageLicenses.PackageID AS ID, 'License' AS Type, - Licenses.Name, '' as Cond - FROM Licenses INNER JOIN PackageLicenses - ON PackageLicenses.LicenseID = Licenses.ID - UNION SELECT Packages.ID AS ID, 'Keywords' AS Type, - PackageKeywords.Keyword AS Name, '' as Cond - FROM PackageKeywords - INNER JOIN Packages ON Packages.PackageBaseID = PackageKeywords.PackageBaseID - """ - return get_extended_dict(query) - - def get_extended_fields(): # Returns: [ID, Type, Name, Cond] query = """ @@ -190,8 +167,7 @@ def get_extended_fields(): EXTENDED_FIELD_HANDLERS = { - "--extended": get_limited_extended_fields, - "--all": get_extended_fields + "--extended": get_extended_fields } @@ -277,8 +253,6 @@ def main(): ]) update_state(packages_state, update_time) - else: - print("Packages have not been updated; skipping.") updated, update_time = should_update(pkgbases_state, "PackageBases") if not updated: @@ -290,8 +264,6 @@ def main(): "WHERE PackagerUID IS NOT NULL") f.writelines([bytes(x[0] + "\n", "UTF-8") for x in cur.fetchall()]) update_state(pkgbases_state, update_time) - else: - print("PackageBases have not been updated; skipping.") updated, update_time = should_update(users_state, "Users") if not updated: @@ -302,8 +274,6 @@ def main(): cur = conn.execute("SELECT UserName FROM Users") f.writelines([bytes(x[0] + "\n", "UTF-8") for x in cur.fetchall()]) update_state(users_state, update_time) - else: - print("Users have not been updated; skipping.") conn.close()