Permalink
Browse files

Flatten bundle plist structure a bit

  • Loading branch information...
1 parent 8f1fc21 commit ff9a1f2f374c3328d5e476b2330850c7f3db3950 @jeromebaum committed Aug 23, 2012
@@ -6,12 +6,7 @@
<string>com.jeromebaum.y2012.bundle.L0.Conditional</string>
<key>BundleName</key>
<string>Branch statement</string>
- <key>Contents</key>
- <array>
- <dict>
- <key>Template</key>
- <string>Template.jsont</string>
- </dict>
- </array>
+ <key>Template</key>
+ <string>Template.jsont</string>
</dict>
</plist>
@@ -6,14 +6,9 @@
<string>com.jeromebaum.y2012.bundle.L0.Empty</string>
<key>BundleName</key>
<string>Do nothing</string>
- <key>Contents</key>
- <array>
- <dict>
- <key>FinalTemplate</key>
- <string>Final.jsont</string>
- <key>Template</key>
- <string>Template.jsont</string>
- </dict>
- </array>
+ <key>FinalTemplate</key>
+ <string>Final.jsont</string>
+ <key>Template</key>
+ <string>Template.jsont</string>
</dict>
</plist>
@@ -6,12 +6,7 @@
<string>com.jeromebaum.y2012.bundle.L0.Include</string>
<key>BundleName</key>
<string>Include another bundle</string>
- <key>Contents</key>
- <array>
- <dict>
- <key>Template</key>
- <string>Template.jsont</string>
- </dict>
- </array>
+ <key>Template</key>
+ <string>Template.jsont</string>
</dict>
</plist>
@@ -6,14 +6,9 @@
<string>com.jeromebaum.y2012.bundle.L0.Shell</string>
<key>BundleName</key>
<string>Run shell command</string>
- <key>Contents</key>
- <array>
- <dict>
- <key>FinalTemplate</key>
- <string>Final.jsont</string>
- <key>Template</key>
- <string>Template.jsont</string>
- </dict>
- </array>
+ <key>FinalTemplate</key>
+ <string>Final.jsont</string>
+ <key>Template</key>
+ <string>Template.jsont</string>
</dict>
</plist>
@@ -6,14 +6,9 @@
<string>com.jeromebaum.y2012.bundle.L0.Text</string>
<key>BundleName</key>
<string>Output raw text</string>
- <key>Contents</key>
- <array>
- <dict>
- <key>FinalTemplate</key>
- <string>Final.jsont</string>
- <key>Template</key>
- <string>Template.jsont</string>
- </dict>
- </array>
+ <key>FinalTemplate</key>
+ <string>Final.jsont</string>
+ <key>Template</key>
+ <string>Template.jsont</string>
</dict>
</plist>
@@ -6,12 +6,7 @@
<string>com.jeromebaum.y2012.bundle.L1.EnsureWheelCanSudo</string>
<key>BundleName</key>
<string>Ensure that members of the wheel group can run sudo</string>
- <key>Contents</key>
- <array>
- <dict>
- <key>Template</key>
- <string>Template.jsont</string>
- </dict>
- </array>
+ <key>Template</key>
+ <string>Template.jsont</string>
</dict>
</plist>
@@ -6,12 +6,7 @@
<string>com.jeromebaum.y2012.bundle.L1.CheckHasLine</string>
<key>BundleName</key>
<string>Check whether the file has a matching line (grep)</string>
- <key>Contents</key>
- <array>
- <dict>
- <key>Template</key>
- <string>Template.jsont</string>
- </dict>
- </array>
+ <key>Template</key>
+ <string>Template.jsont</string>
</dict>
</plist>
@@ -6,12 +6,7 @@
<string>com.jeromebaum.y2012.bundle.L1.EnsureFile</string>
<key>BundleName</key>
<string>Ensure a file exists</string>
- <key>Contents</key>
- <array>
- <dict>
- <key>Template</key>
- <string>Template.jsont</string>
- </dict>
- </array>
+ <key>Template</key>
+ <string>Template.jsont</string>
</dict>
</plist>
@@ -6,12 +6,7 @@
<string>com.jeromebaum.y2012.bundle.L2.EnsureUserIsInGroup</string>
<key>BundleName</key>
<string>Ensure that the given user is in the given group</string>
- <key>Contents</key>
- <array>
- <dict>
- <key>Template</key>
- <string>Template.jsont</string>
- </dict>
- </array>
+ <key>Template</key>
+ <string>Template.jsont</string>
</dict>
</plist>
@@ -6,12 +6,7 @@
<string>com.jeromebaum.y2012.bundle.L2.CheckPackageInstalled</string>
<key>BundleName</key>
<string>Check whether the given package is installed</string>
- <key>Contents</key>
- <array>
- <dict>
- <key>Template</key>
- <string>Template.jsont</string>
- </dict>
- </array>
+ <key>Template</key>
+ <string>Template.jsont</string>
</dict>
</plist>
@@ -6,12 +6,7 @@
<string>com.jeromebaum.y2012.bundle.L2.EnsurePackageInstalled</string>
<key>BundleName</key>
<string>Ensure that the given package is installed</string>
- <key>Contents</key>
- <array>
- <dict>
- <key>Template</key>
- <string>Template.jsont</string>
- </dict>
- </array>
+ <key>Template</key>
+ <string>Template.jsont</string>
</dict>
</plist>
@@ -6,12 +6,7 @@
<string>com.jeromebaum.y2012.bundle.L2.EnsurePackagesInstalled</string>
<key>BundleName</key>
<string>Ensure that the given packages are installed</string>
- <key>Contents</key>
- <array>
- <dict>
- <key>Template</key>
- <string>Template.jsont</string>
- </dict>
- </array>
+ <key>Template</key>
+ <string>Template.jsont</string>
</dict>
</plist>
@@ -6,12 +6,7 @@
<string>com.jeromebaum.y2012.bundle.L2.CheckUserExists</string>
<key>BundleName</key>
<string>Check whether the given username exists</string>
- <key>Contents</key>
- <array>
- <dict>
- <key>Template</key>
- <string>Template.jsont</string>
- </dict>
- </array>
+ <key>Template</key>
+ <string>Template.jsont</string>
</dict>
</plist>
@@ -6,12 +6,7 @@
<string>com.jeromebaum.y2012.bundle.L2.EnsureUserExists</string>
<key>BundleName</key>
<string>Ensure that the given user exists</string>
- <key>Contents</key>
- <array>
- <dict>
- <key>Template</key>
- <string>Template.jsont</string>
- </dict>
- </array>
+ <key>Template</key>
+ <string>Template.jsont</string>
</dict>
</plist>
@@ -6,12 +6,7 @@
<string>com.jeromebaum.y2012.bundle.L2.EnsureUsersExist</string>
<key>BundleName</key>
<string>Ensure that the given users exist</string>
- <key>Contents</key>
- <array>
- <dict>
- <key>Template</key>
- <string>Template.jsont</string>
- </dict>
- </array>
+ <key>Template</key>
+ <string>Template.jsont</string>
</dict>
</plist>
@@ -6,12 +6,7 @@
<string>root</string>
<key>BundleName</key>
<string>Root bundle (just calls EnsureFile for testing)</string>
- <key>Contents</key>
- <array>
- <dict>
- <key>Template</key>
- <string>Template.jsont</string>
- </dict>
- </array>
+ <key>Template</key>
+ <string>Template.jsont</string>
</dict>
</plist>
View
@@ -52,11 +52,11 @@ def loadTemplate(filename):
bundles[bundleId] = { 'data': plist }
bundleDir = os.path.dirname(bPlist)
- templateName = plist['Contents'][0]['Template']
+ templateName = plist['Template']
templateName = os.path.join(bundleDir, templateName)
bundles[bundleId]['Template'] = loadTemplate(templateName)
- finalName = plist['Contents'][0].get('FinalTemplate', None)
+ finalName = plist.get('FinalTemplate', None)
if finalName:
finalName = os.path.join(bundleDir, finalName)
bundles[bundleId]['FinalTemplate'] = loadTemplate(finalName)

0 comments on commit ff9a1f2

Please sign in to comment.