diff options
author | Carlo Landmeter <clandmeter@gmail.com> | 2011-04-11 13:25:41 +0000 |
---|---|---|
committer | Carlo Landmeter <clandmeter@gmail.com> | 2011-04-11 13:25:41 +0000 |
commit | 9af711360c00af61fc3c74a4a79518402220f976 (patch) | |
tree | 67fdde03ace61a9eac948143b9e19435945f3ec4 | |
parent | 742e04bb13f24402d27757c8fb9f544474da51d7 (diff) | |
download | apk_browser-9af711360c00af61fc3c74a4a79518402220f976.tar.bz2 apk_browser-9af711360c00af61fc3c74a4a79518402220f976.tar.xz |
use correct tid in importer and use different timestamps for differnt repos
-rw-r--r-- | apk_browser.module | 11 |
1 files changed, 5 insertions, 6 deletions
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 . '<br>' . $checksum_db. '<br>' . 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 |