Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Choco shows pretty old version 3.1.0 of scc #508

Open
ahoehma opened this issue Sep 11, 2024 · 9 comments
Open

Choco shows pretty old version 3.1.0 of scc #508

ahoehma opened this issue Sep 11, 2024 · 9 comments
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed

Comments

@ahoehma
Copy link

ahoehma commented Sep 11, 2024

https://community.chocolatey.org/packages/scc

@boyter
Copy link
Owner

boyter commented Sep 11, 2024

Ah yes... one of those things I forget to ever update.

Err if you want to submit a PR for it that would help. I don't think I set this up from memory and I have no idea how to actually update the choco sources for this.

@boyter boyter added bug Something isn't working help wanted Extra attention is needed good first issue Good for newcomers labels Sep 11, 2024
@ahoehma
Copy link
Author

ahoehma commented Sep 13, 2024

I can try. But my choco-maintainer knownledge is below zero :-) Any hint for this. Sources? Or is this all manually? Just asking.

@boyter
Copy link
Owner

boyter commented Sep 13, 2024

I honestly have no idea. It looks simple to do inside the scc repo where the choco stuff is, but I have no idea about submitting it.

@ahoehma
Copy link
Author

ahoehma commented Sep 13, 2024

Ok. Found it. "packages/chocolatey". I can try.

@boyter
Copy link
Owner

boyter commented Sep 13, 2024

Let me know how you go! Maybe document it too... then I can keep it in line for you in the future.

@ahoehma
Copy link
Author

ahoehma commented Sep 13, 2024

Hui ... the existing information are not much :-) I have to understand how to build a choco-package first. Then may I can reproduce the building ... but then finally I guess you should upload this stuff to choco or?

@ahoehma
Copy link
Author

ahoehma commented Sep 14, 2024

@boyter I found something :-)

First there is a missing '/" in line 12 of packages/chocolatey/scc.nuspec:

<packageSourceUrl>https://github.com/boyter/scc/tree/master/packages/chocolatey/</packageSourceUrl>
---------------------------------------------------------------------------------^

Then to create a choco package all we have to do is to run "choco pack" inside packages/chocolatey/.

hoehmann@md2yxh2c • 2024-09-14 • 16:53 • MINGW64 /d/Dev/git/privat/scc/packages/chocolatey (master) •
$choco pack
Chocolatey v2.3.0
Attempting to build package from 'scc.nuspec'.
Successfully created package 'D:\Dev\git\privat\scc\packages\chocolatey\scc.3.3.5.nupkg'

I removed also all comments from chocolateyuninstall.ps1 and chocolateyinstall.ps1 as the comment inside these files tells.

# IMPORTANT: Before releasing this package, copy/paste the next 2 lines into PowerShell to remove all comments from this file:
#   $f='c:\path\to\thisFile.ps1'
#   gc $f | ? {$_ -notmatch "^\s*#"} | % {$_ -replace '(^.*?)\s*?[^``]#.*','$1'} | Out-File $f+".~" -en utf8; mv -fo $f+".~" $f

The question is now what is the result of building scc itself? Because I think something must be copied inside the choco-package. I'm not sure about this step. Is the docu "make install clean" still valid?

PS: docu: https://docs.chocolatey.org/en-us/create/create-packages/

@ahoehma
Copy link
Author

ahoehma commented Sep 14, 2024

Bämm ... I got something running :) - At least the installation ... so the whole process is not ready yet !

scc/packages/chocolatey/tools/chocolateyinstall.ps1

$ErrorActionPreference = 'Stop';

$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
$url = 'https://github.com/boyter/scc/releases/download/v3.3.5/scc_Windows_i386.zip'
$url64 = 'https://github.com/boyter/scc/releases/download/v3.3.5/scc_Windows_x86_64.zip'

$packageArgs = @{
  packageName    = $env:ChocolateyPackageName
  unzipLocation  = $toolsDir
  fileType       = 'exe'
  url            = $url
  url64bit       = $url64
  softwareName   = 'scc*'
  checksum       = '668e791983ce531224a5d12ed2f1bf1a323dc61221e29abdbf1da3c9b5c0d618'
  checksumType   = 'sha256'
  checksum64     = '62606a775199df5c7d7c93c29919c71918286d6ef57952946ad536dca6afc148'
  checksumType64 = 'sha256'
}

