Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
etersoft-build-utils
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
korinf
etersoft-build-utils
Commits
a813091b
Commit
a813091b
authored
Feb 22, 2010
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add aptU - update/install package(s) and update their requires
parent
4a2fd422
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
56 additions
and
0 deletions
+56
-0
aptU
bin/aptU
+56
-0
No files found.
bin/aptU
0 → 100755
View file @
a813091b
#!/bin/sh
# 2010 (c) Etersoft www.etersoft.ru
# Author: Vitaly Lipatov <lav@etersoft.ru>
# Public domain
# load common functions, compatible with local and installed script
.
`
dirname
$0
`
/../share/eterbuild/functions/common
load_mod gettext
if
[
"
$1
"
=
"-h"
]
;
then
echog
"aptU [-v] - update package and all it requires"
echog
"Usage: aptU [package(s)]"
echog
" -v - verbose"
exit
0
fi
if
[
"
$1
"
=
"-v"
]
;
then
shift
else
VERBOSE
=
">/dev/null"
fi
get_requires
()
{
rpm
--requires
$@
|
grep
-v
rpmlib |
cut
-f1
-d
" "
|
sort
-u
}
ALREADYHANDLEDAPT
=
"bash sh apt rpm glibc-core glibc-locales glibc-preinstall filesystem alt-gpgkeys"
ALREADYHANDLEDRPM
=
install_packages
()
{
local
ERROR
=
local
LIST
=
"
$@
"
test
-n
"
$LIST
"
||
{
echog
"There is no more packages to install"
;
return
;
}
echo
"Install
$LIST
"
$SUDO
apt-get
install
$LIST
ALREADYHANDLEDAPT
=
"
$ALREADYHANDLEDAPT
$LIST
"
REQLIST
=
"
$(
get_requires
$LIST
)
"
REQLIST
=
$(
do_exclude_list
"
$ALREADYHANDLEDRPM
"
"
$REQLIST
"
)
$SUDO
apt-get
install
$REQLIST
$VERBOSE
ALREADYHANDLEDRPM
=
"
$ALREADYHANDLEDRPM
$REQLIST
"
ERROR
=
$?
echog
"Translate rpm requires to package names..."
PACKAGES
=
`
$SUDO
apt-get
install
--print-uris
$REQLIST
|
grep
"is already the newest version"
|
cut
-f1
-d
" "
|
sort
-u
`
PACKAGES
=
$(
do_exclude_list
"
$ALREADYHANDLEDAPT
"
"
$PACKAGES
"
)
if
[
"
$ERROR
"
!=
"0"
]
;
then
echog
"Install by rpm requires is failed, try to to install converted names"
$SUDO
apt-get
install
$PACKAGES
fi
install_packages
$PACKAGES
}
install_packages
$@
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