autopkg / mosen-recipes

Recipes for osx application update management
MIT License
12 stars 20 forks source link

Recipe asks for Y/N #1

Open henningkessler opened 10 years ago

henningkessler commented 10 years ago

Hi mosen,

if try to run the FontExplorerXPro.munki recipe with following Override:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Identifier</key>
    <string>local.munki.FontExplorerXPro</string>
    <key>Input</key>
    <dict>
        <key>MUNKI_REPO_SUBDIR</key>
        <string>apps</string>
        <key>NAME</key>
        <string>FontExplorer X Pro</string>
        <key>CLIENT_LICENSE</key>
        <string>/Volumes/DS4600_RAID/Admin/ClientLicense.fcl</string>
    </dict>
    <key>ParentRecipe</key>
    <string>com.github.mosen.munki.FontExplorerXPro</string>
</dict>
</plist>

I will be asked if I accept the license agreement and the run stops there waiting for input:

[someone@server:/Volumes/DS4600_RAID/Admin]1050$ autopkg run -vv FontExplorerXPro.munki
Processing FontExplorerXPro.munki...
URLDownloader
{'Input': {'filename': u'FontExplorer X Pro.dmg',
           'url': u'http://www.fontexplorerx.com/download/free-trial/Mac'}}
URLDownloader: Item at URL is unchanged.
URLDownloader: Using existing /Users/someone/Library/AutoPkg/Cache/local.munki.FontExplorerXPro/downloads/FontExplorer X Pro.dmg
{'Output': {'pathname': u'/Users/someone/Library/AutoPkg/Cache/local.munki.FontExplorerXPro/downloads/FontExplorer X Pro.dmg'}}
EndOfCheckPhase
{'Input': {}}
{'Output': {}}
AppDmgVersioner
{'Input': {'dmg_path': u'/Users/someone/Library/AutoPkg/Cache/local.munki.FontExplorerXPro/downloads/FontExplorer X Pro.dmg'}}
Agree Y/N?

After entering "Y" the run proceeds and I am asked a second time

Agree Y/N? Y
AppDmgVersioner: Mounted disk image /Users/someone/Library/AutoPkg/Cache/local.munki.FontExplorerXPro/downloads/FontExplorer X Pro.dmg
AppDmgVersioner: BundleID: com.linotype.FontExplorerX
AppDmgVersioner: Version: 4.2.1
{'Output': {'app_name': u'FontExplorer X Pro.app',
            'bundleid': u'com.linotype.FontExplorerX',
            'version': u'4.2.1'}}
Copier
{'Input': {'destination_path': u'/Users/someone/Library/AutoPkg/Cache/local.munki.FontExplorerXPro/FontExplorer X Pro/FontExplorer X Pro.app',
           'overwrite': True,
           'source_path': u'/Users/someone/Library/AutoPkg/Cache/local.munki.FontExplorerXPro/downloads/FontExplorer X Pro.dmg/FontExplorer X Pro.app'}}
Agree Y/N? Y

And if I do subsequent runs it creates multiple packages and multiple packageinfos of the same version:

The following new items were imported:
    Name                     Version          Catalogs                         Pkginfo Path
    ----                     -------          --------                         ------------
    FontExplorer X Pro       4.2.1            testing                          apps/FontExplorer X Pro-4.2.1.plist
The following new items were imported:
    Name                     Version          Catalogs                         Pkginfo Path
    ----                     -------          --------                         ------------
    FontExplorer X Pro       4.2.1            testing                          apps/FontExplorer X Pro-4.2.1__1.plist

Is this the expected behavior or am I doing something terribly wrong?

gregneagle commented 10 years ago

On Oct 9, 2014, at 11:05 AM, henningkessler notifications@github.com wrote:

And if I do subsequent runs it creates multiple packages and multiple packageinfos of the same version:

The following new items were imported: Name Version Catalogs Pkginfo Path


FontExplorer X Pro 4.2.1 testing apps/FontExplorer X Pro-4.2.1.plist

The following new items were imported: Name Version Catalogs Pkginfo Path


FontExplorer X Pro 4.2.1 testing apps/FontExplorer X Pro-4.2.1__1.plist

Is this the expected behavior or am I doing something terribly wrong?

That, at least, is expected behavior if you don't run makecatalogs between autopkg imports. If the items are not in the catalogs, the MunkiImporter processor won't know they are the repo.

henningkessler commented 10 years ago

Oh sorry, I should have considered a bit longer before posting this part. Thank you for clarifying this.

gregneagle commented 10 years ago

On Oct 9, 2014, at 11:05 AM, henningkessler notifications@github.com wrote:

I will be asked if I accept the license agreement and the run stops there waiting for input: [someone@server:/Volumes/DS4600_RAID/Admin]1050$ autopkg run -vv FontExplorerXPro.munki Processing FontExplorerXPro.munki... URLDownloader {'Input': {'filename': u'FontExplorer X Pro.dmg', 'url': u'http://www.fontexplorerx.com/download/free-trial/Mac'}} URLDownloader: Item at URL is unchanged. URLDownloader: Using existing /Users/someone/Library/AutoPkg/Cache/local.munki.FontExplorerXPro/downloads/FontExplorer X Pro.dmg {'Output': {'pathname': u'/Users/someone/Library/AutoPkg/Cache/local.munki.FontExplorerXPro/downloads/FontExplorer X Pro.dmg'}} EndOfCheckPhase {'Input': {}} {'Output': {}} AppDmgVersioner {'Input': {'dmg_path': u'/Users/someone/Library/AutoPkg/Cache/local.munki.FontExplorerXPro/downloads/FontExplorer X Pro.dmg'}} Agree Y/N?

After entering "Y" the run proceeds and I am asked a second time As for this, the DmgMounter processor (of which the AppDmgVersioner processor is a subclass) should handle the license agreement for you:

https://github.com/autopkg/autopkg/blob/master/Code/autopkglib/DmgMounter.py#L109-L110

This is the same code used by Munki when mounting a disk image that has an embedded SLA.

Not sure why it's not working for you.

-Greg

mosen commented 10 years ago

Just a further unrelated note about the recipe - In 4.2.1 I see that I can't copy the license file into the bundle. Warnings about bundle modification. I'm using the server to distribute the client license, but I will investigate licensing the client as standalone, and where that license is installed.

henningkessler commented 10 years ago

My problem seams to be related to the OS version (10.6.8). I just made another test install on a VM with 10.6.8 and had the same effect...