Compare commits

...

4 Commits

Author SHA1 Message Date
Chris 54f64095ea Changed text width in apply command output 2017-02-22 21:20:16 +01:00
Chris 989a8b831e Bugfixes 2017-02-01 03:59:36 +01:00
Chris 2dce9e4e8b Updated installer stuff 2016-12-31 01:43:07 +01:00
Chris ab96d598fb Updated readme 2016-12-24 14:41:38 +01:00
11 changed files with 98 additions and 38 deletions

View File

@ -13,7 +13,6 @@ heavy lifting for you, including dependencies.
$ chmod +x hotfix-installer.run
$ ./hotfix-installer.run
### Manual install
If you would like to install it manually:
@ -21,35 +20,33 @@ If you would like to install it manually:
$ curl -O ~/bin/hotfix http://files.noccy.com/hotfix/hotfix
$ chmod +x ~/bin/hotfix
## Using Hotfixes
### Security precautions
To use a hotfix, you need to have the publishers public key imported. For my hotfixes,
you need to do:
If you want to make sure that you are using an official build of the hotfix utility,
you should verify the hotfix executable using the NoccyLabs signing key. Make sure
you import the key as specified below, and then download the signature into the same
directory as the executable:
$ curl http://files.noccy.com/hotfix/signing-key.asc | gpg --import -
$ curl http://files.noccy.com/hotfix/hotfix.sig > hotfix.sig
$ gpg --verify hotfix.sig
Next, create a file at `~/.hotfix.conf` containing:
You should get output confirming a good signature.
[alias]
noccy=http://files.noccy.com/hotfix/{fix}.fix.signed
### How do I import the public key?
And finally, apply the desired hotfix:
$ curl http://files.noccy.com/hotfix/signing-key.gpg | gpg --import -
$ hotfix apply noccy:install-processing
## Available Hotfixes
### Processing
This will install the latest version of Processing into `/opt`.
Without a defined alias you would do:
$ hotfix apply http://files.noccy.com/hotfix/install-processing.fix.signed
### Spotify
This hotfix will enable the official Spotify debian repositories and install the Spotify client.
It is not compatible with any other distros at this time.
$ hotfix apply http://files.noccy.com/hotfix/install-spotify.fix.signed
## Publishing Hotfixes
1. Create your hotfix in a text editor. You can use one of the examples as a
starting point.
2. Test the fix locally, using `hotfix apply -I <file>` to make sure it works
as intended.
3. Once everything works as intended, sign the hotfix using `hotfix sign <file>`
and upload the `.fix.signed` file to your location of choice.
4. Put a link to your public key in your forum signature, on your about page etc.
5. Publish your fix together with the relevant information.

View File

@ -1,6 +1,6 @@
<?php
define("APP_VERSION", "0.1-pre");
if (!defined('APP_VERSION')) define("APP_VERSION", "0.1-pre");
require_once __DIR__."/../vendor/autoload.php";
require_once __DIR__."/systemtest.php";

4
build/app.prop Normal file
View File

@ -0,0 +1,4 @@
# comment
APP_VERSION=0.2.x
APP_NAME=hotfix

10
build/gitprops.php Normal file
View File

@ -0,0 +1,10 @@
<?php
$git = trim(exec("git describe --tags"));
$git = explode("-",$git);
if (count($git)>1) {
$git = array_slice($git,0,2);
}
$git = join(".",$git);
echo "APP_VERSION={$git}\n";

View File

@ -18,6 +18,7 @@
"symfony/console": "^3.0",
"symfony/yaml": "^3.0",
"noccylabs/downloader": "@dev",
"symfony/expression-language": "^3.2"
"symfony/expression-language": "^3.2",
"noccylabs/tinyphar": "^0.1.1"
}
}

18
installer/install.sh Normal file
View File

@ -0,0 +1,18 @@
#!/bin/bash
if [ ! -d ~/bin ]; then
echo "Creating ~/bin..."
mkdir ~/bin
fi
echo "Installing hotfix executable..."
cp hotfix ~/bin/hotfix
echo "Fixing permissions..."
chmod +x ~/bin/hotfix
if [ -e ~/.hotfix.conf ]; then
echo "Configuration file ~/.hotfix.conf already exists"
else
echo "Installing configuration file..."
cp hotfix.conf ~/.hotfix.conf
fi

11
installer/message Normal file
View File

@ -0,0 +1,11 @@
This will install hotfix into the bin directory of the current user (as ~/bin/hotfix). If
the directory does not exist, it will be created. Most Linux distributions will add the
~/bin directory to the path if it is found. If hotfix isn't callable from the command line
after restarting your shell and/or rebooting, please consult the documentation.
Some basic aliases will be installed into ~/.hotfix.conf if the file doesn't already exist.
Just remember to import the keys of the publishers whose hotfixes you are applying!
This installer was created on %{installer.date}

BIN
makephar

Binary file not shown.

View File

@ -1,13 +0,0 @@
{
"output": "hotfix",
"include": [
"bin",
"src",
"vendor"
],
"stub": "bin/bootstrap.php",
"options": {
"chmod": "0777"
},
"compress": 3
}

32
selfie.conf Normal file
View File

@ -0,0 +1,32 @@
package "NoccyLabs Hotfix" {
output "setup-hotfix.run";
destination "~/bin";
res "app.version" "v0.2";
// screens
screen "welcome" type="message" entry=true {
title "Welcome to the %{app.name} %{app.version} installer";
text "@{installer:MESSAGE}";
next "license";
}
screen "license" type="license" {
title "Open Source License";
license "GNU GPL v3 or later";
text "@{installer:LICENSE}";
}
// bundles
bundle "installer" {
file "LICENSE" src="LICENSE";
file "MESSAGE" src="installer/message";
}
bundle "app" default=true {
file "hotfix";
file "hotfix.conf";
file "install.sh" src="installer/install.sh";
script "install.sh";
}
}

View File

@ -57,7 +57,7 @@ class ApplyCommand extends Command
$header = $hotfix->getHeader();
$output->writeln(" Hotfix: <fg=yellow;options=bold>".$header->getName()."</fg=yellow;options=bold>");
$output->writeln(" Author: <comment>".$header->getAuthor()."</comment>");
$info = explode("\n",wordwrap(trim($header->getInfo()), 60));
$info = explode("\n",wordwrap(trim($header->getInfo()), 80));
$info = "<comment>".join("</comment>\n <comment>", $info)."</comment>";
$output->writeln(" Info: ".$info);
$output->writeln("");