summaryrefslogtreecommitdiffstats
path: root/scripts/mkpkglists.py
diff options
context:
space:
mode:
authorLukas Fleischer <lfleischer@archlinux.org>2016-10-17 15:20:29 +0200
committerLukas Fleischer <lfleischer@archlinux.org>2016-10-17 15:23:13 +0200
commit37188603b52a3dac23df229ada82c7da0c3d9c00 (patch)
treef7df7af7edcd8ca49fe1354883537013d020319f /scripts/mkpkglists.py
parent85866796a40923708f6b868c32ddc2f2f4417d1d (diff)
downloadaur-37188603b52a3dac23df229ada82c7da0c3d9c00.tar.gz
aur-37188603b52a3dac23df229ada82c7da0c3d9c00.tar.xz
Make maintenance scripts installable
Add wrappers for the maintenance scripts to the setuptools configuration. Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
Diffstat (limited to 'scripts/mkpkglists.py')
-rwxr-xr-xscripts/mkpkglists.py38
1 files changed, 0 insertions, 38 deletions
diff --git a/scripts/mkpkglists.py b/scripts/mkpkglists.py
deleted file mode 100755
index 8a0f2e9d..00000000
--- a/scripts/mkpkglists.py
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/usr/bin/python3
-
-import datetime
-import gzip
-
-import aurweb.config
-import aurweb.db
-
-packagesfile = aurweb.config.get('mkpkglists', 'packagesfile')
-pkgbasefile = aurweb.config.get('mkpkglists', 'pkgbasefile')
-
-
-def main():
- conn = aurweb.db.Connection()
-
- datestr = datetime.datetime.utcnow().strftime("%a, %d %b %Y %H:%M:%S GMT")
- pkglist_header = "# AUR package list, generated on " + datestr
- pkgbaselist_header = "# AUR package base list, generated on " + datestr
-
- with gzip.open(packagesfile, "w") as f:
- f.write(bytes(pkglist_header + "\n", "UTF-8"))
- cur = conn.execute("SELECT Packages.Name FROM Packages " +
- "INNER JOIN PackageBases " +
- "ON PackageBases.ID = Packages.PackageBaseID " +
- "WHERE PackageBases.PackagerUID IS NOT NULL")
- f.writelines([bytes(x[0] + "\n", "UTF-8") for x in cur.fetchall()])
-
- with gzip.open(pkgbasefile, "w") as f:
- f.write(bytes(pkgbaselist_header + "\n", "UTF-8"))
- cur = conn.execute("SELECT Name FROM PackageBases " +
- "WHERE PackagerUID IS NOT NULL")
- f.writelines([bytes(x[0] + "\n", "UTF-8") for x in cur.fetchall()])
-
- conn.close()
-
-
-if __name__ == '__main__':
- main()