slitaz-base-files view rootfs/usr/lib/slitaz/libpkg.sh @ rev 181

prepa for release
author Christophe Lincoln <pankso@slitaz.org>
date Thu May 24 12:38:33 2012 +0200 (2012-05-24)
parents bffd6c0e7c5b
children de45cc358765
line source
1 #!/bin/sh
2 #
3 # SliTaz Packages base functions used by packages manager, cook and
4 # all tools dealing with packages and receipts.
5 #
6 # Documentation: man libpkg or /usr/share/doc/slitaz/libpkg.txt
7 #
8 # Copyright (C) 2012 SliTaz GNU/Linux - BSD License
9 #
11 # Unset all receipt variables.
12 unset_receipt() {
13 unset PACKAGE VERSION EXTRAVERSION SHORT_DESC HOST_ARCH TARBALL \
14 DEPENDS BUILD_DEPENDS WANTED WGET_URL PROVIDE CROSS_BUG
15 }
17 # Converts /tmp/pkg.tazpkg to pkg
18 package_name() {
19 local name=$(basename $1)
20 echo ${name%.tazpkg}
21 }
23 #
24 # Do we realy need the code below here ???
25 #
27 # checks to see if file is proper tazpkg
28 is_valid_tazpkg() {
29 local file=$1
30 [ -a $file ] && [ "$file" != "$(package_name $file)" ]
31 }
33 check_valid_tazpkg() {
34 local file=$1
35 if ! is_valid_tazpkg $file; then
36 eval_gettext "\$file is not a tazpkg. Exiting"; newline
37 exit 1
38 fi
39 }