handle package update
This commit is contained in:
@@ -4,6 +4,7 @@ import lombok.SneakyThrows;
|
||||
import net.woggioni.jpacrepo.model.Hasher;
|
||||
import net.woggioni.jpacrepo.model.MD5InputStream;
|
||||
import net.woggioni.jpacrepo.model.Parser;
|
||||
import net.woggioni.jpacrepo.pacbase.CompressionFormat;
|
||||
import net.woggioni.jpacrepo.pacbase.PkgData;
|
||||
import net.woggioni.jpacrepo.service.PacmanServiceRemote;
|
||||
import net.woggioni.jwo.JWO;
|
||||
@@ -19,6 +20,7 @@ import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.InputStream;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.security.DigestInputStream;
|
||||
import java.security.MessageDigest;
|
||||
@@ -102,7 +104,8 @@ public class ClientTest {
|
||||
h.read(out, 0, (int) a);
|
||||
System.out.println(h.digest());
|
||||
|
||||
PkgData p = Parser.parseFile(Paths.get(file));
|
||||
Path path = Paths.get(file);
|
||||
PkgData p = Parser.parseFile(path, CompressionFormat.guess(path));
|
||||
System.out.println(p.md5sum());
|
||||
|
||||
}
|
||||
|
@@ -40,7 +40,7 @@ class MarshalTest extends AnyFlatSpec {
|
||||
.filter(Files.isRegularFile(_))
|
||||
.filter((p: Path) => pattern.matcher(p.getFileName.toString).matches)
|
||||
.limit(10)
|
||||
.map(Parser.parseFile)
|
||||
.map(Parser.parseFile(_, CompressionFormat.Z_STANDARD))
|
||||
.collect(Collectors.toList[PkgData])
|
||||
val list = new PkgDataList(pkgDatas)
|
||||
mar.marshal(list, System.out)
|
||||
|
@@ -9,6 +9,14 @@ import scala.collection.mutable
|
||||
|
||||
class ExampleSpec extends AnyFlatSpec with Matchers {
|
||||
|
||||
def foo(a : Int)(b : String = "walter"): Unit = {
|
||||
println(s"a: $a, b: $b")
|
||||
}
|
||||
|
||||
def foo(c : Int): Unit = {
|
||||
foo(a=c)("adfsda")
|
||||
}
|
||||
|
||||
// "A Stack" should "pop values in last-in-first-out order" in {
|
||||
// val stack = new mutable.Stack[Int]
|
||||
// stack.push(1)
|
||||
@@ -25,7 +33,6 @@ class ExampleSpec extends AnyFlatSpec with Matchers {
|
||||
// }
|
||||
|
||||
"sdfgf" should "dfgfd" in {
|
||||
val initial = InitialSchemaAction("none")
|
||||
println(initial)
|
||||
foo(a=5)()
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user