aboutsummaryrefslogtreecommitdiffstats
path: root/testing/aaudit/aaudit-repo-create
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2014-05-10 01:10:59 +0300
committerTimo Teräs <timo.teras@iki.fi>2014-05-10 01:12:00 +0300
commit6fbca72d680bb7ce7bccb41c86becf1762b042c1 (patch)
treec4beb6bfd620ad2eca86079fa04452ad0e1b9618 /testing/aaudit/aaudit-repo-create
parent9562bf59198a9b1ae90daec9bad97d545a781080 (diff)
downloadaports-6fbca72d680bb7ce7bccb41c86becf1762b042c1.tar.bz2
aports-6fbca72d680bb7ce7bccb41c86becf1762b042c1.tar.xz
testing/aaudit: rewrite client in lua, use json in configs
also use json to talk between client and server. and make the client program handle all command line flags.
Diffstat (limited to 'testing/aaudit/aaudit-repo-create')
-rwxr-xr-xtesting/aaudit/aaudit-repo-create51
1 files changed, 0 insertions, 51 deletions
diff --git a/testing/aaudit/aaudit-repo-create b/testing/aaudit/aaudit-repo-create
deleted file mode 100755
index 7b3ce91220..0000000000
--- a/testing/aaudit/aaudit-repo-create
+++ /dev/null
@@ -1,51 +0,0 @@
-#!/usr/bin/lua5.2
-
-local posix = require 'posix'
-local aaudit = require 'aaudit'
-
-local function usage()
- print("usage: aaudit-repo-create [-a ADDRESS] -d DESCRIPTION [-i COMMIT_IDENTITY] [-m COMMIT_MESSAGE] [-g GROUPS]")
- os.exit(1)
-end
-
-local C = { initial=true }
-local groups = {}
-local address, description
-
-for ret, optval in posix.getopt(arg, 'a:d:g:i:m:') do
- if ret == 'a' then
- address = optval
- elseif ret == 'd' then
- description = optval
- elseif ret == 'g' then
- groups['"'..optval..'"'] = true
- elseif ret == 'i' then
- C.identity = optval
- elseif ret == 'm' then
- C.message = optval
- else
- usage()
- end
-end
-
-if not address or not description then usage() end
-
--- For now default to use address as the repository name
-local repo, repohome = address, aaudit.repohome(address)
-
--- Create repository + write config
-os.execute(([[
-mkdir -p %s; cd %s
-git init --quiet --bare
-]]):format(repohome, repohome))
-
-aaudit.write_file(("%s/aaudit.conf"):format(repohome), ([[
-address = "%s";
-description = "%s";
-groups = { %s };
-]]):format(address, description, table.concat(groups, ', ')))
-
-aaudit.write_file(("%s/description"):format(repohome), ("%s (%s)"):format(description, address))
-
--- Initial import of configuration
-aaudit.import_commit(repohome, C)