Index: connectors/l10n_drupalorg/l10n_drupalorg.admin.inc
===================================================================
RCS file: connectors/l10n_drupalorg/l10n_drupalorg.admin.inc
diff -N connectors/l10n_drupalorg/l10n_drupalorg.admin.inc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ connectors/l10n_drupalorg/l10n_drupalorg.admin.inc	15 Oct 2008 14:20:05 -0000
@@ -0,0 +1,75 @@
+<?php
+// $Id: l10n_drupalorg.module,v 1.1.2.8.2.3 2008/10/15 10:47:37 goba Exp $
+
+/**
+ * @file
+ *   Administration pages for localization community for drupal.org.
+ */
+
+// = Settings ==================================================================
+
+/**
+ * Settings form callback.
+ */
+function l10n_drupalorg_settings_form() {
+  $form = array();
+  $form['l10n_drupalorg_limit'] = array(
+    '#title' => t('Number of projects to scan at once'),
+    '#description' => t('The number of projects to scan on a manual or cron run. Scanning is synchronous, so you need to wait for the download to complete and Drupal to extract and parse the tarball content. If everything goes well, detailed data about the project and its releases, files, and translatable strings will be inserted into the database and become available for translation.'),
+    '#type' => 'select',
+    '#options' => drupal_map_assoc(array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 16, 18, 20)),
+    '#default_value' => variable_get('l10n_drupalorg_limit', 1),
+  );
+  $form['l10n_drupalorg_cron'] = array(
+    '#title' => t('Scan new projects on every cron run'),
+    '#type' => 'radios',
+    '#options' => array(t('Disabled'), t('Enabled')),
+    '#default_value' => variable_get('l10n_drupalorg_cron', 0),
+  );
+  return system_settings_form($form);
+}
+
+// = Project synchronization ===================================================
+
+/**
+ * Scans files of a project and release picked.
+ *
+ * @param $automated
+ *   TRUE if the execution was automated, so user feedback should
+ *   not be provided. FALSE otherwise.
+ *
+ * @todo
+ *   Do less HTTP queries! Look at ARCHITECTURE.txt for more information.
+ */
+function l10n_drupalorg_scan($automated = FALSE) {
+  include_once 'projects.inc';
+  include_once drupal_get_path('module', 'l10n_community') .'/extractor.inc';
+  
+  // Always update full project list.
+  l10n_drupalorg_sync_projects();
+  
+  // Pick the projects we did not update for the longest period and sync fresh release list.
+  $result = db_query_range("SELECT * FROM {l10n_community_project} WHERE connector_module = 'l10n_drupalorg' AND status = 1 ORDER BY last_parsed ASC", 0, variable_get('l10n_drupalorg_limit', 1));
+  while ($project = db_fetch_object($result)) {
+    l10n_drupalorg_sync_releases($project);
+    
+    // Pick the release we did not update for the longest period, and sync the tarball.
+    // We should only look for releases with downloads. Placeholder releases for later
+    // versions should not be considered.
+    $release = db_fetch_object(db_query_range("SELECT r.* FROM {l10n_community_project} p LEFT JOIN {l10n_community_release} r ON p.pid = r.pid WHERE p.pid = %d AND r.download_link != '' ORDER BY r.last_parsed ASC", $project->pid, 0, 1));
+    $result = l10n_drupalorg_sync_files($release);
+    
+    if (!$automated) {
+      // User feedback, if not automated. Log messages are already done.
+      if (isset($result['error'])) {
+        drupal_set_message($result['error'], 'error');
+      }
+      if (isset($result['message'])) {
+        drupal_set_message($result['message']);
+      }
+    }
+  }
+  
+  // Ensure that a Drupal page will be displayed with the messages.
+  return '';
+}
Index: connectors/l10n_drupalorg/l10n_drupalorg.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/l10n_server/connectors/l10n_drupalorg/Attic/l10n_drupalorg.module,v
retrieving revision 1.1.2.8.2.3
diff -u -p -r1.1.2.8.2.3 l10n_drupalorg.module
--- connectors/l10n_drupalorg/l10n_drupalorg.module	15 Oct 2008 10:47:37 -0000	1.1.2.8.2.3
+++ connectors/l10n_drupalorg/l10n_drupalorg.module	15 Oct 2008 14:20:05 -0000
@@ -17,7 +17,7 @@
 function l10n_drupalorg_help($path, $arg) {
   switch ($path) {
     case 'admin/l10n_server/l10n_drupalorg':
-      return '<p>'. t('The drupal.org localization community connector watches for new projects at drupal.org, downloads the new packages and extracts their translatable strings. Here you can set up the limits of how these operations are performed. The <a href="@scan_link">Scan tab</a> allows you to initiate a manual scan.', array('@scan_link' => url('admin/l10n_server/l10n_drupalorg/scan'))) .'</p>';
+      return '<p>'. t('The drupal.org localization community connector watches for new releases of projects at drupal.org, downloads the new packages and extracts their translatable strings. Here you can set up the limits of how these operations are performed. The <a href="@scan_link">Scan tab</a> allows you to initiate a manual scan.', array('@scan_link' => url('admin/l10n_server/l10n_drupalorg/scan'))) .'</p>';
   }
 }
 
