public inbox for cygwin-apps@cygwin.com
 help / color / mirror / Atom feed
* [PATCH cygport] Make src packages which put files under /usr/src/package-version-release/
@ 2014-04-24 20:42 Jon TURNEY
  2014-04-28  2:34 ` Yaakov (Cygwin/X)
  0 siblings, 1 reply; 5+ messages in thread
From: Jon TURNEY @ 2014-04-24 20:42 UTC (permalink / raw)
  To: cygwin-apps

[-- Attachment #1: Type: text/plain, Size: 728 bytes --]


From a previous discussion [1] on this subject, it seems to be that if this is
desirable, then source packages should be fixed rather than working around
this in setup.

Attached is a patch to cygport to do exactly that.

I was also going to prepare a patch for http://cygwin.com/setup.html to say
that the source should be installed into /usr/src/package-version-release/,
but that is what the first sentence under "Method One" already says, and I
don't see anything else to contradict that.

(As an aside, how would a patch to move "Method one" and "Method two" to an
archive page be received?  It seems to me that they are not relevant to nearly
all new packages)

[1] http://cygwin.com/ml/cygwin-apps/2011-12/msg00022.html

[-- Attachment #2: 0001-Put-source-package-contents-in-a-PF-directory.patch --]
[-- Type: text/plain, Size: 2183 bytes --]

From c1425a51197c3b658fbae32c1dfb57c5b68b1d0f Mon Sep 17 00:00:00 2001
From: Jon TURNEY <jon.turney@dronecode.org.uk>
Date: Sat, 19 Apr 2014 14:29:41 +0100
Subject: [PATCH] Put source package contents in a ${PF}/ directory

This makes source packages which, when installed, will place all their files
into /usr/src/${PF}, rather than directly into /usr/src.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
---
 lib/pkg_pkg.cygpart | 23 ++++++++++++++---------
 1 file changed, 14 insertions(+), 9 deletions(-)

diff --git a/lib/pkg_pkg.cygpart b/lib/pkg_pkg.cygpart
index 6a21a42..b3ae33b 100644
--- a/lib/pkg_pkg.cygpart
+++ b/lib/pkg_pkg.cygpart
@@ -439,45 +439,50 @@ __pkg_srcpkg() {
 	echo;
 	__step "Creating source patches";
 
+	local spkgsrcdir="${spkgdir}/${PF}";
+	mkdir -p ${spkgsrcdir};
+
 	__pkg_diff;
 
 	if [ -s ${patchdir}/${cygwin_patchfile} ]
 	then
-		cp ${patchdir}/${cygwin_patchfile} ${spkgdir};
+		cp ${patchdir}/${cygwin_patchfile} ${spkgsrcdir};
 	fi
 
 	if [ -s ${patchdir}/${src_patchfile} ]
 	then
-		cp ${patchdir}/${src_patchfile} ${spkgdir};
+		cp ${patchdir}/${src_patchfile} ${spkgsrcdir};
 	fi
 
 	__step "Creating source package";
 
-	cp ${top}/${cygportfile} ${spkgdir};
+	cp ${top}/${cygportfile} ${spkgsrcdir};
 
 	for src in ${_src_orig_pkgs} ${_src_orig_patches}
 	do
-		cp ${top}/${src} ${spkgdir};
+		cp ${top}/${src} ${spkgsrcdir};
 	done
 
-	cd ${spkgdir};
+	cd ${spkgsrcdir};
 
 	if __arg_bool SIG
 	then
 		if check_prog gpg
 		then
-			__gpg_sign ${spkgdir}/${cygportfile} "CYGPORT SCRIPT";
-			__gpg_sign ${spkgdir}/${cygwin_patchfile} "CYGWIN PATCH";
+			__gpg_sign ${spkgsrcdir}/${cygportfile} "CYGPORT SCRIPT";
+			__gpg_sign ${spkgsrcdir}/${cygwin_patchfile} "CYGWIN PATCH";
 
-			if [ -f ${spkgdir}/${src_patchfile} ]
+			if [ -f ${spkgsrcdir}/${src_patchfile} ]
 			then
-				__gpg_sign ${spkgdir}/${src_patchfile} "SOURCE PATCH";
+				__gpg_sign ${spkgsrcdir}/${src_patchfile} "SOURCE PATCH";
 			fi
 		else
 			inform "gnupg must be installed in order to make signatures.";
 		fi
 	fi
 
+	cd ${spkgdir};
+
 	tar Jcvf ${distdir}/${PN}/${PF}-src.tar.xz * || error "Source package creation failed"
 	echo;
 }
-- 
1.8.5.5


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH cygport] Make src packages which put files under /usr/src/package-version-release/
  2014-04-24 20:42 [PATCH cygport] Make src packages which put files under /usr/src/package-version-release/ Jon TURNEY
@ 2014-04-28  2:34 ` Yaakov (Cygwin/X)
  2014-04-28 12:23   ` Jon TURNEY
                     ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Yaakov (Cygwin/X) @ 2014-04-28  2:34 UTC (permalink / raw)
  To: cygwin-apps

[-- Attachment #1: Type: text/plain, Size: 895 bytes --]

On 2014-04-24 15:42, Jon TURNEY wrote:
>  From a previous discussion [1] on this subject, it seems to be that if this is
> desirable, then source packages should be fixed rather than working around
> this in setup.
>
> Attached is a patch to cygport to do exactly that.

The downside is, if you then rebuild the package like that, you end up 
with /usr/src/NAME-VERSION-RELEASE/NAME-VERSION-RELEASE[.ARCH, as of 
today's git master], which seems a bit repetitive to me.  What do you 
(and others) think about making the "topdir" also the "workdir" if the 
former is already of the form NAME-VERSION-RELEASE.ARCH, as per the 
attached patch instead?

> (As an aside, how would a patch to move "Method one" and "Method two" to an
> archive page be received?  It seems to me that they are not relevant to nearly
> all new packages)

http://cygwin.com/ml/cygwin-apps/2013-06/msg00182.html


Yaakov


[-- Attachment #2: 0003-usr-src-name-ver-rel-arch.patch --]
[-- Type: text/x-patch, Size: 1357 bytes --]

diff --git a/bin/cygport.in b/bin/cygport.in
index 388c7d6..bf23ca2 100755
--- a/bin/cygport.in
+++ b/bin/cygport.in
@@ -670,13 +670,18 @@ unset restrict
 #
 ################################################################################
 
-declare -r workdir="${top}/${PF}.${ARCH}";
+if [ "${top##*/}" = "${PF}.${ARCH}" ]
+then
+	declare -r workdir="${top}";
+else
+	declare -r workdir="${top}/${PF}.${ARCH}";
+fi
 declare -r srcdir="${workdir}/src";
 declare -r origsrcdir="${workdir}/origsrc";
 declare -r configdir="${workdir}/config";
 declare -r logdir="${workdir}/log";
 declare -r patchdir="${workdir}/patch";
-declare -r spkgdir="${workdir}/spkg";
+declare -r spkgdir="${workdir}/spkg/${PF}.${ARCH}";
 declare -r distdir="${workdir}/dist";
 
 SRC_DIR=${SRC_DIR:-${ORIG_PN:-${PN}}-${PV}};
diff --git a/lib/pkg_pkg.cygpart b/lib/pkg_pkg.cygpart
index 6a21a42..a5bca08 100644
--- a/lib/pkg_pkg.cygpart
+++ b/lib/pkg_pkg.cygpart
@@ -460,8 +460,6 @@ __pkg_srcpkg() {
 		cp ${top}/${src} ${spkgdir};
 	done
 
-	cd ${spkgdir};
-
 	if __arg_bool SIG
 	then
 		if check_prog gpg
@@ -478,7 +476,9 @@ __pkg_srcpkg() {
 		fi
 	fi
 
-	tar Jcvf ${distdir}/${PN}/${PF}-src.tar.xz * || error "Source package creation failed"
+	cd ${spkgdir%/*};
+
+	tar Jcvf ${distdir}/${PN}/${PF}-src.tar.xz ${spkgdir##*/}/ || error "Source package creation failed"
 	echo;
 }
 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH cygport] Make src packages which put files under /usr/src/package-version-release/
  2014-04-28  2:34 ` Yaakov (Cygwin/X)
