Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
3938e8bce5
|
|||
|
aee15b4f2a
|
|||
|
18b1103fdc
|
|||
|
c5a02da0f0
|
|||
|
c0c2f3233a
|
|||
|
bda00ac90e
|
+9
-8
@@ -35,6 +35,10 @@ func parse(id string, base *check.Absolute, r io.Reader) (*hst.Config, error) {
|
||||
shell := fhs.AbsRoot.Append("bin", "zsh")
|
||||
home := hst.AbsPrivateTmp.Append("home")
|
||||
|
||||
root := hst.FSOverlay{
|
||||
Target: fhs.AbsRoot,
|
||||
Lower: []*check.Absolute{base.Append("initial")},
|
||||
}
|
||||
c := hst.Config{
|
||||
ID: id,
|
||||
Enablements: new(hst.Enablements),
|
||||
@@ -51,13 +55,7 @@ func parse(id string, base *check.Absolute, r io.Reader) (*hst.Config, error) {
|
||||
Container: &hst.ContainerConfig{
|
||||
Env: make(map[string]string),
|
||||
Filesystem: []hst.FilesystemConfigJSON{
|
||||
{FilesystemConfig: &hst.FSOverlay{
|
||||
Target: fhs.AbsRoot,
|
||||
Lower: []*check.Absolute{
|
||||
base.Append("template", "initial"),
|
||||
},
|
||||
Upper: base.Append("template", "upper"),
|
||||
}},
|
||||
{FilesystemConfig: &root},
|
||||
{FilesystemConfig: &hst.FSBind{
|
||||
Target: home,
|
||||
Source: base.Append("state", id),
|
||||
@@ -102,10 +100,13 @@ func parse(id string, base *check.Absolute, r io.Reader) (*hst.Config, error) {
|
||||
if err := scanOnce(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if v, err := strconv.Atoi(s.Text()); err != nil {
|
||||
if template, identity, ok := strings.Cut(s.Text(), ":"); !ok {
|
||||
return nil, io.ErrUnexpectedEOF
|
||||
} else if v, err := strconv.Atoi(identity); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
c.Identity = v
|
||||
root.Upper = base.Append("template", template, "upper")
|
||||
}
|
||||
|
||||
if err := scanOnce(); err != nil {
|
||||
|
||||
+3
-3
@@ -20,7 +20,7 @@ func TestParse(t *testing.T) {
|
||||
want *hst.Config
|
||||
err error
|
||||
}{
|
||||
{"com.discordapp.Discord", `8
|
||||
{"com.discordapp.Discord", `nonfree:8
|
||||
exec Discord --ozone-platform-hint=wayland
|
||||
|
||||
gpu
|
||||
@@ -74,9 +74,9 @@ talk com.canonical.Unity
|
||||
{FilesystemConfig: &hst.FSOverlay{
|
||||
Target: fhs.AbsRoot,
|
||||
Lower: []*check.Absolute{
|
||||
base.Append("template", "initial"),
|
||||
base.Append("initial"),
|
||||
},
|
||||
Upper: base.Append("template", "upper"),
|
||||
Upper: base.Append("template", "nonfree", "upper"),
|
||||
}},
|
||||
{FilesystemConfig: &hst.FSBind{
|
||||
Target: hst.AbsPrivateTmp.Append("home"),
|
||||
|
||||
+51
-9
@@ -7,6 +7,8 @@ package main
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"log"
|
||||
"os"
|
||||
"os/exec"
|
||||
@@ -34,7 +36,7 @@ func main() {
|
||||
flagVerbose bool
|
||||
flagBase string
|
||||
|
||||
base, template, initial, upper, work *check.Absolute
|
||||
base, template, initial *check.Absolute
|
||||
)
|
||||
c := command.New(os.Stderr, log.Printf, "app", func([]string) (err error) {
|
||||
msg.SwapVerbose(flagVerbose)
|
||||
@@ -49,9 +51,7 @@ func main() {
|
||||
}
|
||||
|
||||
template = base.Append("template")
|
||||
initial = template.Append("initial")
|
||||
upper = template.Append("upper")
|
||||
work = template.Append("work")
|
||||
initial = base.Append("initial")
|
||||
return
|
||||
}).Flag(
|
||||
&flagVerbose,
|
||||
@@ -70,7 +70,21 @@ func main() {
|
||||
)
|
||||
c.NewCommand(
|
||||
"enter", "Enter mutable state template",
|
||||
func([]string) error {
|
||||
func(args []string) error {
|
||||
if len(args) != 1 {
|
||||
dents, err := os.ReadDir(template.String())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
for _, dent := range dents {
|
||||
if !dent.IsDir() {
|
||||
continue
|
||||
}
|
||||
fmt.Println(dent.Name())
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
config := hst.Config{
|
||||
ID: "app.hakurei.mutable",
|
||||
Container: &hst.ContainerConfig{
|
||||
@@ -79,8 +93,8 @@ func main() {
|
||||
{FilesystemConfig: &hst.FSOverlay{
|
||||
Target: fhs.AbsRoot,
|
||||
Lower: []*check.Absolute{initial},
|
||||
Upper: upper,
|
||||
Work: work,
|
||||
Upper: template.Append(args[0], "upper"),
|
||||
Work: template.Append(args[0], "work"),
|
||||
}},
|
||||
{FilesystemConfig: &hst.FSEphemeral{
|
||||
Target: fhs.AbsTmp,
|
||||
@@ -130,18 +144,46 @@ func main() {
|
||||
"run", "Start the named application",
|
||||
func(args []string) error {
|
||||
if len(args) != 1 {
|
||||
return errors.New("run requires 1 argument")
|
||||
dents, err := os.ReadDir(base.Append("app").String())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
for _, dent := range dents {
|
||||
if dent.IsDir() {
|
||||
continue
|
||||
}
|
||||
fmt.Println(dent.Name())
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var config *hst.Config
|
||||
var r io.Reader
|
||||
f, err := os.Open(base.Append("app", args[0]).String())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
config, err = parse(args[0], base, f)
|
||||
r = f
|
||||
|
||||
var common *os.File
|
||||
if common, err = os.Open(base.Append("common").String()); err != nil {
|
||||
if !errors.Is(err, os.ErrNotExist) {
|
||||
_ = f.Close()
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
r = io.MultiReader(f, common)
|
||||
}
|
||||
|
||||
config, err = parse(args[0], base, r)
|
||||
if closeErr := f.Close(); err == nil {
|
||||
err = closeErr
|
||||
}
|
||||
if common != nil {
|
||||
if closeErr := common.Close(); err == nil {
|
||||
err = closeErr
|
||||
}
|
||||
}
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -190,8 +190,8 @@ ln -s \
|
||||
})
|
||||
|
||||
const (
|
||||
version = "22.1.7"
|
||||
checksum = "GFjsoTzJ72YWQuAaNmlO67IIkoZ8Z12u3n0dOEMSpltmyXUJp8e3cccWDrscXILZ"
|
||||
version = "22.1.8"
|
||||
checksum = "_QzoDE0W6cv0vfIWeLPDvqG_vKhz6IGWl1nqUUvhlKWiRzf5dMGqeC3tyS2XgI6j"
|
||||
)
|
||||
|
||||
native.MustRegister("llvm-project", func(t Toolchain) (*Metadata, pkg.Artifact) {
|
||||
|
||||
@@ -2,11 +2,11 @@ package hakurei-source {
|
||||
description = "hakurei source tree";
|
||||
exclude = true;
|
||||
|
||||
version# = "0.4.3";
|
||||
version# = "0.4.4";
|
||||
output = remoteTar {
|
||||
url = "https://git.gensokyo.uk/rosa/hakurei/archive/"+
|
||||
"v"+version+".tar.gz";
|
||||
checksum = "1LqBJIcYcAFTVfydCahOm4hjjKhY953X9ars0eQj32hnpNncWFefuT6OJpZzIlZv";
|
||||
checksum = "BCIKpRiVv2tDg8lyX1bG_VgTBBMFCByv726x6DfJ0LiRg5ma4T5fcxYUaQl8JMVB";
|
||||
compress = gzip;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -3,11 +3,11 @@ package python {
|
||||
website = "https://www.python.org";
|
||||
anitya = 13254;
|
||||
|
||||
version# = "3.14.5";
|
||||
version# = "3.14.6";
|
||||
source = remoteTar {
|
||||
url = "https://www.python.org/ftp/python/"+version+
|
||||
"/Python-"+version+".tgz";
|
||||
checksum = "zYIpDlk2ftZ-UVGCQS1rthle2OHoyXV653ztWiopKV1NhmIJf1K2hHbkwM4DozQ9";
|
||||
checksum = "yynwXnElUvlAweA_RkBKQY35P59Gu5YU6ickJs6Z-blIoHgw5KgKXROY1gq2w0ez";
|
||||
compress = gzip;
|
||||
};
|
||||
patches = [ "zipfile-no-default-strict_timestamps.patch" ];
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
diff --git a/Lib/zipfile/__init__.py b/Lib/zipfile/__init__.py
|
||||
index 19aea290b58..51603ba9510 100644
|
||||
index 2b6e6163b96..180b1bdb42a 100644
|
||||
--- a/Lib/zipfile/__init__.py
|
||||
+++ b/Lib/zipfile/__init__.py
|
||||
@@ -617,7 +617,7 @@ def _decodeExtra(self, filename_crc):
|
||||
@@ -621,7 +621,7 @@ def _decodeExtra(self, filename_crc):
|
||||
extra = extra[ln+4:]
|
||||
|
||||
@classmethod
|
||||
@@ -10,13 +10,13 @@ index 19aea290b58..51603ba9510 100644
|
||||
+ def from_file(cls, filename, arcname=None, *, strict_timestamps=False):
|
||||
"""Construct an appropriate ZipInfo for a file on the filesystem.
|
||||
|
||||
filename should be the path to a file or directory on the filesystem.
|
||||
@@ -1412,7 +1412,7 @@ class ZipFile:
|
||||
_windows_illegal_name_trans_table = None
|
||||
filename should be the path to a file or directory on the
|
||||
@@ -1421,7 +1421,7 @@ class ZipFile:
|
||||
_ignore_invalid_names = False
|
||||
|
||||
def __init__(self, file, mode="r", compression=ZIP_STORED, allowZip64=True,
|
||||
- compresslevel=None, *, strict_timestamps=True, metadata_encoding=None):
|
||||
+ compresslevel=None, *, strict_timestamps=False, metadata_encoding=None):
|
||||
"""Open the ZIP file with mode read 'r', write 'w', exclusive create 'x',
|
||||
or append 'a'."""
|
||||
"""Open the ZIP file with mode read 'r', write 'w', exclusive create
|
||||
'x', or append 'a'."""
|
||||
if mode not in ('r', 'w', 'x', 'a'):
|
||||
|
||||
@@ -5,7 +5,7 @@ package util-linux {
|
||||
// release candidates confuse Anitya
|
||||
latest = anityaFallback;
|
||||
|
||||
version# = "2.42.1";
|
||||
version# = "2.42.2";
|
||||
source = remoteTar {
|
||||
url = "https://www.kernel.org/pub/linux/utils/util-linux/"+
|
||||
"v"+join {
|
||||
@@ -19,7 +19,7 @@ package util-linux {
|
||||
};
|
||||
sep = ".";
|
||||
}+"/util-linux-"+version+".tar.gz";
|
||||
checksum = "f1c006mnFL9jTEsqnJn08hHqwcL8TpjCJNIToZNuGEPsLmEdNL87r8RzBT-nl9QB";
|
||||
checksum = "Z4IZapPCKQP37aeWMDhxcvuOCy-IR_aHZvfUEMZ0T7trwC1znZACKH_3ddqXwBCg";
|
||||
compress = gzip;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user