From faabfed88500eda66b46b639444a616446161e80 Mon Sep 17 00:00:00 2001 From: Jon Kliegman Date: Wed, 1 Sep 2010 09:39:44 -0400 Subject: [PATCH] Cause cros_workon to die rather than clobber local_manifest cros_workon would clobber local edits to local_manifest in many cases This is a quick fix to prevent it. The proper solution is to actually parse local_manifest as an XML doc and modify the DOM. Not play tricks with grep. BUG=chromium-os:6272 TEST=Ran cros_workon against missing local_manifest, auto-generated local_manifest, local_manifest with indented tags. local_manifest with multi-line tags and local_manifest with tags at all." + fi + sed -ne '/^[[:space:]]\+[^[:space:]]/q1' "${local_manifest}" + if [ $? -ne 0 ]; then + die "Your local manifest will be clobbered running cros_workon. You can not have any tags that span multiple lines or are indented." + fi + egrep -q "^[^<]" "${local_manifest}" + if [ $? -ne 1 ]; then + die "Your local manifest will be clobbered running cros_workon. You can not have any tags that span multiple lines" + fi + grep -v "