diff options
Diffstat (limited to 'backend/modules/gentoo_portage/portage.php')
-rw-r--r-- | backend/modules/gentoo_portage/portage.php | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/backend/modules/gentoo_portage/portage.php b/backend/modules/gentoo_portage/portage.php index bcfa7d7..324a370 100644 --- a/backend/modules/gentoo_portage/portage.php +++ b/backend/modules/gentoo_portage/portage.php @@ -1,8 +1,8 @@ <?php -$file=glob(CACHE.'/portage/*.tar.bz2'); -if ($file) { - $file=array_reverse($file); - $file=$file[0]; +$r=query('SELECT * FROM `cache` WHERE `type`="portage"'); +if ($r->rowCount() > 0) { + $entry=new sql_cache_entry($r->fetch(PDO::FETCH_ASSOC)); + $file=CACHE."/$entry->file"; execute_command('Unpack portage snapshot', "tar -xvjpf '$file' -C '$imagedir/usr'"); } else { start_internal_task('Copy local portage tree to image'); @@ -13,6 +13,7 @@ if ($file) { $cmd="cp -av -t '$imagedir/usr/portage/' '$from'"; error_get_last(); @shell_exec($cmd); + // TODO something wrong with this end_internal task being in the foreach end_internal_task((int)(bool)error_get_last()); } end_internal_task(0); |