From 5e0e0abd61f61992ca002d153286de4117401b8b Mon Sep 17 00:00:00 2001 From: Matthias Fechner <idefix@fechner.net> Date: Sun, 15 Nov 2020 14:38:06 +0100 Subject: [PATCH] Fixed some last problem, first migrations are looking promising. --- gen_config.py | 3 ++- import_mailman_list.sh | 6 +++--- import_mbox.sh | 4 ++-- send_command.sh | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/gen_config.py b/gen_config.py index c3e0633..e5babf2 100755 --- a/gen_config.py +++ b/gen_config.py @@ -16,7 +16,8 @@ xml = ET.Element("list") ET.SubElement(xml, "listname").text = old_vars['new_listname'] ET.SubElement(xml, "status").text = 'open' -ET.SubElement(xml, "type").text = 'import' +ET.SubElement(xml, "type").text = 'private_working_group' +ET.SubElement(xml, "topic").text = 'other' # subject is required in sympa if old_vars['description']: ET.SubElement(xml, "subject").text = old_vars['description'] diff --git a/import_mailman_list.sh b/import_mailman_list.sh index 0f929af..5776109 100755 --- a/import_mailman_list.sh +++ b/import_mailman_list.sh @@ -3,7 +3,7 @@ LIST=$1 ROBOT=${2:-fechner.net} NEWLIST=${3:-$LIST} -ARCHIVE=/usr/mailman/archives/private/$LIST.mbox/$LIST.mbox +ARCHIVE=/usr/local/mailman/archives/private/$LIST.mbox/$LIST.mbox [[ -n "$LIST" ]] || { echo "list may not be empty" ; exit 1 } [[ -f "/usr/local/etc/sympa/$ROBOT/robot.conf" ]] || { echo "robot does not exist" ; exit 1 } @@ -17,7 +17,7 @@ set -x INPUT=$(mktemp) /usr/local/mailman/bin/config_list -o $INPUT $LIST -sed -e s/\ \'/\ u\'/ -e s/\ \"/\ u\"/ -i $INPUT +sed -i '' -e s/\ \'/\ u\'/ -e s/\ \"/\ u\"/ $INPUT echo "new_listname = u'$NEWLIST'" >> $INPUT echo "robot = u'$ROBOT'" >> $INPUT awk '/^wwsympa_url/ { print "url = u\""$2"\""; }' < /usr/local/etc/sympa/$ROBOT/robot.conf >> $INPUT @@ -47,7 +47,7 @@ fi #done # we skip this for now -#/usr/local/mailman/bin/rmlist $LIST +/usr/local/mailman/bin/rmlist $LIST ./notify_owner.py $INPUT rm $INPUT diff --git a/import_mbox.sh b/import_mbox.sh index aac1d41..88620cb 100755 --- a/import_mbox.sh +++ b/import_mbox.sh @@ -48,7 +48,7 @@ pushd "$SYMPA_ROOT/list_data/$SYMPA_DOMAIN/$LIST_NAME/archives" # Convert to Sympa text archives echo "Step 2: converting $MBOX_BACKUP into .log files" -mbox2sympa.pl $MBOX_BACKUP +/root/git/github.com/mailman2sympa/mbox2sympa.pl $MBOX_BACKUP rm $MBOX_BACKUP chown -R $SYMPA_USER "$SYMPA_ROOT/list_data/$SYMPA_DOMAIN/$LIST_NAME/archives" @@ -56,7 +56,7 @@ chmod -R g=rX,o= "$SYMPA_ROOT/list_data/$SYMPA_DOMAIN/$LIST_NAME/archives" # Convert to Sympa web archives input files echo "Step 3: converting .log files into arc/${LIST_NAME}\@${SYMPA_DOMAIN}/\*/arctxt files" -su sympa -s /usr/local/bin/bash -c "/usr/local/libexec/sympa/arc2webarc.pl $LIST_NAME $SYMPA_DOMAIN" || true +su -m sympa -c "/usr/local/libexec/sympa/arc2webarc.pl $LIST_NAME $SYMPA_DOMAIN" || true # Generate the HTML archives echo "Step 4: triggering web archives regeneration" diff --git a/send_command.sh b/send_command.sh index dcc97d8..7ca9804 100755 --- a/send_command.sh +++ b/send_command.sh @@ -1,4 +1,4 @@ -#!/us/bin/env zsh +#!/usr/bin/env zsh # wrapper around sendmail to send commands to sympa [ -f /usr/local/etc/sympa/$1/robot.conf ] || { echo "Robot does not exist" ; exit 1 } -- GitLab