Index: includes/common.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/common.inc,v
retrieving revision 1.674
diff -u -r1.674 common.inc
--- includes/common.inc	13 Jul 2007 20:07:14 -0000	1.674
+++ includes/common.inc	15 Jul 2007 14:44:56 -0000
@@ -1589,8 +1589,12 @@
  *   The name of the CSS file.
  */
 function drupal_build_css_cache($types, $filename) {
-  $data = '';
-
+  $data = '';  
+ 
+  $file_header  = "/**\n";
+  $file_header .= " * The below content is aggregated from the following files.\n";
+  $file_header .= " * For licensing information please look in the original files.\n *\n";
+  
   // Create the css/ within the files folder.
   $csspath = file_create_path('css');
   file_check_directory($csspath, FILE_CREATE_DIRECTORY);
@@ -1608,6 +1612,8 @@
           $contents = preg_replace('/@import\s+(?!url)[\'"]?(\S*)\b[\'"]?/i', '@import url("\1")', $contents);
           // Fix all paths within this CSS file, ignoring absolute paths.
           $data .= preg_replace('/url\(([\'"]?)(?![a-z]+:)/i', 'url(\1'. $path . '\2', $contents);
+          // Add the url to the aggregated file.
+          $file_header .= ' * '. $GLOBALS['base_url'] .'/'. $file ."\n";
         }
       }
     }
@@ -1625,9 +1631,12 @@
       /\*([^*\\\\]|\*(?!/))+\*/ |   # Remove comments that are not CSS hacks.
       [\n\r]                        # Remove line breaks.
       >x', '\1', $data);
-
+    
+    // Close the comment that list the aggregated files.
+    $file_header .= " */\n";
+    
     // Create the CSS file.
-    file_save_data($data, $csspath .'/'. $filename, FILE_EXISTS_REPLACE);
+    file_save_data($file_header . $data, $csspath .'/'. $filename, FILE_EXISTS_REPLACE);
   }
   return $csspath .'/'. $filename;
 }
@@ -1826,9 +1835,13 @@
  * @return
  *   The name of the JS file.
  */
-function drupal_build_js_cache($files, $filename) {
-  $contents = '';
-
+function drupal_build_js_cache($files, $filename) {  
+  $contents   = '';  
+  
+  $file_header  = "/**\n";
+  $file_header .= " * The below content is aggregated from the following files.\n";
+  $file_header .= " * For licensing information please look in the original files.\n *\n";
+  
   // Create the js/ within the files folder.
   $jspath = file_create_path('js');
   file_check_directory($jspath, FILE_CREATE_DIRECTORY);
@@ -1837,13 +1850,16 @@
     // Build aggregate JS file.
     foreach ($files as $path => $info) {
       if ($info['preprocess']) {
+        // Add the url to the aggregated file.
+        $file_header .= ' * '. $GLOBALS['base_url'] .'/'. $path ."\n";
         // Append a ';' after each JS file to prevent them from running together.
         $contents .= _drupal_compress_js(file_get_contents($path). ';');
       }
     }
-
+    // Close the comment that list the aggregated files.
+    $file_header .= " */\n";
     // Create the JS file.
-    file_save_data($contents, $jspath .'/'. $filename, FILE_EXISTS_REPLACE);
+    file_save_data($file_header . $contents, $jspath .'/'. $filename, FILE_EXISTS_REPLACE);
   }
 
   return $jspath .'/'. $filename;
