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

add/fix i18n; make pot && make msgmerge; add ru.po
author Aleksej Bobylev <al.bobylev@gmail.com>
date Mon May 21 10:44:59 2012 +0300 (2012-05-21)
parents 1691917d8883
children 021b49de9f37
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 # checks to see if file is proper tazpkg
24 is_valid_tazpkg() {
25 local file=$1
26 [ -a $file ] && [ "$file" != "$(package_name $file)" ]
27 }
29 check_valid_tazpkg() {
30 local file=$1
31 if ! is_valid_tazpkg $file; then
32 eval_gettext "\$file is not a tazpkg. Exiting"; newline
33 exit 1
34 fi
35 }