Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=pacman-g2.git;a=commitdiff;h=35ff855fc58a4c8acf12ed21d70a8a306096ab1e

commit 35ff855fc58a4c8acf12ed21d70a8a306096ab1e
Author: crazy <[email protected]>
Date:   Sat Feb 13 23:52:05 2016 +0100

makepkg
* added lots missing locals
* use a local var for $1 etc
* btw we need a lot more functions in makepkg

diff --git a/scripts/makepkg b/scripts/makepkg
index 331de0e..bac0fdc 100755
--- a/scripts/makepkg
+++ b/scripts/makepkg
@@ -183,8 +183,10 @@ strip_url() {
}

checkdeps() {
+
local missdep=""
local deplist=""
+       local dep nl

[ $# -gt 0 ] || return

@@ -217,9 +219,12 @@ checkdeps() {
}

handledeps() {
+
local missingdeps=0
local deplist="$*"
local haveperm=0
+       local dep i success pkgdir
+
if [ \( "`id -u`" = "0" -a "$INFAKEROOT" != "1" \) -o "$DEP_SUDO" = 1 ]; then
haveperm=1
fi
@@ -446,19 +451,23 @@ chroot_clean()

create_pkg()
{
+
+       local it
+       local p="$1"
+
msg "Generating files for $1:"
# write the .PKGINFO file
msg2 ".PKGINFO file... " >&2
if [ "$1" = "$pkgname" ]; then
cd $startdir/pkg
else
-               cd $startdir/pkg.$1
+               cd $startdir/pkg.$p
fi
-       size=`du -cb . | tail -n 1 | awk '{print $1}'`
+       local size=`du -cb . | tail -n 1 | awk '{print $1}'`
$ECHO "# Generated by makepkg" >.PKGINFO
$ECHO -n "# " >>.PKGINFO
date >>.PKGINFO
-       $ECHO "pkgname = $1" >>.PKGINFO
+       $ECHO "pkgname = $p" >>.PKGINFO
$ECHO "pkgver = $pkgver-$pkgrel" >>.PKGINFO
$ECHO "pkgdesc = $pkgdesc" >>.PKGINFO
if [ -n "$pkgdesc_localized" ]; then
@@ -505,7 +514,7 @@ create_pkg()

# check for an install script
if [ "$install" == "" ]; then
-               [ -e $startdir/$1.install ] && install=$1.install
+               [ -e $startdir/$p.install ] && install=$p.install
fi
if [ "$install" != "" ]; then
msg2 ".INSTALL file... " >&2
@@ -553,9 +562,9 @@ create_pkg()
msg "Searching for depends..."
warning "Do not use this information without thinking!"
if [ -n "$_F_makepkg_chkdep" ]; then
-                               chkdep -m $_F_makepkg_chkdep -d ./ -n $1 -i
+                               chkdep -m $_F_makepkg_chkdep -d ./ -n $p -i
else
-                               chkdep -d ./ -n $1 -i
+                               chkdep -d ./ -n $p -i
fi
else
warning "Chkdep is not installed and is required to search depends."
@@ -568,11 +577,12 @@ create_pkg()

strip_pkg()
{
-       local dir="" subpkg=""
-       if [ "$1" = "$pkgname" ]; then
+       local dir="" subpkg="" p="$1"
+
+       if [ "$p" = "$pkgname" ]; then
dir="$startdir/pkg"
else
-               dir="$startdir/pkg.$1"
+               dir="$startdir/pkg.$p"
subpkg="subpackage "
fi
if [ ! "`check_option NOSTRIP`" -a "$NOSTRIP" = "0" ]; then
@@ -580,7 +590,7 @@ strip_pkg()
find $dir/{,usr,usr/local,opt/*}/lib -type f -not -name "*.dll" -not -name 
"*.exe" \
-exec /usr/bin/strip --strip-debug '{}' \; 2>&1 \
| grep -v "No such file" | grep -v "format not recognized"
-               msg "Stripping symbols from binaries from $subpkg$1..."
+               msg "Stripping symbols from binaries from $subpkg$p..."
find $dir/{,usr,usr/local,opt/*}/{bin,sbin} -type f -not -name "*.dll" -not 
-name "*.exe" \
-exec /usr/bin/strip '{}' \; 2>&1 \
| grep -v "No such file" | grep -v "format not recognized"
@@ -589,9 +599,10 @@ strip_pkg()

in_array()
{
-       local i
-       needle=$1
+
+       local needle=$1 i
shift 1
+
# array() undefined
[ -z "$1" ] && return 1
for i in $*
@@ -603,6 +614,9 @@ in_array()

install_pkg()
{
+
+       local i subpkg targs
+
if [ "$INSTALL" = "1" -a "`id -u`" = "0" -a "$INFAKEROOT" != "1" ]; then
msg "Installing package(s) with $PACMAN -U..."
targs="$PKGDEST/${pkgname}-${pkgver}-${pkgrel}-${CARCH}.$PKG_EXT"
_______________________________________________
Frugalware-git mailing list
[email protected]
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to