summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEudyptula <eitan@mosenkis.net>2009-08-04 18:00:13 -0400
committerEudyptula <eitan@mosenkis.net>2009-08-04 18:00:13 -0400
commitf2cda93f2641c73b4a80d1c761b6a787fe5b4233 (patch)
tree60da7545055dacc17eaa170c2c51ef4efef0ac73
parentWidespread cleanup - moved $conf, $death into $S; $S is given as arg to init_... (diff)
downloadingenue-f2cda93f2641c73b4a80d1c761b6a787fe5b4233.tar.gz
ingenue-f2cda93f2641c73b4a80d1c761b6a787fe5b4233.tar.bz2
ingenue-f2cda93f2641c73b4a80d1c761b6a787fe5b4233.zip
Started backend script to copy portage tree into image and configure portage
-rw-r--r--backend/modules/gentoo_portage/portage.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/backend/modules/gentoo_portage/portage.php b/backend/modules/gentoo_portage/portage.php
new file mode 100644
index 0000000..c09d4d7
--- /dev/null
+++ b/backend/modules/gentoo_portage/portage.php
@@ -0,0 +1,16 @@
+<?php
+start_internal_task('Set up portage in image');
+end_internal_task(0);
+start_internal_task('Copy portage tree into image');
+foreach (glob("{$S['conf']['portdir']}/*") as $from) {
+ $file=substr($from, strlen($S['conf']['portdir'])+1);
+ // Skip distfiles, binary packages, and potential overlay directories
+ if ($file == 'distfiles' || $file == 'packages' || $file == 'local' || $file == 'overlay') continue;
+ $cmd="cp -av -t '$I/usr/portage/' '$from'";
+ error_get_last();
+ @shell_exec($cmd);
+ log_status("$cmd", !(error_get_last()));
+}
+log_status("Symlink make.profile -> /usr/portage/profiles/{$headers['profile']}", symlink("/usr/portage/profiles/{$headers['profile']}", "$I/etc/make.profile"));
+end_internal_task(0);
+?>