WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Resolving dependencies while creating TCE  (Read 4643 times)

Offline christianix

  • Newbie
  • *
  • Posts: 9
Resolving dependencies while creating TCE
« on: August 07, 2016, 08:21:20 AM »
Hello,

I'm creating a TCE from a local clone of the PiCore 7.x repo. In order to resolve the dependencies I've created a small script which might help others:

Code: [Select]
#!/bin/bash

if [ \( $# != 1 \) -o \( "$1" == "-h" \) ]; then
        echo "Usage: $0 TCE_DIR"
        exit 1
fi

TCE="$1"
REPO="/data/tiny-core-linux/piCore-7.0/distro.ibiblio.org/tinycorelinux/7.x/armv6/tcz"

if ! [ -d "$TCE" ]; then
        echo "ERROR: \"$TCE\" not a directory"
        exit 1
fi

for DEP in $(cat $TCE/*.dep); do
        if ! [ -f "$TCE/${DEP}" ]; then
                if [ -f "$REPO/${DEP}" ]; then
                        echo "Copying missing package $DEP to $TCE"
                        cp "$REPO/${DEP}" "$TCE/"
                        if [ -f "$REPO/${DEP}.dep" ]; then
                                echo "  - Adding dependency file ${DEP}.dep to $TCE"
                                cp "$REPO/${DEP}.dep" "$TCE/"
                        fi
                else
                        echo "WARNING: Missing package $DEP not found in repo"
                fi
        fi
done


You need to replace REPO with your local repo path. The script takes the TCE directory as parameter, e. g. tce/optional.

Off topic: I don't have fast internet at home, so I clone the repo somewhere else and work offline from home - that's why I can't use the official tools.