Browse Source

Merge pull request #4852 from afishbeck/eclcmd-legacy

HPCC-9387 Add legacy import support to ecl publish, deploy, and run

Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 11 years ago
parent
commit
8a08f65c28
3 changed files with 11 additions and 3 deletions
  1. 4 0
      ecl/eclcmd/eclcmd_common.cpp
  2. 5 1
      ecl/eclcmd/eclcmd_common.hpp
  3. 2 2
      initfiles/etc/bash_completion/ecl

+ 4 - 0
ecl/eclcmd/eclcmd_common.cpp

@@ -369,6 +369,8 @@ public:
     void buildCmd(StringBuffer &cmdLine)
     {
         cmdLine.set("eclcc -E");
+        if (cmd.optLegacy)
+            cmdLine.append(" -legacy");
         appendOptPath(cmdLine, 'I', cmd.optImpPath.str());
         appendOptPath(cmdLine, 'L', cmd.optLibPath.str());
         if (cmd.optAttributePath.length())
@@ -557,6 +559,8 @@ eclCmdOptionMatchIndicator EclCmdWithEclTarget::matchCommandLineOption(ArgvItera
         return EclCmdOptionMatch;
     if (iter.matchFlag(optNoArchive, ECLOPT_ECL_ONLY))
         return EclCmdOptionMatch;
+    if (iter.matchFlag(optLegacy, ECLOPT_LEGACY) || iter.matchFlag(optLegacy, ECLOPT_LEGACY_DASH))
+        return EclCmdOptionMatch;
     if (iter.matchOption(optResultLimit, ECLOPT_RESULT_LIMIT))
         return EclCmdOptionMatch;
     if (iter.matchOption(optTargetCluster, ECLOPT_CLUSTER_DEPRECATED)||iter.matchOption(optTargetCluster, ECLOPT_CLUSTER_DEPRECATED_S))

+ 5 - 1
ecl/eclcmd/eclcmd_common.hpp

@@ -140,6 +140,8 @@ typedef IEclCommand *(*EclCommandFactory)(const char *cmdname);
 #define ECLOPT_IMP_PATH_S "-I"
 #define ECLOPT_MANIFEST "--manifest"
 #define ECLOPT_MANIFEST_DASH "-manifest"
+#define ECLOPT_LEGACY "--legacy"
+#define ECLOPT_LEGACY_DASH "-legacy"
 
 #define ECLOPT_VERBOSE "--verbose"
 #define ECLOPT_VERBOSE_S "-v"
@@ -236,7 +238,7 @@ public:
 class EclCmdWithEclTarget : public EclCmdCommon
 {
 public:
-    EclCmdWithEclTarget() : optNoArchive(false), optResultLimit((unsigned)-1)
+    EclCmdWithEclTarget() : optLegacy(false), optNoArchive(false), optResultLimit((unsigned)-1)
     {
     }
     virtual eclCmdOptionMatchIndicator matchCommandLineOption(ArgvIterator &iter, bool finalAttempt=false);
@@ -255,6 +257,7 @@ public:
             "   -Ipath                 Add path to locations to search for ecl imports\n"
             "   -Lpath                 Add path to locations to search for system libraries\n"
             "   --manifest             Specify path to manifest file\n"
+            "   --legacy               Use legacy import semantics (deprecated)\n"
         );
     }
 public:
@@ -268,6 +271,7 @@ public:
     IArrayOf<IEspNamedValue> debugValues;
     unsigned optResultLimit;
     bool optNoArchive;
+    bool optLegacy;
 };
 
 class EclCmdWithQueryTarget : public EclCmdCommon

+ 2 - 2
initfiles/etc/bash_completion/ecl

@@ -26,7 +26,7 @@
 _flag_option()
 {
     case "$1" in
-        "--help" | "-v" | "--verbose" | "--no-reload" | "--no-files" | "-A" | "--activate" | "-O" | "--overwrite" | "--ecl-only")
+        "--help" | "-v" | "--verbose" | "--no-reload" | "--no-files" | "-A" | "--activate" | "-O" | "--overwrite" | "--ecl-only" | "--legacy")
             echo 1
             ;;
         *)
@@ -150,7 +150,7 @@ _ecl_opts_packagemap()
 
 _ecl_opts_deploy()
 {
-    echo -n "-t= --target= -n= --name= --main= --ecl-only --limit= --snapshot= -sn="
+    echo -n "-t= --target= -n= --name= --main= --ecl-only --legacy --limit= --snapshot= -sn="
     echo -n "--wait= --manifest= "
 }