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
Nurlan
eepm
Commits
ad6e875e
Commit
ad6e875e
authored
Jul 20, 2012
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rewrite query_file, port rpmqf
parent
ce76f5ba
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
64 additions
and
25 deletions
+64
-25
TODO
TODO
+1
-0
epm-query_file
bin/epm-query_file
+57
-25
epm-sh-functions
bin/epm-sh-functions
+6
-0
No files found.
TODO
View file @
ad6e875e
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
3. Переделать по возможности все команды на PMTYPE
3. Переделать по возможности все команды на PMTYPE
4. Проверить, что в общем всё работает
4. Проверить, что в общем всё работает
5. Там, где нужно, добавить $SUDO
5. Там, где нужно, добавить $SUDO
6. rpmqf, если не найдёт в локальной базе, могла бы искать в глобальной
Отказаться от distr_vendor в rpm-build-altlinux-compat и использовать distr_info отсюда.
Отказаться от distr_vendor в rpm-build-altlinux-compat и использовать distr_info отсюда.
...
...
bin/epm-query_file
View file @
ad6e875e
#!/bin/sh
#!/bin/sh
#
#
# Copyright (C) 2012 Etersoft
# Copyright (C) 20
09, 20
12 Etersoft
# Copyright (C) 2012 Vitaly Lipatov <lav@etersoft.ru>
# Copyright (C) 20
09, 20
12 Vitaly Lipatov <lav@etersoft.ru>
#
#
# This file is free software; you can redistribute it and/or modify
# This file is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# it under the terms of the GNU General Public License as published by
...
@@ -18,34 +18,66 @@
...
@@ -18,34 +18,66 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
#
#
# etersoft-build-utils/bin/rpmqf
# use and modify TOFILE recursively
real_file
()
{
local
LINKTO1 LINKTO
local
TOFILE
# get canonical path
if
[
-e
"
$1
"
]
;
then
TOFILE
=
$1
else
TOFILE
=
`
which
$1
2>/dev/null
||
echo
$1
`
if
[
"
$TOFILE
"
!=
"
$1
"
]
;
then
echo
"Note:
$1
is placed as
$TOFILE
"
fi
fi
# get value of symbolic link
if
[
-L
"
$TOFILE
"
]
;
then
LINKTO
=
`
readlink
"
$TOFILE
"
`
echo
"Note:
$TOFILE
is link to
$LINKTO
"
real_file
"
$LINKTO
"
fi
FULLFILEPATH
=
`
readlink
-f
$TOFILE
`
}
# copied from korinf/tools/run-script/scripts/search
# copied from korinf/tools/run-script/scripts/search
__do_query
()
{
case
$PMTYPE
in
apt-rpm
)
CMD
=
"rpm -qf"
;;
apt-dpkg
)
CMD
=
"dpkg -S"
;;
yum-rpm|urpm-rpm
)
CMD
=
"rpm -qf"
;;
zypper-rpm
)
CMD
=
"rpm -qf"
;;
*
)
fatal
"Do not known query command for
$PMTYPE
"
;;
esac
docmd
$CMD
$@
}
epm_query_file
()
epm_query_file
()
{
{
[
-n
"
$pkg_filenames
"
]
||
fatal
"Run query without names"
# file can exists or not
[
-n
"
$pkg_filenames
"
]
||
fatal
"Run query without file names"
case
$DISTRNAME
in
"ALTLinux"
|
"PCLinux"
)
CMD
=
"rpm -qf"
;;
"Ubuntu"
|
"Debian"
)
CMD
=
"dpkg -S"
;;
"LinuxXP"
|
"Fedora"
|
"ASPLinux"
|
"CentOS"
|
"RHEL"
|
"Scientific"
)
CMD
=
"rpm -qf"
;;
"Mandriva"
)
CMD
=
"rpm -qf"
;;
"SUSE"
)
CMD
=
"rpm -qf"
;;
*
)
RET
=
1
CMD
=
"echo
\"
Do not known query command for DISTRNAME
$DISTRNAME
\"
"
;;
esac
docmd
$CMD
$pkg_filenames
for
i
in
$pkg_filenames
;
do
real_file
"
$i
"
__do_query
$FULLFILEPATH
done
}
}
bin/epm-sh-functions
View file @
ad6e875e
...
@@ -33,6 +33,12 @@ set_target_pkg_env()
...
@@ -33,6 +33,12 @@ set_target_pkg_env()
RPMVENDOR
=
$(
$DISTRVENDOR
-n
"
$DISTRNAME
"
)
RPMVENDOR
=
$(
$DISTRVENDOR
-n
"
$DISTRNAME
"
)
}
}
# for systems without realpath command
realpath
()
{
readlink
-f
"
$@
"
}
# Print command line and run command line
# Print command line and run command line
docmd
()
docmd
()
{
{
...
...
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