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
b66cf143
Commit
b66cf143
authored
Oct 07, 2020
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update estrlist using
parent
a172d9d2
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
21 additions
and
66 deletions
+21
-66
aptU
bin/aptU
+3
-3
rpmbsh
bin/rpmbsh
+1
-1
rpmgp
bin/rpmgp
+1
-1
rpmreqs
bin/rpmreqs
+8
-8
buildsrpm
share/eterbuild/functions/buildsrpm
+1
-1
common
share/eterbuild/functions/common
+2
-2
repl
share/eterbuild/functions/repl
+2
-2
strings
share/eterbuild/functions/strings
+3
-48
No files found.
bin/aptU
View file @
b66cf143
...
...
@@ -37,7 +37,7 @@ rpmreqs_to_apt()
{
local
REQLIST
=
"
$@
"
local
PACKAGES
=
`
$SUDO
apt-get
install
--print-uris
$REQLIST
|
grep
"is already the newest version"
|
cut
-f1
-d
" "
|
sort
-u
`
do_exclude_list
"
$ALREADYHANDLEDAPT
"
"
$PACKAGES
"
estrlist exclude
"
$ALREADYHANDLEDAPT
"
"
$PACKAGES
"
}
install_by_requires
()
...
...
@@ -54,7 +54,7 @@ install_by_requires()
fi
echog
"Autoskip
$SKIPPACKAGES
, try again..."
RLIST
=
$(
do_exclude_list
"
$SKIPPACKAGES
"
"
$RLIST
"
)
RLIST
=
$(
estrlist exclude
"
$SKIPPACKAGES
"
"
$RLIST
"
)
install_by_requires
"
$RLIST
"
fi
}
...
...
@@ -71,7 +71,7 @@ install_packages()
docmd
$SUDO
apt-get
install
$LIST
ALREADYHANDLEDAPT
=
"
$ALREADYHANDLEDAPT
$LIST
"
REQLIST
=
"
$(
$ETERBUILDBIN
/rpmreqs
$LIST
)
"
REQLIST
=
$(
regexp_exclude_list
"
$ALREADYHANDLEDRPM
"
"
$REQLIST
"
)
REQLIST
=
$(
estrlist regexp_exclude
"
$ALREADYHANDLEDRPM
"
"
$REQLIST
"
)
test
-n
"
$REQLIST
"
||
{
echog
"There is no more req packages to install"
;
return
;
}
install_by_requires
$REQLIST
...
...
bin/rpmbsh
View file @
b66cf143
...
...
@@ -102,7 +102,7 @@ fi
# if ok and test install is requested, do it
if
[
"
$RESULT
"
=
"0"
]
&&
[
-n
"
$INSTALLPKG
"
]
;
then
BINPACKAGES
=
$(
$ETERBUILDBIN
/myhsh
$MENVARG
-b
$LISTBUILT
| estrlist reg_exclude
debuginfo
-
)
||
fatal
"Can't get binary packages for
$LISTBUILT
"
BINPACKAGES
=
$(
$ETERBUILDBIN
/myhsh
$MENVARG
-b
$LISTBUILT
| estrlist reg_exclude
".*debuginfo.*"
-
)
||
fatal
"Can't get binary packages for
$LISTBUILT
"
estrlist isempty
"
$BINPACKAGES
"
&&
fatal
"There is no binary packages after build"
...
...
bin/rpmgp
View file @
b66cf143
...
...
@@ -263,7 +263,7 @@ if [ -n "$UPDATECACHE" ] ; then
exit
0
fi
PKGNAME
=
$(
strip_spaces
$LISTRPMARGS
$LISTNAMES
)
PKGNAME
=
$(
estrlist
strip_spaces
$LISTRPMARGS
$LISTNAMES
)
if
[
-z
"
$ALLSYSTEM$UPDATECACHE
"
]
;
then
test
-z
"
$PKGNAME
"
&&
fatal
"Please run with spec/package name"
...
...
bin/rpmreqs
View file @
b66cf143
...
...
@@ -66,10 +66,10 @@ trans_rpmdeps_to_pkgname_ldv()
local
ALREADYHANDLEDRPM
=
"rpmlib.* rtld libgcc_s
\.
.* libstdc
\+\+
.* libc
\.
so.* ld-linux
\.
so.* libpthread
\.
so.* librt
\.
so.*"
local
REQLIST
=
"
$@
"
REQLIST
=
$(
regexp_exclude_list
"
$ALREADYHANDLEDRPM
"
"
$REQLIST
"
)
REQLIST
=
$(
estrlist regexp_exclude
"
$ALREADYHANDLEDRPM
"
"
$REQLIST
"
)
REALPKGNAMELIST
=
$(
regexp_exclude_list
". /*"
"
$REQLIST
"
)
REQCONVLIST
=
$(
do_exclude_list
"
$REALPKGNAMELIST
"
"
$REQLIST
"
)
REALPKGNAMELIST
=
$(
estrlist regexp_exclude
". /*"
"
$REQLIST
"
)
REQCONVLIST
=
$(
estrlist exclude
"
$REALPKGNAMELIST
"
"
$REQLIST
"
)
set_hasherdir
HASHERDIR
=
$HASHERDIR
-pkgreqs
...
...
@@ -114,7 +114,7 @@ common-licenses
librpmbuild
passwdqc-control"
REQLIST
=
$(
estrlist union
$(
convert_pkgfile_to_pkgname
$PKGFILES
)
$REALPKGNAMELIST
)
REQLIST
=
$(
regexp_exclude_list
"
$ALREADYHANDLEDRPM
"
"
$REQLIST
"
)
REQLIST
=
$(
estrlist regexp_exclude
"
$ALREADYHANDLEDRPM
"
"
$REQLIST
"
)
estrlist union
$REQLIST
}
...
...
@@ -129,17 +129,17 @@ trans_rpmdeps_to_pkgname_lav()
local
ALREADYHANDLEDRPM
=
"rpmlib.* rtld libgcc_s
\.
.* libstdc
\+\+
.* libc
\.
so.* libm
\.
so.* ld-linux
\.
so.* ld-linux-x86-64
\.
so.* libpthread
\.
so.* librt
\.
so.* libdl
\.
so.*"
local
REQLIST
=
"
$@
"
REQLIST
=
$(
estrlist reg_
word
exclude
"
$ALREADYHANDLEDRPM
"
"
$REQLIST
"
)
REQLIST
=
$(
estrlist reg_exclude
"
$ALREADYHANDLEDRPM
"
"
$REQLIST
"
)
# FIXME: strange regexp for drop libNAME.so.NUM and perl(Package) and /bin/sh
REALPKGNAMELIST
=
$(
estrlist reg_exclude
"
\.
so
\.
/.*
(.*"
"
$REQLIST
"
)
REALPKGNAMELIST
=
$(
estrlist reg_exclude
"
.*
\.
so
\.
.* .*/.* .*
(.*"
"
$REQLIST
"
)
# FIXME: external list? Set priorities/
REQCONVLIST
=
$(
estrlist exclude
"
$REALPKGNAMELIST
"
"
$REQLIST
"
| filter_multiple_provides |
sed
-e
"s|(64bit)|.*(64bit)|g"
)
# partially copied from aptU
#VIRTREQ=$(LANG=C apt-get install --print-uris $REQLIST 2>&1 | grep "is a virtual package provided by" | cut -f2 -d" " | sort -u)
#FIXME: f.i., we got /usr/bin/lpstat in VIRTREQ (select cups or lprng package?). Skip now
#REQLIST=$(
regexp_exclude_list
"VIRTREQ" "$REQLIST")
#REQLIST=$(
estrlist regexp_exclude
"VIRTREQ" "$REQLIST")
# TODO: we have store_output function
TFILE
=
$(
make_temp_file
)
PKGFILES
=
...
...
@@ -199,7 +199,7 @@ common-licenses
librpmbuild
passwdqc-control"
REQLIST
=
$(
estrlist union
$PKGFILES
$REALPKGNAMELIST
)
REQLIST
=
$(
estrlist reg_
word
exclude
"
$ALREADYHANDLEDRPM
"
"
$REQLIST
"
)
REQLIST
=
$(
estrlist reg_exclude
"
$ALREADYHANDLEDRPM
"
"
$REQLIST
"
)
estrlist union
$REQLIST
| estrlist list -
}
...
...
share/eterbuild/functions/buildsrpm
View file @
b66cf143
...
...
@@ -125,7 +125,7 @@ do
done
LISTBUILT
=
$(
strip_spaces
"
$LISTBUILT
"
)
LISTBUILT
=
$(
estrlist
strip_spaces
"
$LISTBUILT
"
)
test
-z
"
$LISTBUILT
"
&&
fatal
"Error: List for build is empty. Check if the file is exists."
}
share/eterbuild/functions/common
View file @
b66cf143
...
...
@@ -414,8 +414,8 @@ do
set_target_type
${
i
/-/
}
||
LISTARGS
=
"
$LISTARGS
$i
"
fi
done
LISTNAMES
=
$(
strip_spaces
"
$LISTNAMES
"
)
LISTARGS
=
$(
strip_spaces
"
$LISTARGS
"
)
LISTNAMES
=
$(
estrlist
strip_spaces
"
$LISTNAMES
"
)
LISTARGS
=
$(
estrlist
strip_spaces
"
$LISTARGS
"
)
[
-n
"
$VERBOSE
"
]
&&
echo
"LISTNAMES=
$LISTNAMES
LISTARGS=
$LISTARGS
"
||
:
}
...
...
share/eterbuild/functions/repl
View file @
b66cf143
...
...
@@ -160,7 +160,7 @@ clean_pkgreq()
echo
"
$i
"
|
grep
"[()<=>]"
>
/dev/null
&&
continue
echo
"
$i
"
|
grep
"^ *[0-9]
\.
[0-9]"
>
/dev/null
&&
continue
echo
-n
"
$i
"
|
sed
-e
"s|[,}]||g"
done
| filter_strip_spaces
done
|
estrlist
filter_strip_spaces
}
# Print list of all build requires in ALT notation
...
...
@@ -178,7 +178,7 @@ print_pkgreq()
# Print list of all groups
print_grpreq
()
{
eval_spec
${
1
}
|
grep
"^Group"
|
sed
-e
"s|^.*:||g"
|
sort
-u
| filter_strip_spaces
eval_spec
${
1
}
|
grep
"^Group"
|
sed
-e
"s|^.*:||g"
|
sort
-u
|
estrlist
filter_strip_spaces
}
# FIXME: need improvement
...
...
share/eterbuild/functions/strings
View file @
b66cf143
...
...
@@ -4,58 +4,13 @@
# Public domain
filter_strip_spaces
()
{
# possible use just
#xargs echo
sed
-e
"s|
\+
| |g"
|
\
sed
-e
"s|^ ||"
|
sed
-e
"s|
\$
||"
}
# TODO: see etersoft-build-utils/tests/test_isnumber.sh
isnumber
()
{
echo
"
$*
"
| filter_strip_spaces |
grep
-q
"^[0-9]
\+
$"
}
strip_spaces
()
{
echo
"
$*
"
| filter_strip_spaces
}
# remove_from_list "1." "11 12 21 22" -> "21 22"
remove_from_list
()
{
local
i
local
RES
=
for
i
in
$2
;
do
echo
"
$i
"
|
grep
-q
-w
"
$1
"
||
RES
=
"
$RES
$i
"
done
strip_spaces
"
$RES
"
}
# Args: LIST1 LIST2
# do_exclude_list print LIST2 exclude fields contains also in LIST1
# Example: do_exclude_list "1 3" "1 2 3 4" -> "2 4"
do_exclude_list
()
{
estrlist exclude
"
$@
"
}
# regexp_exclude_list "22 1." "11 12 21 22" -> "21"
regexp_exclude_list
()
{
estrlist reg_wordexclude
"
$@
"
}
estrlist
()
{
# can't use fatal here due $(estrlist) using
[
-x
"
$ETERBUILDBIN
/estrlist"
]
||
return
$ETERBUILDBIN
/estrlist
"
$@
"
echo
"
$*
"
| estrlist filter_strip_spaces |
grep
-q
"^[0-9]
\+
$"
}
#
CHECKME: the same like estrlist has ?
#
the same like estrlist match (reg_has)
# Note: used egrep! write '[0-9]+(first|two)', not '[0-9]\+...'
rhas
()
{
...
...
@@ -71,7 +26,7 @@ drop_args()
local
ARGS
=
"
$1
"
shift
local
LISTIGNORE
=
"
$@
"
echo
"
$ARGS
"
|
sed
-e
"s|-[
${
LISTIGNORE
/ /
}
]||g"
| filter_strip_spaces
echo
"
$ARGS
"
|
sed
-e
"s|-[
${
LISTIGNORE
/ /
}
]||g"
|
estrlist
filter_strip_spaces
#echo "$ARGS" | \
# ( for i in $LISTIGNORE ; do sed -e "s|-$i||g" ; done ) #| sed -e "s| +| |g"
}
...
...
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