Normalize the product makefile path in inherit-product.
Some vendor product makefiles call $(inherit-product) on the same
product makefile with different paths, by using "../" in relative paths.
However inherit-product requires unique path as ID for a product
makefile, for bookkeeping purpose.
Normalize the product makefile path in inherit-product, if the path
contains "../".
Change-Id: I1a864ce120c713d8e79ec179213b9fc9352aba53
diff --git a/tools/normalize_path.py b/tools/normalize_path.py
index 1b3d42e..6c4d548 100755
--- a/tools/normalize_path.py
+++ b/tools/normalize_path.py
@@ -14,11 +14,16 @@
# See the License for the specific language governing permissions and
# limitations under the License.
"""
-Normalize and output paths read from stdin.
+Normalize and output paths from arguments, or stdin if no arguments provided.
"""
import os.path
import sys
+if len(sys.argv) > 1:
+ for p in sys.argv[1:]:
+ print os.path.normpath(p)
+ sys.exit(0)
+
for line in sys.stdin:
print os.path.normpath(line.strip())