mirror of
https://github.com/upa/mscp.git
synced 2026-02-13 00:24:42 +08:00
add SPDX-License-Identifier to source files
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
/* SPDX-License-Identifier: GPL-3.0-only */
|
||||
#ifndef _MSCP_H_
|
||||
#define _MSCP_H_
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/* SPDX-License-Identifier: GPL-3.0-only */
|
||||
#ifndef _MSCP_VERSION_H_
|
||||
#define _MSCP_VERSION_H_
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/* SPDX-License-Identifier: GPL-3.0-only */
|
||||
#ifndef _ATOMIC_H_
|
||||
#define _ATOMIC_H_
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/* SPDX-License-Identifier: GPL-3.0-only */
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
|
||||
/* SPDX-License-Identifier: GPL-3.0-only */
|
||||
#include <dirent.h>
|
||||
#include <sys/stat.h>
|
||||
#include <glob.h>
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/* SPDX-License-Identifier: GPL-3.0-only */
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/* SPDX-License-Identifier: GPL-3.0-only */
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/* SPDX-License-Identifier: GPL-3.0-only */
|
||||
#ifndef _MESSAGE_H_
|
||||
#define _MESSAGE_H_
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/* SPDX-License-Identifier: GPL-3.0-only */
|
||||
#include <stdbool.h>
|
||||
#include <unistd.h>
|
||||
#include <math.h>
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/* SPDX-License-Identifier: GPL-3.0-only */
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <dirent.h>
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/* SPDX-License-Identifier: GPL-3.0-only */
|
||||
#ifndef _PATH_H_
|
||||
#define _PATH_H_
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/* SPDX-License-Identifier: GPL-3.0-only */
|
||||
#ifdef __APPLE__
|
||||
#include <stdlib.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/* SPDX-License-Identifier: GPL-3.0-only */
|
||||
#ifndef _PLATFORM_H_
|
||||
#define _PLATFORM_H_
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/* SPDX-License-Identifier: GPL-3.0-only */
|
||||
#define PY_SSIZE_T_CLEAN
|
||||
#include <Python.h>
|
||||
#include <errno.h>
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
from os.path import dirname, basename, isfile, isdir, exists
|
||||
from os import listdir
|
||||
import sys
|
||||
|
||||
"""
|
||||
|
||||
This file simply implements the src_path to dst_path conversion logic
|
||||
just for test. file_fill() and file_fill_recursive() in file.c
|
||||
implements this logic.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
def recursive(src, rel_path, dst, dst_should_dir, replace_dir_name):
|
||||
|
||||
if isfile(src):
|
||||
if dst_should_dir:
|
||||
print("{} => {}/{}{}".format(src, dst, rel_path, basename(src)))
|
||||
else:
|
||||
print("{} => {}{}".format(src, rel_path, dst))
|
||||
return
|
||||
|
||||
# src is directory
|
||||
for f in listdir(src):
|
||||
next_src = "{}/{}".format(src, f)
|
||||
if replace_dir_name and dst_should_dir:
|
||||
next_rel_path = ""
|
||||
else:
|
||||
next_rel_path = "{}{}/".format(rel_path, basename(src))
|
||||
recursive(next_src, next_rel_path, dst, dst_should_dir, False)
|
||||
|
||||
|
||||
def fill_dst(srclist, dst):
|
||||
dst_must_dir = len(srclist) > 1
|
||||
for src in srclist:
|
||||
dst_should_dir = isdir(src) | isdir(dst)
|
||||
replace_dir_name = not isdir(dst)
|
||||
recursive(src, "", dst, dst_should_dir | dst_must_dir, replace_dir_name)
|
||||
|
||||
|
||||
def main():
|
||||
if (len(sys.argv) < 2):
|
||||
print("usage: {} source ... target".format(sys.argv[0]))
|
||||
fill_dst(sys.argv[1:len(sys.argv) - 1], sys.argv[len(sys.argv) - 1])
|
||||
|
||||
main()
|
||||
@@ -1,3 +1,4 @@
|
||||
/* SPDX-License-Identifier: GPL-3.0-only */
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/* SPDX-License-Identifier: GPL-3.0-only */
|
||||
#ifndef _SSH_H_
|
||||
#define _SSH_H_
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/* SPDX-License-Identifier: GPL-3.0-only */
|
||||
#ifndef _UTIL_H_
|
||||
#define _UTIL_H_
|
||||
|
||||
|
||||
Reference in New Issue
Block a user