From 0c5efe2b2f6521508aa1158636f5b4456d91223d Mon Sep 17 00:00:00 2001 From: MilhouseVH Date: Sun, 12 Feb 2017 22:37:35 +0000 Subject: [PATCH 1/4] skip_unpack: remove unused script --- scripts/skip_unpack | 47 --------------------------------------------- 1 file changed, 47 deletions(-) delete mode 100755 scripts/skip_unpack diff --git a/scripts/skip_unpack b/scripts/skip_unpack deleted file mode 100755 index 78248f0839..0000000000 --- a/scripts/skip_unpack +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/bash - -################################################################################ -# This file is part of OpenELEC - http://www.openelec.tv -# Copyright (C) 2009-2016 Stephan Raue (stephan@openelec.tv) -# -# OpenELEC is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 2 of the License, or -# (at your option) any later version. -# -# OpenELEC is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with OpenELEC. If not, see . -################################################################################ - -. config/options $1 - -if [ -z "$1" ]; then - echo "usage: $0 package_name" - exit 1 -fi - -if [ ! -f $PKG_DIR/package.mk ]; then - printf "${boldred}$1: no package.mk file found${endcolor}\n" - exit 1 -fi - -STAMP=$PKG_BUILD/.libreelec-unpack - -if [ -f $STAMP ] ; then - printf "%${BUILD_INDENT}c ${boldcyan}SKIP_UNPACK${endcolor} $1\n" ' '>&$SILENT_OUT - export BUILD_INDENT=$((${BUILD_INDENT:-1}+$BUILD_INDENT_SIZE)) - - rm -f $STAMP - STAMP_DEPENDS="$PKG_DIR $PKG_NEED_UNPACK $PROJECT_DIR/$PROJECT/patches/$PKG_NAME" - [ -n "$DEVICE" ] && STAMP_DEPENDS="$STAMP_DEPENDS $PROJECT_DIR/$PROJECT/devices/$DEVICE/patches/$PKG_NAME" - PKG_DEEPMD5=$(find $STAMP_DEPENDS -exec md5sum {} \; 2>/dev/null | sort | md5sum | cut -d" " -f1) - for i in PKG_NAME PKG_DEEPMD5; do - eval val=\$$i - echo "STAMP_$i=\"$val\"" >> $STAMP - done -fi From ac57520d9d25c1731127e317ec1d28b737f37410 Mon Sep 17 00:00:00 2001 From: MilhouseVH Date: Sun, 12 Feb 2017 22:37:35 +0000 Subject: [PATCH 2/4] get: cleanup - optimise and remove redundant code --- scripts/get | 42 +++++++++++++++++------------------------- 1 file changed, 17 insertions(+), 25 deletions(-) diff --git a/scripts/get b/scripts/get index de2e0123d0..dedb943261 100755 --- a/scripts/get +++ b/scripts/get @@ -30,6 +30,16 @@ fi if [ -n "$PKG_URL" -a -n "$PKG_SOURCE_NAME" ]; then mkdir -p $SOURCES/$1 + PACKAGE="$SOURCES/$1/$PKG_SOURCE_NAME" + PACKAGE_MIRROR="$DISTRO_MIRROR/$PKG_NAME/$PKG_SOURCE_NAME" + [ "$VERBOSE" != "yes" ] && WGET_OPT=-q + WGET_CMD="wget --timeout=30 --tries=3 --passive-ftp --no-check-certificate -c $WGET_OPT -O $SOURCES/$1/$PKG_SOURCE_NAME" + + STAMP="$PACKAGE.url" + + # Nothing to be downloaded, exit now... + [ -f $SOURCES/$1/$PKG_SOURCE_NAME -a "$(cat $STAMP 2>/dev/null)" == "$PKG_URL" ] && exit 0 + # Avoid concurrent downloads of the same package _isblocked=N exec 99<$SOURCES/$1 @@ -38,40 +48,22 @@ if [ -n "$PKG_URL" -a -n "$PKG_SOURCE_NAME" ]; then sleep 1 done - PACKAGE="$SOURCES/$1/$PKG_SOURCE_NAME" - PACKAGE_MIRROR="$DISTRO_MIRROR/$PKG_NAME/$PKG_SOURCE_NAME" - [ "$VERBOSE" != "yes" ] && WGET_OPT=-q - WGET_CMD="wget --timeout=30 --tries=3 --passive-ftp --no-check-certificate -c $WGET_OPT -O $SOURCES/$1/$PKG_SOURCE_NAME" - - NBWGET="1" - - STAMP="$PACKAGE.url" - MD5SUM="$PACKAGE.md5" - - DL="yes" - if [ -f "$STAMP" ]; then - [ "`cat $STAMP`" == "$PKG_URL" ] && DL="no" - fi - - if [ "$DL" == "yes" ]; then - rm -f $STAMP + if ! [ -f $SOURCES/$1/$PKG_SOURCE_NAME -a "$(cat $STAMP 2>/dev/null)" == "$PKG_URL" ]; then + rm -f $SOURCES/$1/$PKG_SOURCE_NAME $STAMP printf "%${BUILD_INDENT}c ${boldcyan}GET${endcolor} $1\n" ' '>&$SILENT_OUT export BUILD_INDENT=$((${BUILD_INDENT:-1}+$BUILD_INDENT_SIZE)) - until [ -f "$STAMP" ] || $WGET_CMD $PKG_URL || $WGET_CMD $PACKAGE_MIRROR; do - NBWGET=$(($NBWGET+1)) - if [ "$NBWGET" -gt "10" ]; then + NBWGET=1 + until $WGET_CMD "$PKG_URL" || $WGET_CMD "$PACKAGE_MIRROR"; do + NBWGET=$((NBWGET + 1)) + if [ $NBWGET -gt 10 ]; then echo -e "\nCant't get $1 sources : $PKG_URL\n Try later !!" exit 1 fi done - echo $PKG_URL > $STAMP - md5sum -t $PACKAGE > $MD5SUM - - rm -f $BUILD_BASE*/$STAMPS_NOARCH/$1/unpack - rm -f $BUILD_BASE*/$STAMPS_NOARCH/$1/build + echo "$PKG_URL" > $STAMP fi fi From 50aac918e697cefe2c2ca7abfea9386c1820c247 Mon Sep 17 00:00:00 2001 From: MilhouseVH Date: Sun, 12 Feb 2017 22:37:35 +0000 Subject: [PATCH 3/4] extract: typos --- scripts/extract | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/extract b/scripts/extract index c6712862dd..006c179c08 100755 --- a/scripts/extract +++ b/scripts/extract @@ -32,8 +32,8 @@ case $PKG_SOURCE_NAME in $2) f="$SOURCES/$1/$PKG_SOURCE_NAME" if [ ! -f $f ]; then - echo "error: File $PKG_SOURCE_NAME doesn't exists in package $1 sources directory" - echo "have you called scripts/extract before scripts/get ?" + echo "error: File $PKG_SOURCE_NAME doesn't exist in package $1 sources directory" + echo "Have you called scripts/extract before scripts/get ?" exit 1 fi case $PKG_SOURCE_NAME in From 03363dc5cda9ec61b0c4aaecd659eb7e970c6e13 Mon Sep 17 00:00:00 2001 From: MilhouseVH Date: Sun, 12 Feb 2017 22:37:35 +0000 Subject: [PATCH 4/4] get: silence libssl.so/libcrypto.so messages --- scripts/get | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/get b/scripts/get index dedb943261..9199c38bea 100755 --- a/scripts/get +++ b/scripts/get @@ -54,6 +54,9 @@ if [ -n "$PKG_URL" -a -n "$PKG_SOURCE_NAME" ]; then printf "%${BUILD_INDENT}c ${boldcyan}GET${endcolor} $1\n" ' '>&$SILENT_OUT export BUILD_INDENT=$((${BUILD_INDENT:-1}+$BUILD_INDENT_SIZE)) + # unset LD_LIBRARY_PATH to stop wget from using toolchain/lib and loading libssl.so/libcrypto.so instead of host libraries + unset LD_LIBRARY_PATH + NBWGET=1 until $WGET_CMD "$PKG_URL" || $WGET_CMD "$PACKAGE_MIRROR"; do NBWGET=$((NBWGET + 1))