diff options
author | Lukas Fleischer <lfleischer@archlinux.org> | 2017-08-01 07:08:29 +0200 |
---|---|---|
committer | Lukas Fleischer <lfleischer@archlinux.org> | 2017-08-01 07:08:29 +0200 |
commit | d9883ee64215ee91bfe1cc3e75c83ec6e6875671 (patch) | |
tree | a63cb58f6dec8f1bd92ad5a4c0108c7fd7e0697d /aurweb/scripts | |
parent | e06773add6bbecdf9ce797412ff0125780ba635d (diff) | |
download | aur-d9883ee64215ee91bfe1cc3e75c83ec6e6875671.tar.gz aur-d9883ee64215ee91bfe1cc3e75c83ec6e6875671.tar.xz |
mkpkglists: Generate a list of user names
In addition to the packages list and the package base list, also create
a list of registered user names.
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
Diffstat (limited to 'aurweb/scripts')
-rwxr-xr-x | aurweb/scripts/mkpkglists.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/aurweb/scripts/mkpkglists.py b/aurweb/scripts/mkpkglists.py index 8a0f2e9d..686ee7d0 100755 --- a/aurweb/scripts/mkpkglists.py +++ b/aurweb/scripts/mkpkglists.py @@ -8,6 +8,7 @@ import aurweb.db packagesfile = aurweb.config.get('mkpkglists', 'packagesfile') pkgbasefile = aurweb.config.get('mkpkglists', 'pkgbasefile') +userfile = aurweb.config.get('mkpkglists', 'userfile') def main(): @@ -16,6 +17,7 @@ def main(): 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 + userlist_header = "# AUR user name list, generated on " + datestr with gzip.open(packagesfile, "w") as f: f.write(bytes(pkglist_header + "\n", "UTF-8")) @@ -31,6 +33,11 @@ def main(): "WHERE PackagerUID IS NOT NULL") f.writelines([bytes(x[0] + "\n", "UTF-8") for x in cur.fetchall()]) + with gzip.open(userfile, "w") as f: + f.write(bytes(userlist_header + "\n", "UTF-8")) + cur = conn.execute("SELECT UserName FROM Users") + f.writelines([bytes(x[0] + "\n", "UTF-8") for x in cur.fetchall()]) + conn.close() |