Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
99b686e2b7 | |||
57c898c8d4 | |||
9fc56f5dc8 | |||
7b7b386dab |
2
Makefile
2
Makefile
@ -1,5 +1,5 @@
|
||||
SUBDIRS := $(wildcard */.)
|
||||
VERSION = 24.06
|
||||
VERSION = 24.07
|
||||
|
||||
install:
|
||||
@for dir in $(SUBDIRS) ; do \
|
||||
|
@ -42,7 +42,11 @@ get_fn_url() {
|
||||
get_file() {
|
||||
if [[ "${1}" == "https://"* || "${1}" == "http://"* || "${1}" == "ftp://"* ]]
|
||||
then
|
||||
curl "${1}" --progress-bar -OL
|
||||
if [ $OPT_INSECURE -eq 1 ]; then
|
||||
curl "${1}" --insecure --progress-bar -OL
|
||||
else
|
||||
curl "${1}" --progress-bar -OL
|
||||
fi
|
||||
return $?
|
||||
elif [ -f "${pkgpath}/${1}" ]; then
|
||||
cp "${pkgpath}/${1}" .
|
||||
@ -89,6 +93,7 @@ help_cmd() {
|
||||
echo_color " $BOLD--no-depend$RESET: don't check depends"
|
||||
echo_color " $BOLD--no-stdout$RESET: disable stdout for PACKAGE() function"
|
||||
echo_color " $BOLD--no-cache$RESET: don't check cache"
|
||||
echo_color " $BOLD--insecure$RESET: allow insecure curl downloads"
|
||||
echo_color " $BOLD--no-opts$RESET: don't show/list options"
|
||||
echo_color " $BOLD--cores$RESET: how many cores to use for the build"
|
||||
echo_color " $BOLD--out$RESET: directory for the output archive"
|
||||
@ -154,6 +159,7 @@ check_depends() {
|
||||
OPT_NO_DEPEND=0 # checking depends is ENABLED
|
||||
OPT_NO_STDOUT=0 # PACKAGE() function output is ENABLED
|
||||
OPT_NO_CACHE=0 # cache is ENABLED
|
||||
OPT_INSECURE=0 # insecure curl downloads are DISABLED
|
||||
OPT_NO_OPTS=0 # showing/listing options is ENABLED
|
||||
OPT_CORES=$(nproc) # use ALL CPU cores
|
||||
OPT_OUT="DEFAULT" # use the package dist directory for output
|
||||
@ -171,6 +177,8 @@ for arg in "$@"; do
|
||||
OPT_NO_STDOUT=1 ;;
|
||||
"--no-cache")
|
||||
OPT_NO_CACHE=1 ;;
|
||||
"--insecure")
|
||||
OPT_INSECURE=1 ;;
|
||||
"--no-opts")
|
||||
OPT_NO_OPTS=1 ;;
|
||||
"--cores"*)
|
||||
@ -223,6 +231,7 @@ if [ $OPT_NO_OPTS -eq 0 ]; then
|
||||
print " $BOLD NO_DEPEND = $(itoyn $OPT_NO_DEPEND)"
|
||||
print " $BOLD NO_SDTOUT = $(itoyn $OPT_NO_STDOUT)"
|
||||
print " $BOLD NO_CACHE = $(itoyn $OPT_NO_CACHE)"
|
||||
print " $BOLD INSECURE = $(itoyn $OPT_INSECURE)"
|
||||
print " $BOLD NO_OPTS = $(itoyn $OPT_NO_OPTS)"
|
||||
print " $BOLD CORES = ${OPT_CORES}"
|
||||
print " $BOLD OUT = ${OPT_OUT}"
|
||||
@ -368,6 +377,8 @@ info "Running the build function"
|
||||
export CC="gcc"
|
||||
export CXX="g++"
|
||||
export CFLAGS="-march=x86-64 -mtune=generic -O2"
|
||||
export CPPFLAGS="-march=x86-64 -mtune=generic -O2"
|
||||
export CXXFLAGS="-march=x86-64 -mtune=generic -O2"
|
||||
export ROOTDIR="${rootpath}"
|
||||
export MAKEFLAGS="-j${OPT_CORES}"
|
||||
export MAKEOPTS="-j${OPT_CORES}"
|
||||
@ -387,6 +398,7 @@ fi
|
||||
|
||||
unset XORG_CONFIG XORG_PREFIX
|
||||
unset MAKEOPTS MAKEFLAGS CXX
|
||||
unset CPPFLAGS CXXFLAGS
|
||||
unset CFLAGS ROOTDIR CC
|
||||
|
||||
if [ "$SECONDS" != "0" ]; then
|
||||
|
@ -1,7 +1,7 @@
|
||||
PREFIX = /usr
|
||||
|
||||
install:
|
||||
install -Dm755 "mp-check.sh" $(DESTDIR)/$(PREFIX)/bin/mp-check
|
||||
install -Dm755 "main.sh" $(DESTDIR)/$(PREFIX)/bin/mp-check
|
||||
|
||||
uninstall:
|
||||
rm $(DESTDIR)/$(PREFIX)/bin/mp-check
|
||||
|
@ -242,6 +242,10 @@ check_archive(){
|
||||
add_warning "Changes file is empty"
|
||||
fi
|
||||
|
||||
if ! grep "${version}" "${tmpdir}/CHANGES" &> /dev/null; then
|
||||
add_warning "Changes potentially does not have an entry for the current version"
|
||||
fi
|
||||
|
||||
info "Checking archive name"
|
||||
|
||||
archivefile="$(basename "${archivepath}")"
|
||||
@ -312,6 +316,12 @@ check_source(){
|
||||
if ! grep -q . "${sourcepath}/changes.md"; then
|
||||
add_warning "Changes file is empty"
|
||||
fi
|
||||
|
||||
if ! grep "${VERSION}" "${sourcepath}/changes.md" &> /dev/null; then
|
||||
add_warning "Changes potentially does not have an entry for the current version"
|
||||
fi
|
||||
|
||||
clean_pkg_vars
|
||||
}
|
||||
|
||||
#################
|
@ -78,17 +78,24 @@ fi
|
||||
# source and store every package
|
||||
files=("INFO" "LIST")
|
||||
pc="$(ls -1q "${srcpath}" | wc -l)"
|
||||
pi=1
|
||||
pi=0
|
||||
|
||||
info "Sourcing all the packages"
|
||||
set_indent
|
||||
|
||||
for pkg in "${srcpath}/"*; do
|
||||
package=$(basename "${pkg}")
|
||||
info "(${pi}/${pc}) Sourcing \"${package}\""
|
||||
pkg_name=$(basename "${pkg}")
|
||||
pi=$((pi+1))
|
||||
|
||||
if should_ignore "${pkg_name}"; then
|
||||
info "(${pi}/${pc}) Ignoring \"${pkg_name}\""
|
||||
continue
|
||||
fi
|
||||
|
||||
info "(${pi}/${pc}) Sourcing \"${pkg_name}\""
|
||||
|
||||
source "${pkg}/pkg.sh"
|
||||
check_ret "(${pi}/${pc}) Failed to import the source script for \"${package}\""
|
||||
check_ret "(${pi}/${pc}) Failed to import the source script for \"${pkg_name}\""
|
||||
|
||||
check_pkg_vars
|
||||
check_ret
|
||||
@ -97,7 +104,6 @@ for pkg in "${srcpath}/"*; do
|
||||
files+=("${NAME}_${VERSION}.mpf.sig")
|
||||
|
||||
clean_pkg_vars
|
||||
pi=$((pi+1))
|
||||
done
|
||||
|
||||
success "Completed"
|
||||
|
@ -42,6 +42,7 @@ help_cmd() {
|
||||
echo_color " $BOLD--no-depend$RESET: don't check depends"
|
||||
echo_color " $BOLD--no-stdout$RESET: disable stdout for build() function"
|
||||
echo_color " $BOLD--no-cache$RESET: don't use cache"
|
||||
echo_color " $BOLD--insecure$RESET: allow insecure curl downloads"
|
||||
echo_color " $BOLD--no-opts$RESET: don't show/list options"
|
||||
echo_color " $BOLD--no-sign$RESET: don't sign build packages"
|
||||
echo_color " $BOLD--cores$RESET: how many cores to use for the build"
|
||||
@ -74,17 +75,10 @@ list_to_str(){
|
||||
mp_build_opts(){
|
||||
local opts=("${1}" "--no-opts" "--out='${2}'")
|
||||
|
||||
if [ $OPT_NO_DEPEND -eq 1 ]; then
|
||||
opts+=("--no-depend")
|
||||
fi
|
||||
|
||||
if [ $OPT_NO_STDOUT -eq 1 ]; then
|
||||
opts+=("--no-stdout")
|
||||
fi
|
||||
|
||||
if [ $OPT_NO_CACHE -eq 1 ]; then
|
||||
opts+=("--no-cache")
|
||||
fi
|
||||
[ $OPT_NO_DEPEND -eq 1 ] && opts+=("--no-depend")
|
||||
[ $OPT_NO_STDOUT -eq 1 ] && opts+=("--no-stdout")
|
||||
[ $OPT_INSECURE -eq 1 ] && opts+=("--insecure")
|
||||
[ $OPT_NO_CACHE -eq 1 ] && opts+=("--no-cache")
|
||||
|
||||
mp-build ${opts[@]}
|
||||
return "$?"
|
||||
@ -97,6 +91,7 @@ OPT_SKIP_FAIL=0 # stop build when a package build fails
|
||||
OPT_NO_DEPEND=0 # checking depends is ENABLED
|
||||
OPT_NO_STDOUT=0 # build() function output is ENABLED
|
||||
OPT_NO_CACHE=0 # cache is ENABLED
|
||||
OPT_INSECURE=0 # insecure curl downloads are DISABLED
|
||||
OPT_NO_OPTS=0 # showing/listing options is ENABLED
|
||||
OPT_NO_SIGN=0 # sign all the built packages
|
||||
OPT_CORES=$(nproc) # use ALL CPU cores
|
||||
@ -118,6 +113,8 @@ for arg in "$@"; do
|
||||
OPT_NO_STDOUT=1 ;;
|
||||
"--no-cache")
|
||||
OPT_NO_CACHE=1 ;;
|
||||
"--insecure")
|
||||
OPT_INSECURE=1 ;;
|
||||
"--no-opts")
|
||||
OPT_NO_OPTS=1 ;;
|
||||
"--no-sign")
|
||||
@ -162,6 +159,7 @@ if [ $OPT_NO_OPTS -eq 0 ]; then
|
||||
print " $BOLD NO_DEPEND = $(itoyn $OPT_NO_DEPEND)"
|
||||
print " $BOLD NO_SDTOUT = $(itoyn $OPT_NO_STDOUT)"
|
||||
print " $BOLD NO_CACHE = $(itoyn $OPT_NO_CACHE)"
|
||||
print " $BOLD INSECURE = $(itoyn $OPT_INSECURE)"
|
||||
print " $BOLD NO_OPTS = $(itoyn $OPT_NO_OPTS)"
|
||||
print " $BOLD NO_SIGN = $(itoyn $OPT_NO_SIGN)"
|
||||
print " $BOLD CORES = $OPT_CORES"
|
||||
@ -205,16 +203,22 @@ fi
|
||||
|
||||
# build every package
|
||||
pc=${#OPT_PACKAGES[@]}
|
||||
pi=1
|
||||
pi=0
|
||||
|
||||
for pkg_name in "${OPT_PACKAGES[@]}"; do
|
||||
pkg="${srcpath}/${pkg_name}"
|
||||
pi=$((pi+1))
|
||||
|
||||
if [ ! -d "${pkg}" ]; then
|
||||
error "Package not found: \"${pkg_name}\""
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if should_ignore "${pkg_name}"; then
|
||||
info "(${pi}/${pc}) Ignoring \"${pkg_name}\""
|
||||
continue
|
||||
fi
|
||||
|
||||
info "(${pi}/${pc}) Building \"${pkg_name}\""
|
||||
|
||||
if [ $OPT_SKIP_FAIL -eq 1 ]; then
|
||||
@ -239,7 +243,6 @@ for pkg_name in "${OPT_PACKAGES[@]}"; do
|
||||
fi
|
||||
|
||||
success "(${pi}/${pc}) Build was successful for \"${pkg_name}\""
|
||||
pi=$((pi+1))
|
||||
done
|
||||
|
||||
success "Completed all the package builds"
|
||||
|
@ -230,3 +230,11 @@ check_pkg_vars() {
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
# check if a package should be ignored
|
||||
should_ignore(){
|
||||
for i in "${IGNORE[@]}"; do
|
||||
[ "${i}" == "${1}" ] && return 0
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
Reference in New Issue
Block a user