From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from sa-prd-fep-043.btinternet.com (mailomta28-sa.btinternet.com [213.120.69.34]) by sourceware.org (Postfix) with ESMTPS id D6A433861010 for ; Sat, 5 Jun 2021 14:28:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D6A433861010 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=dronecode.org.uk Authentication-Results: sourceware.org; spf=none smtp.mailfrom=dronecode.org.uk Received: from sa-prd-rgout-002.btmx-prd.synchronoss.net ([10.2.38.5]) by sa-prd-fep-043.btinternet.com with ESMTP id <20210605142849.IISA19470.sa-prd-fep-043.btinternet.com@sa-prd-rgout-002.btmx-prd.synchronoss.net>; Sat, 5 Jun 2021 15:28:49 +0100 Authentication-Results: btinternet.com; auth=pass (LOGIN) smtp.auth=jonturney@btinternet.com X-SNCR-Rigid: 603871830E197126 X-Originating-IP: [86.139.167.9] X-OWM-Source-IP: 86.139.167.9 (GB) X-OWM-Env-Sender: jonturney@btinternet.com X-VadeSecure-score: verdict=clean score=0/300, class=clean X-RazorGate-Vade: gggruggvucftvghtrhhoucdtuddrgeduledrfedtfedgjeeiucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuueftkffvkffujffvgffngfevqffopdfqfgfvnecuuegrihhlohhuthemuceftddunecunecujfgurhephffvufffkffoggfgsedtkeertdertddtnecuhfhrohhmpeflohhnucfvuhhrnhgvhicuoehjohhnrdhtuhhrnhgvhiesughrohhnvggtohguvgdrohhrghdruhhkqeenucggtffrrghtthgvrhhnpeeuieejgeduvdeutdffieeileefffdufeekhefgjefffeehtdekjeegkeeftdfffeenucfkphepkeeirddufeelrdduieejrdelnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehhvghloheplhhotggrlhhhohhsthdrlhhotggrlhguohhmrghinhdpihhnvghtpeekiedrudefledrudeijedrledpmhgrihhlfhhrohhmpeeojhhonhdrthhurhhnvgihsegurhhonhgvtghouggvrdhorhhgrdhukheqpdhrtghpthhtohepoegthihgfihinhdqrghpphhssegthihgfihinhdrtghomheqpdhrtghpthhtohepoehjohhnrdhtuhhrnhgvhiesughrohhnvggtohguvgdrohhrghdruhhkqe X-RazorGate-Vade-Verdict: clean 0 X-RazorGate-Vade-Classification: clean Received: from localhost.localdomain (86.139.167.9) by sa-prd-rgout-002.btmx-prd.synchronoss.net (5.8.340) (authenticated as jonturney@btinternet.com) id 603871830E197126; Sat, 5 Jun 2021 15:28:49 +0100 From: Jon Turney To: cygwin-apps@cygwin.com Cc: Jon Turney Subject: [PATCH cygport] Add srcpackage command Date: Sat, 5 Jun 2021 15:28:22 +0100 Message-Id: <20210605142822.16698-1-jon.turney@dronecode.org.uk> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1198.8 required=5.0 tests=BAYES_00, FORGED_SPF_HELO, GIT_PATCH_0, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: cygwin-apps@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Cygwin package maintainer discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Jun 2021 14:29:01 -0000 Add srcpackage command, which only creates source package Move src.hint generation from __pkg_dist to __pkg_srcpkg Various tweaks to allow it to work when 'cygport prep' hasn't been run. This is intended for use in automation, to build from the source package, rather than a packaging repository, ensuring that all files used by the build are properly present in the source package. --- bin/cygport.in | 6 +++ data/cygport-bash-completion | 2 +- lib/help.cygpart | 1 + lib/pkg_pkg.cygpart | 81 +++++++++++++++++++----------------- lib/syntax.cygpart | 1 + 5 files changed, 52 insertions(+), 39 deletions(-) diff --git a/bin/cygport.in b/bin/cygport.in index e9295be..81dd166 100755 --- a/bin/cygport.in +++ b/bin/cygport.in @@ -641,6 +641,12 @@ do (__pkg_binpkg && __pkg_pkgcheck && __pkg_srcpkg && __pkg_dist ${_pkg_tag}) 2>&1 | tee -a ${pkglog}; _status=${PIPESTATUS[0]}; ;; + srcpackage|srcpkg) + __stage Packaging Source; + __log_init ${pkglog}; + (__pkg_srcpkg) 2>&1 | tee -a ${pkglog}; + _status=${PIPESTATUS[0]}; + ;; diff|mkdiff|mkpatch) __pkg_diff; _status=$?; diff --git a/data/cygport-bash-completion b/data/cygport-bash-completion index 9085e19..a97416d 100644 --- a/data/cygport-bash-completion +++ b/data/cygport-bash-completion @@ -9,7 +9,7 @@ _cygport() commands='download fetch wget get \ prep unpack oldpatch compile build make \ - check test inst install list dep depends \ + check test inst install list dep depends srcpackage srcpkg \ package pkg package-test pkg-test diff mkdiff mkpatch \ upload stage announce almostall all all-test clean finish \ help info version homepage website vars' diff --git a/lib/help.cygpart b/lib/help.cygpart index dfb943d..ff630c2 100644 --- a/lib/help.cygpart +++ b/lib/help.cygpart @@ -45,6 +45,7 @@ __show_help() { compile run all compilation steps test run the package's test suite, if one exists install install into a DESTDIR, and run post-installation steps + srcpackage create source package package create binary and source packages package-test create binary and source packages, marked as test upload upload finished packages to cygwin.com diff --git a/lib/pkg_pkg.cygpart b/lib/pkg_pkg.cygpart index 91e8768..3110cf0 100644 --- a/lib/pkg_pkg.cygpart +++ b/lib/pkg_pkg.cygpart @@ -462,12 +462,16 @@ __gpg_sign() { __pkg_srcpkg() { local src; + mkdir -p ${spkgdir}; rm -fr ${spkgdir}/*; - echo; - __step "Creating source patches"; + if [ -d ${patchdir} ] + then + echo; + __step "Creating source patches"; - __pkg_diff; + __pkg_diff; + fi if [ -s ${patchdir}/${cygwin_patchfile} ] then @@ -519,8 +523,44 @@ __pkg_srcpkg() { cd ${spkgdir%/*}; + mkdir -p ${distdir}/${PN}; tar Jcvf ${distdir}/${PN}/${PF}-src.tar.xz ${spkgdir##*/}/ || error "Source package creation failed" echo; + + # source package hint + if [ ! -f ${distdir}/${PN}/${PN}-${PVR}-src.hint ] + then + pkg_category_var=${PN//[-+\.]/_}_CATEGORY; + pkg_summary_var=${PN//[-+\.]/_}_SUMMARY; + pkg_description_var=${PN//[-+\.]/_}_DESCRIPTION; + + if [ -f ${C}/${PN}-src.hint ] + then + cp ${C}/${PN}-src.hint ${distdir}/${PN}/${PN}-${PVR}-src.hint + elif [ -f ${C}/setup.hint ] + then + cp ${C}/setup.hint ${distdir}/${PN}/${PN}-${PVR}-src.hint + elif [ -n "${!pkg_category_var:-${CATEGORY}}" \ + -a -n "${!pkg_summary_var:-${SUMMARY}}${!pkg_description_var:-${DESCRIPTION}}" ] + then + cat > ${distdir}/${PN}/${PN}-${PVR}-src.hint <<-_EOF +category: ${!pkg_category_var:-${CATEGORY}} +build-depends: cygport ${BUILD_REQUIRES} +sdesc: "${!pkg_summary_var:-${SUMMARY}}" +ldesc: "${!pkg_description_var:-${DESCRIPTION:-${!pkg_summary_var:-${SUMMARY}}}}" +skip: +${pkg_tag} +_EOF + if [ -n "${HOMEPAGE}" ] + then + cat >> ${distdir}/${PN}/${PN}-${PVR}-src.hint <<-_EOF +homepage: ${HOMEPAGE} +_EOF + fi + else + warning "${PN}-src.hint is missing"; + fi + fi } __pkg_dist() { @@ -896,41 +936,6 @@ ${pkg_tag} _EOF done fi - - # source package hint - if [ ! -f ${distdir}/${PN}/${PN}-${PVR}-src.hint ] - then - pkg_category_var=${PN//[-+\.]/_}_CATEGORY; - pkg_summary_var=${PN//[-+\.]/_}_SUMMARY; - pkg_description_var=${PN//[-+\.]/_}_DESCRIPTION; - - if [ -f ${C}/${PN}-src.hint ] - then - cp ${C}/${PN}-src.hint ${distdir}/${PN}/${PN}-${PVR}-src.hint - elif [ -f ${C}/setup.hint ] - then - cp ${C}/setup.hint ${distdir}/${PN}/${PN}-${PVR}-src.hint - elif [ -n "${!pkg_category_var:-${CATEGORY}}" \ - -a -n "${!pkg_summary_var:-${SUMMARY}}${!pkg_description_var:-${DESCRIPTION}}" ] - then - cat > ${distdir}/${PN}/${PN}-${PVR}-src.hint <<-_EOF -category: ${!pkg_category_var:-${CATEGORY}} -build-depends: cygport ${BUILD_REQUIRES} -sdesc: "${!pkg_summary_var:-${SUMMARY}}" -ldesc: "${!pkg_description_var:-${DESCRIPTION:-${!pkg_summary_var:-${SUMMARY}}}}" -skip: -${pkg_tag} -_EOF - if [ -n "${HOMEPAGE}" ] - then - cat >> ${distdir}/${PN}/${PN}-${PVR}-src.hint <<-_EOF -homepage: ${HOMEPAGE} -_EOF - fi - else - warning "${PN}-src.hint is missing"; - fi - fi } # protect functions diff --git a/lib/syntax.cygpart b/lib/syntax.cygpart index 4ff9973..9ec12f2 100644 --- a/lib/syntax.cygpart +++ b/lib/syntax.cygpart @@ -151,6 +151,7 @@ __step() { __log_init() { local log=${1} + mkdir -p ${logdir} rm -f ${log} echo -e cygport ${_cygport_version} '\n' >> ${log} -- 2.31.1