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
bb1cb7e6
Commit
bb1cb7e6
authored
Feb 15, 2020
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rewrite removerepo
parent
8d73548f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
53 additions
and
45 deletions
+53
-45
epm-removerepo
bin/epm-removerepo
+53
-45
No files found.
bin/epm-removerepo
View file @
bb1cb7e6
#!/bin/sh
#
# Copyright (C) 2012, 2017 Etersoft
# Copyright (C) 2012, 2017 Vitaly Lipatov <lav@etersoft.ru>
# Copyright (C) 2012, 2017
, 2020
Etersoft
# Copyright (C) 2012, 2017
, 2020
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
...
...
@@ -19,55 +19,63 @@
load_helper epm-sh-altlinux
# remove grepped lines
__epm_removerepo_alt_grepremove
()
{
local
rp
epm repolist |
grep
-E
"
$1
"
|
while
read
rp
;
do
sudocmd apt-repo
rm
"
$rp
"
done
}
__epm_removerepo_alt
()
{
local
repo
=
"
$*
"
[
-n
"
$repo
"
]
||
fatal
"No such repo or task. Use epm remove repo <autoimports|archive|tasks|TASKNUMBER>"
assure_exists apt-repo
if
tasknumber
"
$repo
"
>
/dev/null
;
then
local
tn
for
tn
in
$(
tasknumber
"
$repo
"
)
;
do
__epm_removerepo_alt_grepremove
" repo/
$tn
/"
done
return
fi
case
"
$1
"
in
autoimports
)
info
"remove autoimports repo"
[
-n
"
$DISTRVERSION
"
]
||
fatal
"Empty DISTRVERSION"
repo
=
"autoimports.
$(
echo
"
$DISTRVERSION
"
|
tr
"[:upper:]"
"[:lower:]"
)
"
sudocmd apt-repo
rm
"
$repo
"
;;
archive
)
info
"remove archive repos"
__epm_removerepo_alt_grepremove
"archive/"
;;
tasks
)
info
"remove task repos"
__epm_removerepo_alt_grepremove
" repo/[0-9]+/"
;;
task
)
shift
__epm_removerepo_alt_grepremove
" repo/
$1
/"
;;
*
)
sudocmd apt-repo
rm
"
$*
"
;;
esac
}
epm_removerepo
()
{
local
repo
=
"
$(
eval echo
$quoted_args
)
"
case
$DISTRNAME
in
ALTLinux
)
assure_exists apt-repo
case
"
$repo
"
in
autoimports
)
info
"remove autoimports repo"
[
-n
"
$DISTRVERSION
"
]
||
fatal
"Empty DISTRVERSION"
repo
=
"
$repo
.
$(
echo
"
$DISTRVERSION
"
|
tr
"[:upper:]"
"[:lower:]"
)
"
;;
archive
)
info
"remove archive repos"
assure_exists apt-repo
epm repolist |
grep
"archive/"
|
while
read
repo
;
do
sudocmd apt-repo
rm
"
$repo
"
done
return
0
;;
tasks
)
info
"remove task repos"
assure_exists apt-repo
epm repolist |
grep
-E
" repo/[0-9]+/"
|
while
read
repo
;
do
sudocmd apt-repo
rm
"
$repo
"
done
return
0
;;
*
)
if
tasknumber
"
$repo
"
>
/dev/null
;
then
assure_exists apt-repo
local
tn
for
tn
in
$(
tasknumber
"
$repo
"
)
;
do
repoline
=
"
$(
epm repolist |
grep
" repo/
$tn
/"
| line
)
"
#"
[
-n
"
$repoline
"
]
||
{
info
"Can't find
$tn
task in the repository list"
;
continue
;
}
sudocmd apt-repo
rm
"
$repoline
"
# try again to remove possible x86_64-i586
repoline
=
"
$(
epm repolist |
grep
" repo/
$tn
/"
| line
)
"
#"
[
-n
"
$repoline
"
]
||
continue
sudocmd apt-repo
rm
"
$repoline
"
done
return
0
fi
;;
esac
[
-n
"
$repo
"
]
||
fatal
"No such repo or task. Use epm remove repo <autoimports|archive|tasks|TASKNUMBER>"
sudocmd apt-repo
rm
"
$repo
"
__epm_removerepo_alt
$repo
return
;;
esac
;
...
...
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