diff --git a/fserver.drush.inc b/fserver.drush.inc index 99885a3..8c66322 100644 --- a/fserver.drush.inc +++ b/fserver.drush.inc @@ -22,15 +22,12 @@ function fserver_drush_command() { $items = array(); $items['fserver-status'] = array( - 'callback' => 'fserver_drush_status', 'description' => 'Determine the packaging status of a project.', ); $items['fserver-package'] = array( - 'callback' => 'fserver_drush_package', 'description' => 'Update packaging for a project.', ); $items['fserver-distro'] = array( - 'callback' => 'fserver_drush_distro', 'description' => 'Update packaging for a distribution.', ); return $items; @@ -53,7 +50,7 @@ function fserver_drush_help($section) { /** * Package new releases for a specified project or all. */ -function fserver_drush_package() { +function drush_fserver_package() { if (!drush_get_option('uri') && !drush_get_option('l')) { drush_die('You must use the --uri option to specify the location of this site.'); } @@ -94,7 +91,7 @@ function fserver_drush_package() { /** * Display project packaging status. */ -function fserver_drush_status() { +function drush_fserver_status() { $projects = _fserver_drush_get_projects(); // Filter the project list by the argument. @@ -276,7 +273,7 @@ class FserverProject { $packaging[] = "version = \"{$tag['version']}\""; $packaging = "\n" . implode("\n", $packaging); - $files = file_scan_directory($this->backend->path, '.info', $exclude_mask); + $files = file_scan_directory($this->backend->path, '.info$', $exclude_mask); foreach ($files as $path => $file) { // @TODO: Parse the info file or not? $info_file = file_get_contents($file->filename); @@ -348,23 +345,15 @@ class FserverProject_git { $this->init_wc(); // Retrieve tag info - _drush_shell_exec_output_set(' '); // Clear output cache. - drush_op('drush_shell_exec', "git --git-dir={$this->path}/.git show {$vc}"); + _drush_shell_exec_output_set(' '); // Clear output cache. + drush_op('drush_shell_exec', "git --git-dir={$this->path}/.git log -1 --pretty=format:%%ct {$vc}"); $info = drush_shell_exec_output(); - if ($info[0] == "tag {$vc}") { - $info = implode("\n", $info); - $info = explode("\n\n", $info); - list($basic, $commit, $message) = $info; - - $basic = explode("\n", $basic); - array_shift($basic); // Removes tag line - array_shift($basic); // Removes author line - - // Set timestamp on the tag - $date = array_shift($basic); - $date = strtotime(trim(substr($date, strpos($date, ':') + 1))); - $tag['timestamp'] = is_numeric($date) ? $date : time(); - } + $tag['timestamp'] = $info[0]; + drush_op('drush_shell_exec', "git --git-dir={$this->path}/.git tag -l {$vc} -n 1000"); + $info = drush_shell_exec_output(); + // Remove the tag from the first line of the message: + $info[0] = str_replace($vc, '', $info[0]); + $tag['message'] = implode("\n", $info); return $tag; } } @@ -381,7 +370,7 @@ class FserverProject_git { // Create the directory if it doesn't exist. if (file_check_directory($file_path, TRUE)) { $vc = $tag['original']; - drush_op('drush_shell_exec', "git --git-dir={$this->path}/.git checkout {$vc}"); + drush_op('drush_shell_exec', "git --git-dir={$this->path}/.git --work-tree={$this->path} checkout {$vc}"); $this->FserverProject->write_package_info($tag, array('.git')); drush_op('drush_shell_exec', "tar -Pcf - --exclude='.git' --transform='s,{$this->path},{$this->FserverProject->name},' {$this->path} | gzip > {$file_path}/{$base}.tgz"); @@ -564,7 +553,7 @@ function fserver_posix_groupname() { return NULL; } -function fserver_drush_distro() { +function drush_fserver_distro() { if (!drush_get_option('version')) { drush_die('No version supplied, please use --version to specify a version for your release.'); } diff --git a/fserver.info b/fserver.info index 93115b8..e0211ff 100644 --- a/fserver.info +++ b/fserver.info @@ -37,6 +37,6 @@ features[views][] = "fserver_projects" features[views][] = "fserver_release_lookup" features[views][] = "fserver_releases" features[views][] = "fserver_updates" -features[views_api][] = "api:3.0-alpha1" +features[views_api][] = "api:2" name = "Feature Server" package = "Features" diff --git a/fserver.module b/fserver.module index 1ae2f64..69fbe5c 100644 --- a/fserver.module +++ b/fserver.module @@ -97,32 +97,32 @@ function fserver_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) { function fserver_cck_options($type = 'core') { switch ($type) { case 'core': - return drupal_map_assoc(array('5.x', '6.x', '7.x')); - + $result = drupal_map_assoc(array('5.x', '6.x', '7.x')); + break; case 'major': $major = range(0, 50); unset($major[0]); - return $major; - + $result = $major; + break; case 'method': - return array( + $result = array( 0 => t('Manual upload'), 'git' => t('GIT repository tags'), 'svn' => t('SVN repository tags folder'), ); - + break; case 'patch': - return range(0, 50); - + $result = range(0, 50); + break; case 'recommended': - return array(t('Not recommended'), t('Recommended')); - + $result = array(t('Not recommended'), t('Recommended')); + break; case 'security': - return array(t('Not a security release'), t('Security release')); - + $result = array(t('Not a security release'), t('Security release')); + break; case 'type': // We don't use t() here as the update XML requires these strings to be uniform. - return array( + $result = array( // 'core' => 'Drupal project', 'profile' => 'Installation profiles', 'module' => 'Modules', @@ -131,6 +131,10 @@ function fserver_cck_options($type = 'core') { // 'translation' => 'Translations', ); } + + drupal_alter('fserver_cck_options', $result, $type); + + return $result; } /** diff --git a/fserver.views_default.inc b/fserver.views_default.inc index 2b9fcc4..037db2c 100644 --- a/fserver.views_default.inc +++ b/fserver.views_default.inc @@ -142,6 +142,7 @@ function fserver_views_default_views() { 'title' => '', 'description' => '', 'weight' => 0, + 'name' => 'navigation', )); $views[$view->name] = $view; @@ -895,6 +896,7 @@ function fserver_views_default_views() { 'title' => '', 'description' => '', 'weight' => 0, + 'name' => 'navigation', )); $views[$view->name] = $view; @@ -1418,6 +1420,82 @@ function fserver_views_default_views() { 'field' => 'field_fserver_redirect_value', 'relationship' => 'field_fserver_project_nid', ), + 'field_fserver_method_value' => array( + 'label' => 'Packaging method', + 'alter' => array( + 'alter_text' => 0, + 'text' => '', + 'make_link' => 0, + 'path' => '', + 'link_class' => '', + 'alt' => '', + 'prefix' => '', + 'suffix' => '', + 'target' => '', + 'help' => '', + 'trim' => 0, + 'max_length' => '', + 'word_boundary' => 1, + 'ellipsis' => 1, + 'html' => 0, + 'strip_tags' => 0, + ), + 'empty' => '', + 'hide_empty' => 0, + 'empty_zero' => 0, + 'link_to_node' => 0, + 'label_type' => 'widget', + 'format' => 'default', + 'multiple' => array( + 'group' => TRUE, + 'multiple_number' => '', + 'multiple_from' => '', + 'multiple_reversed' => FALSE, + ), + 'exclude' => 0, + 'id' => 'field_fserver_method_value', + 'table' => 'node_data_field_fserver_method', + 'field' => 'field_fserver_method_value', + 'relationship' => 'field_fserver_project_nid', + ), + 'field_fserver_repository_value' => array( + 'label' => 'Repository URL', + 'alter' => array( + 'alter_text' => 0, + 'text' => '', + 'make_link' => 0, + 'path' => '', + 'link_class' => '', + 'alt' => '', + 'prefix' => '', + 'suffix' => '', + 'target' => '', + 'help' => '', + 'trim' => 0, + 'max_length' => '', + 'word_boundary' => 1, + 'ellipsis' => 1, + 'html' => 0, + 'strip_tags' => 0, + ), + 'empty' => '', + 'hide_empty' => 0, + 'empty_zero' => 0, + 'link_to_node' => 0, + 'label_type' => 'widget', + 'format' => 'default', + 'multiple' => array( + 'group' => TRUE, + 'multiple_number' => '', + 'multiple_from' => '', + 'multiple_reversed' => FALSE, + ), + 'exclude' => 0, + 'id' => 'field_fserver_repository_value', + 'table' => 'node_data_field_fserver_repository', + 'field' => 'field_fserver_repository_value', + 'relationship' => 'field_fserver_project_nid', + ), )); $handler->override_option('sorts', array( 'release_tag' => array( @@ -1576,6 +1654,8 @@ function fserver_views_default_views() { 'link' => 'nid', 'type' => 'field_fserver_type_value', 'redirect' => 'field_fserver_redirect_value', + 'sourcecode_type' => 'field_fserver_method_value', + 'sourcecode_uri' => 'field_fserver_repository_value', ), 'release' => array( 'version_major' => 'field_fserver_versionmajor_value', @@ -1604,6 +1684,7 @@ function fserver_views_default_views() { 'title' => '', 'description' => '', 'weight' => 0, + 'name' => 'navigation', )); $handler->override_option('displays', array()); $handler->override_option('sitename_title', FALSE); diff --git a/views/fserver-updatexml.tpl.php b/views/fserver-updatexml.tpl.php index 60eb773..834a713 100644 --- a/views/fserver-updatexml.tpl.php +++ b/views/fserver-updatexml.tpl.php @@ -5,36 +5,30 @@