Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
eepm
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vladislav
eepm
Commits
7bef5c47
Commit
7bef5c47
authored
Jul 25, 2023
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
epm-check_updated_repo: add support for LISTS from apt-config (see ALT bug 46987)
parent
3057e5e2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
14 deletions
+24
-14
epm-check_updated_repo
bin/epm-check_updated_repo
+24
-14
No files found.
bin/epm-check_updated_repo
View file @
7bef5c47
...
...
@@ -17,18 +17,30 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
__epm_apt_set_lists_pkg
()
{
# apt-dpkg
pkg
=
"Packages"
LISTS
=
'/var/lib/apt/lists'
if
[
"
$BASEDISTRNAME
"
=
"alt"
]
;
then
pkg
=
"pkglist"
# see update-kernel: Use Dir::State::lists for apt update freshness check (ALT bug 46987)
eval
"
$(
apt-config shell LISTS Dir::State::lists/f
)
"
fi
}
# initially copied from update-kernel
# print number of days and error status if number of days more than 0
__epm_check_apt_db_days
()
{
# apt-dpkg
local
pkg
=
"Packages"
[
"
$BASEDISTRNAME
"
=
"alt"
]
&&
pkg
=
"pkglist"
local
pkg
local
pkglists
pkglists
=
$(
find /var/lib/apt/lists
-name
"*_
$pkg
*"
-ctime
+1 2>/dev/null
)
__epm_apt_set_lists_pkg
pkglists
=
$(
find
$LISTS
-name
"*_
$pkg
*"
-ctime
+1 2>/dev/null
)
if
[
-z
"
$pkglists
"
]
;
then
# note: duplicate __is_repo_info_downloaded
pkglists
=
$(
find
/var/lib/apt/lists
-name
"*_
$pkg
*"
2>/dev/null
)
pkglists
=
$(
find
$LISTS
-name
"*_
$pkg
*"
2>/dev/null
)
[
-n
"
$pkglists
"
]
&&
return
echo
"never downloaded"
return
1
...
...
@@ -38,7 +50,7 @@ __epm_check_apt_db_days()
local
ts
=
0
# set ts to newest file ctime
# shellcheck disable=SC2044
for
i
in
$(
find
/var/lib/apt/lists/
-name
"*_
$pkg
*"
2>/dev/null
)
;
do
for
i
in
$(
find
$LISTS
-name
"*_
$pkg
*"
2>/dev/null
)
;
do
t
=
$(
stat
-c
%Z
"
$i
"
)
[
"
$t
"
-gt
"
$ts
"
]
&&
ts
=
$t
done
...
...
@@ -59,11 +71,10 @@ __epm_check_apt_db_days()
__epm_touch_apt_pkg
()
{
# apt-dpkg
local
pkg
=
"Packages"
[
"
$BASEDISTRNAME
"
=
"alt"
]
&&
pkg
=
"pkglist"
local
pkg
__epm_apt_set_lists_pkg
# ordinal package file have date of latest upstream change, not latest update, so update fake file
sudorun
touch
"
/var/lib/apt/lists
/eepm-fake_
$pkg
"
sudorun
touch
"
$LISTS
/eepm-fake_
$pkg
"
}
__epm_touch_pkg
()
...
...
@@ -80,11 +91,10 @@ __is_repo_info_downloaded()
{
case
$PMTYPE
in
apt-
*
)
# apt-dpkg
local
pkg
=
"Packages"
[
"
$BASEDISTRNAME
"
=
"alt"
]
&&
pkg
=
"pkglist"
local
pkg
__epm_apt_set_lists_pkg
local
pkglists
pkglists
=
$(
find
/var/lib/apt/lists
-name
"*_
$pkg
*"
2>/dev/null
)
pkglists
=
$(
find
$LIST
-name
"*_
$pkg
*"
2>/dev/null
)
[
-n
"
$pkglists
"
]
||
return
1
;;
*
)
...
...
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