- BPM Can now install and remove symlinks
This commit is contained in:
parent
29a4c35a44
commit
b6d217819c
@ -192,6 +192,13 @@ func InstallPackage(filename, installDir string, force bool) error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
case tar.TypeSymlink:
|
||||||
|
fmt.Println("old name: " + header.Linkname)
|
||||||
|
fmt.Println("new name: " + header.Name)
|
||||||
|
err := os.Symlink(header.Linkname, extractFilename)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
return errors.New("ExtractTarGz: uknown type: " + strconv.Itoa(int(header.Typeflag)) + " in " + extractFilename)
|
return errors.New("ExtractTarGz: uknown type: " + strconv.Itoa(int(header.Typeflag)) + " in " + extractFilename)
|
||||||
}
|
}
|
||||||
@ -376,7 +383,7 @@ func RemovePackage(pkg, rootDir string) error {
|
|||||||
files := GetPackageFiles(pkg, rootDir)
|
files := GetPackageFiles(pkg, rootDir)
|
||||||
for _, file := range files {
|
for _, file := range files {
|
||||||
file = path.Join(rootDir, file)
|
file = path.Join(rootDir, file)
|
||||||
stat, err := os.Stat(file)
|
stat, err := os.Lstat(file)
|
||||||
if os.IsNotExist(err) {
|
if os.IsNotExist(err) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
3
main.go
3
main.go
@ -17,7 +17,7 @@ import (
|
|||||||
/* A simple-to-use package manager */
|
/* A simple-to-use package manager */
|
||||||
/* ---------------------------------- */
|
/* ---------------------------------- */
|
||||||
|
|
||||||
var bpmVer = "0.0.6"
|
var bpmVer = "0.0.7"
|
||||||
var rootDir = "/"
|
var rootDir = "/"
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
@ -215,6 +215,7 @@ func resolveCommand() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
err := bpm_utils.RemovePackage(pkg, rootDir)
|
err := bpm_utils.RemovePackage(pkg, rootDir)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalf("Could not remove package\nError: %s\n", err)
|
log.Fatalf("Could not remove package\nError: %s\n", err)
|
||||||
}
|
}
|
||||||
|
Binary file not shown.
Binary file not shown.
@ -1,5 +1,5 @@
|
|||||||
name: bpm
|
name: bpm
|
||||||
description: The Bubble Package Manager
|
description: The Bubble Package Manager
|
||||||
version: 0.0.6
|
version: 0.0.7
|
||||||
architecture: x86_64
|
architecture: x86_64
|
||||||
type: binary
|
type: binary
|
||||||
|
Loading…
x
Reference in New Issue
Block a user