From 7015338aef3ac6fa9e0c9f280a6512d8395dfce5 Mon Sep 17 00:00:00 2001 From: Brandon Philips Date: Mon, 7 Apr 2014 09:56:57 -0700 Subject: [PATCH] fix(initialize): don't quote version or ID The update_engine parsing and XML generation code is very naive. Instead of trying to implement a correct parser and generater in C++ just generate a file that doesn't have quote's around fields that we know won't have spaces. --- initialize/oem.go | 4 ++-- initialize/oem_test.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/initialize/oem.go b/initialize/oem.go index b7f3d6c..7fe1fd6 100644 --- a/initialize/oem.go +++ b/initialize/oem.go @@ -18,9 +18,9 @@ type OEMRelease struct { func (oem *OEMRelease) String() string { fields := []string{ - fmt.Sprintf("ID=%q", oem.ID), + fmt.Sprintf("ID=%s", oem.ID), + fmt.Sprintf("VERSION_ID=%s", oem.VersionID), fmt.Sprintf("NAME=%q", oem.Name), - fmt.Sprintf("VERSION_ID=%q", oem.VersionID), fmt.Sprintf("HOME_URL=%q", oem.HomeURL), fmt.Sprintf("BUG_REPORT_URL=%q", oem.BugReportURL), } diff --git a/initialize/oem_test.go b/initialize/oem_test.go index 50ebaee..1ef10d4 100644 --- a/initialize/oem_test.go +++ b/initialize/oem_test.go @@ -42,9 +42,9 @@ func TestOEMReleaseWrittenToDisk(t *testing.T) { t.Fatalf("Unable to read expected file: %v", err) } - expect := `ID="rackspace" + expect := `ID=rackspace +VERSION_ID=168.0.0 NAME="Rackspace Cloud Servers" -VERSION_ID="168.0.0" HOME_URL="https://www.rackspace.com/cloud/servers/" BUG_REPORT_URL="https://github.com/coreos/coreos-overlay" `