Changeset 317


Ignore:
Timestamp:
12/03/07 15:20:41 (17 years ago)
Author:
smasson
Message:

check possible errors related to wrong path definition

Location:
trunk/SRC
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/SRC/ForOldVersion/keep_compatibility.pro

    r281 r317  
    22; 
    33; @file_comments 
     4; For internal use of SAXO 
    45;   1) define key_forgetold = 1b - keyword_set(flag) 
    56;   2) remove all oldcm_used.pro found in !path 
    67;   3) define and create myuniquetmpdir and add it to !path 
    78;   4) copy oldcm_full(_empty) to myuniquetmpdir+'oldcm_used.pro' 
     9;   5) make sure that the common variables are correctly initialized. 
     10;   6) merge the online_help if possible... 
    811; 
    912; @categories 
     
    1619; cm_general 
    1720; 
    18 ; @restrictions 
    19 ; copy oldcm_full or oldcm_empty must be found in the !path. 
    20 ; dir must also be in the !path 
    21 ; 
    2221; @examples 
    23 ; IDL> keep_compatibility,0 
     22; keep_compatibility, 0 
    2423; 
    2524; @history 
     
    3736; 
    3837@cm_general 
     38; 
     39  IF n_elements(myuniquetmpdir) NE 0 THEN return 
    3940; 
    4041; version should be at least 6.0 
     
    5455; are we using gdl or idl?? 
    5556  defsysv, '!gdl', exist = key_gdl 
    56 ; 
    57   IF n_elements(myuniquetmpdir) NE 0 THEN BEGIN 
    58     !path = myuniquetmpdir + path_sep(/search_path) + !path 
    59     return 
    60   ENDIF 
    6157; 
    6258  if n_elements(flag) eq 0 then flag = 1b - keyword_set(key_forgetold) 
     
    9692  ENDIF 
    9793; 
    98 ; make sure that the common variables are correctly initialized. 
     94; 5) make sure that the common variables are correctly initialized. 
    9995; 
    10096  IF size(ccmeshparameters, /type) NE 8 THEN BEGIN 
     
    109105  ENDIF 
    110106; 
    111 ; merge the online_help if possible... 
     107; 6) merge the online_help if possible... 
    112108; 
    113109  mergeonline_help 
  • trunk/SRC/Utilities/def_myuniquetmpdir.pro

    r311 r317  
    4040; add it to !path 
    4141    !path = myuniquetmpdir + path_sep(/search_path) + !path 
     42; check that each element of !path is unique 
     43    splpath = strsplit(!path, path_sep(/search_path), /extract, count = ndir) 
     44    nouniq = different(lindgen(ndir), uniq(splpath, sort(splpath))) 
     45    IF nouniq[0] NE -1 THEN BEGIN 
     46      allpro = find('*.pro', iodirectory = !path, /onlypro) 
     47      nall = n_elements(allpro)  
     48      allpro = strmid(allpro, reform(strpos(allpro, '/', /reverse_search), 1, nall)+1) 
     49      nouniqpro = different(lindgen(nall), uniq(allpro, sort(allpro))) 
     50      IF nouniqpro[0] NE -1 THEN BEGIN  
     51        nouniqcnt = n_elements(nouniq) 
     52        nouniqprocnt = n_elements(nouniqpro) 
     53        text = ['', '   --- WARNING ---' $ 
     54                , 'Your !path contains '+strtrim(nouniqcnt, 1)+' duplicate elements' $ 
     55                , 'This can create bugs for files with the same name located in several directories ('+strtrim(nouniqprocnt, 1)+' found)'] 
     56        dummy = report(text) 
     57        text = ['', 'duplicate directories in the path:', splpath[nouniq[0:9 <(nouniqcnt-1)]]] 
     58        IF nouniqcnt GT 10 THEN text = [text, '...'] 
     59        dummy = report(text, /simple) 
     60        text = ['', 'files with the same name:', allpro[nouniqpro[0:9 <(nouniqprocnt-1)]]] 
     61        IF nouniqprocnt GT 10 THEN text = [text, '...', ''] 
     62        dummy = report(text, /simple) 
     63      ENDIF 
     64    ENDIF 
    4265  ENDIF 
    4366; 
Note: See TracChangeset for help on using the changeset viewer.