Skip to content
This repository has been archived by the owner on Oct 25, 2022. It is now read-only.

Don't require nuspec name to match directory name #78

Closed
wants to merge 2 commits into from

Conversation

bdukes
Copy link

@bdukes bdukes commented May 12, 2017

My scenario is that I have multiple folders for the same package (beta or legacy versions), so I can't use the same folder name as the package for all of them.

Hope it helps. Thanks!

@bdukes
Copy link
Author

bdukes commented May 12, 2017

It looks like my scenario would ideally be handled via #74 in the future, but I still think this approach is worth allowing, as well.

@majkinetor
Copy link
Owner

majkinetor commented May 12, 2017

What is the problem in using $Latest.PackageName.

@bdukes
Copy link
Author

bdukes commented May 12, 2017

I didn't know that was an option, it looks like it fixes my issues.

Thanks!

@bdukes bdukes closed this May 12, 2017
@bdukes
Copy link
Author

bdukes commented May 12, 2017

Sorry, I spoke too soon. I still get the error "No nuspec file found in the package directory" if I specify PackageName (I had forgotten to revert these changes before testing with PackageName)

@bdukes bdukes reopened this May 12, 2017
@majkinetor
Copy link
Owner

Can you post a link to your code?

@majkinetor
Copy link
Owner

You must rename your nuspec file to match the folder name. Then it will work, with this

$Latest = @{ URL32 = $url32; URL64 = $url64; Version = $version; PackageName = 'imagemagick.app' }

Output:

1 [ M:0 D:1 A:0 ?:1 ]  17-05-16 20:47:23  C:\Work\_\Chocolatey-Packages\automatic\imagemagick.app - legacy
master~> .\update.ps1
imagemagick.app - legacy - checking updates using au version 2017.5.12.225800
URL check
  https://www.imagemagick.org/download/binaries/ImageMagick-6.9.8-5-Q16-x64-dll.exe
  https://www.imagemagick.org/download/binaries/ImageMagick-6.9.8-5-Q16-x86-dll.exe
nuspec version: 6.9.8.4
remote version: 6.9.8.5
New version is available
Automatic checksum started
Downloading imagemagick.app 32 bit
  from 'https://www.imagemagick.org/download/binaries/ImageMagick-6.9.8-5-Q16-x86-dll.exe'

Download of ImageMagick-6.9.8-5-Q16-x86-dll.exe (23,18 MB) completed.
Package downloaded and hash calculated for 32 bit version
Downloading imagemagick.app 64 bit
  from 'https://www.imagemagick.org/download/binaries/ImageMagick-6.9.8-5-Q16-x64-dll.exe'

Download of ImageMagick-6.9.8-5-Q16-x64-dll.exe (24,22 MB) completed.
Package downloaded and hash calculated for 64 bit version
Updating files
  $Latest data:
    Checksum32      (String)    21facd160eba82c062e0edefdd42a586a08404a68c7e0e772af9a15296a4dc54
    Checksum64      (String)    df623fe82898ae9445a7a9bf4beab7f2bd2b6f92d0efd66b19428dd6a1c13afb
    ChecksumType32  (String)    sha256
    ChecksumType64  (String)    sha256
    FileType        (String)    exe
    NuspecVersion   (String)    6.9.8.4
    PackageName     (String)    imagemagick.app
    URL32           (String)    https://www.imagemagick.org/download/binaries/ImageMagick-6.9.8-5-Q16-x86-dll.exe
    URL64           (String)    https://www.imagemagick.org/download/binaries/ImageMagick-6.9.8-5-Q16-x64-dll.exe
    Version         (String)    6.9.8.5

  imagemagick.app - legacy.nuspec
    setting id:  imagemagick.app
updating version: 6.9.8.4 -> 6.9.8.5
  tools\chocolateyInstall.ps1
    (^\s*url64\s*=\s*)('.*') = $1'https://www.imagemagick.org/download/binaries/ImageMagick-6.9.8-5-Q16-x64-dll.exe'
    (^\s*checksum64\s*=\s*)('.*') = $1'df623fe82898ae9445a7a9bf4beab7f2bd2b6f92d0efd66b19428dd6a1c13afb'
    (^\s*url\s*=\s*)('.*') = $1'https://www.imagemagick.org/download/binaries/ImageMagick-6.9.8-5-Q16-x86-dll.exe'
    (^\s*checksum\s*=\s*)('.*') = $1'21facd160eba82c062e0edefdd42a586a08404a68c7e0e772af9a15296a4dc54'
Package updated


Path          : C:\Work\_\Chocolatey-Packages\automatic\imagemagick.app - legacy
Name          : imagemagick.app
Updated       : True
Pushed        : False
RemoteVersion : 6.9.8.5
NuspecVersion : 6.9.8.4
Result        : {imagemagick.app - legacy - checking updates using au version 2017.5.12.225800, URL check,   https://www.imagemagick.org/download/binaries/ImageMagick-6.9.8-5-Q16-x64-dll.exe,
                   https://www.imagemagick.org/download/binaries/ImageMagick-6.9.8-5-Q16-x86-dll.exe...}
Error         :
NuspecPath    : C:\Work\_\Chocolatey-Packages\automatic\imagemagick.app - legacy\imagemagick.app - legacy.nuspec
NuspecXml     : #document



------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------2 [ M:2 D:1 A:0 ?:1 ]  17-05-16 20:50:01  C:\Work\_\Chocolatey-Packages\automatic\imagemagick.app - legacy
master~> ls


    Directory: C:\Work\_\Chocolatey-Packages\automatic\imagemagick.app - legacy


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
d-----       16.5.2017.     20:44                tools
-a----       16.5.2017.     20:49           2255 imagemagick.app - legacy.nuspec
-a----       16.5.2017.     20:50           5619 imagemagick.app.6.9.8.5.nupkg
-a----       16.5.2017.     20:47           1158 update.ps1


------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------3 [ M:2 D:1 A:0 ?:1 ]  17-05-16 20:50:40  C:\Work\_\Chocolatey-Packages\automatic\imagemagick.app - legacy

bdukes added a commit to bdukes/Chocolatey-Packages that referenced this pull request May 19, 2017
Per majkinetor/au#78 (comment), the nuspec name needs to match the package name, and the package name needs to be specified in the update script
@bdukes
Copy link
Author

bdukes commented May 19, 2017

Thanks for the assistance, I've got it working now.

@bdukes bdukes closed this May 19, 2017
@riezebosch
Copy link

Maybe something for the wiki, I suppose?

@majkinetor
Copy link
Owner

Probably belongs in docs. Would get outdated a bit with #74 but I am not sure if time will allow. If anybody wants to update the README.md now with this scenario I wouldn't mind PR.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants