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
etersoft
eepm
Commits
d6ea3fd0
Commit
d6ea3fd0
authored
Mar 24, 2014
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
introduce get_local_alt_contents_index and use repolist for get local repo path
parent
311b45ed
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
28 deletions
+50
-28
epm-filelist
bin/epm-filelist
+8
-12
epm-search_file
bin/epm-search_file
+7
-16
epm-sh-altlinux
bin/epm-sh-altlinux
+35
-0
No files found.
bin/epm-filelist
View file @
d6ea3fd0
...
...
@@ -22,24 +22,20 @@ load_helper epm-query
# TODO: port or rewrite apt-file
# https://bugzilla.altlinux.org/show_bug.cgi?id=14449
# see also epm-search-file
local_content_filelist
()
__alt_
local_content_filelist
()
{
local
SYSARCH
SYSARCH
=
$(
uname
-m
)
[
"
$SYSARCH
"
=
"x86_64"
]
||
SYSARCH
=
i586
load_helper epm-sh-altlinux
local
REPODIR
=
/var/ftp/pub/ALTLinux/Sisyphus
local
CI
=
$REPODIR
/
$SYSARCH
/base/contents_index
local
CINOA
=
$REPODIR
/noarch/base/contents_index
local
CI
=
"
$(
get_local_alt_contents_index
)
"
# TODO: safe way to use less
#local OUTCMD="less"
#[ -n "$USETTY" ] || OUTCMD="cat"
OUTCMD
=
"cat"
test
-r
$CI
&&
test
-r
$CINOA
||
fatal
"Can't locate
$CI
or
$CINOA
"
{
[
-n
"
$USETTY
"
]
&&
echo
"Search in
$CI
and
$CINOA
for
$1
..."
grep
-h
--
".*
$1
$"
$CI
$CINOA
|
sed
-e
"s|
\(
.*
\)\t\(
.*
\)
|
\1
|g"
[
-n
"
$USETTY
"
]
&&
echo
"Search in
$CI
for
$1
..."
grep
-h
--
".*
$1
$"
$CI
|
sed
-e
"s|
\(
.*
\)\t\(
.*
\)
|
\1
|g"
}
|
$OUTCMD
}
...
...
@@ -51,7 +47,7 @@ __epm_filelist_remote()
case
$PMTYPE
in
apt-rpm
)
# TODO: use RESTful interface to prometeus? See ALT bug #29496
docmd_foreach local_content_filelist
$@
docmd_foreach
__alt_
local_content_filelist
$@
;;
*
)
fatal
"Query filelist for non installed packages does not realized"
...
...
bin/epm-search_file
View file @
d6ea3fd0
...
...
@@ -17,28 +17,19 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# TODO: port or rewrite apt-file
# https://bugzilla.altlinux.org/show_bug.cgi?id=14449
local_content_search
()
__alt_local_content_search
()
{
# TODO: use global get_sysarch function
local
SYSARCH
SYSARCH
=
$(
uname
-m
)
[
"
$SYSARCH
"
=
"x86_64"
]
||
SYSARCH
=
i586
load_helper epm-sh-altlinux
local
CI
=
"
$(
get_local_alt_contents_index
)
"
# FIXME: use config or/and web url
local
REPODIR
=
/var/ftp/pub/ALTLinux/Sisyphus
local
CI
=
$REPODIR
/
$SYSARCH
/base/contents_index
local
CINOA
=
$REPODIR
/noarch/base/contents_index
#local OUTCMD="less"
#[ -n "$USETTY" ] || OUTCMD="cat"
OUTCMD
=
"cat"
test
-r
$CI
&&
test
-r
$CINOA
||
fatal
"Can't locate
$CI
or
$CINOA
"
{
[
-n
"
$USETTY
"
]
&&
echo
"Search in
$CI
and
$CINOA
for
$1
..."
grep
-h
--
".*
$1
.*
\t
"
$CI
$CINOA
|
sed
-e
"s|
\(
.*
\)\t\(
.*
\)
|
\2
:
\1
|g"
[
-n
"
$USETTY
"
]
&&
echo
"Search in
$CI
for
$1
..."
grep
-h
--
".*
$1
.*
\t
"
$CI
|
sed
-e
"s|
\(
.*
\)\t\(
.*
\)
|
\2
:
\1
|g"
}
|
$OUTCMD
}
...
...
@@ -49,7 +40,7 @@ epm_search_file()
case
$PMTYPE
in
apt-rpm
)
local_content_search
$pkg_filenames
__alt_
local_content_search
$pkg_filenames
return
;;
apt-dpkg|aptitude-dpkg
)
assure_exists apt-file
...
...
bin/epm-sh-altlinux
0 → 100644
View file @
d6ea3fd0
#!/bin/sh
#
# Copyright (C) 2014 Etersoft
# Copyright (C) 2014 Vitaly Lipatov <lav@etersoft.ru>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# TODO: port or rewrite apt-file
# https://bugzilla.altlinux.org/show_bug.cgi?id=14449
get_local_alt_contents_index
()
{
load_helper epm-repolist
epm_repolist |
grep
"rpm file:/"
|
sed
-e
"s|^rpm file:||g"
|
while
read
URL ARCH other
;
do
test
-d
"
$URL
/
$ARCH
"
||
continue
# fatal "Local mirror is not accessible via $URL/$ARCH"
FILE
=
"
$URL
/
$ARCH
/base/contents_index"
if
[
-r
"
$FILE
"
]
;
then
echo
"
$FILE
"
else
info
"TODO for girar server: There is no
$(
basename
$FILE
)
file in
$(
dirname
$FILE
)
"
fi
done
}
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