summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorSimon Rettberg2021-07-09 14:14:34 +0200
committerSimon Rettberg2021-07-09 14:14:34 +0200
commit9b9e3b19cdccf5e442c129d4814da7987afb16a7 (patch)
tree803302a75fd40c039cf2eb35055001c2c5053570 /core
parentRequire explicit confgig for distcc/ccache, print local config (diff)
downloadmltk-9b9e3b19cdccf5e442c129d4814da7987afb16a7.tar.gz
mltk-9b9e3b19cdccf5e442c129d4814da7987afb16a7.tar.xz
mltk-9b9e3b19cdccf5e442c129d4814da7987afb16a7.zip
Use autoclone where possible
Diffstat (limited to 'core')
-rw-r--r--core/includes/downloader.inc6
-rw-r--r--core/modules/busybox/module.build8
-rw-r--r--core/modules/busybox/module.conf3
-rw-r--r--core/modules/cron/module.build9
-rw-r--r--core/modules/cron/module.conf3
-rw-r--r--core/modules/dmidecode/module.build6
-rw-r--r--core/modules/lightdm-greeter-bwlp/module.build4
-rw-r--r--core/modules/networkd-dispatcher/module.build4
-rw-r--r--core/modules/printergui/module.build10
-rw-r--r--core/modules/printergui/module.conf1
-rw-r--r--core/modules/pvs2/module.build4
-rw-r--r--core/modules/redsocks/module.build12
-rw-r--r--core/modules/redsocks/module.conf3
-rw-r--r--core/modules/slxbrowser/module.build4
-rw-r--r--core/modules/speedcheck/module.build4
-rw-r--r--core/modules/usbguard/module.build5
-rw-r--r--core/modules/usbguard/module.conf3
-rw-r--r--core/modules/vmchooser2/module.build4
18 files changed, 34 insertions, 59 deletions
diff --git a/core/includes/downloader.inc b/core/includes/downloader.inc
index 4d4d23ba..7de0945d 100644
--- a/core/includes/downloader.inc
+++ b/core/includes/downloader.inc
@@ -110,6 +110,12 @@ download_if_empty() {
download "$SRC" "$DST"
}
+# Clone the REQUIRED_GIT git repositories.
+# Syntax is:
+# <url>
+# <url>|branch
+# <url>||commit-ish
+# Second syntax is mostly for git servers that don't accept a non-branch when shallow-cloning
autoclone () {
[ -z "$REQUIRED_GIT" ] && return 0
local url branch dst dstdir checkout
diff --git a/core/modules/busybox/module.build b/core/modules/busybox/module.build
index ae009259..27270a2c 100644
--- a/core/modules/busybox/module.build
+++ b/core/modules/busybox/module.build
@@ -1,10 +1,8 @@
#!/bin/bash
fetch_source() {
- if ! [ -d "src/.git" ]; then
- git clone --depth 1 "${REQUIRED_GIT}" --branch "$REQUIRED_BRANCH" src || perror "Could not clone busybox git"
- fi
- cde src
+ autoclone
+ cde src/busybox
# Needed for newer glibc
if ! grep -q 'OPT_SET.*clock_settime.*CLOCK_REALTIME' "coreutils/date.c"; then
git apply "${MODULE_DIR}/1_31_1-stime.patch" || perror "Could not apply stime patch for 1.31.1"
@@ -29,7 +27,7 @@ fetch_source() {
build() {
cp "${MODULE_DIR}/openslx-busybox-config" "src/.config"
- cde src
+ cde src/busybox
yes '' | make oldconfig
pinfo "Running make (if this hangs, check for unset options, ie. when you increased the REQUIRED_BRANCH)"
make || perror "failed."
diff --git a/core/modules/busybox/module.conf b/core/modules/busybox/module.conf
index 6f29188b..f9072efe 100644
--- a/core/modules/busybox/module.conf
+++ b/core/modules/busybox/module.conf
@@ -1,6 +1,5 @@
#!/bin/bash
-REQUIRED_GIT="git://git.busybox.net/busybox"
-REQUIRED_BRANCH="1_31_1"
+REQUIRED_GIT="git://git.busybox.net/busybox||1_31_1"
REQUIRED_BINARIES="busybox"
REQUIRED_DIRECTORIES="
/
diff --git a/core/modules/cron/module.build b/core/modules/cron/module.build
index d4ecce79..66cc8ecc 100644
--- a/core/modules/cron/module.build
+++ b/core/modules/cron/module.build
@@ -1,16 +1,11 @@
#!/bin/bash
fetch_source() {
- [ -d "${MODULE_WORK_DIR}/src/.git" ] && return 0
- rm -rf -- "${MODULE_WORK_DIR}/src"
- git clone "${REQUIRED_GIT}" "${MODULE_WORK_DIR}/src" || perror "Could not clone git to ${MODULE_WORK_DIR}/src"
- cd "${MODULE_WORK_DIR}/src"
- git checkout "${REQUIRED_COMMIT}" || perror "Could not switch to required commit"
- cd - &>/dev/null
+ autoclone
}
build() {
# compilation
- cde "${MODULE_WORK_DIR}/src"
+ cde "${MODULE_WORK_DIR}/src/cronie"
./autogen.sh || perror "Autogen failed"
./configure --disable-dependency-tracking --enable-syscrontab --prefix= --exec-prefix= --bindir=/opt/openslx/bin --sbindir=/opt/openslx/sbin || perror "configure failed"
diff --git a/core/modules/cron/module.conf b/core/modules/cron/module.conf
index 0a9c52c3..dad74838 100644
--- a/core/modules/cron/module.conf
+++ b/core/modules/cron/module.conf
@@ -2,8 +2,7 @@
REQUIRED_MODULES="
slxlog
"
-REQUIRED_GIT="https://github.com/cronie-crond/cronie.git"
-REQUIRED_COMMIT="d582556168e740fbd19e777a6733b404084e69d8"
+REQUIRED_GIT="https://github.com/cronie-crond/cronie.git||d582556168e740fbd19e777a6733b404084e69d8"
REQUIRED_BINARIES="
crond
"
diff --git a/core/modules/dmidecode/module.build b/core/modules/dmidecode/module.build
index 6b891730..93929aff 100644
--- a/core/modules/dmidecode/module.build
+++ b/core/modules/dmidecode/module.build
@@ -1,15 +1,13 @@
#!/bin/bash
fetch_source() {
- [ -d "${MODULE_WORK_DIR}/src/.git" ] && return 0
- rm -rf -- "${MODULE_WORK_DIR}/src"
- git clone "${REQUIRED_GIT}" "${MODULE_WORK_DIR}/src" || perror "Could not create ${MODULE_WORK_DIR}/src"
+ autoclone
}
build() {
# compilation
- cde "${MODULE_WORK_DIR}/src"
+ cde "${MODULE_WORK_DIR}/src/dmidecode"
make || perror "Could not compile dmidecode using 'make'."
diff --git a/core/modules/lightdm-greeter-bwlp/module.build b/core/modules/lightdm-greeter-bwlp/module.build
index 9698970e..76088717 100644
--- a/core/modules/lightdm-greeter-bwlp/module.build
+++ b/core/modules/lightdm-greeter-bwlp/module.build
@@ -1,10 +1,10 @@
#!/bin/bash
fetch_source() {
- git clone "$REQUIRED_GIT" "${MODULE_WORK_DIR}/src"
+ autoclone
}
build() {
- local SRCDIR="${MODULE_WORK_DIR}/src/"
+ local SRCDIR="${MODULE_WORK_DIR}/src/slxgreeter"
local BUILDDIR="${SRCDIR}/build/"
local DESTDIR="${MODULE_BUILD_DIR}/opt/openslx/bin"
diff --git a/core/modules/networkd-dispatcher/module.build b/core/modules/networkd-dispatcher/module.build
index 76ec5a8c..c704093c 100644
--- a/core/modules/networkd-dispatcher/module.build
+++ b/core/modules/networkd-dispatcher/module.build
@@ -1,6 +1,6 @@
#!/bin/bash
fetch_source() {
- git clone --depth 1 "$REQUIRED_GIT" "${MODULE_WORK_DIR}/src"
+ autoclone
}
build() {
@@ -10,7 +10,7 @@ build() {
post_copy() {
(
set -o errexit
- local SRCDIR="${MODULE_WORK_DIR}/src/"
+ local SRCDIR="${MODULE_WORK_DIR}/src/networkd-dispatcher"
# figure out where to put files
local conf_target="$(grep -oE 'EnvironmentFile=-?\S+' ${SRCDIR}/networkd-dispatcher.service)"
conf_target="${conf_target#*/}"
diff --git a/core/modules/printergui/module.build b/core/modules/printergui/module.build
index fcf55406..2d941186 100644
--- a/core/modules/printergui/module.build
+++ b/core/modules/printergui/module.build
@@ -1,19 +1,13 @@
#!/bin/bash
fetch_source() {
- git clone "${REQUIRED_GIT}" "${MODULE_WORK_DIR}/src"
- cd "${MODULE_WORK_DIR}/src"
- git checkout "$REQUIRED_COMMIT"
- cd - &>/dev/null
+ autoclone
}
build() {
- local SRCDIR="${MODULE_WORK_DIR}/src/"
+ local SRCDIR="${MODULE_WORK_DIR}/src/printergui"
local DESTDIR="${MODULE_BUILD_DIR}/opt/openslx/cups"
- # first activate qt 4
- activate_qt 4
-
mkdir -p "$DESTDIR"
cde "$DESTDIR"
pinfo "Running cmake"
diff --git a/core/modules/printergui/module.conf b/core/modules/printergui/module.conf
index 3875944b..2668e076 100644
--- a/core/modules/printergui/module.conf
+++ b/core/modules/printergui/module.conf
@@ -3,7 +3,6 @@ REQUIRED_MODULES="
slxlog
"
REQUIRED_GIT="git://git.openslx.org/openslx-ng/printergui.git"
-REQUIRED_COMMIT="HEAD"
REQUIRED_BINARIES="
printergui
printpwgui
diff --git a/core/modules/pvs2/module.build b/core/modules/pvs2/module.build
index 3be43b87..39fc0d48 100644
--- a/core/modules/pvs2/module.build
+++ b/core/modules/pvs2/module.build
@@ -1,11 +1,11 @@
#!/bin/bash
fetch_source() {
- git clone "${REQUIRED_GIT}" "${MODULE_WORK_DIR}/src"
+ autoclone
}
build() {
- local SRCDIR="${MODULE_WORK_DIR}/src/"
+ local SRCDIR="${MODULE_WORK_DIR}/src/pvs2"
local BUILDDIR="${SRCDIR}/build/"
local DESTDIR="${MODULE_BUILD_DIR}/opt/openslx/bin"
diff --git a/core/modules/redsocks/module.build b/core/modules/redsocks/module.build
index b1298c9d..a905d736 100644
--- a/core/modules/redsocks/module.build
+++ b/core/modules/redsocks/module.build
@@ -1,16 +1,8 @@
#!/bin/bash
-#tool/distro specific functions for fetching, building and installing dependencies
-
fetch_source () {
- mkdir -p src
- cde src
- if [ ! -d "redsocks" ]; then
- git clone "$REQUIRED_GIT" "redsocks" || perror "Could not clone redoscks from github"
- fi
- cde redsocks
- git checkout "$REQUIRED_REVISION" || perror "Could not checkout revision $REQUIRED_REVISION"
-}
+ autoclone
+}
build () {
cde "$MODULE_WORK_DIR/src/redsocks"
diff --git a/core/modules/redsocks/module.conf b/core/modules/redsocks/module.conf
index a9093160..56ac3a41 100644
--- a/core/modules/redsocks/module.conf
+++ b/core/modules/redsocks/module.conf
@@ -1,6 +1,5 @@
#!/bin/bash
-REQUIRED_GIT="git://github.com/darkk/redsocks.git"
-REQUIRED_REVISION="2e3f648809e27cc19cb7a8702f19b553a7ef9a81"
+REQUIRED_GIT="git://github.com/darkk/redsocks.git||2e3f648809e27cc19cb7a8702f19b553a7ef9a81"
REQUIRED_BINARIES="
redsocks
"
diff --git a/core/modules/slxbrowser/module.build b/core/modules/slxbrowser/module.build
index d8b66125..9ab0cb22 100644
--- a/core/modules/slxbrowser/module.build
+++ b/core/modules/slxbrowser/module.build
@@ -1,11 +1,11 @@
#!/bin/bash
fetch_source() {
- git clone "${REQUIRED_GIT}" "${MODULE_WORK_DIR}/src"
+ autoclone
}
build() {
- local SRCDIR="${MODULE_WORK_DIR}/src/"
+ local SRCDIR="${MODULE_WORK_DIR}/src/slxbrowser"
mkdir -p "${MODULE_BUILD_DIR}/${REQUIRED_PREFIX}"
cde "${MODULE_BUILD_DIR}/${REQUIRED_PREFIX}"
diff --git a/core/modules/speedcheck/module.build b/core/modules/speedcheck/module.build
index d306f23f..787047fc 100644
--- a/core/modules/speedcheck/module.build
+++ b/core/modules/speedcheck/module.build
@@ -1,11 +1,11 @@
#!/bin/bash
fetch_source() {
- git clone "${REQUIRED_GIT}" "${MODULE_WORK_DIR}/src" || perror "Could not clone $REQUIRED_GIT"
+ autoclone
}
build() {
- local SRCDIR="${MODULE_WORK_DIR}/src/"
+ local SRCDIR="${MODULE_WORK_DIR}/src/speedcheck"
[ ! -d "${MODULE_BUILD_DIR}/${REQUIRED_PREFIX}" ] && mkdir -p "${MODULE_BUILD_DIR}/${REQUIRED_PREFIX}"
cd "${MODULE_BUILD_DIR}/${REQUIRED_PREFIX}"
diff --git a/core/modules/usbguard/module.build b/core/modules/usbguard/module.build
index bbf5b330..d4879f91 100644
--- a/core/modules/usbguard/module.build
+++ b/core/modules/usbguard/module.build
@@ -2,10 +2,7 @@ fetch_source() {
[ -d "${MODULE_WORK_DIR}/src/.git" ] && return 0
rm -rf -- "${MODULE_WORK_DIR}/src"
download_untar "${REQUIRED_LIBSODIUM_URL}" "src/libsodium/"
- git clone --depth 1 "${REQUIRED_GIT}" "${MODULE_WORK_DIR}/src/usbguard" || perror "Could not clone git to ${MODULE_WORK_DIR}/src/usbguard"
- cd "${MODULE_WORK_DIR}/src/usbguard"
- git checkout "${REQUIRED_COMMIT}" || perror "Could not switch to required commit"
- cd - &>/dev/null
+ autoclone
}
build() {
diff --git a/core/modules/usbguard/module.conf b/core/modules/usbguard/module.conf
index cf9bfc10..61c83b6c 100644
--- a/core/modules/usbguard/module.conf
+++ b/core/modules/usbguard/module.conf
@@ -1,8 +1,7 @@
#!/bin/bash
-REQUIRED_GIT="https://github.com/dkopecek/usbguard.git"
+REQUIRED_GIT="https://github.com/dkopecek/usbguard.git||4ba9fbb337da439a1bcff6886847fb24b3df95b3"
REQUIRED_LIBSODIUM_URL="https://download.libsodium.org/libsodium/releases/libsodium-1.0.16.tar.gz"
REQUIRED_LIBSODIUM_UNTAR_NAME="libsodium-1.0.16"
-REQUIRED_COMMIT="4ba9fbb337da439a1bcff6886847fb24b3df95b3"
REQUIRED_BINARIES="usbguard usbguard-daemon"
REQUIRED_LIBRARIES=""
REQUIRED_DIRECTORIES="/"
diff --git a/core/modules/vmchooser2/module.build b/core/modules/vmchooser2/module.build
index 9abb90de..29bd4aeb 100644
--- a/core/modules/vmchooser2/module.build
+++ b/core/modules/vmchooser2/module.build
@@ -1,11 +1,11 @@
#!/bin/bash
fetch_source() {
- git clone "${REQUIRED_GIT}" "${MODULE_WORK_DIR}/src"
+ autoclone
}
build() {
- local SRCDIR="${MODULE_WORK_DIR}/src/"
+ local SRCDIR="${MODULE_WORK_DIR}/src/vmchooser2"
[ ! -d "${MODULE_BUILD_DIR}/${REQUIRED_PREFIX}" ] && mkdir -p "${MODULE_BUILD_DIR}/${REQUIRED_PREFIX}"
cd "${MODULE_BUILD_DIR}/${REQUIRED_PREFIX}"