mirror of
https://github.com/sbopkg/sbopkg
synced 2024-11-10 03:50:33 +03:00
Scattered minor cleanups.
Signed-off-by: Mauro Giachero <mauro.giachero@gmail.com>
This commit is contained in:
parent
2b553679e8
commit
c8b479507a
@ -135,7 +135,8 @@ EOF
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Make sure there are no unexpected files in $SBOPKGTMP
|
# Make sure there are no unexpected files in $SBOPKGTMP
|
||||||
if [[ -n $(find $SBOPKGTMP -maxdepth 1 -not -name sbopkg\*) ]]; then
|
if [[ -n $(find $SBOPKGTMP -maxdepth 1 -not -name sbopkg\* 2> \
|
||||||
|
/dev/null) ]]; then
|
||||||
cat << EOF
|
cat << EOF
|
||||||
|
|
||||||
ERROR
|
ERROR
|
||||||
@ -519,7 +520,7 @@ check_for_updates() {
|
|||||||
local VERSION_EXPRESSION
|
local VERSION_EXPRESSION
|
||||||
local UPDATELIST VERSION_FILE PROGRESSBAR_INTERRUPTED
|
local UPDATELIST VERSION_FILE PROGRESSBAR_INTERRUPTED
|
||||||
local STRING INDEX OLDNAME NAME VER INST_ARCH BUILD
|
local STRING INDEX OLDNAME NAME VER INST_ARCH BUILD
|
||||||
local VER_NUMERIC NEWVER_NUMERIC UPDATED
|
local VER_NUMERIC NEWVER_NUMERIC VER_NDIGITS NEWVER_NDIGIT UPDATED
|
||||||
local CURPKG PKGS NUMPKGS PROGRESSCOUNTER=0
|
local CURPKG PKGS NUMPKGS PROGRESSCOUNTER=0
|
||||||
|
|
||||||
if [[ -z $REPO_TOOL ]]; then
|
if [[ -z $REPO_TOOL ]]; then
|
||||||
@ -628,16 +629,22 @@ check_for_updates() {
|
|||||||
VER_NUMERIC=$(tr -c "[:digit:]" " " <<< "$VER")
|
VER_NUMERIC=$(tr -c "[:digit:]" " " <<< "$VER")
|
||||||
NEWVER_NUMERIC=$(tr -c "[:digit:]" " " <<< "$NEWVER")
|
NEWVER_NUMERIC=$(tr -c "[:digit:]" " " <<< "$NEWVER")
|
||||||
# The version number must have the same number of digits
|
# The version number must have the same number of digits
|
||||||
while [[ $(wc -w <<< $VER_NUMERIC) -lt $(wc -w <<< $NEWVER_NUMERIC) ]]; do
|
VER_NDIGIT=$(wc -w <<< $VER_NUMERIC)
|
||||||
|
NEWVER_NDIGIT=$(wc -w <<< $NEWVER_NUMERIC)
|
||||||
|
while [[ $VER_NDIGIT -lt $NEWVER_NDIGIT ]]; do
|
||||||
VER_NUMERIC="$VER_NUMERIC 0"
|
VER_NUMERIC="$VER_NUMERIC 0"
|
||||||
|
((VER_NDIGIT++))
|
||||||
done
|
done
|
||||||
while [[ $(wc -w <<< $VER_NUMERIC) -gt $(wc -w <<< $NEWVER_NUMERIC) ]]; do
|
while [[ $VER_NDIGIT -gt $NEWVER_NDIGIT ]]; do
|
||||||
NEWVER_NUMERIC="$NEWVER_NUMERIC 0"
|
NEWVER_NUMERIC="$NEWVER_NUMERIC 0"
|
||||||
|
((NEWVER_NDIGIT++))
|
||||||
done
|
done
|
||||||
# The build number is just like the least significant version
|
# The build number is just like the least significant version
|
||||||
# number
|
# number
|
||||||
VER_NUMERIC="$VER_NUMERIC $(tr -c "[:digit:]" ' ' <<< "$BUILD")"
|
VER_NUMERIC="$VER_NUMERIC $(tr -c "[:digit:]" ' ' \
|
||||||
NEWVER_NUMERIC="$NEWVER_NUMERIC $(tr -c "[:digit:]" ' ' <<< "$NEWBUILD")"
|
<<< "$BUILD")"
|
||||||
|
NEWVER_NUMERIC="$NEWVER_NUMERIC $(tr -c "[:digit:]" ' ' \
|
||||||
|
<<< "$NEWBUILD")"
|
||||||
UPDATED=$(updates_compare_versions $VER_NUMERIC \
|
UPDATED=$(updates_compare_versions $VER_NUMERIC \
|
||||||
$NEWVER_NUMERIC)
|
$NEWVER_NUMERIC)
|
||||||
|
|
||||||
@ -653,9 +660,12 @@ check_for_updates() {
|
|||||||
elif [[ $UPDATED -eq -1 ]]; then
|
elif [[ $UPDATED -eq -1 ]]; then
|
||||||
if [[ $DEBUG -ge 1 ]]; then
|
if [[ $DEBUG -ge 1 ]]; then
|
||||||
echo $NAME: >> $UPDATELIST
|
echo $NAME: >> $UPDATELIST
|
||||||
echo " INSTALLED PACKAGE IS NEWER THAN REPO" >> $UPDATELIST
|
echo " INSTALLED PACKAGE IS NEWER THAN REPO" \
|
||||||
|
>> $UPDATELIST
|
||||||
echo " Installed version: " $CURPKG >> $UPDATELIST
|
echo " Installed version: " $CURPKG >> $UPDATELIST
|
||||||
echo " Repo version: " $NAME-$NEWVER-$NEWARCH-${NEWBUILD}$REPO_TAG >> $UPDATELIST
|
echo " Repo version: " \
|
||||||
|
$NAME-$NEWVER-$NEWARCH-${NEWBUILD}$REPO_TAG \
|
||||||
|
>> $UPDATELIST
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
if [[ $DEBUG -eq 2 ]]; then
|
if [[ $DEBUG -eq 2 ]]; then
|
||||||
@ -675,8 +685,8 @@ check_for_updates() {
|
|||||||
echo $(($PROGRESSCOUNTER * 100 / $NUMPKGS))
|
echo $(($PROGRESSCOUNTER * 100 / $NUMPKGS))
|
||||||
done
|
done
|
||||||
} | progressbar "Building list of potential updates" "This may take\
|
} | progressbar "Building list of potential updates" "This may take\
|
||||||
a few moments depending on how many packages from the $REPO_DESC are\
|
a few moments depending on how many packages from the $REPO_DESC\
|
||||||
installed..."
|
are installed..."
|
||||||
echo >> $UPDATELIST
|
echo >> $UPDATELIST
|
||||||
echo "Potential update list complete." >> $UPDATELIST
|
echo "Potential update list complete." >> $UPDATELIST
|
||||||
fi
|
fi
|
||||||
@ -882,7 +892,7 @@ select_repository() {
|
|||||||
PID=$!
|
PID=$!
|
||||||
fi
|
fi
|
||||||
set_repo_vars
|
set_repo_vars
|
||||||
[[ $PID ]] && kill $PID 2>/dev/null
|
[[ $PID ]] && kill $PID 2> /dev/null
|
||||||
dialog --title "Save this setting?" --defaultno --yesno \
|
dialog --title "Save this setting?" --defaultno --yesno \
|
||||||
"$(crunch "Would you like to save this repository setting \
|
"$(crunch "Would you like to save this repository setting \
|
||||||
in the user's $HOME/.sbopkg.conf file? (One will be created if \
|
in the user's $HOME/.sbopkg.conf file? (One will be created if \
|
||||||
@ -3604,7 +3614,8 @@ else
|
|||||||
CLIQUEUE=$SBOPKGTMP/sbopkg_cli_queue
|
CLIQUEUE=$SBOPKGTMP/sbopkg_cli_queue
|
||||||
> $SBOPKGTMP/sbopkg-start-queue
|
> $SBOPKGTMP/sbopkg-start-queue
|
||||||
for PKGBUILD in $BUILD; do
|
for PKGBUILD in $BUILD; do
|
||||||
if [[ -r $QUEUEDIR/$PKGBUILD.sboq ]] && search_package $PKGBUILD; then
|
if [[ -r $QUEUEDIR/$PKGBUILD.sboq ]] &&
|
||||||
|
search_package $PKGBUILD; then
|
||||||
crunch_fmt "Both a queuefile and a package were found with \
|
crunch_fmt "Both a queuefile and a package were found with \
|
||||||
the name \"$PKGBUILD\". Which would you like to use?"
|
the name \"$PKGBUILD\". Which would you like to use?"
|
||||||
echo
|
echo
|
||||||
@ -3633,8 +3644,8 @@ else
|
|||||||
# Add a single package
|
# Add a single package
|
||||||
echo $PKGBUILD >> $CLIQUEUE
|
echo $PKGBUILD >> $CLIQUEUE
|
||||||
else
|
else
|
||||||
crunch_fmt "Queuefile or package $PKGBUILD not found - \
|
crunch_fmt "Queuefile or package $PKGBUILD not found\
|
||||||
skipping."
|
- skipping."
|
||||||
echo
|
echo
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user