Rename components

portmaster -> portmaster-core
pmctl -> portmaster-control
This commit is contained in:
Daniel 2019-07-04 13:57:55 +02:00
parent 457e6f21a2
commit b5cc3121ae
6 changed files with 18 additions and 18 deletions

View file

@ -31,7 +31,7 @@ func init() {
func main() {
// Set Info
info.Set("Portmaster", "0.2.5", "AGPLv3", true)
info.Set("Portmaster", "0.3.0", "AGPLv3", true)
// Start
err := modules.Start()

View file

@ -16,7 +16,7 @@ function check {
# get version
version=$(grep "info.Set" main.go | cut -d'"' -f4)
# build versioned file name
filename="portmaster_v${version//./-}"
filename="portmaster-core_v${version//./-}"
# platform
platform="${GOOS}_${GOARCH}"
if [[ $GOOS == "windows" ]]; then
@ -40,7 +40,7 @@ function build {
# get version
version=$(grep "info.Set" main.go | cut -d'"' -f4)
# build versioned file name
filename="portmaster_v${version//./-}"
filename="portmaster-core_v${version//./-}"
# platform
platform="${GOOS}_${GOARCH}"
if [[ $GOOS == "windows" ]]; then

View file

@ -14,7 +14,7 @@ import (
)
const (
logPrefix = "[pmctl]"
logPrefix = "[control]"
)
var (
@ -22,7 +22,7 @@ var (
databaseRootDir *string
rootCmd = &cobra.Command{
Use: "pmctl",
Use: "portmaster-control",
Short: "contoller for all portmaster components",
PersistentPreRunE: initPmCtl,
RunE: func(cmd *cobra.Command, args []string) error {
@ -55,7 +55,7 @@ func main() {
// }()
// set meta info
info.Set("Portmaster Control", "0.1.3", "AGPLv3", true)
info.Set("Portmaster Control", "0.2.0", "AGPLv3", true)
// check if meta info is ok
err := info.CheckVersion()
@ -97,7 +97,7 @@ func initPmCtl(cmd *cobra.Command, args []string) error {
if err != nil {
return fmt.Errorf("%s failed to upgrade self: %s", logPrefix, err)
}
fmt.Println("upgraded pmctl")
fmt.Println("upgraded portmaster-control")
}
return nil

View file

@ -8,7 +8,7 @@ COL_BOLD="\033[01;01m"
COL_RED="\033[31m"
destDirPart1="../dist"
destDirPart2="pmctl"
destDirPart2="control"
function check {
# output
@ -16,7 +16,7 @@ function check {
# get version
version=$(grep "info.Set" main.go | cut -d'"' -f4)
# build versioned file name
filename="pmctl_v${version//./-}"
filename="portmaster-control_v${version//./-}"
# platform
platform="${GOOS}_${GOARCH}"
if [[ $GOOS == "windows" ]]; then
@ -28,9 +28,9 @@ function check {
# check if file exists
if [[ -f $destPath ]]; then
echo "[pmctl] $platform $version already built"
echo "[control] $platform $version already built"
else
echo -e "${COL_BOLD}[pmctl] $platform $version${COL_OFF}"
echo -e "${COL_BOLD}[control] $platform $version${COL_OFF}"
fi
}
@ -40,7 +40,7 @@ function build {
# get version
version=$(grep "info.Set" main.go | cut -d'"' -f4)
# build versioned file name
filename="pmctl_v${version//./-}"
filename="portmaster-control_v${version//./-}"
# platform
platform="${GOOS}_${GOARCH}"
if [[ $GOOS == "windows" ]]; then
@ -52,19 +52,19 @@ function build {
# check if file exists
if [[ -f $destPath ]]; then
echo "[pmctl] $platform already built in version $version, skipping..."
echo "[control] $platform already built in version $version, skipping..."
return
fi
# build
./build
if [[ $? -ne 0 ]]; then
echo -e "\n${COL_BOLD}[pmctl] $platform: ${COL_RED}BUILD FAILED.${COL_OFF}"
echo -e "\n${COL_BOLD}[control] $platform: ${COL_RED}BUILD FAILED.${COL_OFF}"
exit 1
fi
mkdir -p $(dirname $destPath)
cp $output $destPath
echo -e "\n${COL_BOLD}[pmctl] $platform: successfully built.${COL_OFF}"
echo -e "\n${COL_BOLD}[control] $platform: successfully built.${COL_OFF}"
}
function check_all {

View file

@ -27,7 +27,7 @@ var runCore = &cobra.Command{
Use: "core",
Short: "Run the Portmaster Core",
RunE: func(cmd *cobra.Command, args []string) error {
return run("core/portmaster", cmd, false)
return run("core/portmaster-core", cmd, false)
},
FParseErrWhitelist: cobra.FParseErrWhitelist{
// UnknownFlags will ignore unknown flags errors and continue parsing rest of the flags

View file

@ -13,7 +13,7 @@ import (
func checkForUpgrade() (update *updates.File) {
info := info.GetInfo()
file, err := updates.GetLocalPlatformFile("pmctl/pmctl")
file, err := updates.GetLocalPlatformFile("control/portmaster-control")
if err != nil {
return nil
}
@ -113,6 +113,6 @@ func removeOldBin() error {
return nil
}
fmt.Println("removed previous pmctl")
fmt.Println("removed previous portmaster-control")
return nil
}