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
d7df8bdd
Commit
d7df8bdd
authored
Aug 13, 2024
by
Boris Yumankulov
Committed by
Vitaly Lipatov
Nov 09, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add epm create-fake command (eterbug #17597)
parent
10feaae3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
163 additions
and
0 deletions
+163
-0
epm
bin/epm
+4
-0
epm-create-fake
bin/epm-create-fake
+159
-0
No files found.
bin/epm
View file @
d7df8bdd
...
...
@@ -466,6 +466,10 @@ check_command()
epm_cmd
=
play
direct_args
=
1
;;
create-fake
)
# HELPCMD: create fake rpm
epm_cmd
=
create-fake
direct_args
=
1
;;
-V
|
checkpkg|integrity
)
# HELPCMD: check package file integrity (checksum)
epm_cmd
=
checkpkg
;;
...
...
bin/epm-create-fake
0 → 100755
View file @
d7df8bdd
#!/bin/sh
#
# Copyright (C) 2017-2018, 2020 Etersoft
# Copyright (C) 2017-2018, 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
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
load_helper epm-assure
load_helper epm-repack-rpm
__create_spec
()
{
echo
"%{!?fake_name: %global fake_name
$NAME
}"
>>
"
$1
"
echo
"%{!?fake_version: %global fake_version
$VERSION
}"
>>
"
$1
"
echo
"%{!?fake_release: %global fake_release
$RELEASE
}"
>>
"
$1
"
if
[
-n
"
$REQUIRES
"
]
;
then
echo
"%{!?fake_requires: %global fake_requires
$REQUIRES
}"
>>
"
$1
"
fi
if
[
-n
"
$PROVIDES
"
]
;
then
echo
"%{!?fake_provides: %global fake_provides
$PROVIDES
}"
>>
"
$1
"
fi
cat
<<
EOF
>> "
$1
"
%define _rpmdir
$PWD
Name: fake-%{fake_name}
Version: %{fake_version}
Release: %{fake_release}
License: CC0
Group: Other
Summary: Faked provides package
%if "%{?fake_provides}" != ""
Provides: %{fake_provides}
%endif
Provides: %{fake_name}
%if "%{?fake_requires}" != ""
Requires: %{fake_requires}
%endif
BuildArch: noarch
%description
This package is empty. It has been created to put fake entry in rpmdb.
%files
#intentionaly empty
%changelog
#intentionaly empty
EOF
}
__epm_create-fake_help
()
{
message
'
epm create-fake - create package with fake provides and requires. Use follow params:
--install - auto install fake package
--version=* - set package version (by default version is 0)
--release=* - set package release (by default release is 0)
--requires=* - set package requires
--provides=* - set package provides (by default package provide only it self)
Examples:
# epm create-fake --install python-somepackage
# epm create-fake --install --provides="python3dist(somepackage)" python-somepackage
# epm create-fake --install --requires=python3 --requires=python3-module python-somepackage
'
return
}
epm_create-fake
()
{
VERSION
=
0
RELEASE
=
0
REQUIRES
=
""
for
i
in
"
$@
"
;
do
case
$i
in
--version
=
*
)
VERSION
=
"
${
i
#*=
}
"
shift
# past argument
;;
--release
=
*
)
RELEASE
=
"
${
i
#*=
}
"
shift
# past argument
;;
--requires
=
*
)
REQUIRES+
=
"
${
i
#*=
}
"
shift
# past argument
;;
--provides
=
*
)
PROVIDES+
=
"
${
i
#*=
}
"
shift
# past argument
;;
--help
|
-h
)
__epm_create-fake_help
return
;;
*
)
# unknown option
;;
esac
done
NAME
=
$1
if
[
-z
"
$NAME
"
]
;
then
fatal
"Error: You have to specify PACKAGE_NAME"
fi
# will set RPMBUILD
__assure_exists_rpmbuild
HOME
=
"
$(
mktemp
-d
--tmpdir
=
$BIGTMPDIR
)
"
||
fatal
remove_on_exit
$HOME
export
HOME
__create_rpmmacros
tmpbuilddir
=
$HOME
/
$(
basename
$NAME
)
.tmpdir
mkdir
$tmpbuilddir
cd
$tmpbuilddir
/
||
fatal
SPECFILE
=
${
PWD
}
/
${
NAME
}
.spec
__create_spec
"
$SPECFILE
"
showcmd
$RPMBUILD
-bb
$SPECFILE
if
[
-n
"
$verbose
"
]
;
then
a
=
''
$RPMBUILD
-bb
$SPECFILE
||
fatal
else
a
=
''
$RPMBUILD
-bb
$SPECFILE
>
/dev/null
||
fatal
fi
repacked_rpm
=
"
$(
realpath
"
$tmpbuilddir
/noarch/*.rpm"
)
"
remove_on_exit
"
$repacked_rpm
"
if
[
-n
"
$install
"
]
;
then
epm
install
"
$repacked_rpm
"
fi
}
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