403Webshell
Server IP : 82.208.35.60  /  Your IP : 216.73.216.238
Web Server : Apache/2.4.55 (FreeBSD) OpenSSL/1.1.1q-freebsd PHP/7.3.31
System : FreeBSD server7.d2m.cz 12.4-RELEASE-p9 FreeBSD 12.4-RELEASE-p9 GENERIC amd64
User : studiokobylisy_cz ( 1008)
PHP Version : 7.3.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /usr/ports/Mk/Scripts/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/ports/Mk/Scripts/cargo-crates-git-common.awk
# MAINTAINER: rust@FreeBSD.org

BEGIN {
	# No approval required to add a new gitlab instance here
	gitlab_hosts["code.videolan.org"] = 1
	gitlab_hosts["foss.heptapod.net"] = 1
	gitlab_hosts["framagit.org"] = 1
	gitlab_hosts["gitlab.com"] = 1
	gitlab_hosts["gitlab.common-lisp.net"] = 1
	gitlab_hosts["gitlab.cs.fau.de"] = 1
	gitlab_hosts["gitlab.dune-project.org"] = 1
	gitlab_hosts["gitlab.freedesktop.org"] = 1
	gitlab_hosts["gitlab.gnome.org"] = 1
	gitlab_hosts["gitlab.howett.net"] = 1
	gitlab_hosts["gitlab.inria.fr"] = 1
	gitlab_hosts["gitlab.isc.org"] = 1
	gitlab_hosts["gitlab.linphone.org"] = 1
	gitlab_hosts["gitlab.mathematik.uni-stuttgart.de"] = 1
	gitlab_hosts["gitlab.mn.tu-dresden.de"] = 1
	gitlab_hosts["gitlab.mpcdf.mpg.de"] = 1
	gitlab_hosts["gitlab.redox-os.org"] = 1
	gitlab_hosts["gitlab.torproject.org"] = 1
	gitlab_hosts["gitlab.xfce.org"] = 1
	gitlab_hosts["invent.kde.org"] = 1
	gitlab_hosts["salsa.debian.org"] = 1
	gitlab_hosts["source.puri.sm"] = 1
}

function warn(fmt, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z) {
	printf("WARNING: " fmt "\n", a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z) >"/dev/stderr"
}

function commit_from_git_url(url) {
	if (url["query", "tag"]) {
		return url["query", "tag"]
	} else {
		return url["fragment"]
	}
}

function split_git_url(info, git_url,		url, path, account, project, commit, i, dir_ver, host) {
	delete info
	split_url(url, git_url)
	url["scheme"] = tolower(url["scheme"])
	url["host"] = tolower(url["host"])
	if (url["scheme"] ~ /^git(\+https?)?$/) {
		if (url["host"] == "github.com") {
			split(url["path"], path, "/")
			account = path[2]
			project = path[3]
			sub(/\.[gG][iI][tT]$/, "", project)
			commit = commit_from_git_url(url)

			delete url
			url["scheme"] = "https"
			url["host"] = "codeload.github.com"
			url["path"] = sprintf("/%s/%s/tar.gz/%s", account, project, commit)
			url["query"] = "dummy"
			url["query", "dummy"] = "/"
			info["site"] = join_url(url)

			info["filename"] = sprintf("%s-%s-%s_GH0.tar.gz", account, project, commit)

			# Per bsd.sites.mk:
			# "GitHub silently converts tags starting with v to not have v in the filename
			# and extraction directory.  It also replaces + with -."
			dir_ver = commit
			sub(/^[vV]/, "", dir_ver)
			gsub(/\+/, "-", dir_ver)
			gsub(/--/, "-", dir_ver)
			info["dir"] = sprintf("%s-%s", project, dir_ver)

			return 1
		} else if (gitlab_hosts[url["host"]]) {
			split(url["path"], path, "/")
			account = path[2]
			for (i = 3; i < length(path); i++) {
				account = account "/" path[i]
			}
			project = path[i]
			sub(/\.[gG][iI][tT]$/, "", project)
			commit = commit_from_git_url(url)

			host = url["host"]
			delete url
			url["scheme"] = "https"
			url["host"] = host
			url["path"] = sprintf("/%s/%s/-/archive/%s.tar.gz", account, project, commit)
			url["query"] = "dummy"
			url["query", "dummy"] = "/"
			info["site"] = join_url(url)

			gsub(/\//, "-", account)
			info["filename"] = sprintf("%s-%s-%s_GL0.tar.gz", account, project, commit)

			info["dir"] = sprintf("%s-%s", project, commit)

			return 1
		}
	}

	warn("Do not know how to handle %s", git_url)
	warn("If it points to a GitLab instance try adding the hostname to gitlab_hosts[] at the top of cargo-crates-git-common.awk")
	return 0
}

Youez - 2016 - github.com/yon3zu
LinuXploit