From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on sa.local.altlinux.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.1 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=altlinux.org; s=dkim; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=leUb4I/ypC0dt1fm+WCnG9t9xOX9RWnXherd4eMWYI4=; b=sNU+KJnnqSKEfsVWF81syYp6Hj M7Ci21JZ1c9shnzcUmdiWzL8gw82HfDdCnxw800bqnDF89xTHSeFucn4qwUI3jeiQi7q0sP+UzDOB 6JYGjKqg/X5T7uHvRLGQ7Kyw32xDC9YstIhxq5n66vj7RG8qTq/AD8ucmil1INkbPP+5qCO4CDD3v RIE8a45klSeGkSKvJ5tCyJQnwkoH8FlL/oKa5pFc8b3TjNqSAKmVdzSrAdBvmYvn1jhKz/IY+jmXc 7yb7W7qQY/19YM6DedUJQ6GcwrpH/gsh8rp1mEoIiv589/osQfKaZinmHPNz1vLf4ltSf+ldNEiVz l67HJ32Q==; From: "Vladimir D. Seleznev" To: devel@lists.altlinux.org Date: Sat, 11 Apr 2020 02:10:44 +0300 Message-Id: <20200410231044.1436970-3-vseleznv@altlinux.org> X-Mailer: git-send-email 2.25.2 In-Reply-To: <20200410231044.1436970-1-vseleznv@altlinux.org> References: <20200410231044.1436970-1-vseleznv@altlinux.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 46.39.229.193 X-SA-Exim-Mail-From: vseleznv@altlinux.org X-SA-Exim-Version: 4.2 X-SA-Exim-Scanned: Yes (on mail.cs.msu.ru) Cc: vseleznv@altlinux.org Subject: [devel] [PATCH 2/2] gb: optimize rebuilt srpm if its identity is equal to identity of srpm in the repo X-BeenThere: devel@lists.altlinux.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: ALT Linux Team development discussions List-Id: ALT Linux Team development discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Apr 2020 23:11:09 -0000 Archived-At: List-Archive: List-Post: --- gb/gb-task-check-build-i | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/gb/gb-task-check-build-i b/gb/gb-task-check-build-i index 9017e12..38a6ab3 100755 --- a/gb/gb-task-check-build-i +++ b/gb/gb-task-check-build-i @@ -249,10 +249,26 @@ for arch in $GB_ARCH; do fi done +osrpm_identity= +osrpm="$GB_REPO_DIR/files/SRPMS/$srpmsu" +if [ -f "$osrpm" ]; then + echo >&2 "$I: Found $srpmsu in the repo, this means the package was rebuilt" + osrpm_identity="$(pkg_identity "$osrpm")" +fi + for arch in $GB_ARCH; do [ -d "$arch/srpm" -o ! -s "$arch/excluded" ] || continue f="$arch/srpm/$srpmsu" [ -f "$f" ] || continue + srpm_identity="$(pkg_identity "$f")" + echo >&2 "$I: $arch $srpmsu identity = $srpm_identity" + # non-empty $osrpm_identity means the NEVR was rebuilt + # optimize rebuilt sourcerpm if identities of original and rebuilt sourcerpms are equal + if [ -n "$osrpm_identity" ] && + [ "$osrpm_identity" = "$srpm_identity" ]; then + echo >&2 "$I: $arch: optimize rebuilt $srpmsu cause its identity is equal to $srpmsu in the repo" + install -p "$osrpm" "$f" + fi built_pkgname="$(rpmquery --qf '%{name}' -p -- "$f")" echo "$built_pkgname" > pkgname break -- 2.25.2