@@ -935,8 +935,9 @@ def process(self, fields, about_file_path, running_inventory=False,
935935 errors = self .hydrate (fields )
936936 # We want to copy the license_files before the validation
937937 if reference_dir :
938- copy_license_notice_files (
938+ copy_err = copy_license_notice_files (
939939 fields , base_dir , reference_dir , afp )
940+ errors .extend (copy_err )
940941
941942 # TODO: why? we validate all fields, not only these hydrated
942943 validation_errors = validate_fields (
@@ -1278,21 +1279,26 @@ def copy_redist_src(abouts, location, output):
12781279 errors = []
12791280 for about in abouts :
12801281 if about .redistribute .value :
1282+ file_exist = True
12811283 for e in about .errors :
12821284 if 'Field about_resource' in e .message and 'not found' in e .message :
12831285 msg = e .message + u' and cannot be copied.'
12841286 errors .append (Error (CRITICAL , msg ))
1287+ file_exist = False
12851288 continue
1286- for k in about .about_resource .value :
1287- from_path = about .about_resource .value .get (k )
1288- norm_from_path = norm (from_path )
1289- relative_from_path = norm_from_path .partition (util .norm (location ))[2 ]
1290- # Need to strip the '/' to use the join
1291- if relative_from_path .startswith ('/' ):
1292- relative_from_path = relative_from_path .partition ('/' )[2 ]
1293- # Get the directory name of the output path
1294- output_dir = os .path .dirname (os .path .join (output , util .norm (relative_from_path )))
1295- copy_file (from_path , output_dir )
1289+ if file_exist :
1290+ for k in about .about_resource .value :
1291+ from_path = about .about_resource .value .get (k )
1292+ norm_from_path = norm (from_path )
1293+ relative_from_path = norm_from_path .partition (util .norm (location ))[2 ]
1294+ # Need to strip the '/' to use the join
1295+ if relative_from_path .startswith ('/' ):
1296+ relative_from_path = relative_from_path .partition ('/' )[2 ]
1297+ # Get the directory name of the output path
1298+ output_dir = os .path .dirname (os .path .join (output , util .norm (relative_from_path )))
1299+ err = copy_file (from_path , output_dir )
1300+ if err :
1301+ errors .extend (err )
12961302 return errors
12971303
12981304
0 commit comments