Install-ChocolateyZipPackage @packageArgs
hoehmann@md2yxh2c • 2024-09-14 • 17:45 • MINGW64 /d/Dev/git/privat/scc/packages/chocolatey (master) •
$choco pack
Chocolatey v2.3.0
Attempting to build package from 'scc.nuspec'.
Successfully created package 'D:\Dev\git\privat\scc\packages\chocolatey\scc.3.3.5.nupkg'
hoehmann@md2yxh2c • 2024-09-14 • 17:40 • MINGW64 /d/Dev/git/privat/scc/packages/chocolatey (master) •
$choco install scc --version="3.3.5" --source="D:\Dev\git\privat\scc\packages\chocolatey"
Chocolatey v2.3.0
Installing the following packages:
scc
By installing, you accept licenses for the packages.
Downloading package from source 'D:\Dev\git\privat\scc\packages\chocolatey'

scc v3.3.5
scc package files install completed. Performing other installation steps.
64-bit System erkannt, lade 64-bit ZIP herunter...
Downloading scc
  from 'https://github.com/boyter/scc/releases/download/v3.3.5/scc_Windows_x86_64.zip'
Progress: 100% - Completed download of C:\ProgramData\chocolatey\lib\scc\tools\scc_Windows_x86_64.zip (2.36 MB).
Download of scc_Windows_x86_64.zip (2.36 MB) completed.
C:\ProgramData\chocolatey\lib\scc\tools\scc_Windows_x86_64.zip
Extracting C:\ProgramData\chocolatey\lib\scc\tools\scc_Windows_x86_64.zip to C:\ProgramData\chocolatey\lib\scc\tools...
C:\ProgramData\chocolatey\lib\scc\tools
Das Tool wurde erfolgreich entpackt. Füge es dem PATH hinzu...
PATH environment variable does not have C:\ProgramData\chocolatey\lib\scc\tools in it. Adding...
Environment Vars (like PATH) have changed. Close/reopen your shell to
 see the changes (or in powershell/cmd.exe just type `refreshenv`).
 ShimGen has successfully created a shim for scc.exe
 The install of scc was successful.
  Deployed to 'C:\ProgramData\chocolatey\lib\scc\tools'

Chocolatey installed 1/1 packages.
 See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
hoehmann@md2yxh2c • 2024-09-14 • 17:49 • MINGW64 /d/Dev/git/privat/scc/packages/chocolatey (master) •
$scc --version
scc version 3.3.5

The installation folder looks like this:

hoehmann@md2yxh2c • 2024-09-14 • 17:53 • MINGW64 /d/Dev/git/privat/scc/packages/chocolatey (master) •
$ll "C:\ProgramData\chocolatey\lib\scc\tools"
total 6325
-rw-r--r-- 1 hoehmann 1049089    1099 May 17 10:37 LICENSE
-rw-r--r-- 1 hoehmann 1049089    1128 Sep 13 08:26 LICENSE.txt
-rw-r--r-- 1 hoehmann 1049089   51423 Jul  1 00:25 README.md
-rw-r--r-- 1 hoehmann 1049089     346 Sep 13 08:26 VERIFICATION.txt
-rw-r--r-- 1 hoehmann 1049089     595 Sep 14 07:52 chocolateybeforemodify.ps1
-rw-r--r-- 1 hoehmann 1049089     768 Sep 14 17:45 chocolateyinstall.ps1
-rw-r--r-- 1 hoehmann 1049089    9010 Sep 14 07:52 chocolateyinstall.ps1.org
-rw-r--r-- 1 hoehmann 1049089    1106 Sep 13 09:05 chocolateyuninstall.ps1
-rw-r--r-- 1 hoehmann 1049089    4922 Sep 14 07:52 chocolateyuninstall.ps1.org
-rwxr-xr-x 1 hoehmann 1049089 6377984 Jul  3 01:02 scc.exe*

@boyter
Copy link
Owner

boyter commented Sep 15, 2024

Neat progress.

I must confess I don't have a windows machine anymore to actually test this sort of stuff. I might need to setup a VM just for this sort of thing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed
Projects
Status: TODO
Development

No branches or pull requests

2 participants