Ignore:
Timestamp:
Nov 5, 2013, 3:40:52 PM (11 years ago)
Author:
rybkin
Message:

See C.L. 511

File:
1 edited

Legend:

Unmodified
Added
Removed
  • CMT/HEAD/source/cmt_generators.cxx

    r628 r652  
    28412841  m_PACKAGEFULLNAME.set ("PACKAGEFULLNAME");
    28422842  m_ISLOCAL.set ("ISLOCAL");
     2843  m_ISINCLUDED.set ("ISINCLUDED");
    28432844
    28442845  packages_header_fragment.set ("packages_header");
     
    28542855  m_PACKAGEFULLNAME = "";
    28552856  m_ISLOCAL = "";
     2857  m_ISINCLUDED = "";
    28562858
    28572859  packages_header_fragment.reset ();
     
    28992901      if (!packages_header_fragment.copy (m_output_file, 1, &m_PACKAGE)) return;
    29002902
    2901       Project* cur = Project::get_current ();
     2903      const Project* p_cur (Project::get_current ());
    29022904      Use::UsePtrVector uses (Use::get_ordered_uses ());
    29032905      uses.push_back (&Use::current ());
     2906
     2907      Project::ConstProjectPtrVector path_exclusions;
     2908      Project::fill_exclusion (path_exclusions);
     2909
    29042910      cmt_string temp;
    29052911      for (int i = uses.size () - 1; i >= 0; i--)
    29062912        {
    29072913          Use* use = uses[i];
     2914
    29082915          if (use->discarded) continue;
    29092916          if (use->m_hidden) continue;
     
    29112918          if (use->get_package ()->is_cmt ()) continue;
    29122919
    2913           if (use->get_project () == cur)
    2914             m_ISLOCAL = "is_local";
    2915           else
    2916             m_ISLOCAL = "is_not_local";
     2920          const Project* up = use->get_project ();
     2921
     2922          m_ISLOCAL = "is_not_local";
     2923          if (p_cur)
     2924            {
     2925              if (up)
     2926                {
     2927                  if (up == p_cur)
     2928                    {
     2929                      m_ISLOCAL = "is_local";
     2930                    }
     2931                }
     2932              else
     2933                {
     2934                  if (use->get_realpath ().find (p_cur->get_cmtpath_real ()) == 0)
     2935                    {
     2936                      m_ISLOCAL = "is_local";
     2937                    }
     2938                }
     2939            }
     2940          else if (use == &Use::current ())
     2941            {
     2942              m_ISLOCAL = "is_local";
     2943            }
     2944
     2945          m_ISINCLUDED = "is_included";
     2946          for (int j = 0; j < path_exclusions.size (); j++)
     2947            {
     2948              const Project* sp = path_exclusions[j];
     2949              if (up)
     2950                {
     2951                  if (up == sp)
     2952                    {
     2953                      m_ISINCLUDED = "is_not_included";
     2954                    }
     2955                }
     2956              else
     2957                {
     2958                  if (use->get_realpath ().find (sp->get_cmtpath_real ()) == 0)
     2959                    {
     2960                      m_ISINCLUDED = "is_not_included";
     2961                    }
     2962                }
     2963            }
    29172964
    29182965          temp = use->get_full_path ();
     
    29272974              temp += "mgr";
    29282975              break;
     2976            default:
     2977              break;
    29292978            }
    29302979#ifdef WIN32
     
    29322981#endif
    29332982          m_PACKAGEMGRPATH = temp;
    2934           //      fprintf (m_output_file, "%s\n", temp.c_str());
    29352983
    29362984          temp = "";
     
    29563004#endif
    29573005          m_PACKAGEFULLNAME = temp;
    2958           //      fprintf (m_output_file, "%s\n", temp.c_str());
    29593006
    29603007          m_PACKAGE = use->get_package_name ();
     
    29913038            }
    29923039
    2993           if (!package_fragment.copy (m_output_file, 6,
     3040          if (!package_fragment.copy (m_output_file, 7,
    29943041                                      &m_PACKAGE, &m_PACKAGEPREFIX,
    29953042                                      &m_DEPENDENCIES,
    29963043                                      &m_PACKAGEMGRPATH, &m_PACKAGEFULLNAME,
    2997                                       &m_ISLOCAL)) return;
     3044                                      &m_ISLOCAL, &m_ISINCLUDED)) return;
    29983045        }
    29993046
     
    30163063
    30173064      CmtSystem::close_ostream (m_output_file, new_file_name);
    3018       //  fclose (m_output_file);
    30193065
    30203066      commit (new_file_name);
Note: See TracChangeset for help on using the changeset viewer.