@@ -32,6 +32,7 @@ function l10n_drupalorg_menu() {
     'access arguments' => array('administer localization community for drupal.org'),
     'page callback' => 'drupal_get_form',
     'page arguments' => array('l10n_drupalorg_settings_form'),
+    'file' => 'l10n_drupalorg.admin.inc',
   );
   $items['admin/l10n_server/l10n_drupalorg/configure'] = array(
     'title' => 'Configure',
@@ -41,6 +42,7 @@ function l10n_drupalorg_menu() {
     'title' => 'Scan',
     'access arguments' => array('administer localization community for drupal.org'),
     'page callback' => 'l10n_drupalorg_scan',
+    'file' => 'l10n_drupalorg.admin.inc',
     'type' => MENU_LOCAL_TASK
   );
   return $items;
@@ -61,71 +63,3 @@ function l10n_drupalorg_cron() {
     l10n_drupalorg_scan(TRUE);
   }
 }
-
-// = Settings ==================================================================
-
-/**
- * Settings form callback.
- */
-function l10n_drupalorg_settings_form() {
-  $form = array();
-  $form['l10n_drupalorg_limit'] = array(
-    '#title' => t('Number of projects to scan at once'),
-    '#description' => t('The number of projects to scan on a manual or cron run. Scanning is synchronous, so you need to wait for the download to complete and Drupal to extract and parse the tarball content. If everything goes well, detailed data about the project and its releases, files, and translatable strings will be inserted into the database and become available for translation.'),
-    '#type' => 'select',
-    '#options' => drupal_map_assoc(array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 16, 18, 20)),
-    '#default_value' => variable_get('l10n_drupalorg_limit', 1),
-  );
-  $form['l10n_drupalorg_cron'] = array(
-    '#title' => t('Scan new projects on every cron run'),
-    '#type' => 'radios',
-    '#options' => array(t('Disabled'), t('Enabled')),
-    '#default_value' => variable_get('l10n_drupalorg_cron', 0),
-  );
-  return system_settings_form($form);
-}
-
-// = Project synchronization ===================================================
-
-/**
- * Scans files of a project and release picked.
- *
- * @param $automated
- *   TRUE if the execution was automated, so user feedback should
- *   not be provided. FALSE otherwise.
- *
- * @todo
- *   Do less HTTP queries! Look at ARCHITECTURE.txt for more information.
- */
-function l10n_drupalorg_scan($automated = FALSE) {
-  include_once 'projects.inc';
-  include_once drupal_get_path('module', 'l10n_community') .'/extractor.inc';
-  
-  // Always update full project list.
-  l10n_drupalorg_sync_projects();
-  
-  // Pick the projects we did not update for the longest period and sync fresh release list.
-  $result = db_query_range("SELECT * FROM {l10n_community_project} WHERE connector_module = 'l10n_drupalorg' ORDER BY last_parsed ASC", 0, variable_get('l10n_drupalorg_limit', 1));
-  while ($project = db_fetch_object($result)) {
-    l10n_drupalorg_sync_releases($project);
-    
-    // Pick the release we did not update for the longest period, and sync the tarball.
-    // We should only look for releases with downloads. Placeholder releases for later
-    // versions should not be considered.
-    $release = db_fetch_object(db_query_range("SELECT r.* FROM {l10n_community_project} p LEFT JOIN {l10n_community_release} r ON p.pid = r.pid WHERE p.pid = %d AND r.download_link != '' ORDER BY r.last_parsed ASC", $project->pid, 0, 1));
-    $result = l10n_drupalorg_sync_files($release);
-    
-    if (!$automated) {
-      // User feedback, if not automated. Log messages are already done.
-      if (isset($result['error'])) {
-        drupal_set_message($result['error'], 'error');
-      }
-      if (isset($result['message'])) {
-        drupal_set_message($result['message']);
-      }
-    }
-  }
-  
-  // Ensure that a Drupal page will be displayed with the messages.
-  return '';
-}
Index: connectors/l10n_drupalorg/projects.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/l10n_server/connectors/l10n_drupalorg/Attic/projects.inc,v
retrieving revision 1.1.2.6.2.1
diff -u -p -r1.1.2.6.2.1 projects.inc
--- connectors/l10n_drupalorg/projects.inc	15 Oct 2008 10:47:37 -0000	1.1.2.6.2.1
+++ connectors/l10n_drupalorg/projects.inc	15 Oct 2008 14:20:06 -0000
@@ -41,6 +41,10 @@ function l10n_drupalorg_sync_projects() 
   foreach ($projects as $uri => $project) {
     if ($existing_project = db_fetch_object(db_query("SELECT * FROM {l10n_community_project} WHERE uri = '%s'", $uri))) {
       if ($existing_project->connector_module == 'l10n_drupalorg') {
+        if ($existing_project->status == 0) {
+          // Skip this project if it is disabled.
+          continue;
+        }
         if ($project->title != $existing_project->title) {
           // Update if title is different (uri should not change, other data is
           // internal). Also set the parsed timestamp to the past, so we will
@@ -53,14 +57,14 @@ function l10n_drupalorg_sync_projects() 
         $t_args = array('%uri' => $uri, '%other_connector' => $existing_project->connector_module, '%this_connector' => 'l10n_drupalorg');
         watchdog('l10n_drupalorg', 'An existing project under the URI %uri is already handled by the %other_connector module. Not possible to add it with %this_connector.', $t_args);
         drupal_set_message(t('An existing project under the URI %uri is already handled by the %other_connector module. Not possible to add it with %this_connector.', $t_args), 'error');
-        return;
+        continue;
       }
     }
     else {
       // New project, not recorded before.
       db_query(
-        "INSERT INTO {l10n_community_project} (uri, title, last_parsed, home_link, connector_module) VALUES ('%s', '%s', %d, '%s', '%s')",
-        $uri, $project->title, 0, $project->link, 'l10n_drupalorg'
+        "INSERT INTO {l10n_community_project} (uri, title, last_parsed, home_link, connector_module, status) VALUES ('%s', '%s', %d, '%s', '%s', %d)",
+        $uri, $project->title, 0, $project->link, 'l10n_drupalorg', 1
       );
     }
   }
Index: connectors/l10n_localpacks/l10n_localpacks.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/l10n_server/connectors/l10n_localpacks/Attic/l10n_localpacks.module,v
retrieving revision 1.1.2.9.2.2
diff -u -p -r1.1.2.9.2.2 l10n_localpacks.module
--- connectors/l10n_localpacks/l10n_localpacks.module	15 Oct 2008 10:47:37 -0000	1.1.2.9.2.2
+++ connectors/l10n_localpacks/l10n_localpacks.module	15 Oct 2008 14:20:06 -0000
@@ -164,33 +164,41 @@ function l10n_localpacks_scan($automated
     }        
   }
   
