mirror of
https://github.com/safing/portmaster
synced 2025-09-04 11:39:29 +00:00
Rename components
portmaster -> portmaster-core pmctl -> portmaster-control
This commit is contained in:
parent
457e6f21a2
commit
b5cc3121ae
6 changed files with 18 additions and 18 deletions
2
main.go
2
main.go
|
@ -31,7 +31,7 @@ func init() {
|
||||||
func main() {
|
func main() {
|
||||||
|
|
||||||
// Set Info
|
// Set Info
|
||||||
info.Set("Portmaster", "0.2.5", "AGPLv3", true)
|
info.Set("Portmaster", "0.3.0", "AGPLv3", true)
|
||||||
|
|
||||||
// Start
|
// Start
|
||||||
err := modules.Start()
|
err := modules.Start()
|
||||||
|
|
|
@ -16,7 +16,7 @@ function check {
|
||||||
# get version
|
# get version
|
||||||
version=$(grep "info.Set" main.go | cut -d'"' -f4)
|
version=$(grep "info.Set" main.go | cut -d'"' -f4)
|
||||||
# build versioned file name
|
# build versioned file name
|
||||||
filename="portmaster_v${version//./-}"
|
filename="portmaster-core_v${version//./-}"
|
||||||
# platform
|
# platform
|
||||||
platform="${GOOS}_${GOARCH}"
|
platform="${GOOS}_${GOARCH}"
|
||||||
if [[ $GOOS == "windows" ]]; then
|
if [[ $GOOS == "windows" ]]; then
|
||||||
|
@ -40,7 +40,7 @@ function build {
|
||||||
# get version
|
# get version
|
||||||
version=$(grep "info.Set" main.go | cut -d'"' -f4)
|
version=$(grep "info.Set" main.go | cut -d'"' -f4)
|
||||||
# build versioned file name
|
# build versioned file name
|
||||||
filename="portmaster_v${version//./-}"
|
filename="portmaster-core_v${version//./-}"
|
||||||
# platform
|
# platform
|
||||||
platform="${GOOS}_${GOARCH}"
|
platform="${GOOS}_${GOARCH}"
|
||||||
if [[ $GOOS == "windows" ]]; then
|
if [[ $GOOS == "windows" ]]; then
|
||||||
|
|
|
@ -14,7 +14,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
logPrefix = "[pmctl]"
|
logPrefix = "[control]"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
@ -22,7 +22,7 @@ var (
|
||||||
databaseRootDir *string
|
databaseRootDir *string
|
||||||
|
|
||||||
rootCmd = &cobra.Command{
|
rootCmd = &cobra.Command{
|
||||||
Use: "pmctl",
|
Use: "portmaster-control",
|
||||||
Short: "contoller for all portmaster components",
|
Short: "contoller for all portmaster components",
|
||||||
PersistentPreRunE: initPmCtl,
|
PersistentPreRunE: initPmCtl,
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
|
@ -55,7 +55,7 @@ func main() {
|
||||||
// }()
|
// }()
|
||||||
|
|
||||||
// set meta info
|
// 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
|
// check if meta info is ok
|
||||||
err := info.CheckVersion()
|
err := info.CheckVersion()
|
||||||
|
@ -97,7 +97,7 @@ func initPmCtl(cmd *cobra.Command, args []string) error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("%s failed to upgrade self: %s", logPrefix, err)
|
return fmt.Errorf("%s failed to upgrade self: %s", logPrefix, err)
|
||||||
}
|
}
|
||||||
fmt.Println("upgraded pmctl")
|
fmt.Println("upgraded portmaster-control")
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|
16
pmctl/pack
16
pmctl/pack
|
@ -8,7 +8,7 @@ COL_BOLD="\033[01;01m"
|
||||||
COL_RED="\033[31m"
|
COL_RED="\033[31m"
|
||||||
|
|
||||||
destDirPart1="../dist"
|
destDirPart1="../dist"
|
||||||
destDirPart2="pmctl"
|
destDirPart2="control"
|
||||||
|
|
||||||
function check {
|
function check {
|
||||||
# output
|
# output
|
||||||
|
@ -16,7 +16,7 @@ function check {
|
||||||
# get version
|
# get version
|
||||||
version=$(grep "info.Set" main.go | cut -d'"' -f4)
|
version=$(grep "info.Set" main.go | cut -d'"' -f4)
|
||||||
# build versioned file name
|
# build versioned file name
|
||||||
filename="pmctl_v${version//./-}"
|
filename="portmaster-control_v${version//./-}"
|
||||||
# platform
|
# platform
|
||||||
platform="${GOOS}_${GOARCH}"
|
platform="${GOOS}_${GOARCH}"
|
||||||
if [[ $GOOS == "windows" ]]; then
|
if [[ $GOOS == "windows" ]]; then
|
||||||
|
@ -28,9 +28,9 @@ function check {
|
||||||
|
|
||||||
# check if file exists
|
# check if file exists
|
||||||
if [[ -f $destPath ]]; then
|
if [[ -f $destPath ]]; then
|
||||||
echo "[pmctl] $platform $version already built"
|
echo "[control] $platform $version already built"
|
||||||
else
|
else
|
||||||
echo -e "${COL_BOLD}[pmctl] $platform $version${COL_OFF}"
|
echo -e "${COL_BOLD}[control] $platform $version${COL_OFF}"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@ function build {
|
||||||
# get version
|
# get version
|
||||||
version=$(grep "info.Set" main.go | cut -d'"' -f4)
|
version=$(grep "info.Set" main.go | cut -d'"' -f4)
|
||||||
# build versioned file name
|
# build versioned file name
|
||||||
filename="pmctl_v${version//./-}"
|
filename="portmaster-control_v${version//./-}"
|
||||||
# platform
|
# platform
|
||||||
platform="${GOOS}_${GOARCH}"
|
platform="${GOOS}_${GOARCH}"
|
||||||
if [[ $GOOS == "windows" ]]; then
|
if [[ $GOOS == "windows" ]]; then
|
||||||
|
@ -52,19 +52,19 @@ function build {
|
||||||
|
|
||||||
# check if file exists
|
# check if file exists
|
||||||
if [[ -f $destPath ]]; then
|
if [[ -f $destPath ]]; then
|
||||||
echo "[pmctl] $platform already built in version $version, skipping..."
|
echo "[control] $platform already built in version $version, skipping..."
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# build
|
# build
|
||||||
./build
|
./build
|
||||||
if [[ $? -ne 0 ]]; then
|
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
|
exit 1
|
||||||
fi
|
fi
|
||||||
mkdir -p $(dirname $destPath)
|
mkdir -p $(dirname $destPath)
|
||||||
cp $output $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 {
|
function check_all {
|
||||||
|
|
|
@ -27,7 +27,7 @@ var runCore = &cobra.Command{
|
||||||
Use: "core",
|
Use: "core",
|
||||||
Short: "Run the Portmaster Core",
|
Short: "Run the Portmaster Core",
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
return run("core/portmaster", cmd, false)
|
return run("core/portmaster-core", cmd, false)
|
||||||
},
|
},
|
||||||
FParseErrWhitelist: cobra.FParseErrWhitelist{
|
FParseErrWhitelist: cobra.FParseErrWhitelist{
|
||||||
// UnknownFlags will ignore unknown flags errors and continue parsing rest of the flags
|
// UnknownFlags will ignore unknown flags errors and continue parsing rest of the flags
|
||||||
|
|
|
@ -13,7 +13,7 @@ import (
|
||||||
|
|
||||||
func checkForUpgrade() (update *updates.File) {
|
func checkForUpgrade() (update *updates.File) {
|
||||||
info := info.GetInfo()
|
info := info.GetInfo()
|
||||||
file, err := updates.GetLocalPlatformFile("pmctl/pmctl")
|
file, err := updates.GetLocalPlatformFile("control/portmaster-control")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -113,6 +113,6 @@ func removeOldBin() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Println("removed previous pmctl")
|
fmt.Println("removed previous portmaster-control")
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue