Further work on extracting

Extracting files is threaded with goroutines.
Extracting also sets the proper UID and GUID
Made recursive children getting threaded with goroutines
Decided I will allow wildcards in paths. Hasn't been implemented though.
Fixed issues with ExtendedDirectory reading (I was using a uint16 instead of a uint32)
I couldn't test basically any of this. somehow a for loop isn't incrementing. For seemingly no reason.
This commit is contained in:
Caleb Gardner
2020-12-01 06:14:09 -06:00
parent 1254df2861
commit e302d98665
4 changed files with 130 additions and 48 deletions
+8 -17
View File
@@ -8,7 +8,6 @@ import (
"testing"
goappimage "github.com/CalebQ42/GoAppImage"
"github.com/CalebQ42/squashfs/internal/inode"
)
const (
@@ -18,7 +17,7 @@ const (
)
func TestSquashfs(t *testing.T) {
t.Parallel()
fmt.Println("YOOO")
wd, err := os.Getwd()
if err != nil {
t.Fatal(err)
@@ -31,21 +30,13 @@ func TestSquashfs(t *testing.T) {
if err != nil {
t.Fatal(err)
}
fils, err := rdr.GetAllFiles()
if err != nil {
t.Fatal(err)
}
for _, fil := range fils {
if fil.filType != inode.BasicFileType && fil.filType != inode.BasicDirectoryType && fil.filType != inode.BasicSymlinkType {
fmt.Println("Found non-standard")
fmt.Println(fil.Path())
fmt.Println("type:", fil.filType)
} else if fil.IsSymlink() {
fmt.Println("Symlink!")
fmt.Println(fil.Path())
fmt.Println("symlink path:", fil.SymlinkPath())
}
}
os.RemoveAll(wd + "/testing/" + squashfsName + ".d")
fmt.Println("Whaaaa")
root, _ := rdr.GetRootFolder()
fmt.Println("WHYYYY")
errs := root.ExtractWithOptions(wd+"/testing/"+squashfsName+".d", false, os.ModePerm, true)
fmt.Println(errs)
t.Fatal("No prolems here!")
}
func TestAppImage(t *testing.T) {