- 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 {
|
||||
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:
|
||||
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)
|
||||
for _, file := range files {
|
||||
file = path.Join(rootDir, file)
|
||||
stat, err := os.Stat(file)
|
||||
stat, err := os.Lstat(file)
|
||||
if os.IsNotExist(err) {
|
||||
continue
|
||||
}
|
||||
|
3
main.go
3
main.go
@ -17,7 +17,7 @@ import (
|
||||
/* A simple-to-use package manager */
|
||||
/* ---------------------------------- */
|
||||
|
||||
var bpmVer = "0.0.6"
|
||||
var bpmVer = "0.0.7"
|
||||
var rootDir = "/"
|
||||
|
||||
func main() {
|
||||
@ -215,6 +215,7 @@ func resolveCommand() {
|
||||
}
|
||||
}
|
||||
err := bpm_utils.RemovePackage(pkg, rootDir)
|
||||
|
||||
if err != nil {
|
||||
log.Fatalf("Could not remove package\nError: %s\n", err)
|
||||
}
|
||||
|
Binary file not shown.
Binary file not shown.
@ -1,5 +1,5 @@
|
||||
name: bpm
|
||||
description: The Bubble Package Manager
|
||||
version: 0.0.6
|
||||
version: 0.0.7
|
||||
architecture: x86_64
|
||||
type: binary
|
||||
|
Loading…
x
Reference in New Issue
Block a user