--- /dev/null
+meta4ra@stargrave.org ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIUMcjpT5uw4pSYTic9SqFBrVWxwVl/50Yls0Hpm8Ql1
--- /dev/null
+-----BEGIN PGP SIGNATURE-----
+
+iHUEABYKAB0WIQTbL/jtRAp+lJhvt3bSI36ECQhstwUCZetm/gAKCRDSI36ECQhs
+t31FAQD6t1/WffR40dHXm3hvb4UFAoZthv+lswJJOQdGgJ6ZfwD/Q5lXenxcEkHB
+E1/NtXT0tRuwi4b7MC0mDA9/TkCeRA0=
+=8ZfQ
+-----END PGP SIGNATURE-----
meta4ra is copylefted free software: see the file COPYING for copying
conditions. It should work on all POSIX-compatible systems.
+
+You can select desired fields by ordinary XML-related utulities:
+ xml sel -t -m "/_:metalink/_:file/_:url" -v . -nl data.meta4
#!/bin/sh -e
+# Autodetect possible commandlines for various hashes. Example usage:
+# meta4ra-{create,check} -hashes "$(meta4ra-hashes-detect)" ...
hw="hello world"
hashes=""
#!/bin/sh -e
-exec go build -C cmd/meta4ra -ldflags=-s $@ -o ../../bin/meta4ra
+[ -d vendor ] && mod_vendor="-mod=vendor"
+exec go build -C cmd/meta4ra -ldflags=-s $mod_vendor $@ -o ../../bin/meta4ra
}
flag.Parse()
+ if *showVersion {
+ fmt.Println(meta4ra.Version())
+ return
+ }
+ if *showWarranty {
+ fmt.Println(meta4ra.Warranty)
+ return
+ }
+
data, err := os.ReadFile(*metaPath)
if err != nil {
log.Fatalln(err)
}
}
if len(toCheck) != 0 {
- fmt.Println("not all FILEs met")
- bad = true
+ if _, ok := toCheck["."]; !(len(toCheck) == 1 && ok) {
+ fmt.Println("not all FILEs met")
+ bad = true
+ }
}
if bad {
os.Exit(1)
torrent := flag.String("torrent", "", "Torrent URL")
flag.Usage = func() {
fmt.Fprintf(flag.CommandLine.Output(),
- "Usage: %s [options] [URL ...] < DATA > XXX.meta4\n", os.Args[0])
+ "Usage: %s [options] [URL ...] < data > data.meta4\n", os.Args[0])
flag.PrintDefaults()
}
flag.Parse()
+ if *showVersion {
+ fmt.Println(meta4ra.Version())
+ return
+ }
+ if *showWarranty {
+ fmt.Println(meta4ra.Warranty)
+ return
+ }
+
if *fn == "" {
log.Fatalln("empty -fn")
}
}
flag.Parse()
+ if *showVersion {
+ fmt.Println(meta4ra.Version())
+ return
+ }
+ if *showWarranty {
+ fmt.Println(meta4ra.Warranty)
+ return
+ }
+
hsh := *hashes
if i := strings.Index(hsh, ","); i != -1 {
hsh = hsh[:i]
package main
import (
+ "flag"
"log"
"os"
"path"
)
+var (
+ showVersion = flag.Bool("version", false, "print version")
+ showWarranty = flag.Bool("warranty", false, "print warranty information")
+)
+
func main() {
log.SetFlags(log.Lshortfile)
switch path.Base(os.Args[0]) {
// Metalink 4.0 utilities
package internal
+import (
+ "runtime"
+)
+
const (
Generator = "meta4ra/0.7.0"
SigMediaTypePGP = "application/pgp-signature"
SigMediaTypeSSH = "application/ssh-signature"
BufLen = 1 << 20
+
+ Warranty = `Copyright (C) 2021-2024 Sergey Matveev
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, version 3 of the License.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program. If not, see <http://www.gnu.org/licenses/>.`
)
+
+func Version() string {
+ return Generator + " built with " + runtime.Version()
+}
--- /dev/null
+#!/bin/sh -ex
+
+cur=$(pwd)
+tmp=$(mktemp -d)
+release=$1
+[ -n "$release" ]
+
+git clone . $tmp/meta4ra-$release
+cd $tmp/meta4ra-$release
+git checkout v$release
+
+echo v$release > VERSION
+
+go mod vendor
+find . -name .gitignore -delete
+
+rm -rf .git makedist
+find . -type d -exec chmod 755 {} +
+find . -type f -exec chmod 644 {} +
+chmod +x bin/meta4ra-hashes-detect contrib/mk-meta4 build build-with-thirdparty
+
+cd ..
+tar cvf meta4ra-"$release".tar --uid=0 --gid=0 --numeric-owner meta4ra-"$release"
+zstd -19 -v meta4ra-"$release".tar
+tarball=meta4ra-"$release".tar.zst
+ssh-keygen -Y sign -f ~/.ssh/sign/meta4ra@stargrave.org -n file $tarball
+meta4ra-create -fn "$tarball" -mtime "$tarball" \
+ -sig-ssh "$tarball".sig \
+ http://www.meta4ra.stargrave.org/download/"$tarball" \
+ http://y.www.meta4ra.stargrave.org/download/"$tarball" < "$tarball" > "$tarball".meta4
+
+mv $tmp/$tarball $tarball.meta4 $cur/www/download