-
Couldn't load subscription status.
- Fork 838
Added pelican-gfm plugin #1224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Added pelican-gfm plugin #1224
Changes from 1 commit
2f96d35
140ab9f
9b31101
44d5b95
886009c
284b90e
03dfb9d
963e121
469c99a
922db0c
962682a
7bb9115
6df3efd
f9518da
b897337
788e89b
8b6c56e
d22316b
a056e7e
76574fb
6439c43
4a932be
f57cf1d
7e8b15c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| #!/usr/bin/environment python -B | ||
| #!/usr/bin/environment python333 -B | ||
|
|
||
| from gfm import * | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,10 @@ | ||
| #!/usr/bin/python -B | ||
| #!/usr/bin/python3 -B | ||
|
|
||
| import sys | ||
| import os | ||
| import subprocess | ||
| import gfmVars | ||
|
|
||
| from backports import tempfile | ||
|
|
||
| # Eventually, equivalents for | ||
| # other operating systems / package | ||
|
|
@@ -45,15 +45,14 @@ def dpkg_packages_installed(): | |
|
|
||
| if len(need_to_be_removed) is not 0: | ||
| raise Exception("Found the following conflicting packages\ | ||
| which should be removed:\ | ||
| need_to_be_installed") | ||
| which should be removed:" + str(need_to_be_removed)) | ||
| rem = False | ||
| else: | ||
| rem = True | ||
|
|
||
| if len(need_to_be_installed) is not 0: | ||
| raise Exception("Could not find the following required\ | ||
| packages: need_to_be_installed") | ||
| packages: " + need_to_be_installed ) | ||
| ins = False | ||
| else: | ||
| ins = True | ||
|
|
@@ -63,82 +62,77 @@ def dpkg_packages_installed(): | |
| return True | ||
|
|
||
|
|
||
| def cleanUp(): | ||
| subprocess.call(["rm", "-rf", WORKSPACE]) | ||
|
|
||
|
|
||
| def setup(): | ||
| dpkg_packages_installed() | ||
|
|
||
| if test_configuration() == 1: | ||
| print("System appears to be configured") | ||
| # Configure the environment if it's not already configured | ||
| if not os.path.isdir(WORKSPACE): | ||
| os.mkdir(WORKSPACE) | ||
|
|
||
| subprocess.call([ | ||
| "wget", | ||
| "--quiet", | ||
| ARCHIVES + "/" + gfmVars.VERSION + ".tar.gz", | ||
| WORKSPACE, | ||
| "-P", | ||
| WORKSPACE | ||
| ]) | ||
| subprocess.call([ | ||
| 'tar', | ||
| 'zxf', | ||
| WORKSPACE + "/" + gfmVars.VERSION + ".tar.gz", | ||
| "-C", | ||
| WORKSPACE | ||
| ] | ||
| ) | ||
|
|
||
| BUILDSPACE = gfmVars.WORKSPACE + "/" + "cmark-gfm-" + gfmVars.VERSION + "/build" | ||
|
|
||
| if not os.path.isdir(BUILDSPACE): | ||
| os.mkdir(BUILDSPACE) | ||
|
|
||
| thing1 = subprocess.Popen([ | ||
| "cmake", | ||
| "-DCMARK_TESTS=OFF", | ||
| "-DCMARK_STATIC=OFF", | ||
| ".." | ||
| ], cwd=BUILDSPACE) | ||
| thing1.wait() | ||
|
|
||
| thing2 = subprocess.Popen(["make"], cwd=BUILDSPACE) | ||
| thing2.wait() | ||
|
|
||
| # Move the libcmark.so artifacts in place | ||
| print "Moving files" | ||
| subprocess.call([ | ||
| "mv", | ||
| BUILDSPACE + "/src/libcmark-gfm.so." + gfmVars.VERSION, | ||
| gfmVars.LIBCMARKLOCATION + "libcmark-gfm.so" | ||
| ] | ||
| ) | ||
| subprocess.call([ | ||
| "mv", | ||
| BUILDSPACE + "/extensions/libcmark-gfmextensions.so." + gfmVars.VERSION, | ||
| gfmVars.LIBCMARKLOCATION + "libcmark-gfmextensions.so" | ||
| ] | ||
| ) | ||
| else: | ||
| # Configure the environment if it's not already configured | ||
|
|
||
| with tempfile.TemporaryDirectory() as WORKSPACE: | ||
| subprocess.call([ | ||
| "wget", | ||
| "--quiet", | ||
| gfmVars.ARCHIVES + "/" + gfmVars.VERSION + ".tar.gz", | ||
| WORKSPACE, | ||
| "-P", | ||
| WORKSPACE | ||
| ]) | ||
| subprocess.call([ | ||
| 'tar', | ||
| 'zxf', | ||
| WORKSPACE + "/" + gfmVars.VERSION + ".tar.gz", | ||
| "-C", | ||
| WORKSPACE | ||
| ] | ||
| ) | ||
|
|
||
| BUILDSPACE = WORKSPACE + "/" + "cmark-gfm-" + gfmVars.VERSION + "/build" | ||
|
|
||
| if not os.path.isdir(BUILDSPACE): | ||
| os.mkdir(BUILDSPACE) | ||
|
|
||
| thing1 = subprocess.Popen([ | ||
| "cmake", | ||
| "-DCMARK_TESTS=OFF", | ||
| "-DCMARK_STATIC=OFF", | ||
| ".." | ||
| ], cwd=BUILDSPACE) | ||
| thing1.wait() | ||
|
|
||
| thing2 = subprocess.Popen(["make"], cwd=BUILDSPACE) | ||
| thing2.wait() | ||
|
|
||
| # Move the libcmark.so artifacts in place | ||
| print("Moving files") | ||
| subprocess.call([ | ||
|
||
| "mv", | ||
| BUILDSPACE + "/src/libcmark-gfm.so." + gfmVars.VERSION, | ||
| gfmVars.LIBCMARKLOCATION + "libcmark-gfm.so" | ||
| ] | ||
| ) | ||
| subprocess.call([ | ||
| "mv", | ||
| BUILDSPACE + "/extensions/libcmark-gfmextensions.so." + gfmVars.VERSION, | ||
| gfmVars.LIBCMARKLOCATION + "libcmark-gfmextensions.so" | ||
| ] | ||
| ) | ||
|
|
||
|
|
||
| def test_configuration(): | ||
| """ Tests to ensure that the files that the plugin needs are in place. """ | ||
| CMARKPATH = gfmVars.LIBCMARKLOCATION + "/libcmark-gfm.so." + gfmVars.VERSION | ||
| if os.path.isfile(gfmVars.LIBCMARKLOCATION + "/libcmark-gfm.so") and \ | ||
| os.path.isfile(gfmVars.LIBCMARKLOCATION + "/libcmark-gfmextensions.so"): | ||
| return 0 | ||
| os.path.isfile(gfmVars.LIBCMARKLOCATION + "/libcmark-gfmextensions.so"): | ||
| return True | ||
| else: | ||
| return 1 | ||
| return False | ||
|
|
||
|
|
||
| def configure(): | ||
| print("Checking out the configuration") | ||
| setup() | ||
| cleanUp() | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the
python333a typo?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes that was a typo.