okami.mom/strata
git clone https://git.nkp.pet/okami.mom/strata
66bc88907
main
1#!/bin/sh 2# Update Strata without starting the model (#475): the newest code (git pull, when this folder is a git clone), then 3# what ./setup.sh does before a start - the engine (a new ready-made one when this version needs it, or compiled 4# again when its source changed), the Python packages, each installed model's settings and draft subset. The model 5# files are not touched. Start the model later with ./setup.sh. Options are passed on to setup.py. The bundled Python 6# (python/ beside this file) is used when there is one: ./setup.sh, which this file runs, picks it. 7cd " $( dirname " $ 0" ) " ||exit 1 8# all of it in a function, read before it runs: the git pull below can change this very file 9main () { 10if [ -e .git ];then 11if !command -v git> /dev/null2 >&1;then 12echo "This folder is a git clone, but git is not installed: install it (sudo apt install git) or run" 13echo "\"git pull\" here yourself, then run ./update.sh again." 14exit 1 15fi 16echo "Getting the newest Strata (git pull) ..." 17if !git pull--ff-only ;then 18# The history of the repository was rewritten on 2026-10-06 (#1276): a clone made before that has no commit in 19# common with origin/main, so a fast-forward can never work. Say so, and move it over when nothing is lost. 20if [" $( git rev-parse --is-shallow-repository 2 > /dev/null) " !="true" ]&& !git merge-base HEAD origin/main> /dev/null2 >&1;then 21echo 22echo "This clone is on the repository's old history (cleaned up on 2026-10-06): it has no commit in common" 23echo "with origin/main, so it cannot be updated by git pull." 24if [ -n" $( git status --porcelain --untracked-files=no ) " ];then 25echo "You have local changes to tracked files here, so nothing was touched. To move to the new history" 26echo "yourself (your untracked files, models and settings stay where they are):" 27echo " git branch pre-cleanup-backup && git stash push # keeps the old commits and your edits" 28echo " git checkout -B main origin/main" 29echo "then run ./update.sh again." 30exit 1 31fi 32bk =pre-cleanup-backup 33if git rev-parse--verify -q "refs/heads/ $ bk " > /dev/null2 >&1;then 34bk ="pre-cleanup-backup- $( date +%Y%m%d%H%M%S) " 35fi 36branch =$( git symbolic-ref --short -q HEAD || echo main) 37if git branch" $ bk " HEAD&& git checkout-q -B " $ branch " origin/main;then 38echo "Moved to the new history. Your old commits are kept in the branch $ bk ." 39echo "Untracked files (models, settings, the engine) were not touched." 40else 41# the backup branch made a moment ago would make the by-hand `git branch pre-cleanup-backup` below fail 42git branch-D " $ bk " > /dev/null2 >&1 43echo "Could not move to the new history (the reason is above): nothing was updated. By hand:" 44echo " git branch pre-cleanup-backup" 45echo " git checkout -B main origin/main" 46exit 1 47fi 48else 49echo 50echo "git pull did not succeed (the reason is above): nothing was updated. Files you changed here can stop it:" 51echo "\"git status\" lists them." 52exit 1 53fi 54fi 55else 56echo "This copy of Strata was not made with git, so it cannot fetch new files itself. Download the newest one:" 57echo " https://github.com/Niko1221/Strata/archive/refs/heads/main.zip" 58echo "unzip it anywhere and run ./setup.sh (or ./update.sh) in it: it finds the model files in Strata-data and" 59echo "sets itself up the same way - nothing big is downloaded again." 60echo "Checking this copy's engine and settings meanwhile ..." 61fi 62exec sh ./setup.sh--update " $ @" 63} 64main " $ @"