aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVikraman Choudhury <vikraman.choudhury@gmail.com>2011-06-19 23:55:12 +0530
committerVikraman Choudhury <vikraman.choudhury@gmail.com>2011-06-19 23:55:12 +0530
commit7b2d946e574b43d83198135991f7e9a813c1c5bc (patch)
tree2a37cc63f190d4a99d8e77b2bf00a3ee708be36c /overlay
parentupdate client to handle uuid and passwd (diff)
downloadgentoostats-7b2d946e574b43d83198135991f7e9a813c1c5bc.tar.gz
gentoostats-7b2d946e574b43d83198135991f7e9a813c1c5bc.tar.bz2
gentoostats-7b2d946e574b43d83198135991f7e9a813c1c5bc.zip
update ebuild
Diffstat (limited to 'overlay')
-rw-r--r--overlay/app-portage/gentoostats/Manifest2
-rw-r--r--overlay/app-portage/gentoostats/gentoostats-9999.ebuild17
2 files changed, 18 insertions, 1 deletions
diff --git a/overlay/app-portage/gentoostats/Manifest b/overlay/app-portage/gentoostats/Manifest
index 0837087..dae9b26 100644
--- a/overlay/app-portage/gentoostats/Manifest
+++ b/overlay/app-portage/gentoostats/Manifest
@@ -1 +1 @@
-EBUILD gentoostats-9999.ebuild 636 RMD160 9555c38818abc7142b20d355885408a07583c194 SHA1 c5350b519cec2e06835ccf4b2262b80f29913708 SHA256 66e98764eebc40f29b516926dc315632e86fb22e8f26a1beb0aa185be1731610
+EBUILD gentoostats-9999.ebuild 1156 RMD160 af4280c5a30113fad203deebe2ae5ec1903c9f03 SHA1 4469ad5120f689219f30bc375aa73e6f7d0f69c8 SHA256 7c51b32f7eee3567e46d1e02ab6531d6f0ae8248a411437517beb77b9ddf0475
diff --git a/overlay/app-portage/gentoostats/gentoostats-9999.ebuild b/overlay/app-portage/gentoostats/gentoostats-9999.ebuild
index d19a8ee..98ae89d 100644
--- a/overlay/app-portage/gentoostats/gentoostats-9999.ebuild
+++ b/overlay/app-portage/gentoostats/gentoostats-9999.ebuild
@@ -23,6 +23,8 @@ RDEPEND="${DEPEND}
>=app-portage/gentoolkit-0.3.0.2
dev-python/simplejson"
+AUTHFILE="${ROOT}"/etc/gentoostats/auth.cfg
+
src_compile() {
cd "client"
distutils_src_compile
@@ -35,4 +37,19 @@ src_install() {
pkg_postinst() {
distutils_pkg_postinst
+
+ if ! [ -f "${AUTHFILE}" ]; then
+ elog "Generating uuid and password in ${AUTHFILE}"
+ if ! [ -d "$(dirname "${AUTHFILE}")" ]; then
+ mkdir "$(dirname "${AUTHFILE}")"
+ fi
+ touch "${AUTHFILE}"
+ echo "[AUTH]" >> "${AUTHFILE}"
+ echo -n "UUID : " >> "${AUTHFILE}"
+ cat /proc/sys/kernel/random/uuid >> "${AUTHFILE}"
+ echo -n "PASSWD : " >> "${AUTHFILE}"
+ < /dev/urandom tr -dc a-zA-Z0-9 | head -c16 >> "${AUTHFILE}"
+ echo >> "${AUTHFILE}"
+ fi
+ chmod 0444 "${AUTHFILE}"
}