Code Monkey home page Code Monkey logo

Comments (25)

gep13 avatar gep13 commented on July 22, 2024

Argh, again, I totally never thought of the icons when I moved the files. Was acting on a "simple" request from Rob and never thought about the icons. I will try to get this sorted out at the weekend. Thanks for letting me know!

By the way, this edition of Calibre was the first to successfully publish from the new server that I have created in Azure dedicated to chocolatey automatic packages. It is running all the time, every hour, so the auto packages running in the coreteampackages repo should almost instantly be up to date :-)

from chocolatey-packages.

TomOne avatar TomOne commented on July 22, 2024

Argh, again, I totally never thought of the icons when I moved the files.

Not a big issue. This happened also to other package maintainers.

But of course it’s better to avoid it. Using an orphan gh-pages branch would solve this problem (unless the repository changes).
Look how I use it:

I know, it requires a few minutes to set them up, but in my opinion it’s worth the effort. The iconUrls are then shorter and easier. In addition I read on multiple resources that do not recommend to use the raw url to a file hosted on GitHub.

By the way, this edition of Calibre was the first to successfully publish from the new server that I have created in Azure dedicated to chocolatey automatic packages.

Very nice. But even cooler would be if it would be possible to handle automatic packages with a (headless) Linux server. Then I could set them up on my Raspberry Pi at home. In addition, Linux hostings are usually cheaper. Only because we make Windows packages, it doesn’t exclude the use of Linux. 😃

from chocolatey-packages.

ferventcoder avatar ferventcoder commented on July 22, 2024

Ah @TomOne, we think alike there. There are some things happening this year that should make *nix more friendly. :)

from chocolatey-packages.

gep13 avatar gep13 commented on July 22, 2024

@TomOne I like it! I will look into getting that setup as well. It currently isn't costing me anything to run this server in the cloud, so there is no great loss there, but there is no doubt that linux hosting would be the preferred option in terms of cost.

from chocolatey-packages.

gep13 avatar gep13 commented on July 22, 2024

I have implemented the required changes in this pull request:

#9

Gary

from chocolatey-packages.

gep13 avatar gep13 commented on July 22, 2024

Obviously the changes won't take affect until new packages are pushed to chocolatey.org, but hopefully everything should be lined up ready for when that happens now :-) Baby steps...

from chocolatey-packages.

TomOne avatar TomOne commented on July 22, 2024

Awesome. 😃

Using the gh-pages branch has also other benefits:

  • Sometimes it happens that raw links to files on GitHub repositories don’t work (maybe because maintenance work on GitHub). And I’ve read that GitHub blocks the access the raw links when there’s too much traffic. But these two issues don’t exist with GitHub pages.
  • I’ve read that it’s recommended to use GitHub pages instead of raw links. Raw links are intended only as preview for files in a repository, not as “hosting platform”:

Wouldn’t it be a good idea to add a general recommendation to the Chocolatey wiki to use a gh-pages branch for the package icons? I know, it takes a few more minutes to set it up, but I think it’s worth the effort.

from chocolatey-packages.

ferventcoder avatar ferventcoder commented on July 22, 2024

As long as there is a step by step with pictures (or a link to something that is), I'm leaning towards it as secondary guidance.

from chocolatey-packages.

gep13 avatar gep13 commented on July 22, 2024

When creating the gh-pages branch manually, I referred to a number of different articles to put it all together. I think a step by step for this specific use case would be required.

from chocolatey-packages.

AnthonyMastrean avatar AnthonyMastrean commented on July 22, 2024

I just followed the instructions at this official guide. The hardest part was saving all the package icons from the cleaning of the repository. I just did something like this

PS> mkdir icons
PS> cp **\*.png, **\*.ico -destination icons
PS> "icons" > .gitignore
PS> git rm -rf .
PS> git add -A
PS> git commit -am "Move package icons to an orphan branch for better hosting"
PS> git push origin gh-pages

from chocolatey-packages.

TomOne avatar TomOne commented on July 22, 2024

Good work @AnthonyMastrean. Just one thing: The contents of in the *.nuspec files need to be adapted too, otherwise the gh-pages branch doesn’t make much sense. 😃

Maybe you already know a quick method to accomplish that, but nevertheless I describe how I did it:
I used the “Regex replace in files” functionality of Komodo Edit. It scans a folder recursively and searches and replaces file contents based on the given regex. Notepad++ has a similar functionality and maybe also Sublime Text.

from chocolatey-packages.

TomOne avatar TomOne commented on July 22, 2024

@AnthonyMastrean, maybe you read it already, but this can be useful for the work with the gh-pages branch: #9 (comment)

from chocolatey-packages.

AnthonyMastrean avatar AnthonyMastrean commented on July 22, 2024

@TomOne, of course! A recursive-replace-regex isn't a bad idea for a large repo. I might just do mine by hand. Thought I'd wrap my head around the gh-pages part first. As for #9, I'm going to play with an "icons" directory + Jekyll from my master branch and a little Travis-CI to publish to gh-pages. It's probably overkill, but I want to play :D

from chocolatey-packages.

TomOne avatar TomOne commented on July 22, 2024

@TomOne, of course! A recursive-replace-regex isn't a bad idea for a large repo. I might just do mine by hand.

