Skip to content

Commit dc0d5e1

Browse files
committed
python requirements dupe handling fixes in make rpm script & plugin type added in spec file
Signed-off-by: ashish-jabble <[email protected]>
1 parent a7de00d commit dc0d5e1

File tree

4 files changed

+15
-8
lines changed

4 files changed

+15
-8
lines changed

plugins/make_deb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22

33
##--------------------------------------------------------------------
4-
## Copyright (c) 2019 Dianomic Systems Inc.
4+
## Copyright (c) 2022 Dianomic Systems Inc.
55
##
66
## Licensed under the Apache License, Version 2.0 (the "License");
77
## you may not use this file except in compliance with the License.

plugins/make_rpm

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22

33
##--------------------------------------------------------------------
4-
## Copyright (c) 2019 Dianomic Systems
4+
## Copyright (c) 2022 Dianomic Systems Inc.
55
##
66
## Licensed under the Apache License, Version 2.0 (the "License");
77
## you may not use this file except in compliance with the License.
@@ -196,6 +196,7 @@ do
196196
sed -i "s/__RELEASE__/${commit_count}/g" SPECS/plugin.spec
197197
sed -i "s/__NAME__/${pkg_name}/g" SPECS/plugin.spec
198198
sed -i "s/__PLUGIN_NAME__/${plugin_name}/g" SPECS/plugin.spec
199+
sed -i "s/__PLUGIN_TYPE__/${plugin_type_install}/g" SPECS/plugin.spec
199200
sed -i "s/__ARCH__/${arch}/g" SPECS/plugin.spec
200201
sed -i "s/__PACKAGE_NAME__/${package_name}/g" SPECS/plugin.spec
201202
sed -i "s|__INSTALL_DIR__|${installs}|g" SPECS/plugin.spec
@@ -241,6 +242,10 @@ EOF
241242
fi
242243
# plugin info version replaced in ${plugin_name}.py
243244
sed -i "s/'version':.*$/'version': '${version}',/g" ${GIT_ROOT}/python/fledge/plugins/${plugin_type}/${plugin_name}/${plugin_name}.py
245+
# Move python requirements to the plugin installed directory
246+
if [ -f "${GIT_ROOT}/python/requirements-${plugin_name}.txt" ]; then
247+
mv ${GIT_ROOT}/python/requirements-${plugin_name}.txt ${GIT_ROOT}/${installs}/requirements.txt
248+
fi
244249
cp -R ${GIT_ROOT}/python .
245250
cp -R ${GIT_ROOT}/VERSION.${plugin_type}.${plugin_name} ./python/fledge/plugins/${plugin_type}/${plugin_name}
246251
else

plugins/packages/DEBIAN/postinst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/sh
22

33
##--------------------------------------------------------------------
4-
## Copyright (c) 2019 Dianomic Systems Inc.
4+
## Copyright (c) 2022 Dianomic Systems Inc.
55
##
66
## Licensed under the Apache License, Version 2.0 (the "License");
77
## you may not use this file except in compliance with the License.

plugins/packages/RPM/SPECS/plugin.spec

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ __DESCRIPTION__
2525
#!/usr/bin/env bash
2626

2727
##--------------------------------------------------------------------
28-
## Copyright (c) 2019 Dianomic Systems Inc.
28+
## Copyright (c) 2022 Dianomic Systems Inc.
2929
##
3030
## Licensed under the Apache License, Version 2.0 (the "License");
3131
## you may not use this file except in compliance with the License.
@@ -54,7 +54,7 @@ __DESCRIPTION__
5454
#!/usr/bin/env bash
5555

5656
##--------------------------------------------------------------------
57-
## Copyright (c) 2019 Dianomic Systems Inc.
57+
## Copyright (c) 2022 Dianomic Systems Inc.
5858
##
5959
## Licensed under the Apache License, Version 2.0 (the "License");
6060
## you may not use this file except in compliance with the License.
@@ -87,7 +87,7 @@ PKG_NAME="__PACKAGE_NAME__"
8787
#!/usr/bin/env bash
8888

8989
##--------------------------------------------------------------------
90-
## Copyright (c) 2019 Dianomic Systems Inc.
90+
## Copyright (c) 2022 Dianomic Systems Inc.
9191
##
9292
## Licensed under the Apache License, Version 2.0 (the "License");
9393
## you may not use this file except in compliance with the License.
@@ -128,11 +128,13 @@ if [ -f /usr/local/fledge/python/extras_install___PLUGIN_NAME__.sh ]; then
128128
fi
129129

130130
# Install any Python dependencies
131-
if [ -f /usr/local/fledge/python/requirements-__PLUGIN_NAME__.txt ]; then
131+
if [ -f /usr/local/fledge/__INSTALL_DIR__/requirements.txt ]; then
132132
bash << EOF
133133
scl enable rh-python36 bash
134-
pip install -Ir /usr/local/fledge/python/requirements-__PLUGIN_NAME__.txt
134+
pip install -Ir /usr/local/fledge/__INSTALL_DIR__/requirements.txt
135135
EOF
136136
fi
137137

138+
echo __PLUGIN_NAME__ __PLUGIN_TYPE__ plugin is installed.
139+
138140
%files

0 commit comments

Comments
 (0)