fix distributor/codename

master
Marc Wäckerlin 6 years ago
parent 1cd48dc8fb
commit 1903f3bc98
  1. 2
      COPYING
  2. 2
      INSTALL
  3. 2
      build-in-docker.conf
  4. 28
      build-in-docker.sh
  5. 6
      resolve-rpmbuilddeps.sh

@ -1 +1 @@
/usr/share/automake-1.15/COPYING
/usr/share/automake-1.16/COPYING

@ -1 +1 @@
/usr/share/automake-1.15/INSTALL
/usr/share/automake-1.16/INSTALL

@ -12,7 +12,7 @@
repos+=("ubuntu:::universe")
# Use Marc Wäckerlin's Repository, see https://repository.mrw.sh
repos+=("debian|ubuntu:::https://repository.mrw.sh:::https://repository.mrw.sh/@DISTRIBUTOR@/marc-waeckerlin.repo")
repos+=("debian|ubuntu:::https://repository.mrw.sh:::https://repository.mrw.sh/@DISTRIBUTOR@/@CODENAME@ marc-waeckerlin")
keys+=("https://repository.mrw.sh/PublicKey")
# centos requires epel-release for some packages, such as Qt WebKit

@ -200,11 +200,25 @@ function ifthenelse() {
arg="$1"
shift
cmd="$*"
DISTRIBUTOR=$(docker exec ${DOCKER_ID} lsb_release -si | sed 's, .*,,' | tr [:upper:] [:lower:])
DISTRIBUTOR=$(docker exec ${DOCKER_ID} lsb_release -si | sed 's, .*,,;s,.*,\L&,g')
CODENAME=$(docker exec ${DOCKER_ID} lsb_release -cs)
ARCH=$((docker exec ${DOCKER_ID} which dpkg > /dev/null 2> /dev/null && docker exec ${DOCKER_ID} dpkg --print-architecture) || echo amd64)
case "$DISTRIBUTOR" in
(opensuse) # code name may be not available, then set leap or tumbleweed
if test "$CODENAME" = "n/a"; then
CODENAME=$(docker exec ${DOCKER_ID} lsb_release -ds | sed "s,\($(docker exec ${DOCKER_ID} lsb_release -si | sed 's, ,\\|,g')\) *,,"';s, .*,,g;s,",,g;s,.*,\L&,g')
fi
;;
(fedora|mageia) # numeric code name
CODENAME=$(docker exec ${DOCKER_ID} lsb_release -rs)
;;
(centos) # only look at major number in centos
CODENAME=$(docker exec ${DOCKER_ID} lsb_release -rs | sed 's,\..*,,')
;;
esac
if test "${arg/:::/}" = "${arg}"; then
docker exec ${DOCKER_ID} bash -c "${cmd//ARG/${arg//@DISTRIBUTOR@/${DISTRIBUTOR}}}"
cmd_tmp="${cmd//ARG/${arg//@DISTRIBUTOR@/${DISTRIBUTOR}}}"
docker exec ${DOCKER_ID} bash -c "${cmd_tmp//@CODENAME@/${CODENAME}}"
else
os="${arg%%:::*}"
thenpart="${arg#*:::}"
@ -215,11 +229,13 @@ function ifthenelse() {
fi
if [[ "${DISTRIBUTOR}-${CODENAME}-${ARCH}" =~ ${os} ]]; then
if test -n "${thenpart}"; then
docker exec ${DOCKER_ID} bash -c "${cmd//ARG/${thenpart//@DISTRIBUTOR@/${DISTRIBUTOR}}}"
cmd_tmp="${cmd//ARG/${thenpart//@DISTRIBUTOR@/${DISTRIBUTOR}}}"
docker exec ${DOCKER_ID} bash -c "${cmd_tmp//@CODENAME@/${CODENAME}}"
fi
else
if test -n "${elsepart}"; then
docker exec ${DOCKER_ID} bash -c "${cmd//ARG/${elsepart//@DISTRIBUTOR@/${DISTRIBUTOR}}}"
cmd_tmp="${cmd//ARG/${elsepart//@DISTRIBUTOR@/${DISTRIBUTOR}}}"
docker exec ${DOCKER_ID} bash -c "${cmd_tmp//@CODENAME@/${CODENAME}}"
fi
fi
fi
@ -323,8 +339,8 @@ EOF
docker exec -i ${DOCKER_ID} rm rpm-key
done
for repo in "${repos[@]}"; do
INSTALL_REPO=$((docker exec ${DOCKER_ID} test -x /usr/bin/zypper && echo zypper ar) || (docker exec ${DOCKER_ID} test -x /usr/bin/dnf && echo dnf config-manager --add-repo) || (docker exec ${DOCKER_ID} test -x /usr/bin/yum && echo wget -O/etc/yum.repos.d/additional$i.repo) || (docker exec ${DOCKER_ID} test -x /usr/sbin/urpmi && echo false))
ifthenelse "${repo}" "${INSTALL_REPO} 'ARG'"
INSTALL_REPO=$((docker exec ${DOCKER_ID} test -x /usr/bin/zypper && echo zypper ar) || (docker exec ${DOCKER_ID} test -x /usr/bin/dnf && echo dnf config-manager --add-repo) || (docker exec ${DOCKER_ID} test -x /usr/bin/yum && echo yum-config-manager --add-repo) || (docker exec ${DOCKER_ID} test -x /usr/sbin/urpmi && echo false))
ifthenelse "${repo}" "${INSTALL_REPO} ARG"
((++i))
done
for package in "${packages[@]}"; do

@ -97,12 +97,12 @@ fi
if test -n "${SCHROOTNAME}"; then
FILES=$(LANG= schroot -c ${SCHROOTNAME} -- rpmbuild -bb --clean --nobuild --define "_topdir ." --define "_sourcedir ." ${PACKAGE_NAME}.spec 2>&1 | sed -n 's, is needed by.*,,p')
if test -n "${FILES}${DEPS}"; then
if test -n "${FILES// /}${DEPS// /}"; then
schroot -c ${SCHROOTNAME} -u root -- ${INSTALL_TOOL} ${FILES} ${DEPS}
fi
else
FILES=$(LANG= rpmbuild -bb --clean --nobuild --define "_topdir ." --define "_sourcedir ." ${PACKAGE_NAME}.spec 2>&1 | sed -n 's, is needed by.*,,p')
if test -n "${FILES}${DEPS}"; then
if test -n "${FILES// /}${DEPS// /}"; then
${INSTALL_TOOL} ${FILES} ${DEPS}
fi
fi
@ -112,7 +112,7 @@ if test -n "${SCHROOTNAME}"; then
else
FILES=$(LANG= rpmbuild -bb --clean --nobuild --define "_topdir ." --define "_sourcedir ." ${PACKAGE_NAME}.spec 2>&1 | sed -n 's, is needed by.*,,p')
fi
if test -n "${FILES}"; then
if test -n "${FILES// /}"; then
echo "**** ERROR: Cannot install: " $FILES
exit 1
fi

Loading…
Cancel
Save