linux-qubasis

linux oasis port as a qubes template

git clone https://9o.is/git/linux-qubasis.git

commit 9bb6d33bd325bc2e5435ca3896181d019b27ff94
parent b7497f9985e0affc1dfc939d06a6b7fa09fef244
Author: Jul <jul@9o.is>
Date:   Wed, 27 Aug 2025 20:46:11 +0800

clean up ninja rule commands

Diffstat:
Mninja/fspec.sh | 4+++-
Mninja/rules.ninja | 4++--
Mninja/sync.sh | 10++++++----
3 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/ninja/fspec.sh b/ninja/fspec.sh @@ -1,5 +1,7 @@ set -eu +hostdir=out/host + out="$1" path="$2" type="$3" @@ -10,7 +12,7 @@ case $type in reg) printf '%s\ntype=reg\nmode=%s\nsource=%s\n\n' \ "$path" "$mode" "$src" > $out.tmp - out/host/fspec-hash <$out.tmp > $out + $hostdir/fspec-hash <$out.tmp > $out rm -f $out.tmp ;; sym) diff --git a/ninja/rules.ninja b/ninja/rules.ninja @@ -4,7 +4,7 @@ rule gen generator = 1 rule sync - command = cd $basedir && downloads=$builddir/downloads sh $basedir/ninja/sync.sh $gendir $in $out >/dev/null + command = sh $basedir/ninja/sync.sh $gendir $in $out >/dev/null description = SYNC $gendir generator = 1 pool = console @@ -54,7 +54,7 @@ rule rsp rspfile_content = $in_newline rule fspec - command = cd $basedir && sh $basedir/ninja/fspec.sh $out $path $type $mode $in $target >/dev/null + command = sh $basedir/ninja/fspec.sh $out $path $type $mode $in $target >/dev/null description = FSPEC $out rule fspec-tar diff --git a/ninja/sync.sh b/ninja/sync.sh @@ -1,7 +1,9 @@ set -eu +dldir=out/downloads + if [ "$#" != 3 ] ; then - echo 'usage: sync.sh gendir in out' >&2 + echo 'usage: sync.sh dir version_file out_file' >&2 exit 2 fi @@ -26,15 +28,15 @@ sync_curl() { local url="$2" local sha256="$3" local rel="$4" - local file="$downloads/${url##*/}" + local file="$dldir/${url##*/}" if [ -e "$repo" ]; then rm -rf "$repo" fi if [ ! -e "$file" ]; then - mkdir -p "$downloads" - curl -OL --progress-bar --output-dir "$downloads" "$url" + mkdir -p "$dldir" + curl -OL --progress-bar --output-dir "$dldir" "$url" printf "$sha256 $file" > "$file.sha256" sha256sum --check "$file.sha256" >/dev/null