summaryrefslogtreecommitdiff
path: root/bin/opie-reorgfiles
blob: 96b3e29da47016f7a84b3d1a4819cf8ad1b2ba5e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#!/bin/sh

APPS=$HOME/Applications
DOCS=$HOME/Documents

if [ -d $APPS -a "$1" != "-f" ]
then
    echo "You seem to already have a $APPS directory."
    echo "Assuming it is the Opie Applications directory. Exiting."
    exit 0
fi

if [ -d $HOME/Apps ]
then
    mv $HOME/Apps $APPS
else
    mkdir $APPS
fi

if [ -f $DOCS/addressbook.xml ]
then
    if [ -f $APPS/addressbook/addressbook.xml ]
    then
	echo "$DOCS/addressbook.xml conflicts with $APPS/addressbook/addressbook.xml"
	echo "Moving $DOCS/addressbook.xml to $HOME"
	mv $DOCS/addressbook.xml $HOME
    else
	mkdir $APPS/addressbook
	mv $DOCS/addressbook.xml $APPS/addressbook
    fi
fi

if [ -f $DOCS/datebooksettings.xml ]
then
    echo "$DOCS/datebooksettings.xml is obsolete"
    echo "Please re-set your datebook preferences"
    rm $DOCS/datebooksettings.xml
fi

if [ -f $DOCS/datebook.xml ]
then
    mkdir $APPS/databook
    mv $DOCS/datebook.xml $APPS/databook
fi

if [ -d $DOCS/qtmail ]
then
    mv $DOCS/qtmail $APPS/
fi

if [ -f $DOCS/todo.xml ]
then
    if [ -f $APPS/todolist/todolist.xml ]
    then
	mv $DOCS/todo.xml $HOME
	echo "$DOCS/todo.xml is superceded by  $APPS/todolist/todolist.xml"
	echo "$DOCS/todo.xml has been moved to $HOME"
    else
	echo "NOTE: $DOCS/todo.xml is obsolete. It will move to $APPS/todolist/todolist.xml"
	echo "when next you run the latest ToDo application."
    fi
fi

if [ ! -d $APPS/qimpen ]
then
    mkdir $APPS/qimpen
fi

if [ -f $DOCS/asciilower.qpt ]
then
    mv $DOCS/asciilower.qpt $APPS/qimpen
fi

if [ -f $DOCS/asciiupper.qpt ]
then
    mv $DOCS/asciiupper.qpt $APPS/qimpen
fi

if [ -f $DOCS/numeric.qpt ]
then
    mv $DOCS/numeric.qpt $APPS/qimpen
fi

if [ -d "$HOME/.qpe" ]
then
    if [ -d "$HOME/Settings" ]
    then
	mv $HOME/.qpe/* "$HOME/Settings"
	rmdir "$HOME/.qpe"
    else
	mv $HOME/.qpe "$HOME/Settings"
    fi
fi