-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathm-makelist
executable file
·72 lines (62 loc) · 1.22 KB
/
m-makelist
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
#!/bin/sh
name=m-makelist
[ -n "$1" ] && { cat <<EoF
Usage: $name
This script walks through directory hierarchy from current directory
and create file lists for mLINUX package.
EoF
exit 0; }
umask 022
curdir="$(pwd)"
pkgpath="$curdir/etc/mpkgs"
listspath="$pkgpath/lists"
cd $pkgpath
file="$(ls *.pkg)"
file="${file%.pkg}.list"
cd $curdir
mkdir -p $listspath
echo > $listspath/$file
{ echo 'file_list <<EoF'
find . |sed -n '
{
/^\.$/d
s/\.\///
/^lib\/modules$/d
/^usr\/bin$/d
/^usr\/lib$/d
/^usr\/sbin$/d
/^usr\/share$/d
/^usr\/share\/doc$/d
/^mnt\/fakeroot$/d
/^mnt\/fakeroot\/etc/d
/^mnt\/fakeroot\/var$/d
/^mnt\/fakeroot\/var\/cache$/d
/^mnt\/fakeroot\/var\/lib$/d
/^mnt\/fakeroot\/var\/log$/d
/^mnt\/fakeroot\/var\/run$/d
/^mnt\/fakeroot\/var\/spool$/d
/^etc\/rc\.d\/start\//p
/^etc\/rc\.d\/stop\//p
/^etc\//d
/.*\//p
}' |sort
echo 'EoF'
echo
echo 'conf_list <<EoC'
find . |sed -n '
{
/^\.$/d
s/\.\///
/^etc\/init\.d$/d
/^etc\/mpkgs$/d
/^etc\/mpkgs\/lists$/d
/^etc\/rc\.d$/d
/^etc\/rc\.d\/start/d
/^etc\/rc\.d\/stop/d
/^etc\/sysconfig$/d
/^etc\//p
/^mnt\/fakeroot\/etc\//p
}' |sort
echo 'EoC'
} > $listspath/$file
exit 0