Commit | Line | Data |
---|---|---|
eff5b070 JB |
1 | #!/bin/bash |
2 | ||
3 | # getCoreDiff.sh: Script that fetch the current sources of core, core-arm | |
4 | # and core-cross collections, and find differences between them | |
5 | ||
6 | msgError() { | |
7 | echo "Error, $@" 2>&1 | |
8 | rm -rf $TMPDIR | |
9 | exit 1 | |
10 | } | |
11 | ||
12 | TMPDIR=$(mktemp -d) | |
13 | ||
14 | version="2.7" | |
15 | ||
16 | gitrepo_core="git://crux.nu/ports/core.git" | |
17 | gitrepo_core_arm="git://crux-arm.nu/crux-arm/ports/core-arm.git" | |
18 | gitrepo_core_cross="git://crux-arm.nu/crux-arm/ports/core-cross.git" | |
19 | ||
20 | # handle signals | |
21 | trap "msgError interrupted" SIGINT SIGTERM | |
22 | ||
23 | echo "+ Fetching git sources..." | |
24 | ||
25 | echo "++ $gitrepo_core" | |
26 | cd $TMPDIR && \ | |
27 | git clone $gitrepo_core && \ | |
28 | cd core && \ | |
29 | git branch 2.7 origin/2.7 && \ | |
30 | git checkout 2.7 | |
31 | ||
32 | echo "++ $gitrepo_core_arm" | |
33 | cd $TMPDIR && \ | |
34 | git clone $gitrepo_core_arm && \ | |
35 | cd core-arm && \ | |
36 | git branch 2.7 origin/2.7 && \ | |
37 | git checkout 2.7 | |
38 | ||
39 | echo "++ $gitrepo_core_cross" | |
40 | cd $TMPDIR && \ | |
41 | git clone $gitrepo_core_cross && \ | |
42 | cd core-cross && \ | |
43 | git branch 2.7 origin/2.7 && \ | |
44 | git checkout 2.7 | |
45 | ||
46 | echo "+ Generating data..." | |
47 | # core list | |
48 | cd $TMPDIR/core && find -type d | grep -v '.git' | sed 's|./||' | sed 1d | sort -u > $TMPDIR/core.lst | |
49 | # core-arm list | |
50 | cd $TMPDIR/core-arm && find -type d | grep -v '.git' | sed 's|./||' | sed 1d | sort -u > $TMPDIR/core-arm.lst | |
51 | # core-cross list | |
52 | cd $TMPDIR/core-cross && find -type d | grep -v '.git' | sed 's|./||' | sed 1d | sort -u > $TMPDIR/core-cross.lst | |
53 | ||
54 | echo | |
55 | echo "++++++++++++++++++++ RESULTS ++++++++++++++++++++" | |
56 | echo | |
57 | echo "* New ports (core -> core-arm)" | |
58 | comm -13 $TMPDIR/core.lst $TMPDIR/core-arm.lst | |
59 | echo | |
60 | echo "* New ports (core -> core-cross)" | |
61 | comm -13 $TMPDIR/core.lst $TMPDIR/core-cross.lst | |
62 | echo | |
63 | echo "* Missing ports (core -> core-cross)" | |
64 | comm -23 $TMPDIR/core.lst $TMPDIR/core-cross.lst | |
65 | echo | |
66 | echo "* Overlayed ports (core -> core-arm)" | |
67 | comm -12 $TMPDIR/core.lst $TMPDIR/core-arm.lst | |
68 | ||
69 | rm -fr $TMPDIR | |
70 | ||
71 | # End of file |