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
7c7da495
Commit
7c7da495
authored
Feb 24, 2016
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix downgrade for LINUX@Etersoft, Debian, Ubuntu, add support for downgrade one or a few packages
parent
cb88c34b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
8 deletions
+42
-8
epm-downgrade
bin/epm-downgrade
+42
-8
No files found.
bin/epm-downgrade
View file @
7c7da495
#!/bin/sh
#!/bin/sh
#
#
# Copyright (C) 2012,2014 Etersoft
# Copyright (C) 2012,2014
,2016
Etersoft
# Copyright (C) 2012,2014 Vitaly Lipatov <lav@etersoft.ru>
# Copyright (C) 2012,2014
,2016
Vitaly Lipatov <lav@etersoft.ru>
#
#
# This program is free software: you can redistribute it and/or modify
# 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
# it under the terms of the GNU Affero General Public License as published by
...
@@ -19,13 +19,39 @@
...
@@ -19,13 +19,39 @@
load_helper epm-check_updated_repo
load_helper epm-check_updated_repo
__epm_add_apt_downgrade_preferences
()
__epm_add_a
lt_a
pt_downgrade_preferences
()
{
{
[
-r
/etc/apt/preferences
]
&&
fatal
"/etc/apt/preferences already exists"
[
-r
/etc/apt/preferences
]
&&
fatal
"/etc/apt/preferences already exists"
cat
<<
EOF
|
$SUDO
tee /etc/apt/preferences
cat
<<
EOF
|
$SUDO
tee /etc/apt/preferences
# main repo
Package: *
Package: *
Pin: release c=
$1
Pin: release c=
classic
Pin-Priority: 1001
Pin-Priority: 1001
# overload with addon repo
Package: *
Pin: release c=addon
Pin-Priority: 1101
EOF
}
# See https://wiki.debian.org/ru/AptPreferences
__epm_add_deb_apt_downgrade_preferences
()
{
[
-r
/etc/apt/preferences
]
&&
fatal
"/etc/apt/preferences already exists"
info
"Running with /etc/apt/preferences:"
cat
<<
EOF
|
$SUDO
tee /etc/apt/preferences
Package: *
Pin: release a=stable
Pin-Priority: 1001
Package: *
Pin: release a=testing
Pin-Priority: 900
Package: *
Pin: release a=unstable
Pin-Priority: 800
EOF
EOF
}
}
...
@@ -45,21 +71,29 @@ epm_downgrade()
...
@@ -45,21 +71,29 @@ epm_downgrade()
case
$PMTYPE
in
case
$PMTYPE
in
apt-rpm
)
apt-rpm
)
__epm_add_apt_downgrade_preferences classic
||
return
__epm_add_alt_apt_downgrade_preferences
||
return
if
[
-n
"
$pkg_filenames
"
]
;
then
sudocmd apt-get
install
$pkg_filenames
else
sudocmd apt-get dist-upgrade
sudocmd apt-get dist-upgrade
fi
__epm_remove_apt_downgrade_preferences
__epm_remove_apt_downgrade_preferences
;;
;;
apt-dpkg
)
apt-dpkg
)
__epm_add_apt_downgrade_preferences testing
||
return
__epm_add_deb_apt_downgrade_preferences
||
return
if
[
-n
"
$pkg_filenames
"
]
;
then
sudocmd apt-get
install
$pkg_filenames
else
sudocmd apt-get dist-upgrade
sudocmd apt-get dist-upgrade
fi
__epm_remove_apt_downgrade_preferences
__epm_remove_apt_downgrade_preferences
;;
;;
yum-rpm
)
yum-rpm
)
# can do update repobase automagically
# can do update repobase automagically
sudocmd yum downgrade
$pkg_filename
sudocmd yum downgrade
$pkg_filename
s
;;
;;
dnf-rpm
)
dnf-rpm
)
sudocmd dnf downgrade
$pkg_filename
sudocmd dnf downgrade
$pkg_filename
s
;;
;;
urpm-rpm
)
urpm-rpm
)
assure_exists urpm-reposync urpm-tools
assure_exists urpm-reposync urpm-tools
...
...
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