From patchwork Tue Jun 19 02:28:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ga=C3=ABl_PORTAY?= X-Patchwork-Id: 931287 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=savoirfairelinux.com Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 418sN3038Vz9s37 for ; Tue, 19 Jun 2018 12:28:49 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id EE31086417; Tue, 19 Jun 2018 02:28:46 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id GtxDVFeQdA99; Tue, 19 Jun 2018 02:28:45 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 38C8C860FB; Tue, 19 Jun 2018 02:28:45 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id DAF5C1C408B for ; Tue, 19 Jun 2018 02:28:43 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id D7E7526C1D for ; Tue, 19 Jun 2018 02:28:43 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id nzMSn2BH5hAf for ; Tue, 19 Jun 2018 02:28:42 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail.savoirfairelinux.com (mail.savoirfairelinux.com [208.88.110.44]) by silver.osuosl.org (Postfix) with ESMTPS id 5F01526325 for ; Tue, 19 Jun 2018 02:28:42 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id A2D889C1C91 for ; Mon, 18 Jun 2018 22:28:40 -0400 (EDT) Received: from mail.savoirfairelinux.com ([127.0.0.1]) by localhost (mail.savoirfairelinux.com [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id bx-eurmJ2all; Mon, 18 Jun 2018 22:28:39 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id BB0E69C3089; Mon, 18 Jun 2018 22:28:39 -0400 (EDT) X-Virus-Scanned: amavisd-new at mail.savoirfairelinux.com Received: from mail.savoirfairelinux.com ([127.0.0.1]) by localhost (mail.savoirfairelinux.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 3osYi5lzFbCk; Mon, 18 Jun 2018 22:28:39 -0400 (EDT) Received: from localhost.localdomain (unknown [172.16.15.22]) by mail.savoirfairelinux.com (Postfix) with ESMTPSA id 89D1C9C1C91; Mon, 18 Jun 2018 22:28:39 -0400 (EDT) From: =?utf-8?q?Ga=C3=ABl_PORTAY?= To: buildroot@buildroot.org Date: Mon, 18 Jun 2018 22:28:35 -0400 Message-Id: <20180619022835.32530-1-gael.portay@savoirfairelinux.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Subject: [Buildroot] [RFC 1/1] support: add qt5bump script X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Ga=C3=ABl_PORTAY?= Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" This script automatically bumps either the latest version of Qt or Qt 5.6 (if --5.6 option is given). It updates URL and checksum of every module's hash file and downloads the sources to validate the changes (unless --no-download is specified through the command line). The current patches are moved to the bumped version directory. Signed-off-by: Gaƫl PORTAY --- support/scripts/qt5bump | 186 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 186 insertions(+) create mode 100755 support/scripts/qt5bump diff --git a/support/scripts/qt5bump b/support/scripts/qt5bump new file mode 100755 index 0000000000..911b1e016a --- /dev/null +++ b/support/scripts/qt5bump @@ -0,0 +1,186 @@ +#!/bin/bash + +set -e + +# Print traditional usage message +usage() { + cat <&2 + return 1 + fi + + if checksum="$(wget -qO- "$url")" + then + hashfile_update_checksum "$1" "$checksum" + else + echo "Error: $module: Cannot wget $url!" >&2 + return 1 + fi + + echo "$module: sha256 $checksum" >&2 +} + +download="make" +while [ $# -gt 0 ] +do + if [ "$1" == "-h" ] || [ "$1" == "--help" ] + then + usage + exit 0 + elif [ "$1" == "--no-download" ] + then + download="echo" + elif [ "$1" == "--5.6" ] + then + BR2_PACKAGE_QT5_VERSION_5_6=y + export BR2_PACKAGE_QT5_VERSION_5_6 + elif [ -z "$QT5_VERSION" ] + then + QT5_VERSION="$1" + QT5_VERSION_MAJOR="${1%.*}" + QT5_VERSION_MINOR="${1##*.}" + shift + break + elif [ "$1" == "--" ] + then + break + else + usage >&2 + echo "Too many arguments!" >&2 + exit 1 + fi + shift +done + +if [ -z "$BR2_PACKAGE_QT5_VERSION_5_6" ] +then + BR2_PACKAGE_QT5_VERSION_LATEST=y + export BR2_PACKAGE_QT5_VERSION_LATEST +fi + +eval "$(get_current_version)" +if [ -z "$QT5_VERSION" ] +then + QT5_VERSION_MINOR="$((CURRENT_QT5_VERSION_MINOR+1))" + QT5_VERSION_MAJOR="$CURRENT_QT5_VERSION_MAJOR" + QT5_VERSION="$QT5_VERSION_MAJOR.$QT5_VERSION_MINOR" +fi +echo "qt5: from $CURRENT_QT5_VERSION to $QT5_VERSION" >&2 + +# First, update references to Qt version in .hash files +find package/qt5/ -name "*.hash" -exec \ +sed -e "s,$CURRENT_QT5_VERSION,$QT5_VERSION,g" \ + -e "s,$CURRENT_QT5_VERSION_MAJOR,$QT5_VERSION_MAJOR,g" \ + -i {} \; + +# Then, update and source every Qt modules +for pkg in package/qt5/qt5* +do + [ -d "$pkg" ] || continue + + module=${pkg##*/} + + # Filter out modules that are not available + if [ "$BR2_PACKAGE_QT5_VERSION_5_6" = y ] + then + case "$module" in + qt5scxml|qt5virtualkeyboard) + echo "Info: $module: skipped" >&2 + continue + ;; + esac + else + case "$module" in + qt5enginio) + echo "Info: $module: skipped" >&2 + continue + ;; + esac + fi + + # Move module's current patches + if [ -d "$pkg/$CURRENT_QT5_VERSION" ] + then + mkdir -p "$pkg/$QT5_VERSION/" + mv "$pkg/$CURRENT_QT5_VERSION/"* "$pkg/$QT5_VERSION/" + rm -Rf "$pkg/$CURRENT_QT5_VERSION/" + fi + + # Update module's .hash file + if ! update_hashfile "$pkg/$module.hash" + then + continue + fi + + # Echo module's target to download + echo "$module-source" +done | \ +xargs "$download" "${O:+O=$O}" "QT5_VERSION=$QT5_VERSION" "$@" + +# Finally, update the appropriate Qt version +sed -e "/^QT5_VERSION_MAJOR = $CURRENT_QT5_VERSION_MAJOR/,/^QT5_VERSION = \$(QT5_VERSION_MAJOR).$CURRENT_QT5_VERSION_MINOR/{\ +/^QT5_VERSION_MAJOR =/s,$CURRENT_QT5_VERSION_MAJOR,$QT5_VERSION_MAJOR,g;\ +/^QT5_VERSION =/s,\\.$CURRENT_QT5_VERSION_MINOR,.$QT5_VERSION_MINOR,g\ +}" \ + -i package/qt5/qt5.mk