mirror of
https://github.com/zuno/slackpkgplus
synced 2025-01-28 19:58:11 +01:00
Small code review
This commit is contained in:
parent
1bd7dd1bb1
commit
8a04091b45
1 changed files with 15 additions and 15 deletions
|
@ -90,7 +90,7 @@ if [ "$SLACKPKGPLUS" = "on" ];then
|
||||||
rm -rf $TMPDIR
|
rm -rf $TMPDIR
|
||||||
fi
|
fi
|
||||||
exit
|
exit
|
||||||
}
|
} # END cleanup()
|
||||||
|
|
||||||
# Override the slackpkg getfile().
|
# Override the slackpkg getfile().
|
||||||
# The new getfile() download all file needed from all defined repositories
|
# The new getfile() download all file needed from all defined repositories
|
||||||
|
@ -275,7 +275,7 @@ if [ "$SLACKPKGPLUS" = "on" ];then
|
||||||
rm $2-tmp
|
rm $2-tmp
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
}
|
} # END getfile()
|
||||||
|
|
||||||
# override slackpkg checkgpg()
|
# override slackpkg checkgpg()
|
||||||
# new checkgpg() is used to check gpg and to merge the CHECKSUMS.md5 files
|
# new checkgpg() is used to check gpg and to merge the CHECKSUMS.md5 files
|
||||||
|
@ -303,7 +303,7 @@ if [ "$SLACKPKGPLUS" = "on" ];then
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
}
|
} # END checkgpg()
|
||||||
|
|
||||||
# override slackpkg checkmd5()
|
# override slackpkg checkmd5()
|
||||||
# Verify if the package was corrupted by checking md5sum
|
# Verify if the package was corrupted by checking md5sum
|
||||||
|
@ -331,7 +331,7 @@ if [ "$SLACKPKGPLUS" = "on" ];then
|
||||||
else
|
else
|
||||||
echo 0
|
echo 0
|
||||||
fi
|
fi
|
||||||
}
|
} # END checkmd5()
|
||||||
|
|
||||||
# Found packages in repository.
|
# Found packages in repository.
|
||||||
# This function selects the package from the higher priority
|
# This function selects the package from the higher priority
|
||||||
|
@ -343,7 +343,7 @@ if [ "$SLACKPKGPLUS" = "on" ];then
|
||||||
#
|
#
|
||||||
# repository_name:pattern
|
# repository_name:pattern
|
||||||
#
|
#
|
||||||
function givepriority {
|
function givepriority() {
|
||||||
local DIR
|
local DIR
|
||||||
local ARGUMENT=$1
|
local ARGUMENT=$1
|
||||||
local PKGDATA
|
local PKGDATA
|
||||||
|
@ -395,7 +395,7 @@ if [ "$SLACKPKGPLUS" = "on" ];then
|
||||||
FULLNAME=$(echo "${PKGDATA[5]}.${PKGDATA[7]}")
|
FULLNAME=$(echo "${PKGDATA[5]}.${PKGDATA[7]}")
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
}
|
} # END givepriority()
|
||||||
|
|
||||||
function searchPackages() {
|
function searchPackages() {
|
||||||
local i
|
local i
|
||||||
|
@ -472,7 +472,7 @@ if [ "$SLACKPKGPLUS" = "on" ];then
|
||||||
rm ${TMPDIR}/waiting
|
rm ${TMPDIR}/waiting
|
||||||
|
|
||||||
echo -e "DONE\n"
|
echo -e "DONE\n"
|
||||||
}
|
} # END searchPackages()
|
||||||
|
|
||||||
function searchlistEX() {
|
function searchlistEX() {
|
||||||
local i
|
local i
|
||||||
|
@ -538,7 +538,7 @@ if [ "$SLACKPKGPLUS" = "on" ];then
|
||||||
printf " %-16s %-24s %-40s \n" "$STATUS" "$REPO" "${RAWNAME}"
|
printf " %-16s %-24s %-40s \n" "$STATUS" "$REPO" "${RAWNAME}"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
}
|
} # END searchlistEX()
|
||||||
|
|
||||||
touch $TMPDIR/greylist.1
|
touch $TMPDIR/greylist.1
|
||||||
if [ -e $CONF/greylist ];then
|
if [ -e $CONF/greylist ];then
|
||||||
|
@ -631,7 +631,7 @@ if [ "$SLACKPKGPLUS" = "on" ];then
|
||||||
#
|
#
|
||||||
function internal_blacklist() {
|
function internal_blacklist() {
|
||||||
echo "$1" >> ${TMPDIR}/blacklist.slackpkgplus
|
echo "$1" >> ${TMPDIR}/blacklist.slackpkgplus
|
||||||
}
|
} # END internal_blacklist()
|
||||||
|
|
||||||
# Override original applyblackist() so that internal blacklist will
|
# Override original applyblackist() so that internal blacklist will
|
||||||
# be applied too.
|
# be applied too.
|
||||||
|
@ -656,7 +656,7 @@ if [ "$SLACKPKGPLUS" = "on" ];then
|
||||||
cat $TMPDIR/greylist.* >$TMPDIR/greylist
|
cat $TMPDIR/greylist.* >$TMPDIR/greylist
|
||||||
grep -qvEw -f $TMPDIR/greylist $TMPDIR/pkglist-pre >$TMPDIR/unchecklist
|
grep -qvEw -f $TMPDIR/greylist $TMPDIR/pkglist-pre >$TMPDIR/unchecklist
|
||||||
|
|
||||||
}
|
} # END applyblacklist()
|
||||||
|
|
||||||
# -- handle the event $1 that occured on packages $SHOWLIST
|
# -- handle the event $1 that occured on packages $SHOWLIST
|
||||||
#
|
#
|
||||||
|
@ -715,7 +715,7 @@ if [ "$SLACKPKGPLUS" = "on" ];then
|
||||||
echo " "
|
echo " "
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
} # END handle_event()
|
||||||
|
|
||||||
# Overrides original remove_pkg(). Required by the notification mechanism.
|
# Overrides original remove_pkg(). Required by the notification mechanism.
|
||||||
function remove_pkg() {
|
function remove_pkg() {
|
||||||
|
@ -731,7 +731,7 @@ if [ "$SLACKPKGPLUS" = "on" ];then
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
handle_event "remove"
|
handle_event "remove"
|
||||||
}
|
} # END remove_pkg()
|
||||||
|
|
||||||
# Overrides original upgrade_pkg(). Required by the notification mechanism.
|
# Overrides original upgrade_pkg(). Required by the notification mechanism.
|
||||||
function upgrade_pkg() {
|
function upgrade_pkg() {
|
||||||
|
@ -758,7 +758,7 @@ if [ "$SLACKPKGPLUS" = "on" ];then
|
||||||
|
|
||||||
done
|
done
|
||||||
handle_event "upgrade"
|
handle_event "upgrade"
|
||||||
}
|
} # END upgrade_pkg()
|
||||||
|
|
||||||
# Overrides original install_pkg(). Required by the notification mechanism.
|
# Overrides original install_pkg(). Required by the notification mechanism.
|
||||||
function install_pkg() {
|
function install_pkg() {
|
||||||
|
@ -785,7 +785,7 @@ if [ "$SLACKPKGPLUS" = "on" ];then
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
handle_event "install"
|
handle_event "install"
|
||||||
}
|
} # END install_pkg()
|
||||||
|
|
||||||
function wgetdebug(){
|
function wgetdebug(){
|
||||||
local SRCURL
|
local SRCURL
|
||||||
|
@ -823,7 +823,7 @@ if [ "$SLACKPKGPLUS" = "on" ];then
|
||||||
return $WGETERR
|
return $WGETERR
|
||||||
|
|
||||||
|
|
||||||
}
|
} # END wgetdebug()
|
||||||
|
|
||||||
DOWNLOADER="wget $WGETOPTS --no-check-certificate --passive-ftp -O"
|
DOWNLOADER="wget $WGETOPTS --no-check-certificate --passive-ftp -O"
|
||||||
if [ "$VERBOSE" = "0" ];then
|
if [ "$VERBOSE" = "0" ];then
|
||||||
|
|
Loading…
Add table
Reference in a new issue