@ 2014-04-28 12:23   ` Jon TURNEY
  2014-04-28 13:31   ` Ken Brown
  2014-05-04  9:10   ` Yaakov (Cygwin/X)
  2 siblings, 0 replies; 5+ messages in thread
From: Jon TURNEY @ 2014-04-28 12:23 UTC (permalink / raw)
  To: cygwin-apps

On 28/04/2014 03:34, Yaakov (Cygwin/X) wrote:
> On 2014-04-24 15:42, Jon TURNEY wrote:
>>  From a previous discussion [1] on this subject, it seems to be that
>> if this is
>> desirable, then source packages should be fixed rather than working
>> around
>> this in setup.
>>
>> Attached is a patch to cygport to do exactly that.
>
> The downside is, if you then rebuild the package like that, you end up
> with /usr/src/NAME-VERSION-RELEASE/NAME-VERSION-RELEASE[.ARCH, as of
> today's git master], which seems a bit repetitive to me.  What do you
> (and others) think about making the "topdir" also the "workdir" if the
> former is already of the form NAME-VERSION-RELEASE.ARCH, as per the
> attached patch instead?

I think "workdir" needs to be at least ARCH, otherwise you lose the 
(just added) ability to do cygport --32 and cygport --64 in the same 
directory?

If I am understanding you correctly, the rest is just a question of 
aesthetics.  I don't mind the repetition, but others might have a 
different opinion.

>> (As an aside, how would a patch to move "Method one" and "Method two"
>> to an
>> archive page be received?  It seems to me that they are not relevant
>> to nearly
>> all new packages)
>
> http://cygwin.com/ml/cygwin-apps/2013-06/msg00182.html

Thanks.  I guess I'll work on a documentation patch for that, then.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH cygport] Make src packages which put files under /usr/src/package-version-release/
  2014-04-28  2:34 ` Yaakov (Cygwin/X)
  2014-04-28 12:23   ` Jon TURNEY
@ 2014-04-28 13:31   ` Ken Brown
  2014-05-04  9:10   ` Yaakov (Cygwin/X)
  2 siblings, 0 replies; 5+ messages in thread
From: Ken Brown @ 2014-04-28 13:31 UTC (permalink / raw)
  To: cygwin-apps

On 4/27/2014 10:34 PM, Yaakov (Cygwin/X) wrote:
> On 2014-04-24 15:42, Jon TURNEY wrote:
>>  From a previous discussion [1] on this subject, it seems to be that
>> if this is
>> desirable, then source packages should be fixed rather than working
>> around
>> this in setup.
>>
>> Attached is a patch to cygport to do exactly that.
>
> The downside is, if you then rebuild the package like that, you end up
> with /usr/src/NAME-VERSION-RELEASE/NAME-VERSION-RELEASE[.ARCH, as of
> today's git master], which seems a bit repetitive to me.  What do you
> (and others) think about making the "topdir" also the "workdir" if the
> former is already of the form NAME-VERSION-RELEASE.ARCH, as per the
> attached patch instead?

I'm used to having workdir below topdir.  Changing this would confuse me 
more than the repetition would.  But I don't feel strongly about it.

Ken

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH cygport] Make src packages which put files under /usr/src/package-version-release/
  2014-04-28  2:34 ` Yaakov (Cygwin/X)
  2014-04-28 12:23   ` Jon TURNEY
  2014-04-28 13:31   ` Ken Brown