Be careful if you plan to use PowerShell for that. PowerShell supports UTF-8 incorrectly and uses these stupid Windows Codepages (e.g. Windows-1252) by default. Also make sure that it doesn’t write a BOM to the nuspec files.

The Wikipedia article of Windows-1252 states that:

Windows-1252 or CP-1252 is a character encoding of the Latin alphabet, used by default in the legacy components of Microsoft Windows in English and some other Western languages.

Well, that means that PowerShell is a legacy Windows component. Bad Microsoft, bad. 👎

from chocolatey-packages.

ferventcoder avatar ferventcoder commented on July 22, 2024

@TomOne always getting on MS for their encoding issues... :)

from chocolatey-packages.

TomOne avatar TomOne commented on July 22, 2024

Sorry, next time I will restrain myself and try to be a bit more diplomatic ;) I suppose that many users suggested Microsoft to improve this messy situation with character encodings, but without success as we can see.

But now back to the topic: I would be happy to write a tutorial how to set up gh-pages as hosting platform for package icons. I am aware that my English is bad, but there’s always the possibility to correct my mistakes.

Regarding the replacement for Ketarin to handle automatic packages, which also works on headless Linux servers, I would choose Node.js as base platform. Node.js is perfectly cross-platform, lightweight, ultra-fast and asynchronous, which is perfect for interactions with the web.

from chocolatey-packages.

gep13 avatar gep13 commented on July 22, 2024

Well, that means that PowerShell is a legacy Windows component. Bad Microsoft, bad. 👎

Is this still the case in the latest version of PowerShell 4?

from chocolatey-packages.

gep13 avatar gep13 commented on July 22, 2024

@AnthonyMastrean

I just followed the instructions at this official guide.

Ok, no idea how I didn't mind that :-) My Google Fu was obviously lacking :-D

from chocolatey-packages.

TomOne avatar TomOne commented on July 22, 2024

Well, that means that PowerShell is a legacy Windows component. Bad Microsoft, bad. 👎

Is this still the case in the latest version of PowerShell 4?

Unfortunately yes. I tested it on Windows 8.1 with PowerShell 4.0. You can reproduce it as follows: Create an UTF-8 encoded text file without BOM called test-utf-8.txt with the following non-ASCII characters as content: © ® δτρν. Type this in PowerShell:

Get-Content .\test-utf-8.txt

The output will be:

© ® δÏÏ�ν

These are definitely not the same characters. 😄

from chocolatey-packages.

gep13 avatar gep13 commented on July 22, 2024

@TomOne :-(

from chocolatey-packages.

TomOne avatar TomOne commented on July 22, 2024

Sorry for disturbing you again, but the latest Calibre package (http://chocolatey.org/packages/calibre) still has the old icon location with the raw link to the non existent calibre icon. The source nuspec has the correct iconUrl (https://github.com/chocolatey/chocolatey-coreteampackages/blob/master/automatic/calibre/calibre.nuspec#L16). What happened here?

from chocolatey-packages.

gep13 avatar gep13 commented on July 22, 2024

@TomOne I think I know exactly what happened...

I don't think the server that Keratin is running on has the latest version of the source code on it. I think I will need to add another scheduled task to include a git pull on the repo to ensure that the latest code is there.

Gary

from chocolatey-packages.

TomOne avatar TomOne commented on July 22, 2024

I have another solution how to create a gh-pages branch for Chocolatey packages. I think it’s is very simple, because it uses only basic Git commands. In addition it incorporates the purpose of my suggestion #9 (comment) right from the beginning. Basically the idea is the following:

  • Create a new local repository on the computer called chocolatey-packages-icons or something like that.
  • Do a first commit on master, e.g. a README.md.
  • Create a gh-pages branch and switch to it.
  • Delete the master branch of the local chocolatey-packages-icons repository
  • Add the chocolatey packages repository as origin.

Then you can:

  • Add the package icons and commit.
  • Push the gh-pages branch to origin.
  • Now you have your package repository e.g. chocolatey-packages and a separate folder with only the gh-pages branch in it (chocolatey-packages-icons).

With git commands, this approach could look like this:

# Make sure that your current working directory is outside of any repository
$ mkdir chocolatey-packages-icons
$ cd chocolatey-packages-icons
$ git init
$ echo "My Chocolatey package icons" > README.md
$ git add .
$ git commit -m "first commit"
$ git checkout -b gh-pages
$ git branch -d master
$ git remote add origin [email protected]:username/repository.git # Replace 'username' with your GitHub username and 'repository' with the name of your existing Chocolatey packages repository.
# Now you can add icons, commit and push with “git push origin gh-pages”

If you like this approach, I would use it for the future guidance how to properly host Chocolatey package icons, which could then be added to the wiki.

from chocolatey-packages.

gep13 avatar gep13 commented on July 22, 2024

@TomOne, this seems like a very workable solution to me. If you are happy to write something up, then I am sure we can git it included in the guidance for package maintenance.

from chocolatey-packages.

gep13 avatar gep13 commented on July 22, 2024

@TomOne ok, so it was what I thought it was. I have updated the ketarin script that I am using to include a git pull every time that it runs to ensure that it has the latest source of all the packages. Hopefully this will sort it out, and when the next version of Calibre comes out later this week, it will all be sorted. Fingers crossed! :-)

from chocolatey-packages.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.