From 9af711360c00af61fc3c74a4a79518402220f976 Mon Sep 17 00:00:00 2001 From: Carlo Landmeter Date: Mon, 11 Apr 2011 13:25:41 +0000 Subject: use correct tid in importer and use different timestamps for differnt repos --- apk_browser.module | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'apk_browser.module') diff --git a/apk_browser.module b/apk_browser.module index b49dc2b..79759aa 100644 --- a/apk_browser.module +++ b/apk_browser.module @@ -220,12 +220,11 @@ function apk_browser_import_apk() { $updated = array(); $added = array(); $skipped = '0'; - foreach ($repos as $repo) { + foreach ($repos as $id => $repo) { $apk_string = file_get_contents($repo['url']); //no need to update if apkindex is not changed $checksum = md5($apk_string); - $checksum_db = variable_get('apk_import_checksum', ''); - //print_r($checksum . '
' . $checksum_db. '
' . variable_get('apk_import_debug', '0')); + $checksum_db = variable_get('apk_import_checksum_'$id, ''); if (($debug == '1') || ($checksum != $checksum_db)) { if ($debug == '1') { watchdog('apk', 'APK importer running in debug mode!', array(), WATCHDOG_WARNING, NULL); @@ -262,7 +261,7 @@ function apk_browser_import_apk() { } } watchdog('apk', 'Added @added and updated @updated and skipped @skipped packages', array('@added' => count($added), '@updated' => count($updated), '@skipped' => $skipped), WATCHDOG_INFO, NULL); - variable_set('apk_import_checksum', $checksum); + variable_set('apk_import_checksum_'.$id, $checksum); } else { watchdog('apk', 'APK index is up-to-date', array(), WATCHDOG_INFO, NULL); } @@ -320,8 +319,8 @@ function apk_browser_add_apk($package, $arch_tid, $repo_tid) { break; } } - $node->taxonomy_apk_repo['und'][0]['tid'] = $repo->tid; - $node->taxonomy_apk_arch['und'][0]['tid'] = $arch->tid; + $node->taxonomy_apk_repo['und'][0]['tid'] = $repo_tid; + $node->taxonomy_apk_arch['und'][0]['tid'] = $arch_tid; $node = node_submit($node); node_save($node); //create a human path based on repo and arch -- cgit v1.2.3