11 config
= configparser
.RawConfigParser()
12 config
.read(os
.path
.dirname(os
.path
.realpath(__file__
)) + "/../../conf/config")
14 aur_db_host
= config
.get('database', 'host')
15 aur_db_name
= config
.get('database', 'name')
16 aur_db_user
= config
.get('database', 'user')
17 aur_db_pass
= config
.get('database', 'password')
18 aur_db_socket
= config
.get('database', 'socket')
20 repo_base_path
= config
.get('serve', 'repo-base')
21 repo_regex
= config
.get('serve', 'repo-regex')
22 template_path
= config
.get('serve', 'template-path')
25 sys
.stderr
.write("%s\n" % (msg
))
28 db
= mysql
.connector
.connect(host
=aur_db_host
, user
=aur_db_user
,
29 passwd
=aur_db_pass
, db
=aur_db_name
,
30 unix_socket
=aur_db_socket
)
33 cur
.execute("SELECT Name FROM PackageBases")
34 repos
= [row
[0] for row
in cur
]
38 if not re
.match(repo_regex
, repo
):
39 die('invalid repository name: %s' % (repo
))
45 print("[%s/%d] %s" % (str(i
).rjust(len(str(n
))), n
, repo
))
47 repo_path
= repo_base_path
+ '/' + repo
+ '.git/'
48 pygit2
.init_repository(repo_path
, True, 48, template_path
=template_path
)