From: Michael Wagner Date: Sat, 13 Mar 2021 22:15:45 +0000 (+0100) Subject: cpp-d1064d X-Git-Tag: i686-linux-gnu-4.7-cross_0.1-1 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=612882f86340e4acf58367c93daa3fb27ac2e48b;p=cross.git cpp-d1064d --- diff --git a/bin/load-dependency b/bin/load-dependency new file mode 100755 index 0000000..2c6781e --- /dev/null +++ b/bin/load-dependency @@ -0,0 +1,97 @@ +#!/bin/bash +set -ex + +# Konzept: +# - Schiebe Paket in required.ld +# - Schleife über Inhalt von required.ld +# x Hole Paket +# x Packe Abhängigkeiten des Pakets nach dependencies.ld +# - Leere required.ld +# - Schleife über dependencies.ld +# x Ist Paket im Verzeichnis +# ja: tunix +# nein: +# - Ist Paket in required.ld? +# ja: tunix +# nein: Füge Paket zu required.ld +# - Ist required.ld leer? +# ja: Ende +# nein: springe nach oben + +usage="load-dependency [PAKET | DEBFILE]" + +function get_deb_name { + pkg=$1 + deb_name=$(ls ${pkg}_*.deb || true) 2>/dev/null +} + +# Lösche Hilfsdateien +rm dependencies.ld required.ld || true 2>/dev/null + +# Prüfe Parameter +if [ -n "$1" ] +then + if [ "${1##*.}" == "deb" ] + then + # prüfe deb + dpkg-deb -I $1 |grep "Depends:" |sed "s/Depends://" |tr ',' '\n' >> dependencies.ld + else + # Schiebe Paket in required.ld + echo "$1" >required.ld + fi +else + echo "Prüfung aller deb files noch nicht implementiert." + exit 1 +fi + +while true +do + if [ -f required.ld ] + then + # Schleife über Inhalt von required.ld + rm dependencies.ld || true 2>/dev/null + while read reqline + do + # Hole Paket + pkg_version=$(echo $reqline |sed "s/ (//" |sed "s/= /=/" |sed "s/)//" |sed "s/>.*//") + apt-get download $pkg_version + + # Packe Abhängigkeiten des Pakets nach dependencies.ld + pkg=${pkg_version##=*} + get_deb_name $pkg + dpkg-deb -I $deb_name |grep "Depends:" |sed "s/Depends://" |tr ',' '\n' >> dependencies.ld + done /dev/null + + # Schleife über dependencies.ld + while read depline + do + # Ist Paket im Verzeichnis + pkg=$depline + get_deb_name $pkg + if [ -z "$deb_name" ] + then + # nein: + # Ist Paket in required.ld? + if ! grep "${pkg}_" required.ld 1>/dev/null + then + # nein: Füge Paket zu required.ld + echo $depline >>required.ld + fi + fi + done Sun, 22 Jan 2021 20:03:04 +0100 + diff --git a/debian/i686-linux-gnu-4.7-cross.changelog b/debian/i686-linux-gnu-4.7-cross.changelog new file mode 120000 index 0000000..af28268 --- /dev/null +++ b/debian/i686-linux-gnu-4.7-cross.changelog @@ -0,0 +1 @@ +global.changelog \ No newline at end of file diff --git a/debian/i686-linux-gnu-4.7-cross.control b/debian/i686-linux-gnu-4.7-cross.control new file mode 100644 index 0000000..1c32453 --- /dev/null +++ b/debian/i686-linux-gnu-4.7-cross.control @@ -0,0 +1,10 @@ +Source: cross +Section: main +Priority: optional +Maintainer: Michael Wagner +Build-Depends: git, mbuild + +Package: i686-linux-gnu-4.7-cross +Architecture: amd64 +Description: i686-linux-gnu-4.7 cross compiler + diff --git a/debian/i686-linux-gnu-4.7-cross.cp b/debian/i686-linux-gnu-4.7-cross.cp new file mode 100755 index 0000000..ad92b41 --- /dev/null +++ b/debian/i686-linux-gnu-4.7-cross.cp @@ -0,0 +1,5 @@ +#!/bin/bash + +mkdir -p $1/opt/cross/i686-linux-gnu-4.7 +rsync -a i686-linux-gnu-4.7 $1/opt/cross +