2009-03-18 12:02:53 +00:00
|
|
|
#!/bin/sh
|
2011-01-09 22:32:01 +00:00
|
|
|
|
2011-01-09 20:26:03 +00:00
|
|
|
################################################################################
|
|
|
|
# This file is part of OpenELEC - http://www.openelec.tv
|
|
|
|
# Copyright (C) 2009-2011 Stephan Raue (stephan@openelec.tv)
|
|
|
|
#
|
|
|
|
# This Program 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, or (at your option)
|
|
|
|
# any later version.
|
|
|
|
#
|
|
|
|
# This Program 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.tv; see the file COPYING. If not, write to
|
|
|
|
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
# http://www.gnu.org/copyleft/gpl.html
|
|
|
|
################################################################################
|
2009-03-18 12:02:53 +00:00
|
|
|
|
2010-07-21 16:54:45 +00:00
|
|
|
. config/options $1
|
2009-03-18 12:02:53 +00:00
|
|
|
|
|
|
|
if [ -z "$3" ]; then
|
|
|
|
echo "usage: $0 package_name file_pattern target_dir"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2010-11-19 12:34:51 +00:00
|
|
|
[ -z "$PKG_URL" ] && exit 1
|
2010-07-22 03:07:09 +00:00
|
|
|
[ ! -d "$SOURCES/$1" -o ! -d "$3" ] && exit 1
|
2009-03-18 12:02:53 +00:00
|
|
|
|
buildsystem: big rework & cleanup - PART-1: split functions from 'config/path' to an seperate file 'config/functions', rework and cleanup some build scripts, remove references to $TARGET_PLATFORM, add support for more then one downloadurl for $PKG_URL (partially done), remove support for: $PKG_DIR/arch, $PKG_DIR/platform, $PKG_DIR/url files, remove support for *.diff patches, create download-stampfiles in sources/$PKG_NAME, create md5 files after download, add support to download all sources at once with './scripts/get'
Signed-off-by: Stephan Raue <stephan@openelec.tv>
2010-11-19 21:01:08 +00:00
|
|
|
for i in $PKG_URL; do
|
|
|
|
FILE="`basename $i`"
|
2010-07-22 03:07:09 +00:00
|
|
|
|
buildsystem: big rework & cleanup - PART-1: split functions from 'config/path' to an seperate file 'config/functions', rework and cleanup some build scripts, remove references to $TARGET_PLATFORM, add support for more then one downloadurl for $PKG_URL (partially done), remove support for: $PKG_DIR/arch, $PKG_DIR/platform, $PKG_DIR/url files, remove support for *.diff patches, create download-stampfiles in sources/$PKG_NAME, create md5 files after download, add support to download all sources at once with './scripts/get'
Signed-off-by: Stephan Raue <stephan@openelec.tv>
2010-11-19 21:01:08 +00:00
|
|
|
case $FILE in
|
2009-03-18 12:02:53 +00:00
|
|
|
$2)
|
buildsystem: big rework & cleanup - PART-1: split functions from 'config/path' to an seperate file 'config/functions', rework and cleanup some build scripts, remove references to $TARGET_PLATFORM, add support for more then one downloadurl for $PKG_URL (partially done), remove support for: $PKG_DIR/arch, $PKG_DIR/platform, $PKG_DIR/url files, remove support for *.diff patches, create download-stampfiles in sources/$PKG_NAME, create md5 files after download, add support to download all sources at once with './scripts/get'
Signed-off-by: Stephan Raue <stephan@openelec.tv>
2010-11-19 21:01:08 +00:00
|
|
|
f="$SOURCES/$1/$FILE"
|
2009-03-18 12:02:53 +00:00
|
|
|
if [ ! -f $f ]; then
|
buildsystem: big rework & cleanup - PART-1: split functions from 'config/path' to an seperate file 'config/functions', rework and cleanup some build scripts, remove references to $TARGET_PLATFORM, add support for more then one downloadurl for $PKG_URL (partially done), remove support for: $PKG_DIR/arch, $PKG_DIR/platform, $PKG_DIR/url files, remove support for *.diff patches, create download-stampfiles in sources/$PKG_NAME, create md5 files after download, add support to download all sources at once with './scripts/get'
Signed-off-by: Stephan Raue <stephan@openelec.tv>
2010-11-19 21:01:08 +00:00
|
|
|
echo "error: File $FILE doesn't exists in package $1 sources directory"
|
2009-03-18 12:02:53 +00:00
|
|
|
echo "have you called scripts/extract before scripts/get ?"
|
|
|
|
exit 1
|
|
|
|
fi
|
buildsystem: big rework & cleanup - PART-1: split functions from 'config/path' to an seperate file 'config/functions', rework and cleanup some build scripts, remove references to $TARGET_PLATFORM, add support for more then one downloadurl for $PKG_URL (partially done), remove support for: $PKG_DIR/arch, $PKG_DIR/platform, $PKG_DIR/url files, remove support for *.diff patches, create download-stampfiles in sources/$PKG_NAME, create md5 files after download, add support to download all sources at once with './scripts/get'
Signed-off-by: Stephan Raue <stephan@openelec.tv>
2010-11-19 21:01:08 +00:00
|
|
|
case $FILE in
|
2009-03-18 12:02:53 +00:00
|
|
|
*.tar)
|
|
|
|
tar xf $f -C $3
|
|
|
|
;;
|
|
|
|
*.tar.bz2 | *.tbz)
|
|
|
|
tar xjf $f -C $3
|
|
|
|
;;
|
|
|
|
*.tar.gz | *.tgz)
|
|
|
|
tar xzf $f -C $3
|
|
|
|
;;
|
2011-06-20 19:56:18 +00:00
|
|
|
*.tar.xz | *.txz)
|
|
|
|
tar xJf $f -C $3
|
|
|
|
;;
|
2010-07-17 22:47:00 +00:00
|
|
|
*.7z)
|
|
|
|
mkdir -p $3/$1
|
|
|
|
7z x -o$3/$1 $f
|
|
|
|
;;
|
2009-03-18 12:02:53 +00:00
|
|
|
*.diff | *.patch)
|
|
|
|
cat $f | patch -d $3 -p1
|
|
|
|
;;
|
|
|
|
*.diff.bz2 | *.patch.bz2 | patch-*.bz2)
|
|
|
|
bzcat $f | patch -d $3 -p1
|
|
|
|
;;
|
|
|
|
*.diff.gz | *.patch.gz | patch-*.gz)
|
|
|
|
zcat $f | patch -d $3 -p1
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
cp -pPR $f $3
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|