mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
Include architectures for dummy data
This commit is contained in:
parent
65d8f18255
commit
3cf974da4d
1 changed files with 21 additions and 3 deletions
|
@ -96,6 +96,22 @@ def genFortune():
|
|||
return fortunes[random.randrange(0, len(fortunes))].replace("'", "")
|
||||
|
||||
|
||||
def genArch() -> str:
|
||||
arches: list[str] = []
|
||||
|
||||
if random.randrange(0, 10) < 8:
|
||||
arches.append("x86_64")
|
||||
if random.randrange(0, 10) < 6:
|
||||
arches.append("aarch64")
|
||||
if random.randrange(0, 10) < 2:
|
||||
arches.append("riscv")
|
||||
|
||||
if arches:
|
||||
return ",".join(arches)
|
||||
else:
|
||||
return "any"
|
||||
|
||||
|
||||
# load the words, and make sure there are enough words for users/pkgs
|
||||
#
|
||||
log.debug("Grabbing words from seed file...")
|
||||
|
@ -235,9 +251,11 @@ for p in list(seen_pkgs.keys()):
|
|||
s = s % (seen_pkgs[p], p, NOW, NOW, uuid, muid, puid)
|
||||
out.write(s)
|
||||
|
||||
s = ("INSERT INTO Packages (ID, PackageBaseID, Name, Version) VALUES "
|
||||
"(%d, %d, '%s', '%s');\n")
|
||||
s = s % (seen_pkgs[p], seen_pkgs[p], p, genVersion())
|
||||
s = (
|
||||
"INSERT INTO Packages (ID, PackageBaseID, Name, Version, Arch) VALUES "
|
||||
"(%d, %d, '%s', '%s', '%s');\n"
|
||||
)
|
||||
s = s % (seen_pkgs[p], seen_pkgs[p], p, genVersion(), genArch())
|
||||
out.write(s)
|
||||
|
||||
count += 1
|
||||
|
|
Loading…
Add table
Reference in a new issue