Skip to content

Commit a7de00d

Browse files
committed
python requirements dupe handling fixes & plugin type added in postint script
Signed-off-by: ashish-jabble <[email protected]>
1 parent 7fb4438 commit a7de00d

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

plugins/make_deb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ do
188188
sed -i "s/fledge$/fledge (${fledge_version})/" ${deb_path}/control
189189
sed -i "s|__INSTALL_DIR__|${installs}|g" ${deb_path}/postinst
190190
sed -i "s/__PLUGIN_NAME__/${plugin_name}/g" ${deb_path}/postinst
191+
sed -i "s/__PLUGIN_TYPE__/${plugin_type_install}/g" ${deb_path}/postinst
191192
desc=`cat "${GIT_ROOT}/Description"`
192193
sed -i "s/__DESCRIPTION__/${desc}/g" ${deb_path}/control
193194
if [ ! -z "${service_notification_version}" ] ; then
@@ -232,6 +233,10 @@ EOF
232233
fi
233234
# plugin info version replaced in ${plugin_name}.py
234235
sed -i "s/'version':.*$/'version': '${version}',/g" ${GIT_ROOT}/python/fledge/plugins/${plugin_type}/${plugin_name}/${plugin_name}.py
236+
# Move python requirements to the plugin installed directory
237+
if [ -f "${GIT_ROOT}/python/requirements-${plugin_name}.txt" ]; then
238+
mv ${GIT_ROOT}/python/requirements-${plugin_name}.txt ${GIT_ROOT}/${installs}/requirements.txt
239+
fi
235240
cp -R ${GIT_ROOT}/python .
236241
cp -R ${GIT_ROOT}/VERSION.${plugin_type}.${plugin_name} ./python/fledge/plugins/${plugin_type}/${plugin_name}
237242
else

plugins/packages/DEBIAN/postinst

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,11 @@ if [ -f /usr/local/fledge/python/extras_install___PLUGIN_NAME__.sh ]; then
3838
sh /usr/local/fledge/python/extras_install___PLUGIN_NAME__.sh
3939
fi
4040

41-
# Install Python dependencies; if any
42-
if [ -f /usr/local/fledge/python/requirements-__PLUGIN_NAME__.txt ]; then
43-
pip3 install -Ir /usr/local/fledge/python/requirements-__PLUGIN_NAME__.txt
41+
# Install Python pip dependencies; if any
42+
if [ -f /usr/local/fledge/__INSTALL_DIR__/requirements.txt ]; then
43+
pip3 install -Ir /usr/local/fledge/__INSTALL_DIR__/requirements.txt
4444
fi
45-
46-
echo __PLUGIN_NAME__ plugin is installed.
45+
echo __PLUGIN_NAME__ __PLUGIN_TYPE__ plugin is installed.
4746
echo "
4847
__PLUGIN_NOTES__
4948
"

0 commit comments

Comments
 (0)