Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
pcy
sspt
Commits
9301306e
Commit
9301306e
authored
Jul 26, 2017
by
PoroCYon
Browse files
fix update
parent
fb39497e
Changes
1
Hide whitespace changes
Inline
Side-by-side
local/libexec/sspt/sspt-update
View file @
9301306e
...
...
@@ -16,14 +16,14 @@ EOF
# TODO: src-db getver $pkg?
read_pkg_version
()
{
local
EPKG
=
$(
escape_string
"
$1
"
)
<
"
$SSPT_SRC_DB_FILE
"
grep
-E
"^
$EPKG
"
|
grep
-E
-
v
-o
"^
$EPKG
"
<
"
$SSPT_SRC_DB_FILE
"
grep
-E
"^
$EPKG
"
|
grep
-E
-
o
"[A-Za-z0-9_
\.\-
]*$
"
}
update_package
()
{
local
PKG
=
"
$1
"
local
BEFORE
=
"
$(
read_pkg_version
)
"
local
BEFORE
=
"
$(
read_pkg_version
"
$1
"
)
"
exec_subcommand pkgcmd pull
"
$PKG
"
local
AFTER
=
$(
exec_subcommand pkgcmd version
"
$PKG
"
)
local
AFTER
=
"
$(
exec_subcommand pkgcmd version
"
$PKG
"
)
"
if
[
"
$BEFORE
"
!=
"
$AFTER
"
]
;
then
exec_subcommand src-db reg
"
$PKG
"
"
$AFTER
"
...
...
@@ -47,10 +47,9 @@ upgrade_pkgs() {
}
update_selection
()
{
touch
/tmp/upgrade_list
local
ALLARGS
=(
"
$@
"
)
for
PKG
in
"
${
ALLARGS
[@]
}
"
;
do
echo
"
$PGK
: "
if
!
update_package
"
$PKG
"
;
then
echo
"
$PKG
"
>>
/tmp/upgrade_list
fi
...
...
@@ -60,9 +59,8 @@ update_selection() {
}
update_all
()
{
touch
/tmp/upgrade_list
while
read
-r
PKG
;
do
echo
"
$PGK
: "
if
!
update_package
"
$PKG
"
;
then
echo
"
$PKG
"
>>
/tmp/upgrade_list
fi
...
...
@@ -71,6 +69,11 @@ update_all() {
upgrade_pkgs
}
if
[
-f
"/tmp/upgrade_list"
]
;
then
rm
/tmp/upgrade_list
fi
touch
/tmp/upgrade_list
if
[
$#
-eq
0
]
;
then
update_all
exit
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment