aboutsummaryrefslogtreecommitdiffstats
path: root/testing
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2014-05-08 11:31:59 +0300
committerTimo Teräs <timo.teras@iki.fi>2014-05-08 11:32:36 +0300
commit3f51528a09596b8234e0521f766b309eec9d6776 (patch)
tree1152083cfc996d893ef1662c6864c7093586abd9 /testing
parent93937fdfd01b74808523fe1111e37dd2b42afc27 (diff)
downloadaports-3f51528a09596b8234e0521f766b309eec9d6776.tar.bz2
aports-3f51528a09596b8234e0521f766b309eec9d6776.tar.xz
main/aaudit: track file permissions too, and run git-gc
Diffstat (limited to 'testing')
-rw-r--r--testing/aaudit/APKBUILD20
-rwxr-xr-xtesting/aaudit/aaudit-import-tar23
-rwxr-xr-xtesting/aaudit/aaudit-refresh1
-rw-r--r--testing/aaudit/aaudit.conf2
4 files changed, 35 insertions, 11 deletions
diff --git a/testing/aaudit/APKBUILD b/testing/aaudit/APKBUILD
index d253c9f152..471f4bb34b 100644
--- a/testing/aaudit/APKBUILD
+++ b/testing/aaudit/APKBUILD
@@ -1,7 +1,7 @@
# Contributor: Timo Teräs <timo.teras@iki.fi>
# Maintainer: Timo Teräs <timo.teras@iki.fi>
pkgname=aaudit
-pkgver=0.1
+pkgver=0.2
pkgrel=0
pkgdesc="Alpine Auditor"
url="http://alpinelinux.org"
@@ -28,17 +28,17 @@ package() {
}
md5sums="6ab0ebec3419a4c495a1935a07d4825c aaudit-emaildiff
-d71863d014f844656b2fd1926f63826e aaudit-import-tar
+a85e99fa4ad3845a78104763444b21bb aaudit-import-tar
5dafe6078c114ac0a445dcf0633371cd aaudit-create
-9bcfb058c2b28b36d593203f838b90fa aaudit-refresh
-43ca8205fec84b7fe8ead005d0cbd8f3 aaudit.conf"
+9f43a5cd22d8176fab45903642be878a aaudit-refresh
+5a6da6c58f46ecede9553c3d183cf384 aaudit.conf"
sha256sums="56ec6e2c13a5e857ae604264a424fd8c6dc04bf37122d88197ddbbb92e42b560 aaudit-emaildiff
-4ea264c0a0fd7e1a0ff52a42db9b098358cce545b3eec1066ecc977cfe06565e aaudit-import-tar
+7edad95c6dda08dfa9595a22b796828e3425d1eb27ae585196db85bd2d467b87 aaudit-import-tar
6643a7c1353253a417a319b0ac8558a348248cb97dcca2c724940350edef47b2 aaudit-create
-6f3fb2d53141be5b58dfbda4977243628ed56de6ad3949ac349ad01013f43f75 aaudit-refresh
-c23f1dd4fe68b5cbde0bb5c8cc9996c9569b1cb4a249523c995381c8b3eee8ee aaudit.conf"
+cec7b57721006b4e2601db1fa7f02009ebd73c1543c59d0f01ef07fb75644349 aaudit-refresh
+93a841ed9d0079d40649df53240bbfe75d3ee8b9d5eb1f03e455eac0a94869a5 aaudit.conf"
sha512sums="114d931491faf8f2df71a050a87d2d895a73f48b3948da424f3c1def9da9ec9dec2db96b2a1fefafd25477dc285a010ea95ce0372174b139d081899e09be01d3 aaudit-emaildiff
-a1db9c83165ca42bcddf37c13b23206b5d1e0d7c00f8d5f1ce942a8ee8d94d21f6ebd85d1e4be53111b7f7468968df18dc00b073c710f25a4ff1a726f11eee83 aaudit-import-tar
+b1b96ba344f407bf09fe1ae480b4e5041ae5558bea57364e7998c98107eb19ee98b48c7e896805a550b2adb66f2978543b2106a70786c09af4dbd207b448558f aaudit-import-tar
85911c1b5e548cfaf417b310abff0d42d0a5a77a49f40584275d55feef30a2c68413c1db70d946709a3bf794dc31ec70bc61c3e50f2a8e1d91e57e13dc6470b1 aaudit-create
-6286214d25322f835156c2891cc509503df22fb979514c3a60a2bb3b520f0fe09e73bae80ed73ff0117e571956fa9cce17f1094e1d3f7698c19d14e80c36c5bd aaudit-refresh
-da7bd0febcf45ee4db8fb32d54fe014830895aafb131b93ad5e1ee8e95bd0a67d12b7931362135ccd7661bbf54909d09be6308c68506970dfbdb7d6f8de70ad3 aaudit.conf"
+115ef61434dde446abc1b9c67d81338acce133ca595669774392db4b3206ae44659841c65f25e0f70a0dcea6086fd065cc11273e4fa7ff64066298e522a70c90 aaudit-refresh
+ff66efccb6f7a304ad515dad31c8ce4fe20b5adb16856968576b2ff08f03620ec9c23113ae95ff25755fea677f8431d95fd46ade0e3d95291274f4379d0850f3 aaudit.conf"
diff --git a/testing/aaudit/aaudit-import-tar b/testing/aaudit/aaudit-import-tar
index effe937568..47de805fe5 100755
--- a/testing/aaudit/aaudit-import-tar
+++ b/testing/aaudit/aaudit-import-tar
@@ -21,6 +21,16 @@ local function match_file(fn, match_list)
return false
end
+function sortedpairs(t)
+ local i, keys, k = 0, {}
+ for k in pairs(t) do keys[#keys+1] = k end
+ table.sort(keys)
+ return function()
+ i = i + 1
+ if keys[i] then return keys[i], t[keys[i]] end
+ end
+end
+
local function checksum_header(block)
local sum = 256
for i = 1,148 do sum = sum + block:byte(i) end
@@ -116,11 +126,19 @@ function import_tar(CONF, TAR, GIT, initial_commit)
GIT:write('\n')
local fn = header.prefix..header.name
- all_files[fn] = { mark=nextmark, mode=header.mode }
+ all_files[fn] = { mark=nextmark, mode=header.mode, uname=header.uname, gname=header.gname }
nextmark = nextmark + 1
if header.mtime > author_time then author_time = header.mtime end
end
end
+ if CONF.track_filemode then
+ GIT:write("blob\nmark :"..nextmark.."\n")
+ GIT:write("data <<END_OF_PERMISSONS\n")
+ for path, v in sortedpairs(all_files) do
+ GIT:write(string.format("%o %s:%s %s\n", v.mode, v.uname, v.gname, path))
+ end
+ GIT:write("END_OF_PERMISSONS\n")
+ end
GIT:write(string.format([[
commit %s
@@ -139,6 +157,9 @@ END_OF_COMMIT_MESSAGE
if not initial_commit then GIT:write(string.format("from %s^0\n", from_ref)) end
GIT:write("deleteall\n")
+ if CONF.track_filemode then
+ GIT:write(string.format("M %o :%i %s\n", romode, nextmark, '.permissions.txt'))
+ end
local path, v
for path, v in pairs(all_files) do
local mode = v.mode
diff --git a/testing/aaudit/aaudit-refresh b/testing/aaudit/aaudit-refresh
index 6e400c5d8c..c2ff334b59 100755
--- a/testing/aaudit/aaudit-refresh
+++ b/testing/aaudit/aaudit-refresh
@@ -13,3 +13,4 @@ if ! git diff --quiet --exit-code master..import; then
git branch --quiet --force master import
fi
git branch --quiet -D import
+git gc --quiet --prune=now
diff --git a/testing/aaudit/aaudit.conf b/testing/aaudit/aaudit.conf
index cfecde6e36..5786225a40 100644
--- a/testing/aaudit/aaudit.conf
+++ b/testing/aaudit/aaudit.conf
@@ -4,6 +4,8 @@ notify_email = { "engineers@alpine.local" };
-- smtp_server = "<server>";
commit_message = "Changes";
+track_filemode = true;
+
no_track_files = {
"*/.git/*",
"*.apk-new",