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
da7aa866
Commit
da7aa866
authored
2 years ago
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add epm repo comment
parent
ada8ebb2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
106 additions
and
0 deletions
+106
-0
epm-commentrepo
bin/epm-commentrepo
+102
-0
epm-repo
bin/epm-repo
+4
-0
No files found.
bin/epm-commentrepo
0 → 100644
View file @
da7aa866
#!/bin/sh
#
# Copyright (C) 2012, 2017, 2020, 2021, 2022 Etersoft
# Copyright (C) 2012, 2017, 2020, 2021, 2022 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/>.
#
load_helper epm-sh-altlinux
load_helper epm-repofix
# remove grepped lines
__epm_commentrepo_alt_grepremove
()
{
local
rl
__replace_text_in_alt_repo
"/^ *#/! s! *(.*
$1
)!#
\1
!g"
exit
# TODO
# ^rpm means full string
if
rhas
"
$1
"
"^rpm"
;
then
rl
=
"
$1
"
else
rl
=
"
$(
(
epm
--quiet
repo list
)
2>/dev/null | grep -E "
$1
")"
[
-z
"
$rl
"
]
&&
warning
"Can't find '
$1
' in the repos (see '# epm repolist' output)"
&&
return
1
fi
echo
"
$rl
"
|
while
read
rp
;
do
if
[
-n
"
$dryrun
"
]
;
then
echo
"
$rp
"
|
grep
-E
--color
--
"
$1
"
continue
fi
#if [ -n "$verbose" ] ; then
# sudocmd apt-repo $dryrun rm "$rp"
#else
__replace_text_in_alt_repo
"s! *
$rp
!#
$rp
!g"
#fi
done
}
__epm_commentrepo_alt
()
{
local
repo
=
"
$*
"
[
-n
"
$repo
"
]
||
fatal
"No such repo or task. Use epm repo comment <regexp|archive|tasks|TASKNUMBER>"
assure_exists apt-repo
if
tasknumber
"
$repo
"
>
/dev/null
;
then
local
tn
for
tn
in
$(
tasknumber
"
$repo
"
)
;
do
__epm_commentrepo_alt_grepremove
" repo/
$tn
/"
done
return
fi
case
"
$1
"
in
archive
)
info
"remove archive repos"
__epm_commentrepo_alt_grepremove
"archive/"
;;
tasks
)
info
"remove task repos"
__epm_commentrepo_alt_grepremove
" repo/[0-9]+/"
;;
task
)
shift
__epm_commentrepo_alt_grepremove
" repo/
$1
/"
;;
-
*
)
fatal
"epm commentrepo: no options are supported"
;;
*
)
# TODO: if return empty for whole line, use grep
# sudocmd apt-repo $dryrun rm "$*"
__epm_commentrepo_alt_grepremove
"
$*
"
;;
esac
}
epm_commentrepo
()
{
case
$DISTRNAME
in
ALTLinux|ALTServer
)
__epm_commentrepo_alt
"
$@
"
return
;;
esac
;
fatal
"Have no suitable command for
$PMTYPE
"
}
This diff is collapsed.
Click to expand it.
bin/epm-repo
View file @
da7aa866
...
@@ -83,6 +83,10 @@ EOF
...
@@ -83,6 +83,10 @@ EOF
load_helper epm-removerepo
load_helper epm-removerepo
epm_removerepo
"
$@
"
epm_removerepo
"
$@
"
;;
;;
comment
)
# HELPCMD: comment out repository line from the sources lists
load_helper epm-commentrepo
epm_commentrepo
"
$@
"
;;
*
)
*
)
fatal
"Unknown command
$
epm repo '
$CMD
'"
fatal
"Unknown command
$
epm repo '
$CMD
'"
;;
;;
...
...
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