CRUX-ARM : Home

Home :: Documentation :: Download :: Development :: Community :: Ports :: Packages :: Bugs :: Links :: About :: Donors
Initial import for getCoreDiff script
authorJose V Beneyto <sepen@crux.nu>
Wed, 25 Apr 2012 12:18:30 +0000 (14:18 +0200)
committerJose V Beneyto <sepen@crux.nu>
Wed, 25 Apr 2012 12:18:30 +0000 (14:18 +0200)
getCoreDiff.sh [new file with mode: 0644]

diff --git a/getCoreDiff.sh b/getCoreDiff.sh
new file mode 100644 (file)
index 0000000..7a2c444
--- /dev/null
@@ -0,0 +1,71 @@
+#!/bin/bash
+
+# getCoreDiff.sh: Script that fetch the current sources of core, core-arm
+# and core-cross collections, and find differences between them
+
+msgError() {
+       echo "Error, $@" 2>&1
+       rm -rf $TMPDIR
+       exit 1
+}
+
+TMPDIR=$(mktemp -d)
+
+version="2.7"
+
+gitrepo_core="git://crux.nu/ports/core.git"
+gitrepo_core_arm="git://crux-arm.nu/crux-arm/ports/core-arm.git"
+gitrepo_core_cross="git://crux-arm.nu/crux-arm/ports/core-cross.git"
+
+# handle signals
+trap "msgError interrupted" SIGINT SIGTERM
+
+echo "+ Fetching git sources..."
+
+echo "++ $gitrepo_core"
+cd $TMPDIR && \
+       git clone $gitrepo_core && \
+       cd core && \
+       git branch 2.7 origin/2.7 && \
+       git checkout 2.7
+
+echo "++ $gitrepo_core_arm"
+cd $TMPDIR && \
+       git clone $gitrepo_core_arm && \
+       cd core-arm && \
+       git branch 2.7 origin/2.7 && \
+       git checkout 2.7
+
+echo "++ $gitrepo_core_cross"
+cd $TMPDIR && \
+       git clone $gitrepo_core_cross && \
+       cd core-cross && \
+       git branch 2.7 origin/2.7 && \
+       git checkout 2.7
+
+echo "+ Generating data..."
+# core list
+cd $TMPDIR/core && find -type d | grep -v '.git' | sed 's|./||' | sed 1d | sort -u > $TMPDIR/core.lst
+# core-arm list
+cd $TMPDIR/core-arm && find -type d | grep -v '.git' | sed 's|./||' | sed 1d | sort -u > $TMPDIR/core-arm.lst
+# core-cross list
+cd $TMPDIR/core-cross && find -type d | grep -v '.git' | sed 's|./||' | sed 1d | sort -u > $TMPDIR/core-cross.lst
+
+echo
+echo "++++++++++++++++++++ RESULTS ++++++++++++++++++++"
+echo
+echo "* New ports (core -> core-arm)"
+comm -13 $TMPDIR/core.lst $TMPDIR/core-arm.lst
+echo
+echo "* New ports (core -> core-cross)"
+comm -13 $TMPDIR/core.lst $TMPDIR/core-cross.lst
+echo
+echo "* Missing ports (core -> core-cross)"
+comm -23 $TMPDIR/core.lst $TMPDIR/core-cross.lst
+echo
+echo "* Overlayed ports (core -> core-arm)"
+comm -12 $TMPDIR/core.lst $TMPDIR/core-arm.lst
+
+rm -fr $TMPDIR
+
+# End of file