summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarlo Landmeter <clandmeter@gmail.com>2011-05-03 15:42:55 +0200
committerCarlo Landmeter <clandmeter@gmail.com>2011-05-03 15:42:55 +0200
commitc45db670dcba4b81a023fd90ae741ccad323d551 (patch)
tree25cb2b649ea0f4bc043756bf428d86f41e69e7a3
parentcdca36a5778636c4e530e004dccb1b8fdec961af (diff)
downloadalpine_drupal_settings-c45db670dcba4b81a023fd90ae741ccad323d551.tar.bz2
alpine_drupal_settings-c45db670dcba4b81a023fd90ae741ccad323d551.tar.xz
2.2 introduces multi arch. this is quick hack to support x86_64
-rw-r--r--alpinelinux.module30
1 files changed, 24 insertions, 6 deletions
diff --git a/alpinelinux.module b/alpinelinux.module
index d7591c9..a62708c 100644
--- a/alpinelinux.module
+++ b/alpinelinux.module
@@ -45,11 +45,17 @@ function alpinelinux_settings($form) {
'#type' => 'fieldset',
'#title' => t('Alpine Linux settings'),
);
- $form['settings']['alpinelinux_latest_link'] = array(
+ $form['settings']['alpinelinux_latest_link_x86'] = array(
'#type' => 'textfield',
- '#title' => t('URL to latest releases file'),
+ '#title' => t('URL to latest x86 releases file'),
'#description' => t('A text file which holds information about Alpine Linux latest releases'),
- '#default_value' => variable_get('alpinelinux_latest_link', '')
+ '#default_value' => variable_get('alpinelinux_latest_link_x86', '')
+ );
+ $form['settings']['alpinelinux_latest_link_x86_64'] = array(
+ '#type' => 'textfield',
+ '#title' => t('URL to latest x86_64 releases file'),
+ '#description' => t('A text file which holds information about Alpine Linux latest releases'),
+ '#default_value' => variable_get('alpinelinux_latest_link_x86_64', '')
);
$form['settings']['alpinelinux_mirrors_link'] = array(
'#type' => 'textfield',
@@ -62,15 +68,27 @@ function alpinelinux_settings($form) {
}
function alpinelinux_latest_releases() {
- $latest = variable_get('alpinelinux_latest_link', '');
+ $latest = variable_get('alpinelinux_latest_link_x86', '');
+ $latest = file($latest);
+ $result = array();
+ if ($latest) {
+ foreach ($latest as $key => $line) {
+ $result[$key] = explode(" ", $line);
+ }
+ variable_set('alpinelinux_releases_x86', $result);
+ } else {
+ watchdog('alpine', 'Failed to get latest x86 alpine release information', array(), WATCHDOG_WARNING, NULL);
+ }
+ $latest = variable_get('alpinelinux_latest_link_x86_64', '');
$latest = file($latest);
+ $result = array();
if ($latest) {
foreach ($latest as $key => $line) {
$result[$key] = explode(" ", $line);
}
- variable_set('alpinelinux_releases', $result);
+ variable_set('alpinelinux_releases_x86_64', $result);
} else {
- watchdog('alpine', 'Failed to get latest alpine release information', array(), WATCHDOG_WARNING, NULL);
+ watchdog('alpine', 'Failed to get latest x86_64 alpine release information', array(), WATCHDOG_WARNING, NULL);
}
}