forked from semios/semios-packages
Compare commits
1
Commits
mksh
..
source_git
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
797459750f |
@@ -59,3 +59,7 @@ def block_hook(hook: str):
|
|||||||
|
|
||||||
def source_url(url: str):
|
def source_url(url: str):
|
||||||
sources.source_url(url)
|
sources.source_url(url)
|
||||||
|
|
||||||
|
|
||||||
|
def source_git(url: str, branch: str | None = None):
|
||||||
|
sources.source_git(url, branch)
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import os
|
import os
|
||||||
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
import tarfile
|
import tarfile
|
||||||
import urllib.parse
|
import urllib.parse
|
||||||
@@ -109,3 +110,20 @@ def source_url(url: str):
|
|||||||
tar.extractall(extract_dir)
|
tar.extractall(extract_dir)
|
||||||
with open("./target/sources.tag", "wt+") as file:
|
with open("./target/sources.tag", "wt+") as file:
|
||||||
file.write(sources_dir)
|
file.write(sources_dir)
|
||||||
|
|
||||||
|
|
||||||
|
def _git_repo_name(url: str) -> str:
|
||||||
|
return url.split("/")[-1].replace(".git", "")
|
||||||
|
|
||||||
|
|
||||||
|
def source_git(url: str, branch: str | None = None):
|
||||||
|
source_path = os.getcwd() + "/target/" + _git_repo_name(url)
|
||||||
|
if os.path.exists("./target/sources.tag"):
|
||||||
|
return
|
||||||
|
cmdline = ["git", "clone", "--depth=1"]
|
||||||
|
if branch:
|
||||||
|
cmdline += ["-b", branch]
|
||||||
|
cmdline += [url, source_path]
|
||||||
|
subprocess.run(cmdline, check=True)
|
||||||
|
with open("./target/sources.tag", "wt+") as file:
|
||||||
|
file.write(source_path)
|
||||||
|
|||||||
@@ -1,22 +0,0 @@
|
|||||||
import os
|
|
||||||
|
|
||||||
from lib.make import *
|
|
||||||
|
|
||||||
version("1.59.2")
|
|
||||||
source_git("https://github.com/mirabilos/mksh-cvs2git.git", "mksh-R59c")
|
|
||||||
|
|
||||||
|
|
||||||
def build():
|
|
||||||
os.system("sh ./Build.sh")
|
|
||||||
|
|
||||||
|
|
||||||
on_build(build)
|
|
||||||
|
|
||||||
|
|
||||||
def pack_mksh(composer):
|
|
||||||
composer.makedir("bin")
|
|
||||||
composer.addfile("mksh", "bin/mksh")
|
|
||||||
|
|
||||||
|
|
||||||
package("mksh")
|
|
||||||
on_pack(pack_mksh)
|
|
||||||
Reference in New Issue
Block a user