!8 Add crudini rpm package

From: @unioah
Reviewed-by: @huangtianhua
Signed-off-by: @huangtianhua
This commit is contained in:
openeuler-ci-bot 2021-07-13 08:37:19 +00:00 committed by Gitee
commit 61090ce361
4 changed files with 147 additions and 59 deletions

View File

@ -1,36 +0,0 @@
# crudini
#### Description
A utility for easily handling ini files from the command line and shell scripts.
#### Software Architecture
Software architecture description
#### Installation
1. xxxx
2. xxxx
3. xxxx
#### Instructions
1. xxxx
2. xxxx
3. xxxx
#### Contribution
1. Fork the repository
2. Create Feat_xxx branch
3. Commit your code
4. Create Pull Request
#### Gitee Feature
1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md
2. Gitee blog [blog.gitee.com](https://blog.gitee.com)
3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore)
4. The most valuable open source project [GVP](https://gitee.com/gvp)
5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help)
6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)

View File

@ -1,37 +1,78 @@
# crudini
#### 介绍
## Description
A utility for easily handling ini files from the command line and shell scripts.
#### 软件架构
软件架构说明
```
Usage: crudini --set [OPTION]... config_file section [param] [value]
or: crudini --get [OPTION]... config_file [section] [param]
or: crudini --del [OPTION]... config_file section [param] [list value]
or: crudini --merge [OPTION]... config_file [section]
```
```
Options:
--existing[=WHAT] For --set, --del and --merge, fail if item is missing,
where WHAT is 'file', 'section', or 'param', or if
not specified; all specified items.
--format=FMT For --get, select the output FMT.
Formats are sh,ini,lines
--inplace Lock and write files in place.
This is not atomic but has less restrictions
than the default replacement method.
--list For --set and --del, update a list (set) of values
--list-sep=STR Delimit list values with "STR" instead of " ,"
--output=FILE Write output to FILE instead. '-' means stdout
--verbose Indicate on stderr if changes were made
--help Write this help to stdout
--version Write version to stdout
```
#### 安装教程
## Examples:
1. xxxx
2. xxxx
3. xxxx
* Add/Update a var
#### 使用说明
`crudini --set config_file section parameter value`
1. xxxx
2. xxxx
3. xxxx
* Update an existing var
#### 参与贡献
`crudini --set --existing config_file section parameter value`
1. Fork 本仓库
2. 新建 Feat_xxx 分支
3. 提交代码
4. 新建 Pull Request
* Delete a var
`crudini --del config_file section parameter`
#### 特技
* Delete a section
1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md
2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com)
3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目
4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目
5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help)
6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)
`crudini --del config_file section`
* output a value
`crudini --get config_file section parameter`
* output a global value not in a section
`crudini --get config_file '' parameter`
* output a section
`crudini --get config_file section`
* output a section, parseable by shell
`eval $(crudini --get --format=sh config_file section)`
* update an ini file from shell variable(s)
`echo name="$name" | crudini --merge config_file section`
* merge an ini file from another ini
`crudini --merge config_file < another.ini`
* compare two ini files using standard UNIX text processing
```
diff <(crudini --get --format=lines file1.ini|sort) \
<(crudini --get --format=lines file2.ini|sort)
```

BIN
crudini-0.9.3.tar.gz Normal file

Binary file not shown.

83
python-crudini.spec Normal file
View File

@ -0,0 +1,83 @@
%global _empty_manifest_terminate_build 0
Name: python-crudini
Version: 0.9.3
Release: 1
Summary: A utility for manipulating ini files
License: GPLv2
URL: http://github.com/pixelb/crudini
Source0: crudini-%{version}.tar.gz
BuildArch: noarch
%description
crudini A utility for manipulating ini files
%package -n python3-crudini
Summary: A utility for manipulating ini files
Provides: python-crudini
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-pbr
BuildRequires: python3-pip
BuildRequires: python3-wheel
BuildRequires: python3-iniparse
Requires: python3-iniparse
%description -n python3-crudini
crudini A utility for manipulating ini files
%package help
Summary: A utility for manipulating ini files
Provides: python3-crudini-doc
%description help
Usage:
crudini --set [OPTION]... config_file section [param] [value]
or: crudini --get [OPTION]... config_file [section] [param]
or: crudini --del [OPTION]... config_file section [param] [list value]
or: crudini --merge [OPTION]... config_file [section]
%prep
%autosetup -n crudini-%{version} -S git
%build
%py3_build
%install
%py3_install
install -d -m755 %{buildroot}/%{_pkgdocdir}
if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
pushd %{buildroot}
if [ -d usr/lib ]; then
find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/lib64 ]; then
find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/bin ]; then
find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/sbin ]; then
find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
fi
touch doclist.lst
if [ -d usr/share/man ]; then
find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
fi
popd
mv %{buildroot}/filelist.lst .
mv %{buildroot}/doclist.lst .
%check
%{__python3} setup.py test
%files -n python3-crudini -f filelist.lst
%dir %{python3_sitelib}/*
%files help -f doclist.lst
%{_docdir}/*
%changelog
* Tue Jul 13 2021 OpenStack_SIG <openstack@openeuler.org> - 0.9.3-1
- Package Spec generate