-  for ($i = 0; $i < variable_get('l10n_localpacks_limit', 1); $i++) { 
-    // Pick the release we did not update for the longest period, and parse the tarball.
-    $release = db_fetch_object(db_query_range("SELECT * FROM {l10n_community_release} ORDER BY last_parsed ASC", 0, 1));
+  $user_feedback = FALSE;
+  $results = db_query_range("SELECT * FROM {l10n_community_release} WHERE pid IN (SELECT pid FROM {l10n_community_project} WHERE connector_module = 'l10n_localpacks' AND status = 1) ORDER BY last_parsed ASC", 0, variable_get('l10n_localpacks_limit', 1));
+  while ($release = db_fetch_object($results)) {
     
-    // Only parse file if something changes since we last parsed it.
+    // Only parse file if something changed since we last parsed it.
     $file_name = $workdir .'/'. $release->download_link;
-    if (filemtime($file_name) > $release->last_parsed) {
-      include_once drupal_get_path('module', 'l10n_community') .'/extractor.inc';
-      $result = l10n_community_parse_package($file_name, $release->rid);
-    }
-    else {
-      $result['message'] .= t('@release was already parsed, no need to scan again.', array('@release' => $release->download_link));
-      // Hackish update of last parsed time so other tarballs will get into the queue too.
-      // @todo: work on something better for this.
-      db_query("UPDATE {l10n_community_release} SET last_parsed = %d WHERE rid = %d", time(), $release->rid);
-    }
-    
-    if (!$automated) {
-      // User feedback, if not automated. Log messages are already done.
-      // @todo: these swallow all but the latest message. Needs fixing.
-      if (isset($result['error'])) {
-        drupal_set_message($result['error'], 'error');
+
+    if (file_exists($file_name)) {
+      if (filemtime($file_name) > $release->last_parsed) {
+        include_once drupal_get_path('module', 'l10n_community') .'/extractor.inc';
+        $result = l10n_community_parse_package($file_name, $release->rid);
+
+        // User feedback, if not automated. Log messages are already done.
+        if (isset($result['error']) && !$automated) {
+          $user_feedback = TRUE;
+          drupal_set_message($result['error'], 'error');
+        }
+        elseif (isset($result['message']) && !$automated) {
+          $user_feedback = TRUE;
+          drupal_set_message($result['message']);
+        }
       }
-      if (isset($result['message'])) {
-        drupal_set_message($result['message']);
+      else {
+        if (!$automated) {
+          $user_feedback = TRUE;
+          drupal_set_message(t('@release was already parsed, no need to scan again.', array('@release' => $release->download_link)));
+        }
       }
     }
+    // Hackish update of last parsed time so other tarballs will get into the queue too.
+    // @todo: work on something better for this.
+    db_query("UPDATE {l10n_community_release} SET last_parsed = %d WHERE rid = %d", time(), $release->rid);
+  }
+  if (!$automated && !$user_feedback) {
+    drupal_set_message(t('No (new) local packages found to scan in %workdir.', array('%workdir' => $workdir)));
   }
   
   // Ensure that a Drupal page will be displayed with the messages.
@@ -216,6 +224,10 @@ function l10n_localpacks_save_data($proj
   // Save project information first.
   if ($existing_project = db_fetch_object(db_query("SELECT * FROM {l10n_community_project} WHERE uri = '%s'", $project_uri))) {
     if ($existing_project->connector_module == 'l10n_localpacks') {
+      if ($existing_project->status == 0) {
+        // Skip this project if it is disabled.
+        return;
+      }
       // No need to update home_link here, as uri is not changed, and we base home_link on the uri.
       db_query("UPDATE {l10n_community_project} SET title = '%s' WHERE uri = '%s' AND connector_module = 'l10n_localpacks'", $project_title, $project_uri);
     }
@@ -229,8 +241,8 @@ function l10n_localpacks_save_data($proj
   }
   else {
     db_query(
-      "INSERT INTO {l10n_community_project} (uri, title, last_parsed, home_link, connector_module) VALUES ('%s', '%s', %d, '%s', '%s')",
-      $project_uri, $project_title, 0, (variable_get('l10n_localpacks_home_link', 0) ? ('http://drupal.org/project/'. $project_uri) : ''), 'l10n_localpacks'
+      "INSERT INTO {l10n_community_project} (uri, title, last_parsed, home_link, connector_module, status) VALUES ('%s', '%s', %d, '%s', '%s', %d)",
+      $project_uri, $project_title, 0, (variable_get('l10n_localpacks_home_link', 0) ? ('http://drupal.org/project/'. $project_uri) : ''), 'l10n_localpacks', 1
     );
   }
   
Index: l10n_community/l10n_community.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/l10n_server/l10n_community/Attic/l10n_community.install,v
retrieving revision 1.1.2.11.2.3
diff -u -p -r1.1.2.11.2.3 l10n_community.install
--- l10n_community/l10n_community.install	15 Oct 2008 10:47:37 -0000	1.1.2.11.2.3
+++ l10n_community/l10n_community.install	15 Oct 2008 14:20:06 -0000
@@ -62,6 +62,11 @@ function l10n_community_schema() {
         'type' => 'varchar',
         'length' => '50',
         'not null' => TRUE,
+      ),
+      'status' => array(
+        'description' => t('Status flag. 1 if new project releases should be looked for, 0 if new scanning and parsing is disabled.'),
+        'type' => 'int',
+        'not null' => TRUE,
       )
     ),
     'primary key' => array('pid'),
@@ -455,3 +460,16 @@ function l10n_community_update_6000() {
 
   return $ret;
 }
+
+/**
+ * Add support for enabled and disabled projects.
+ *
+ * Disabled projects will not participate in the scanning process.
+ */
+function l10n_community_update_6001() {
+  $ret = array();
+  db_add_field($ret, 'l10n_community_project', 'status', array('type' => 'int', 'not null' => TRUE));
+  // Make all existing projects enabled.
+  $ret[] = update_sql("UPDATE {l10n_community_project} SET status = 1");
+  return $ret;
+}
