1
0
mirror of https://github.com/imapsync/imapsync.git synced 2024-11-17 00:02:29 +01:00
imapsync/memo

149 lines
3.9 KiB
Plaintext
Raw Normal View History

2011-03-12 03:43:54 +01:00
#!/bin/sh
2011-06-14 12:59:46 +02:00
# $Id: memo,v 1.31 2011/05/07 02:30:54 gilles Exp gilles $
2011-03-12 03:43:54 +01:00
software_version() {
VERSION=`cat VERSION`
}
2011-03-12 03:45:02 +01:00
statistics_lfo() {
2011-03-12 03:45:04 +01:00
# 62.147.165.21 - - [31/Oct/2010:23:45:28 +0100] "GET /prj/imapsync/VERSION HTTP/1.0" 200 6 "-" "imapsync/1.368 (linux system, perl 5.8.8, Mail::IMAPClient 2.2.9 imapsync)"
2011-03-12 03:45:02 +01:00
#grep prj/imapsync/VERSION /usr/local/apache/logs/access_log | sort -n | cut -d ' ' -f 1,12,13|uniq -c | sort -n # list ip
cat <<EOFF
2011-04-24 23:19:36 +02:00
ssh glamiral@linux-france.org "grep -h prj/imapsync/VERSION /usr/local/apache/logs/access_log*|cut -d ' ' -f 1,12,13,18,19|sort -n|uniq -c|sort -n" # list ip
ssh glamiral@linux-france.org "grep -h prj/imapsync/VERSION /usr/local/apache/logs/access_log*|cut -d ' ' -f 1,12,13,18,19|sort -n|uniq -c|sort -n |grep MSWin32" # Win32
2011-03-12 03:45:02 +01:00
2011-04-24 23:19:36 +02:00
ssh glamiral@linux-france.org "grep -h prj/imapsync/VERSION /usr/local/apache/logs/access_log*|cut -d ' ' -f 13,18,19 |sort -n|uniq -c| sort -n" # OS usage+basename
ssh glamiral@linux-france.org "grep -h prj/imapsync/VERSION /usr/local/apache/logs/access_log*|cut -d ' ' -f 12 |sort -n|uniq -c| sort -n" # imapsync release
2011-03-12 03:45:02 +01:00
tail -f /usr/local/apache/logs/access_log|cat -n|grep prj/imapsync/VERSION|cat -n |grep VERSION # lfo frequency'
EOFF
}
2011-06-14 12:59:46 +02:00
statistics_VERSION() {
2011-03-12 03:45:02 +01:00
2011-06-14 12:59:46 +02:00
TMPDIR=.
export TMPDIR
echo statistics_VERSION_getstats
statistics_VERSION_getstats() {
for f in /home/lf/backuplog/linux-france.org.??-??-2011.bz2; do
b=`basename "$f" .bz2`
echo "$b"
test -f ${b}.imapsync_VERSION && continue
echo NOT DONE ${b}.imapsync_VERSION
bzip2 -dc "$f" | grep -h /prj/imapsync/VERSION > ${b}.imapsync_VERSION
done
}
echo statistics_VERSION_monthly_ip
statistics_VERSION_monthly_ip() {
month=$1
cut -d ' ' -f 1,12,13,18,19 linux-france.org.??-${month}-2011.imapsync_VERSION |sort -n |uniq -c|sort -n > stats_imapsync_2011_${month}.ip
}
echo statistics_VERSION_monthly_ip_wc
statistics_VERSION_monthly_ip_wc() {
month=$1
test -f stats_imapsync_2011_${month}.ip || statistics_VERSION_monthly_ip $month
wc -l stats_imapsync_2011_${month}.ip
}
echo statistics_VERSION_monthly_runs
statistics_VERSION_monthly_runs() {
month=$1
test -f stats_imapsync_2011_${month}.runs || wc -l linux-france.org.??-${month}-2011.imapsync_VERSION > stats_imapsync_2011_${month}.runs
cat stats_imapsync_2011_${month}.runs
}
}
2011-03-12 03:45:02 +01:00
2011-03-12 03:43:54 +01:00
niouzes_compil() {
2011-03-12 03:45:04 +01:00
(
cd /g/public_html/www.linux-france.org/html/
2011-03-12 03:43:54 +01:00
m4 niouzes.m4 > niouzes.xml
python ./niouzes/getmynews.py --neuf niouzes.xml > niouzes-neuf.html
python ./niouzes/getmynews.py --html niouzes.xml > niouzes-html.html
2011-03-12 03:45:04 +01:00
)
2011-03-12 03:43:54 +01:00
}
2011-03-12 03:44:35 +01:00
2011-03-12 03:43:54 +01:00
lfo_announce() {
software_version
2011-03-12 03:45:04 +01:00
NEWS_FILE="/g/public_html/www.linux-france.org/html/niouzes/niouzes_imapsync.xml"
2011-03-12 03:43:54 +01:00
if ! newer VERSION $NEWS_FILE; then
echo "$VERSION already announced"
else
2011-03-12 03:43:55 +01:00
cat > $NEWS_FILE << EOF
2011-03-12 03:43:54 +01:00
<news date="`date '+%Y%m%d'`">
2011-03-12 03:44:35 +01:00
`LANG=fr_FR date '+%A %d %B %Y'` : Synchronisez ou migrez vos boites
aux lettres avec <20>conomie et l'outil <A
2011-03-12 03:43:54 +01:00
HREF="prj/imapsync/">imapsync $VERSION</A> (Gilles LAMIRAL)
</news>
EOF
fi
niouzes_compil
}
2011-03-12 03:44:49 +01:00
#' nedit sucks with syntax color
2011-03-12 03:44:27 +01:00
2011-03-12 03:44:35 +01:00
fm_init() {
2011-03-12 03:44:21 +01:00
software_version
2011-03-12 03:44:49 +01:00
NEWS_FILE_FM="./freshmeat_submition"
2011-03-12 03:44:27 +01:00
NEWS_FILE_FM_INP=${NEWS_FILE_FM}.inp
2011-03-12 03:45:02 +01:00
NEWS_FILE_FM_OUT=${NEWS_FILE_FM}.json
2011-03-12 03:44:35 +01:00
}
2011-03-12 03:44:27 +01:00
2011-03-12 03:44:49 +01:00
fm_read_param() {
# read definitions
. $NEWS_FILE_FM_INP
}
2011-03-12 03:44:35 +01:00
fm_read_announce() {
2011-03-12 03:44:49 +01:00
fm_init
fm_read_param
2011-03-12 03:44:35 +01:00
2011-03-12 03:44:49 +01:00
cat << EOF
2011-03-12 03:45:02 +01:00
{
"release": {
"tag_list": "stable, $RELEASE_FOCUS",
"version": "$VERSION",
"hidden_from_frontpage": false,
"changelog": "$TEXT_BODY"
}
}
2011-03-12 03:44:27 +01:00
2011-03-12 03:44:21 +01:00
EOF
2011-03-12 03:44:35 +01:00
}
fm_announce() {
2011-03-12 03:44:49 +01:00
fm_init
2011-03-12 03:44:35 +01:00
2011-03-12 03:44:49 +01:00
if ! newer VERSION $NEWS_FILE_FM_OUT; then
2011-03-12 03:44:35 +01:00
echo "$VERSION already submitted on freshmeat"
2011-03-12 03:44:49 +01:00
else
2011-03-12 03:44:35 +01:00
if newer VERSION $NEWS_FILE_FM_INP; then
echo "Update $NEWS_FILE_FM_INP please"
return 1
fi
fm_read_announce > $NEWS_FILE_FM_OUT
2011-03-12 03:45:02 +01:00
curl -X PUT -d @../../var/pass/secret.freshmeat -d @$NEWS_FILE_FM_OUT \
-H "Content-Type: application/json" \
http://freshmeat.net/projects/imapsync.json
2011-03-12 03:44:49 +01:00
fi
2011-03-12 03:44:21 +01:00
}