@ 2014-05-04  9:10   ` Yaakov (Cygwin/X)
  2 siblings, 0 replies; 5+ messages in thread
From: Yaakov (Cygwin/X) @ 2014-05-04  9:10 UTC (permalink / raw)
  To: cygwin-apps

On 2014-04-27 21:34, Yaakov (Cygwin/X) wrote:
> On 2014-04-24 15:42, Jon TURNEY wrote:
>>  From a previous discussion [1] on this subject, it seems to be that
>> if this is
>> desirable, then source packages should be fixed rather than working
>> around
>> this in setup.
>>
>> Attached is a patch to cygport to do exactly that.
>
> The downside is, if you then rebuild the package like that, you end up
> with /usr/src/NAME-VERSION-RELEASE/NAME-VERSION-RELEASE[.ARCH, as of
> today's git master], which seems a bit repetitive to me.  What do you
> (and others) think about making the "topdir" also the "workdir" if the
> former is already of the form NAME-VERSION-RELEASE.ARCH, as per the
> attached patch instead?

There didn't seem to be a desire to avoid the repetition, so I dropped 
that part and committed a simpler version of this to master.


Yaakov

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-05-04  9:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-24 20:42 [PATCH cygport] Make src packages which put files under /usr/src/package-version-release/ Jon TURNEY
2014-04-28  2:34 ` Yaakov (Cygwin/X)
2014-04-28 12:23   ` Jon TURNEY
2014-04-28 13:31   ` Ken Brown
2014-05-04  9:10   ` Yaakov (Cygwin/X)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).