Skip to content

Commit e8deb3c

Browse files
committed
Major update.
1 parent 57cc23c commit e8deb3c

26 files changed

+1210
-41
lines changed

README

+7
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,10 @@ Maintenance scripts go here.
33
Anything which is useful for the development of freenet, which isn't an app, a plugin, or part of Freenet itself.
44

55
Obviously the actual private keys etc won't be included...
6+
7+
Note that some of these scripts are supposed to run as different users:
8+
- Most stuff involved in releasing a build is on one user.
9+
- Some of it is on a different user.
10+
- grabbackup is on a third user (which is just used for backups).
11+
12+
You will also need ssh access to osprey.

build-wininstaller

+101
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
#!/bin/bash
2+
MAINVER=0.7.5
3+
echo Clearing ~freenet-buildwin
4+
rm -Rf ~freenet-buildwin/*
5+
rm -Rf ~freenet-buildwin/.[a-zA-Z0-9]*
6+
mkdir ~freenet-buildwin/.ssh
7+
cat ~/.ssh/id_rsa.pub > ~freenet-buildwin/.ssh/authorized_keys
8+
chmod 700 ~freenet-buildwin/.ssh
9+
mkdir ~freenet-buildwin/bin
10+
(echo "cd tmp" ; echo "cd app-wininstaller" ; echo "wine cmd /c build.cmd") > ~freenet-buildwin/bin/build-alpha
11+
mkdir ~freenet-buildwin/tmp
12+
cp -a /usr/src/cvs/eclipse-workspace/app-wininstaller ~freenet-buildwin/tmp
13+
(cd ~freenet-buildwin/tmp/app-wininstaller; git checkout alpha)
14+
echo Copied
15+
GITVERSION=`cd ~freenet-buildwin/tmp/app-wininstaller && git describe --always --abbrev=40`
16+
if [[ -z $GITVERSION ]]; then echo Could not get git version; exit 1; fi
17+
echo Git version is $GITVERSION
18+
rm -Rf ~freenet-buildwin/tmp/app-wininstaller/.git
19+
mkdir ~freenet-buildwin/tmp/app-wininstaller/lib
20+
21+
# Copy files
22+
23+
ln -s /usr/src/cvs/eclipse-workspace/FreenetReleased/freenet.jar ~freenet-buildwin/tmp/app-wininstaller/res/install_node/freenet.jar || exit
24+
ln -s /usr/src/cvs/eclipse-workspace/FreenetReleased/freenet-ext.jar ~freenet-buildwin/tmp/app-wininstaller/res/install_node/freenet-ext.jar || exit
25+
cp ~toad/seednodes.fref ~freenet-buildwin/tmp/app-wininstaller/res/install_node/seednodes.fref || exit
26+
for x in JSTUN KeyUtils ThawIndexBrowser UPnP Library; do
27+
ln -s /usr/src/cvs/eclipse-workspace/FreenetReleased/${x}.jar ~freenet-buildwin/tmp/app-wininstaller/res/install_node/plugins/${x}.jar || exit
28+
done
29+
cp ~freenet-buildwin/tmp/app-wininstaller/bin/Ahk2Exe.exe ~freenet-buildwin/tmp/app-wininstaller/bin/AutoHotkeySC.bin ~freenet-buildwin/tmp/app-wininstaller/res/tool_ahk/
30+
echo Copied dependancies.
31+
32+
VERSION=`cat /usr/src/cvs/eclipse-workspace/FreenetReleased/freenet.build`
33+
echo VERSION is $VERSION
34+
echo Updating build
35+
(cd ~freenet-buildwin/tmp/app-wininstaller; cat src/freenetinstaller/FreenetInstaller_Include_Info.inc | sed "s/_Inc_FreenetBuild = \#[0-9]\\+/_Inc_FreenetBuild = \#$VERSION/" > 1; cat 1 > src/freenetinstaller/FreenetInstaller_Include_Info.inc; cat 1)
36+
chown -R freenet-buildwin.freenet-buildwin ~freenet-buildwin
37+
chmod +x ~freenet-buildwin/bin/build-alpha
38+
echo Running the build
39+
rm ~freenet-buildwin/tmp/app-wininstaller/bin/*
40+
eval `ssh-agent -s`
41+
ssh-add
42+
ssh -n freenet-buildwin@localhost xvfb-run ~freenet-buildwin/bin/build-alpha
43+
kill -9 `pgrep -u freenet-buildwin`
44+
cd
45+
mkdir -p tmp-wi
46+
cd tmp-wi
47+
rm /root/tmp-wi/*
48+
cp ~freenet-buildwin/tmp/app-wininstaller/bin/FreenetInstaller.exe FreenetInstaller-${VERSION}.exe
49+
cd ~freenet-buildwin/tmp/app-wininstaller/res/install_node/updater/ || exit
50+
cp update.cmd update-new.cmd || exit
51+
sha1sum update-new.cmd > update-new.cmd.sha1 || exit
52+
sha1sum update.cmd > update.cmd.sha1 || exit
53+
cd ~/tmp-wi
54+
55+
#Uncomment if just want it for testing.
56+
#echo Built it, file is in `pwd`
57+
#exit
58+
59+
rsync ~freenet-buildwin/tmp/app-wininstaller/res/install_node/updater/update*cmd* osprey.vm.bytemark.co.uk:/var/www/downloads/alpha/update/
60+
61+
echo Uploading
62+
cp FreenetInstaller-${VERSION}.exe ~toad/
63+
echo Signing
64+
su - toad -c "gpg --sign --detach-sign FreenetInstaller-${VERSION}.exe"
65+
cp ~toad/FreenetInstaller-${VERSION}.exe.sig .
66+
echo Uploading to Google Code
67+
#/root/bin/googlecode_upload.py -s "Freenet $MAINVER build $VERSION Windows installer" -p freenet -u matthew.toseland FreenetInstaller-alpha-${VERSION}.exe || exit
68+
cp FreenetInstaller-${VERSION}.exe ~browser/
69+
chmod a+r ~browser/FreenetInstaller-${VERSION}.exe
70+
echo Uploading to emu
71+
rsync -v FreenetInstaller-${VERSION}.exe* osprey.vm.bytemark.co.uk:/var/www/downloads/alpha/installer/
72+
cp FreenetInstaller-${VERSION}.exe* /usr/src/cvs/eclipse-workspace/FreenetReleased/
73+
ssh osprey.vm.bytemark.co.uk -- "cp /var/www/downloads/alpha/.registry .; cat /var/www/downloads/alpha/.registry | sed \"s/FreenetInstaller.exe .*$/FreenetInstaller.exe installer\/FreenetInstaller-${VERSION}.exe/\" > new-registry ; cat new-registry > /var/www/downloads/alpha/.registry"
74+
75+
cp ~freenet-buildwin/tmp/app-wininstaller/res/install_node/wrapper/freenetwrapper.exe ~freenet-buildwin/tmp/app-wininstaller/bin/wrapper-windows-x86-32.exe || exit
76+
77+
cp ~freenet-buildwin/tmp/app-wininstaller/res/install_node/wrapper/wrapper-windows-x86-32.dll ~freenet-buildwin/tmp/app-wininstaller/bin/ || exit
78+
79+
cd ~freenet-buildwin/tmp/app-wininstaller/bin/
80+
mv freenetlauncher.exe freenetlauncher-new.exe
81+
82+
for name in wrapper-windows-x86-32.exe wrapper-windows-x86-32.dll freenetlauncher-new.exe; do
83+
84+
cd ~freenet-buildwin/tmp/app-wininstaller/bin/
85+
86+
echo Uploading ${name} version ${GITVERSION}
87+
88+
mv $name ${name}.${GITVERSION}
89+
sha1sum ${name}.${GITVERSION} > ${name}.${GITVERSION}.sha1
90+
rsync -v ${name}.${GITVERSION}* osprey.vm.bytemark.co.uk:/var/www/downloads/alpha/installer/
91+
92+
ssh osprey.vm.bytemark.co.uk -- "cat /var/www/downloads/alpha/.registry | sed \"s/$name .*$/${name} installer\/${name}.${GITVERSION}/\" > new-registry ; cat new-registry > /var/www/downloads/alpha/.registry"
93+
94+
done
95+
96+
ssh-agent -k
97+
98+
# Doesn't work, why?
99+
#echo "http://downloads.freenetproject.org/alpha/installer/FreenetInstaller-${VERSION}.exe" > FreenetInstaller.exe.url
100+
#rsync -vz FreenetInstaller.exe.url osprey.vm.bytemark.co.uk:/var/www/downloads/alpha/installer/FreenetInstaller.exe.url
101+
echo Now upload ~browser/FreenetInstaller-${VERSION}.exe to Google Code!

build-wininstaller-old

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
#!/bin/bash
2+
MAINVER=0.7.5
3+
rm -Rf ~freenet-buildwin/*
4+
rm -Rf ~freenet-buildwin/.[a-zA-Z0-9]*
5+
mkdir ~freenet-buildwin/.ssh
6+
cat ~/.ssh/id_rsa.pub > ~freenet-buildwin/.ssh/authorized_keys
7+
chmod 700 ~freenet-buildwin/.ssh
8+
mkdir ~freenet-buildwin/bin
9+
(echo "cd tmp" ; echo "cd app-wininstaller" ; echo "wine cmd /c BuildAll.cmd") > ~freenet-buildwin/bin/build
10+
mkdir ~freenet-buildwin/tmp
11+
cp -a /usr/src/cvs/eclipse-workspace/app-wininstaller ~freenet-buildwin/tmp
12+
(cd ~freenet-buildwin/tmp/app-wininstaller; git checkout master)
13+
echo Copied
14+
GITVERSION=`cd ~freenet-buildwin/tmp/app-wininstaller && git describe --always --abbrev=40`
15+
if [[ -z $GITVERSION ]]; then echo Could not get git version; exit 1; fi
16+
rm -Rf ~freenet-buildwin/tmp/app-wininstaller/.git
17+
mkdir ~freenet-buildwin/tmp/app-wininstaller/lib
18+
ln -s ~freenet-buildwin/tmp/app-wininstaller/bin/freenet.jar ~freenet-buildwin/tmp/app-wininstaller/lib/freenet-cvs-snapshot.jar
19+
cp ~toad/seednodes.fref ~freenet-buildwin/tmp/app-wininstaller/src_freenetinstaller/files_install/seednodes.fref
20+
VERSION=`getversion ~freenet-buildwin/tmp/app-wininstaller/`
21+
echo VERSION is $VERSION
22+
(cd ~freenet-buildwin/tmp/app-wininstaller; cat src_freenetinstaller/FreenetInstaller_Include_Info.inc | sed "s/_Inc_FreenetBuild = \#[0-9]\\+/_Inc_FreenetBuild = \#$VERSION/" > 1; cat 1 > src_freenetinstaller/FreenetInstaller_Include_Info.inc; cat 1)
23+
chown -R freenet-buildwin.freenet-buildwin ~freenet-buildwin
24+
chmod +x ~freenet-buildwin/bin/build
25+
eval `ssh-agent -s`
26+
ssh-add
27+
ssh -n freenet-buildwin@localhost xvfb-run ~freenet-buildwin/bin/build
28+
kill -9 `pgrep -u freenet-buildwin`
29+
cd
30+
mkdir tmp-wi
31+
cd tmp-wi
32+
cp ~freenet-buildwin/tmp/app-wininstaller/bin/FreenetInstaller.exe FreenetInstaller-${VERSION}-old.exe
33+
(cd ~freenet-buildwin/tmp/app-wininstaller/src_freenetinstaller/files_install/; cp update.cmd update-new.cmd; sha1sum update-new.cmd > update-new.cmd.sha1; sha1sum update.cmd > update.cmd.sha1)
34+
rsync ~freenet-buildwin/tmp/app-wininstaller/src_freenetinstaller/files_install/update*cmd* osprey.vm.bytemark.co.uk:/var/www/downloads/alpha/update/
35+
cp FreenetInstaller-${VERSION}-old.exe ~toad/
36+
su - toad -c "gpg --sign --detach-sign FreenetInstaller-${VERSION}-old.exe"
37+
cp ~toad/FreenetInstaller-${VERSION}-old.exe.sig .
38+
echo Uploading to Google Code
39+
cp FreenetInstaller-${VERSION}-old.exe ~browser/
40+
chmod a+r ~browser/FreenetInstaller-${VERSION}-old.exe
41+
echo Uploading to emu
42+
rsync -v FreenetInstaller-${VERSION}-old.exe* osprey.vm.bytemark.co.uk:/var/www/downloads/alpha/installer/
43+
cp FreenetInstaller-${VERSION}-old.exe* /usr/src/cvs/eclipse-workspace/FreenetReleased/
44+
ssh osprey.vm.bytemark.co.uk -- "cp /var/www/downloads/alpha/.registry .; cat /var/www/downloads/alpha/.registry | sed \"s/FreenetInstaller-old.exe .*$/FreenetInstaller-old.exe installer\/FreenetInstaller-${VERSION}-old.exe/\" > new-registry ; cat new-registry > /var/www/downloads/alpha/.registry"
45+
46+
cp ~freenet-buildwin/tmp/app-wininstaller/src_freenetinstaller/files_install/bin/wrapper-windows-x86-32.exe ~freenet-buildwin/tmp/app-wininstaller/bin/
47+
48+
cp ~freenet-buildwin/tmp/app-wininstaller/src_freenetinstaller/files_install/lib/wrapper-windows-x86-32.dll ~freenet-buildwin/tmp/app-wininstaller/bin/
49+
50+
for name in wrapper-windows-x86-32.exe wrapper-windows-x86-32.dll start.exe stop.exe freenetlauncher.exe; do
51+
52+
cd ~freenet-buildwin/tmp/app-wininstaller/bin/
53+
54+
echo Uploading ${name} version ${GITVERSION}
55+
56+
mv $name ${name}.${GITVERSION}
57+
sha1sum ${name}.${GITVERSION} > ${name}.${GITVERSION}.sha1
58+
rsync -v ${name}.${GITVERSION}* osprey.vm.bytemark.co.uk:/var/www/downloads/alpha/installer/
59+
60+
ssh osprey.vm.bytemark.co.uk -- "cat /var/www/downloads/alpha/.registry | sed \"s/$name .*$/${name} installer\/${name}.${GITVERSION}/\" > new-registry ; cat new-registry > /var/www/downloads/alpha/.registry"
61+
62+
done
63+
64+
# Doesn't work, why?
65+
#echo "http://downloads.freenetproject.org/alpha/installer/FreenetInstaller-${VERSION}.exe" > FreenetInstaller.exe.url
66+
#rsync -vz FreenetInstaller.exe.url osprey.vm.bytemark.co.uk:/var/www/downloads/alpha/installer/FreenetInstaller.exe.url
67+
echo Now upload ~browser/FreenetInstaller-${VERSION}-old.exe to Google Code!
68+
ssh-agent -k

check-seednode-messages

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
(cat seednodes-failed.mbox | grep "RESULT:.*NOT CONNECTED IN LAST WEEK" | cut -d " " -f 1 | cut -d ":" -f 2) | (while read x; do grep --files-with-match -e "$x" seedrefs/*; done) | (while read x; do echo "$x"; done) | sed "s/^seedrefs\///g" | sed -n "s/^.*---//p"
3+
# | sed -n "s/^.*-\\([^-]*@.*$\\)/\\1/p"

compare-l10n

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
NEWVER=$1
3+
OLDVER=$[ $NEWVER - 1 ]
4+
echo Comparing $NEWVER to $OLDVER
5+
TEMPDIR=`mktemp -d -p /tmp tmp.XXXXXXX`
6+
cd $TEMPDIR
7+
cp -a /usr/src/cvs/eclipse-workspace/fred .
8+
mkdir $OLDVER
9+
mkdir $NEWVER
10+
cd fred
11+
git checkout build0${OLDVER}
12+
cp src/freenet/l10n/freenet.l10n.en.properties ../$OLDVER
13+
git checkout build0${NEWVER}
14+
cp src/freenet/l10n/freenet.l10n.en.properties ../$NEWVER
15+
cd ..
16+
diff -u0 $OLDVER/freenet.l10n.en.properties $NEWVER/freenet.l10n.en.properties > ${OLDVER}-${NEWVER}.diff.txt
17+
less ${OLDVER}-${NEWVER}.diff.txt
18+
rsync -vz ${OLDVER}-${NEWVER}.diff.txt osprey.vm.bytemark.co.uk:/var/www/emu/l10n/
19+
rm -Rf $TEMPDIR

full-backup-osprey

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
cd /root
3+
echo SYNCING FULL BACKUP OF OSPREY.VM.BYTEMARK.CO.UK
4+
mv osprey.full.backup.prevprev osprey.full.backup.previous
5+
rm -Rf osprey.full.backup.previous
6+
echo COPYING PREVIOUS BACKUP
7+
cp -a osprey.full.backup osprey.full.backup.previous
8+
echo SYNCING...
9+
mkdir -p osprey.full.backup
10+
chmod 700 osprey.full.backup
11+
rsync -avzx osprey.vm.bytemark.co.uk:/ osprey.full.backup/backup
12+
echo SYNCED

getversion

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
cd "$1"
3+
chmod -R a+rX .
4+
su nobody -c "java -cp lib/freenet-cvs-snapshot.jar freenet.node.Version" | sed "s/^Freenet: Fred 0.7 (protocol [0-9]*.[0-9]*) build //" | cut -d " " -f 1

grabbackup

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
cp -a latest-backup last-backup
3+
rsync -avz [email protected]:latest-backup .
4+
TARGET=backup-`date +%A`
5+
rm -Rf $TARGET
6+
cp -a latest-backup $TARGET
7+
TARGET=backup-day-`date +%d`
8+
rm -Rf $TARGET
9+
cp -a latest-backup $TARGET
10+
TARGET=backup-`date +%B`
11+
rm -Rf $TARGET
12+
cp -a latest-backup $TARGET
13+
TARGET=backup-`date +%Y`
14+
rm -Rf $TARGET
15+
cp -a latest-backup $TARGET

0 commit comments

Comments
 (0)