summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@open-infrastructure.net>2021-07-30 20:12:12 +0000
committerDaniel Baumann <daniel.baumann@open-infrastructure.net>2021-07-30 20:49:19 +0000
commit1c30393affa5ecfeb6c5266f5672bfd0640a0f77 (patch)
treea9faddd63cce0879bdef25814dc9401f8c7ef1f6
parentHarmonizing parameter and usage in container build command. (diff)
downloadcompute-tools-next.tar.xz
compute-tools-next.zip
python module (FIXME)next
Signed-off-by: Daniel Baumann <daniel.baumann@open-infrastructure.net>
-rw-r--r--Makefile6
-rwxr-xr-xlibexec/container/version.py17
-rw-r--r--python3/compute_tools/__init__.py24
-rw-r--r--python3/compute_tools/container/__init__.py22
-rw-r--r--python3/compute_tools/container/version.py24
5 files changed, 93 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 7bcccc9..a899ea1 100644
--- a/Makefile
+++ b/Makefile
@@ -81,6 +81,9 @@ install: build
mkdir -p $(DESTDIR)/usr/libexec
cp -r libexec/* $(DESTDIR)/usr/libexec
+ mkdir -p $(DESTDIR)/usr/lib/python3/dist-packages
+ cp -r python3/* $(DESTDIR)/usr/lib/python3/dist-packages
+
mkdir -p $(DESTDIR)/usr/share/$(SOFTWARE)
cp -r VERSION.txt $(DESTDIR)/usr/share/$(SOFTWARE)
cp -r share/config share/hooks share/keys share/build-scripts share/get-scripts $(DESTDIR)/usr/share/$(SOFTWARE)
@@ -193,6 +196,9 @@ uninstall:
rm -rf $(DESTDIR)/usr/share/$(SOFTWARE)
rmdir --ignore-fail-on-non-empty --parents $(DESTDIR)/usr/share || true
+ rm -rf $(DESTDIR)/usr/lib/python3/dist-packages/compute_tools
+ rmdir --ignore-fail-on-non-empty --parents $(DESTDIR)/usr/lib/python3/dist-packages
+
rm -rf $(DESTDIR)/usr/libexec/$(PROGRAM)
rmdir --ignore-fail-on-non-empty --parents $(DESTDIR)/usr/libexec || true
diff --git a/libexec/container/version.py b/libexec/container/version.py
new file mode 100755
index 0000000..26e9a60
--- /dev/null
+++ b/libexec/container/version.py
@@ -0,0 +1,17 @@
+#!/usr/bin/python3
+
+#from compute_tools.container import version
+#version.Custom("foo")
+
+#from compute_tools.container import version as CNT
+#CNT.Custom("foo")
+
+from compute_tools import container
+
+container.version.Custom("foo")
+
+
+
+
+#version.print_version()
+#compute_tools.container.version.Custom("foo")
diff --git a/python3/compute_tools/__init__.py b/python3/compute_tools/__init__.py
new file mode 100644
index 0000000..19b88aa
--- /dev/null
+++ b/python3/compute_tools/__init__.py
@@ -0,0 +1,24 @@
+# Open Infrastructure: compute-tools
+
+# Copyright (C) 2014-2021 Daniel Baumann <daniel.baumann@open-infrastructure.net>
+#
+# SPDX-License-Identifier: GPL-3.0+
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU 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 General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+__all__ = [
+ "container",
+]
+
+__version__ = "20210727"
diff --git a/python3/compute_tools/container/__init__.py b/python3/compute_tools/container/__init__.py
new file mode 100644
index 0000000..a955ed9
--- /dev/null
+++ b/python3/compute_tools/container/__init__.py
@@ -0,0 +1,22 @@
+# Open Infrastructure: compute-tools
+
+# Copyright (C) 2014-2021 Daniel Baumann <daniel.baumann@open-infrastructure.net>
+#
+# SPDX-License-Identifier: GPL-3.0+
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU 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 General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+__all__ = [
+ "version",
+]
diff --git a/python3/compute_tools/container/version.py b/python3/compute_tools/container/version.py
new file mode 100644
index 0000000..dd02a6c
--- /dev/null
+++ b/python3/compute_tools/container/version.py
@@ -0,0 +1,24 @@
+# Open Infrastructure: compute-tools
+
+# Copyright (C) 2014-2021 Daniel Baumann <daniel.baumann@open-infrastructure.net>
+#
+# SPDX-License-Identifier: GPL-3.0+
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU 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 General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+def print_version():
+ print(__version__)
+
+def Custom(string):
+ print("P: " + string)