diff options
author | Ori Bernstein <ori@eigenstate.org> | 2021-06-05 05:17:03 -0700 |
---|---|---|
committer | Ori Bernstein <ori@eigenstate.org> | 2021-06-05 05:17:03 -0700 |
commit | 4f3437a3ccde4fadf84f6de254a141cece9ca0af (patch) | |
tree | 7b875560e5a0d44178c651edbbae072af70d1499 /rc | |
parent | 347b552b18cd73514a55a64e93805d33c2c0ddf6 (diff) | |
download | plan9front-4f3437a3ccde4fadf84f6de254a141cece9ca0af.tar.xz |
sysupdate: insert tombstone
after this update, we're on git: update sysupdate
to switch repositories.
Diffstat (limited to 'rc')
-rwxr-xr-x | rc/bin/sysupdate | 44 |
1 files changed, 31 insertions, 13 deletions
diff --git a/rc/bin/sysupdate b/rc/bin/sysupdate index e0420b50f..88fec033c 100755 --- a/rc/bin/sysupdate +++ b/rc/bin/sysupdate @@ -1,17 +1,35 @@ #!/bin/rc + rfork en -source=https://code.9front.org/hg/plan9front -cd / -if(! test -d .hg) - bind -ac /dist/plan9front / -while(! ~ $#* 0){ - switch($1){ - case -i - hg incoming $source - case * - echo usage: sysupdate '[-i]' >[1=2] - exit usage + +updating=() +nl=' +' +if(! test -d /dist/plan9front/.git){ + >[1=2] echo 'end of line for hg: moving to git.' + updating=1 + + if(! test -f /bin/git/pull){ + >[1=2] echo 'git is required:' + >[1=2] echo ' cd /sys/src/cmd/git && mk install' + exit gitless } - shift + + >[1=2] echo ' fetching snapshot...' + cd /dist/plan9front + hget http://git.9front.org/static/plan9front-seed.tar.gz | tar xz + mv .git-snap .git + + git/fs + git/walk >/dev/null + >[1=2] echo ' pulling with git...' } -hg -v pull -u $source + +cd / +if(! test -d .git) + bind -ac /dist/plan9front / +git/pull -u gits://git.9front.org/plan9front/plan9front + +if(~ $updating 1) + >[1=2] echo 'got git: you may remove /dist/plan9front/.hg' +exit '' |