diff options
author | 2011-08-19 01:13:34 +0530 | |
---|---|---|
committer | 2011-08-19 01:13:34 +0530 | |
commit | 287df17a00eaf4349d7bb04ccc12b060f37255eb (patch) | |
tree | 03b16975e7e8cb12c7b653852eec3963a2134d4c | |
parent | add barcharts for /arch and /keyword (diff) | |
download | gentoostats-287df17a00eaf4349d7bb04ccc12b060f37255eb.tar.gz gentoostats-287df17a00eaf4349d7bb04ccc12b060f37255eb.tar.bz2 gentoostats-287df17a00eaf4349d7bb04ccc12b060f37255eb.zip |
fixes by antarus
-rw-r--r-- | overlay/app-portage/gentoostats/Manifest | 2 | ||||
-rw-r--r-- | overlay/app-portage/gentoostats/gentoostats-9999.ebuild | 19 |
2 files changed, 17 insertions, 4 deletions
diff --git a/overlay/app-portage/gentoostats/Manifest b/overlay/app-portage/gentoostats/Manifest index 1fc6430..b9d8459 100644 --- a/overlay/app-portage/gentoostats/Manifest +++ b/overlay/app-portage/gentoostats/Manifest @@ -1 +1 @@ -EBUILD gentoostats-9999.ebuild 1319 RMD160 e6dabb21e90207c85c12a3140fb227602f7b6911 SHA1 8d9ee7a60453a09529e6f7f7d2866987fdf1494f SHA256 cae18e0b8b29eb3c374be5ff313593ffecc0f9e4bad07be174dd3fb9fdc3afb2 +EBUILD gentoostats-9999.ebuild 1745 RMD160 b166ed97e35be943cab17d9a232ab0322fa52d36 SHA1 e7727aa3c58d7713f20b0787e5c5544fbaaae880 SHA256 01c3bb3a9cfc6dbc25d20a4b1b4ec223cf6a428ba38a5a98f6d7779a3b1c1927 diff --git a/overlay/app-portage/gentoostats/gentoostats-9999.ebuild b/overlay/app-portage/gentoostats/gentoostats-9999.ebuild index 30892e9..2a3c666 100644 --- a/overlay/app-portage/gentoostats/gentoostats-9999.ebuild +++ b/overlay/app-portage/gentoostats/gentoostats-9999.ebuild @@ -25,12 +25,12 @@ RDEPEND="${DEPEND} dev-python/simplejson" src_compile() { - cd "client" + pushd "client" distutils_src_compile } src_install() { - cd "client" + pushd "client" distutils_src_install dodir /etc/gentoostats || die @@ -42,6 +42,19 @@ src_install() { fperms 0640 /etc/gentoostats/payload.cfg || die } +generate_uuid() { + if [[ -e /proc/sys/kernel/random/uuid ]]; then + cat /proc/sys/kernel/random/uuid + else + AUTH1=$(< /dev/urandom tr -dc a-zA-Z0-9 | head -c8) + AUTH2=$(< /dev/urandom tr -dc a-zA-Z0-9 | head -c4) + AUTH3=$(< /dev/urandom tr -dc a-zA-Z0-9 | head -c4) + AUTH4=$(< /dev/urandom tr -dc a-zA-Z0-9 | head -c4) + AUTH5=$(< /dev/urandom tr -dc a-zA-Z0-9 | head -c12) + echo "${AUTH1}-${AUTH2}-${AUTH3}-${AUTH4}-${AUTH5}" + fi +} + pkg_postinst() { distutils_pkg_postinst @@ -51,7 +64,7 @@ pkg_postinst() { touch "${AUTHFILE}" echo "[AUTH]" >> "${AUTHFILE}" echo -n "UUID : " >> "${AUTHFILE}" - cat /proc/sys/kernel/random/uuid >> "${AUTHFILE}" + generate_uuid >> "${AUTHFILE}" echo -n "PASSWD : " >> "${AUTHFILE}" < /dev/urandom tr -dc a-zA-Z0-9 | head -c16 >> "${AUTHFILE}" fi |