Skip to content
This repository has been archived by the owner on May 27, 2023. It is now read-only.

Commit

Permalink
change use-new-glibc code
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonYangShadow committed Dec 27, 2021
1 parent c8bebb8 commit be19361
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
Binary file modified build/linux/x86_64/Linux-x86_64-lpmx
Binary file not shown.
10 changes: 5 additions & 5 deletions container/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ func (server *RPC) RPCDelete(req Request, res *Response) error {
return nil
}

func Init(reset bool, deppath string, useOldGlibc bool) *Error {
func Init(reset bool, deppath string, useNewGlibc bool) *Error {
currdir, err := GetConfigDir()
if err != nil {
return err
Expand All @@ -155,7 +155,7 @@ func Init(reset bool, deppath string, useOldGlibc bool) *Error {
config := fmt.Sprintf("%s/.lpmxsys", currdir)

//delete everything
if reset || useOldGlibc {
if reset || useNewGlibc {
_, cerr := RemoveAll(config)
if cerr != nil {
return cerr
Expand Down Expand Up @@ -209,7 +209,7 @@ func Init(reset bool, deppath string, useOldGlibc bool) *Error {
deppath = fmt.Sprintf("%s/dependency.tar.gz", sys.RootDir)
}
if !FileExist(deppath) {
if useOldGlibc {
if !useNewGlibc {
gen_url := fmt.Sprintf("%s/default.dependency.tar.gz", SETTING_URL)
fmt.Printf("Downloading default.dependency.tar.gz from %s\n", gen_url)
err = DirectDownloadFilefromGithub("dependency.tar.gz", gen_url, sys.RootDir)
Expand Down Expand Up @@ -271,7 +271,7 @@ func Init(reset bool, deppath string, useOldGlibc bool) *Error {
return nil
}

func Reset(useOldGlibc bool) *Error {
func Reset(useNewGlibc bool) *Error {
currdir, err := GetConfigDir()
if err != nil {
return err
Expand Down Expand Up @@ -304,7 +304,7 @@ func Reset(useOldGlibc bool) *Error {
RemoveFile(deppath)
}

if useOldGlibc {
if !useNewGlibc {
gen_url := fmt.Sprintf("%s/default.dependency.tar.gz", SETTING_URL)
fmt.Printf("Downloading default.dependency.tar.gz from %s\n", gen_url)
err = DirectDownloadFilefromGithub("dependency.tar.gz", gen_url, sys.RootDir)
Expand Down
12 changes: 6 additions & 6 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ func checkCompleteness() *Error {
func main() {
var InitReset bool
var InitDep string
var InitUseOldGlibc bool
var InitUseNewGlibc bool
var initCmd = &cobra.Command{
Use: "init",
Short: "init the lpmx itself",
Long: "init command is the basic command of lpmx, which is used for initializing lpmx system",
Args: cobra.ExactArgs(0),
Run: func(cmd *cobra.Command, args []string) {
err := Init(InitReset, InitDep, InitUseOldGlibc)
err := Init(InitReset, InitDep, InitUseNewGlibc)
if err != nil {
LOGGER.Fatal(err.Error())
return
Expand All @@ -70,7 +70,7 @@ func main() {
}
initCmd.Flags().BoolVarP(&InitReset, "reset", "r", false, "initialize by force(optional)")
initCmd.Flags().StringVarP(&InitDep, "dependency", "d", "", "dependency tar ball(optional)")
initCmd.Flags().BoolVarP(&InitUseOldGlibc, "use-old-glibc", "g", false, "use old glibc veresion(optional)")
initCmd.Flags().BoolVarP(&InitUseNewGlibc, "use-new-glibc", "g", false, "use new glibc veresion(optional)")

var ListName string
var listCmd = &cobra.Command{
Expand Down Expand Up @@ -974,14 +974,14 @@ func main() {
},
}

var ResetUseOldGlibc bool
var ResetUseNewGlibc bool
var resetCmd = &cobra.Command{
Use: "reset",
Short: "reset dependencies",
Long: "reset necessary libraries of lpmx",
Args: cobra.ExactArgs(0),
Run: func(cmd *cobra.Command, args []string) {
err := Reset(ResetUseOldGlibc)
err := Reset(ResetUseNewGlibc)
if err != nil {
LOGGER.Error(err.Error())
return
Expand All @@ -990,7 +990,7 @@ func main() {
}
},
}
resetCmd.Flags().BoolVarP(&ResetUseOldGlibc, "use-old-glibc", "g", false, "use old glibc veresion(optional)")
resetCmd.Flags().BoolVarP(&ResetUseNewGlibc, "use-new-glibc", "g", false, "use new glibc veresion(optional)")

var versionCmd = &cobra.Command{
Use: "version",
Expand Down

0 comments on commit be19361

Please sign in to comment.