Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Pacman
Pacman Contrib
Commits
f9206725
Commit
f9206725
authored
Feb 18, 2022
by
Daniel M. Capella
Browse files
Merge branch 'nosync' into 'master'
checkupdates: Provide --nosync option See merge request
!2
parents
4e624986
bbf488e9
Changes
2
Show whitespace changes
Inline
Side-by-side
doc/checkupdates.8.txt
View file @
f9206725
...
...
@@ -26,6 +26,10 @@ Options
*-d, \--download*::
Download any pending updates to the pacman cache.
*-n, \--nosync*::
Do not sync the temporary database, works best when the temporary database is
update regularly through some other means such as a cronjob or systemd timer.
*-h, \--help*::
Display syntax and command line options.
...
...
src/checkupdates.sh.in
View file @
f9206725
...
...
@@ -58,6 +58,7 @@ Usage: ${myname} [options]
Options:
-d, --download download pending updates to the pacman cache.
-n, --nosync do not sync the temporary database.
-h, --help display this help message and exit.
Note: Export the "CHECKUPDATES_DB" variable to change the path of the temporary database.
...
...
@@ -65,8 +66,8 @@ Note: Export the "CHECKUPDATES_DB" variable to change the path of the temporary
__EOF__
}
OPT_SHORT
=
'dh'
OPT_LONG
=(
'download'
'help'
'nocolor'
)
OPT_SHORT
=
'd
n
h'
OPT_LONG
=(
'download'
'help'
'nocolor'
'norefresh'
)
if
!
parseopts
"
$OPT_SHORT
"
"
${
OPT_LONG
[@]
}
"
--
"
$@
"
;
then
exit
1
...
...
@@ -74,10 +75,13 @@ fi
set
--
"
${
OPTRET
[@]
}
"
unset
OPT_SHORT OPT_LONG OPTRET
SYNC
=
1
while
:
;
do
case
$1
in
-d
|
--download
)
DOWNLOAD_CACHE
=
1
;;
-n
|
--nosync
)
SYNC
=
0
;;
-h
|
--help
)
usage
exit
0
;;
...
...
@@ -112,10 +116,12 @@ if [[ -z "$DBPath" ]] || [[ ! -d "$DBPath" ]]; then
DBPath
=
"@localstatedir@/lib/pacman/"
fi
mkdir
-p
"
$CHECKUPDATES_DB
"
ln
-s
"
${
DBPath
}
/local"
"
$CHECKUPDATES_DB
"
&> /dev/null
if
!
fakeroot
--
pacman
-Sy
--dbpath
"
$CHECKUPDATES_DB
"
--logfile
/dev/null &> /dev/null
;
then
if
((
${
SYNC
}
))
;
then
mkdir
-p
"
$CHECKUPDATES_DB
"
ln
-s
"
${
DBPath
}
/local"
"
$CHECKUPDATES_DB
"
&> /dev/null
if
!
fakeroot
--
pacman
-Sy
--dbpath
"
$CHECKUPDATES_DB
"
--logfile
/dev/null &> /dev/null
;
then
die
'Cannot fetch updates'
fi
fi
mapfile
-t
updates < <
(
pacman
-Qu
--dbpath
"
$CHECKUPDATES_DB
"
2> /dev/null |
grep
-v
'\[.*\]'
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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