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
2b200d6f
Commit
2b200d6f
authored
5 days ago
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
epm-repo: fixes and improvements
parent
616bb37d
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
17 additions
and
13 deletions
+17
-13
epm-addrepo
bin/epm-addrepo
+2
-2
epm-removerepo
bin/epm-removerepo
+9
-9
epm-repodisable
bin/epm-repodisable
+1
-0
epm-repoenable
bin/epm-repoenable
+2
-1
epm-repofix
bin/epm-repofix
+1
-1
epm-repolist
bin/epm-repolist
+2
-0
No files found.
bin/epm-addrepo
View file @
2b200d6f
...
@@ -217,7 +217,7 @@ __epm_addrepo_apt()
...
@@ -217,7 +217,7 @@ __epm_addrepo_apt()
{
{
local
repo
=
"
$*
"
local
repo
=
"
$*
"
epm
repo list
--quiet
2>/dev/null
|
grep
-q
-F
"
$repo
"
&&
return
0
epm
--quiet
repo list
|
grep
-q
-F
"
$repo
"
&&
return
0
if
[
-n
"
$dryrun
"
]
;
then
if
[
-n
"
$dryrun
"
]
;
then
echo
"
$repo
"
echo
"
$repo
"
...
@@ -428,7 +428,7 @@ __epm_addrepo_alpine()
...
@@ -428,7 +428,7 @@ __epm_addrepo_alpine()
{
{
local
repo
=
"
$1
"
local
repo
=
"
$1
"
is_url
"
$repo
"
||
fatal
"Only URL is supported"
is_url
"
$repo
"
||
fatal
"Only URL is supported"
epm
repo list
--quie
t
|
grep
-q
-F
"
$repo
"
&&
return
0
epm
--quiet
repo lis
t |
grep
-q
-F
"
$repo
"
&&
return
0
echo
"
$repo
"
| sudocmd
tee
-a
/etc/apk/repositories
echo
"
$repo
"
| sudocmd
tee
-a
/etc/apk/repositories
}
}
...
...
This diff is collapsed.
Click to expand it.
bin/epm-removerepo
View file @
2b200d6f
...
@@ -38,8 +38,8 @@ __epm_removerepo_apt()
...
@@ -38,8 +38,8 @@ __epm_removerepo_apt()
for
i
in
/etc/apt/sources.list /etc/apt/sources.list.d/
*
.list
;
do
for
i
in
/etc/apt/sources.list /etc/apt/sources.list.d/
*
.list
;
do
[
-s
"
$i
"
]
||
continue
[
-s
"
$i
"
]
||
continue
# touch file only when it is needed
# touch file only when it is needed
grep
-q
-
E
"
$repo
"
$i
||
continue
grep
-q
-
F
"
$repo
"
$i
||
continue
$sc
sed
-i
-e
"s|.*
$
repo
.*||"
$i
$sc
sed
-i
-e
"s|.*
$
(
sed_escape
"
$repo
"
)
.*||"
$i
done
done
}
}
...
@@ -47,7 +47,7 @@ __epm_removerepo_apt()
...
@@ -47,7 +47,7 @@ __epm_removerepo_apt()
__epm_grep_repo_list
()
__epm_grep_repo_list
()
{
{
while
[
-n
"
$1
"
]
;
do
while
[
-n
"
$1
"
]
;
do
epm
--quiet
repo list
|
grep
-E
"
$1
"
epm
--quiet
repo list
"
$1
"
shift
shift
done
done
}
}
...
@@ -55,17 +55,17 @@ __epm_grep_repo_list()
...
@@ -55,17 +55,17 @@ __epm_grep_repo_list()
# remove grepped lines
# remove grepped lines
__epm_removerepo_alt_grepremove
()
__epm_removerepo_alt_grepremove
()
{
{
local
rl
=
"
$
1
"
local
rl
=
"
$
*
"
if
[
"
$rl
"
=
"all"
]
;
then
if
[
"
$rl
"
=
"all"
]
;
then
rl
=
"
.
*"
rl
=
"*"
fi
fi
# ^rpm means full string
# ^rpm means full string
if
!
rhas
"
$1
"
"^rpm"
;
then
if
!
rhas
"
$rl
"
"^rpm"
;
then
rl
=
"
$(
__epm_grep_repo_list
"
$
@
"
2>/dev/null
)
"
rl
=
"
$(
__epm_grep_repo_list
"
$
rl
"
2>/dev/null
)
"
if
[
-z
"
$rl
"
]
;
then
if
[
-z
"
$rl
"
]
;
then
[
-n
"
$verbose
"
]
&&
warning
'Can'
\'
't find '
$
*
' in the repos (see # epm repolist output)'
[
-n
"
$verbose
"
]
&&
warning
'Can'
\'
't find '
$
rl
' in the repos (see # epm repolist output)'
return
1
return
1
fi
fi
fi
fi
...
@@ -124,7 +124,7 @@ __epm_removerepo_alt()
...
@@ -124,7 +124,7 @@ __epm_removerepo_alt()
if
echo
"
$*
"
|
grep
-q
"^rpm"
;
then
if
echo
"
$*
"
|
grep
-q
"^rpm"
;
then
__epm_removerepo_apt
"
$*
"
__epm_removerepo_apt
"
$*
"
else
else
info
"removing
source.list entries by mask '
$*
'
"
info
"removing
all source.list
"
__epm_removerepo_alt_grepremove
"
$*
"
__epm_removerepo_alt_grepremove
"
$*
"
fi
fi
;;
;;
...
...
This diff is collapsed.
Click to expand it.
bin/epm-repodisable
View file @
2b200d6f
...
@@ -32,6 +32,7 @@ __epm_repodisable_alt()
...
@@ -32,6 +32,7 @@ __epm_repodisable_alt()
else
else
rl
=
"
$(
(
epm
--quiet
repolist
)
2>/dev/null | grep -F "
$1
" | head -n1 )"
rl
=
"
$(
(
epm
--quiet
repolist
)
2>/dev/null | grep -F "
$1
" | head -n1 )"
[
-z
"
$rl
"
]
&&
warning
'Can'
\'
't find $1 entries in the repos (see # epm repolist output)'
&&
return
1
[
-z
"
$rl
"
]
&&
warning
'Can'
\'
't find $1 entries in the repos (see # epm repolist output)'
&&
return
1
[
-z
"
$rl
"
]
&&
warning
"Can't find '"
$1
"' entries in the repos (see # epm repolist output)"
&&
return
1
fi
fi
echo
"
$rl
"
|
while
read
rp
;
do
echo
"
$rl
"
|
while
read
rp
;
do
[
-n
"
$dryrun
"
]
&&
message
'will comment $rp'
&&
continue
[
-n
"
$dryrun
"
]
&&
message
'will comment $rp'
&&
continue
...
...
This diff is collapsed.
Click to expand it.
bin/epm-repoenable
View file @
2b200d6f
...
@@ -30,8 +30,9 @@ __epm_repoenable_alt()
...
@@ -30,8 +30,9 @@ __epm_repoenable_alt()
if
rhas
"
$1
"
"
\^
rpm"
;
then
if
rhas
"
$1
"
"
\^
rpm"
;
then
rl
=
"
$(
echo
"
$1
"
|
sed
-e
's|\^||'
)
"
rl
=
"
$(
echo
"
$1
"
|
sed
-e
's|\^||'
)
"
else
else
rl
=
"
$(
epm
--quiet
--all
repolist
2>/dev/null |
grep
-F
"
$1
"
|
head
-n1
|
sed
-e
's|[[:space:]]*#[[:space:]]*||'
)
"
rl
=
"
$(
epm
--quiet
repolist
--all
2>/dev/null |
grep
-F
"
$1
"
|
head
-n1
|
sed
-e
's|[[:space:]]*#[[:space:]]*||'
)
"
[
-z
"
$rl
"
]
&&
warning
'Can'
\'
't find commented $1 in the repos (see # epm repolist output)'
&&
return
1
[
-z
"
$rl
"
]
&&
warning
'Can'
\'
't find commented $1 in the repos (see # epm repolist output)'
&&
return
1
[
-z
"
$rl
"
]
&&
warning
"Can't find commented '"
$1
"' in the repos (see # epm repolist output)"
&&
return
1
fi
fi
echo
"
$rl
"
|
while
read
rp
;
do
echo
"
$rl
"
|
while
read
rp
;
do
[
-n
"
$dryrun
"
]
&&
message
'will uncomment $rp'
&&
continue
[
-n
"
$dryrun
"
]
&&
message
'will uncomment $rp'
&&
continue
...
...
This diff is collapsed.
Click to expand it.
bin/epm-repofix
View file @
2b200d6f
...
@@ -69,7 +69,7 @@ __replace_alt_version_in_repo()
...
@@ -69,7 +69,7 @@ __replace_alt_version_in_repo()
#echo "Upgrading $DISTRNAME from $1 to $2 ..."
#echo "Upgrading $DISTRNAME from $1 to $2 ..."
epm
--quiet
repo list |
sed
-E
-e
"s|(
$1
)|{
\1
}->{
$2
}|g"
|
grep
-E
--color
--
"
$1
"
epm
--quiet
repo list |
sed
-E
-e
"s|(
$1
)|{
\1
}->{
$2
}|g"
|
grep
-E
--color
--
"
$1
"
# ask and replace only we will have changes
# ask and replace only we will have changes
if
epm
--quiet
repo list
|
grep
-E
-q
--
"
$1
"
;
then
if
epm
--quiet
repo list
"
$1
"
;
then
__replace_text_in_alt_repo
"/^ *#/! s!
$1
!
$2
!g"
__replace_text_in_alt_repo
"/^ *#/! s!
$1
!
$2
!g"
fi
fi
}
}
...
...
This diff is collapsed.
Click to expand it.
bin/epm-repolist
View file @
2b200d6f
...
@@ -91,6 +91,8 @@ print_apt_sources_list()
...
@@ -91,6 +91,8 @@ print_apt_sources_list()
{
{
local
LISTS
=
'/etc/apt/sources.list /etc/apt/sources.list.d/*.list'
local
LISTS
=
'/etc/apt/sources.list /etc/apt/sources.list.d/*.list'
[
-n
"
$1
"
]
&&
echo
"
$*
"
|
grep
-q
"
\.
[*?]"
&&
warning
"Only glob symbols * and ? are supported. Don't use regexp here!"
if
[
"
$1
"
=
"-a"
]
||
[
"
$1
"
=
"--all"
]
;
then
if
[
"
$1
"
=
"-a"
]
||
[
"
$1
"
=
"--all"
]
;
then
shift
shift
local wc
=
$(
__convert_glob__to_regexp
"
$*
"
)
local wc
=
$(
__convert_glob__to_regexp
"
$*
"
)
...
...
This diff is collapsed.
Click to expand it.
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