Re: Writing get-orig-source targets to conform with policy
On Mon, Feb 18, 2008 at 12:30:32AM +0100, Daniel Leidert wrote: Am Sonntag, den 17.02.2008, 23:58 +0100 schrieb Bas Wijnen: [..] The get-orig-source target specifies that it must work from anywhere. Where do you read this? The policy says, that it [..] may be invoked in any directory [..]. That's what I was referring to. To my understanding, this is not a must work from anywhere. I agree, that script-calls should work from any directory. But I expect the user to run the target at a place, where the user has write permissions. I don't want to add tests and checks for this. But this would be necessary to fulfill the requirement you state. Of course the user needs write permissions. The meaning of get-orig-source is to write a file to the current directory. If the user isn't allowed to write there, trying to do this should obviously result in an error. Any sensible implementation (that is, just about any implementation except running a shell script without -e) does this automatically without the need for an explicit check. So indeed, my formulation was a bit sloppy. Sorry about that. What I meant to say was that the tarball should also be created (if the user has enough permissions) in the working directory, if that is not the top-level build directory. Thanks, Bas -- I encourage people to send encrypted e-mail (see http://www.gnupg.org). If you have problems reading my e-mail, use a better reader. Please send the central message of e-mails as plain text in the message body, not as HTML and definitely not as MS Word. Please do not use the MS Word format for attachments either. For more information, see http://pcbcn10.phys.rug.nl/e-mail.html signature.asc Description: Digital signature
Re: Writing get-orig-source targets to conform with policy
On 17/02/2008, Kapil Hari Paranjape wrote: If you want to document how/why you re-packaged the source for Debian, this should be in README.Debian-source. No, that is supposed to be in debian/copyright. See recent discussions on -mentors, then moved to -devel -policy, subthread starting around [EMAIL PROTECTED]. Cheers, -- Cyril Brulebois pgp6HJ8IFaX8W.pgp Description: PGP signature
Re: Writing get-orig-source targets to conform with policy
* Andres Mejia [EMAIL PROTECTED] [080217 07:31]: For ensuring the exact tarball that was used to generate the orig tarball is used. But we keep them allready on alioth. So a get current orig target would be quite easier as an wget from the pkg-games website, wouldn't it? Yours sincerely, Alexander PS: No one stops you from vreating both, a target to get the current orig.tar.gz as well as one to create the newest target. -- http://learn.to/quote/ http://www.catb.org/~esr/faqs/smart-questions.html signature.asc Description: Digital signature
Re: Writing get-orig-source targets to conform with policy
Am Samstag, den 16.02.2008, 23:10 -0500 schrieb Andres Mejia: I have two questions. First question is; Is it at all possible to write a get-orig-source target that calls an external script to handle generating the orig tarball? Of course. The problem I'm facing is when the get-orig-source target is written like: get-orig-source: debian/external-script It works fine under the package's top directory, but fails under any other directory, for instance, /tmp. I've looked over the GNU make documentation hoping to find a special parameter for finding the name of the make script ran, just how a shell script has $0, but I've been unable to find one. Work in the current directory or in /tmp using mktemp. I have written get-orig-source targets for almost all docbook* packages [1] I maintain (where uscan isn't enough). Maybe they are useful examples. Second question is regarding a get-orig-source target I have for the package mediatomb. It goes like: # Common variables used to ease maintenance of the get-orig-source target. MEDIATOMB_TARBALL = mediatomb-0.10.0.tar.gz MEDIATOMB_VERSION = 0.10.0 CORRECT_CHECKSUM = 2436c73de4ac5f3ba1575f7ee93a0430 # Haven't found a way to use this without running it twice COMPUTED_CHECKSUM = $(shell md5sum $(MEDIATOMB_TARBALL) | cut -d ' ' -f 1) get-orig-source: [ -e $(MEDIATOMB_TARBALL) ] || \ wget http://downloads.sourceforge.net/mediatomb/$(MEDIATOMB_TARBALL) The checksum is computed before you download the tarball. Compute it after this step. [1] http://svn.debian.org/wsvn/debian-xml-sgml/packages/?rev=0sc=0 (docbook, d-xml, d-xsl, d-xsl-saxon, d-simple, d-ebnf, d-defguide) Regards, Daniel -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: Writing get-orig-source targets to conform with policy
On Sunday 17 February 2008 4:04:41 am Bas Wijnen wrote: On Sun, Feb 17, 2008 at 02:39:03PM +0900, Emmet Hikory wrote: Andres Mejia wrote: Is it at all possible to write a get-orig-source target that calls an external script to handle generating the orig tarball? Aside from the issue you've outlined, there are no means by which the executability of such an external script is enforced, which can be frustrating when attempting to use such a rule, and receiving a warning debian/external-script: Permission denied. This shouldn't be a problem. You can expect people to have the complete package source installed. So if this script is in the package (and you made it executable), it should just work. To find the path, $(dir $_)/script can be used, to make sure it works from any directory. (Attribution: I learned that from reading your uscan invocation below. ;-) ) Thanks. This was exactly what I wanted to do. This had me stumped for a long time but now I'm free to use whatever scripting language I want and supply whatever options I want for the external scripts. One thing though, the line could be written as $(dir $_)script since an extra / is added at the end for $(dir $_). I tested this using @echo $(dir $_). Thanks, Bas -- Regards, Andres -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: Writing get-orig-source targets to conform with policy
Il giorno Sun, 17 Feb 2008 11:02:21 -0500 Andres Mejia [EMAIL PROTECTED] ha scritto: On Sunday 17 February 2008 4:04:41 am Bas Wijnen wrote: On Sun, Feb 17, 2008 at 02:39:03PM +0900, Emmet Hikory wrote: To find the path, $(dir $_)/script can be used, to make sure it works from any directory. (Attribution: I learned that from reading your uscan invocation below. ;-) ) Thanks. This was exactly what I wanted to do. This had me stumped for a long time but now I'm free to use whatever scripting language I want and supply whatever options I want for the external scripts. One thing though, the line could be written as $(dir $_)script since an extra / is added at the end for $(dir $_). I tested this using @echo $(dir $_). Why not using $(CURDIR)? It should give you the dir where debian/ is located (i.e. $(CURDIR) == debian/../). I've always used it in my debian/rules files, and never had any problem. Kindly, David -- . ''`. Debian maintainer | http://wiki.debian.org/DavidPaleino : :' : Linuxer #334216 --|-- http://www.hanskalabs.net/ `. `'` GPG: 1392B174 | http://snipr.com/qa_page `- 2BAB C625 4E66 E7B8 450A C3E1 E6AA 9017 1392 B174 signature.asc Description: PGP signature
Re: Writing get-orig-source targets to conform with policy
On Sunday 17 February 2008 8:31:11 am Alexander Schmehl wrote: * Andres Mejia [EMAIL PROTECTED] [080217 07:31]: For ensuring the exact tarball that was used to generate the orig tarball is used. But we keep them allready on alioth. So a get current orig target would be quite easier as an wget from the pkg-games website, wouldn't it? That's only if someone does upload the tarball to alioth. For me, it takes 2 or more hours to upload files that are 100MB or more, and that's when doing an upload overnight. For this reason, I wanted to supply a get-orig-source or something similar that does this. It's also a reason why I wanted svn-buildpackage to be able to run debian/rules get-orig-source (or any other script and options for that matter) just like how svn-buildpackage supports downloading an orig tarball. I'm sure the Games Team (and anyone) could benefit from this. I did submit a patch for this by the way, it's at http://bugs.debian.org/458508. -- Regards, Andres -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: Writing get-orig-source targets to conform with policy
Hi! * Andres Mejia [EMAIL PROTECTED] [080217 17:21]: For ensuring the exact tarball that was used to generate the orig tarball is used. But we keep them allready on alioth. So a get current orig target would be quite easier as an wget from the pkg-games website, wouldn't it? That's only if someone does upload the tarball to alioth. For me, it takes 2 or more hours to upload files that are 100MB or more, and that's when doing an upload overnight. But you need to upload the tarball anyway, e.g. on mentors.d.n. And you could just wget it to alioth directly. And TTBOMK it is a pkg-games policy to have the tarballs there. For this reason, I wanted to supply a get-orig-source or something similar that does this. As allready explained: You don't want get-orig-source, which is defined by policy 4.9 to do something different. It's also a reason why I wanted svn-buildpackage to be able to run debian/rules get-orig-source (or any other script and options for that matter) just like how svn-buildpackage supports downloading an orig tarball. I'm sure the Games Team (and anyone) could benefit from this. I did submit a patch for this by the way, it's at http://bugs.debian.org/458508. As long as you guarantee, that all orig.tar.gz end up with the same md5sum. Yours sincerely, Alexander signature.asc Description: Digital signature
Re: Writing get-orig-source targets to conform with policy
On Sunday 17 February 2008 11:37:54 am David Paleino wrote: Il giorno Sun, 17 Feb 2008 11:02:21 -0500 Andres Mejia [EMAIL PROTECTED] ha scritto: On Sunday 17 February 2008 4:04:41 am Bas Wijnen wrote: On Sun, Feb 17, 2008 at 02:39:03PM +0900, Emmet Hikory wrote: To find the path, $(dir $_)/script can be used, to make sure it works from any directory. (Attribution: I learned that from reading your uscan invocation below. ;-) ) Thanks. This was exactly what I wanted to do. This had me stumped for a long time but now I'm free to use whatever scripting language I want and supply whatever options I want for the external scripts. One thing though, the line could be written as $(dir $_)script since an extra / is added at the end for $(dir $_). I tested this using @echo $(dir $_). Why not using $(CURDIR)? It should give you the dir where debian/ is located (i.e. $(CURDIR) == debian/../). I've always used it in my debian/rules files, and never had any problem. Kindly, David $(CURDIR) gives you the current working directory you are in, not where debian/ would reside unless you were in the package's top directory anyway. -- Regards, Andres -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: Writing get-orig-source targets to conform with policy
On Sunday 17 February 2008 1:35:05 pm Alexander Schmehl wrote: Hi! * Andres Mejia [EMAIL PROTECTED] [080217 17:21]: For ensuring the exact tarball that was used to generate the orig tarball is used. But we keep them allready on alioth. So a get current orig target would be quite easier as an wget from the pkg-games website, wouldn't it? That's only if someone does upload the tarball to alioth. For me, it takes 2 or more hours to upload files that are 100MB or more, and that's when doing an upload overnight. But you need to upload the tarball anyway, e.g. on mentors.d.n. And you could just wget it to alioth directly. True, but that's only after I upload to mentors.d.n., when I'm sure a package is ready for upload to Debian. And TTBOMK it is a pkg-games policy to have the tarballs there. I don't recall it being stated as policy. To my knowledge, the idea was to allow someone to be able to be provided an orig tarball so that they can work with a package. Allowing someone to generate an orig tarball is another way of fulfilling this purpose. For this reason, I wanted to supply a get-orig-source or something similar that does this. As allready explained: You don't want get-orig-source, which is defined by policy 4.9 to do something different. Right. It's also a reason why I wanted svn-buildpackage to be able to run debian/rules get-orig-source (or any other script and options for that matter) just like how svn-buildpackage supports downloading an orig tarball. I'm sure the Games Team (and anyone) could benefit from this. I did submit a patch for this by the way, it's at http://bugs.debian.org/458508. As long as you guarantee, that all orig.tar.gz end up with the same md5sum. When the package is finally uploaded somewhere, then orig tarballs can be downloaded instead of generated, thus allowing everyone to have the same orig tarballs with the same md5sum. Yours sincerely, Alexander -- Regards, Andres -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: Writing get-orig-source targets to conform with policy
On Sun, Feb 17, 2008 at 11:30:42PM +0100, David Paleino wrote: Il giorno Sun, 17 Feb 2008 13:59:51 -0500 Andres Mejia [EMAIL PROTECTED] ha scritto: On Sunday 17 February 2008 11:37:54 am David Paleino wrote: Why not using $(CURDIR)? It should give you the dir where debian/ is located (i.e. $(CURDIR) == debian/../). I've always used it in my debian/rules files, and never had any problem. $(CURDIR) gives you the current working directory you are in, not where debian/ would reside unless you were in the package's top directory anyway. When you execute debian/rules, $(CURDIR) *MUST* give you the package's top directory. That's a firm point. Am I missing something? Yes. That this is only true when executing debian/rules. Not when executing /home/user/src/debian/packages/foo-1.3/debian/rules . The get-orig-source target specifies that it must work from anywhere. So you can't rely on CURDIR to be where debian/ is. Thanks, Bas -- I encourage people to send encrypted e-mail (see http://www.gnupg.org). If you have problems reading my e-mail, use a better reader. Please send the central message of e-mails as plain text in the message body, not as HTML and definitely not as MS Word. Please do not use the MS Word format for attachments either. For more information, see http://pcbcn10.phys.rug.nl/e-mail.html signature.asc Description: Digital signature
Re: Writing get-orig-source targets to conform with policy
Il giorno Sun, 17 Feb 2008 13:59:51 -0500 Andres Mejia [EMAIL PROTECTED] ha scritto: On Sunday 17 February 2008 11:37:54 am David Paleino wrote: Why not using $(CURDIR)? It should give you the dir where debian/ is located (i.e. $(CURDIR) == debian/../). I've always used it in my debian/rules files, and never had any problem. $(CURDIR) gives you the current working directory you are in, not where debian/ would reside unless you were in the package's top directory anyway. When you execute debian/rules, $(CURDIR) *MUST* give you the package's top directory. That's a firm point. Am I missing something? -- . ''`. Debian maintainer | http://wiki.debian.org/DavidPaleino : :' : Linuxer #334216 --|-- http://www.hanskalabs.net/ `. `'` GPG: 1392B174 | http://snipr.com/qa_page `- 2BAB C625 4E66 E7B8 450A C3E1 E6AA 9017 1392 B174 signature.asc Description: PGP signature
Re: Writing get-orig-source targets to conform with policy
Am Sonntag, den 17.02.2008, 23:58 +0100 schrieb Bas Wijnen: [..] The get-orig-source target specifies that it must work from anywhere. Where do you read this? The policy says, that it [..] may be invoked in any directory [..]. To my understanding, this is not a must work from anywhere. I agree, that script-calls should work from any directory. But I expect the user to run the target at a place, where the user has write permissions. I don't want to add tests and checks for this. But this would be necessary to fulfill the requirement you state. Regards, Daniel -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Writing get-orig-source targets to conform with policy
Hello, I have two questions. First question is; Is it at all possible to write a get-orig-source target that calls an external script to handle generating the orig tarball? The problem I'm facing is when the get-orig-source target is written like: get-orig-source: debian/external-script It works fine under the package's top directory, but fails under any other directory, for instance, /tmp. I've looked over the GNU make documentation hoping to find a special parameter for finding the name of the make script ran, just how a shell script has $0, but I've been unable to find one. Second question is regarding a get-orig-source target I have for the package mediatomb. It goes like: # Common variables used to ease maintenance of the get-orig-source target. MEDIATOMB_TARBALL = mediatomb-0.10.0.tar.gz MEDIATOMB_VERSION = 0.10.0 CORRECT_CHECKSUM = 2436c73de4ac5f3ba1575f7ee93a0430 # Haven't found a way to use this without running it twice COMPUTED_CHECKSUM = $(shell md5sum $(MEDIATOMB_TARBALL) | cut -d ' ' -f 1) get-orig-source: [ -e $(MEDIATOMB_TARBALL) ] || \ wget http://downloads.sourceforge.net/mediatomb/$(MEDIATOMB_TARBALL) ifeq ($(CORRECT_CHECKSUM),$(COMPUTED_CHECKSUM)) @echo Generating orig tarball tar -xzf $(MEDIATOMB_TARBALL) # Removing some problematic files from upstream rm mediatomb-$(MEDIATOMB_VERSION)/tombupnp/upnp/src/inc/upnp_md5.h rm mediatomb-$(MEDIATOMB_VERSION)/tombupnp/upnp/src/uuid/upnp_md5.c # tar -czf mediatomb_$(MEDIATOMB_VERSION).dfsg1.orig.tar.gz \ mediatomb-$(MEDIATOMB_VERSION) rm -rf mediatomb-$(MEDIATOMB_VERSION) rm $(MEDIATOMB_TARBALL) @echo done. else @echo Checksum mismatch. Correct checksum is $(CORRECT_CHECKSUM). @echo Computed checksum was $(COMPUTED_CHECKSUM). exit 1 endif The problem here is that the get-orig-source target has to be run twice before the checksum passes (unless you happen to have the file in the current directory already). Is there any way around this? The second problem is why I more interested in finding a way to handle external scripts that conforms to Debian Policy where it explains, This target may be invoked in any directory. -- Regards, Andres -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: Writing get-orig-source targets to conform with policy
Hello, On Sat, 16 Feb 2008, Andres Mejia wrote: Second question is regarding a get-orig-source target I have for the package mediatomb. It goes like: # Common variables used to ease maintenance of the get-orig-source target. MEDIATOMB_TARBALL = mediatomb-0.10.0.tar.gz MEDIATOMB_VERSION = 0.10.0 CORRECT_CHECKSUM = 2436c73de4ac5f3ba1575f7ee93a0430 Why have you hardcoded the version number and checksum for the tarball? The way I understand it, the get-orig-source target is used to get newer upstream sources. Policy 4.9 says: `get-orig-source' (optional) This target fetches the most recent version of the original ^^^ source package from a canonical archive site (via FTP or WWW, for example), does any necessary rearrangement to turn it into the original source tar file format described below, and leaves it in the current directory. So your script is mainly a tool to provide an automated way for someone to get a newer version of upstream source re-packaged exactly the way you have done with the current version. If you want to document how/why you re-packaged the source for Debian, this should be in README.Debian-source. This target may be invoked in any directory, and should take care to clean up any temporary files it may have left. I think this means that you should probably run the download in a temporary directory using mktemp and then create/move the output to the directory just above the current directory. I hope this clarifies most of your questions. Regards, Kapil. -- signature.asc Description: Digital signature
Re: Writing get-orig-source targets to conform with policy
On Sunday 17 February 2008 12:52:30 am Kapil Hari Paranjape wrote: Hello, On Sat, 16 Feb 2008, Andres Mejia wrote: Second question is regarding a get-orig-source target I have for the package mediatomb. It goes like: # Common variables used to ease maintenance of the get-orig-source target. MEDIATOMB_TARBALL = mediatomb-0.10.0.tar.gz MEDIATOMB_VERSION = 0.10.0 CORRECT_CHECKSUM = 2436c73de4ac5f3ba1575f7ee93a0430 Why have you hardcoded the version number and checksum for the tarball? For ensuring the exact tarball that was used to generate the orig tarball is used. The way I understand it, the get-orig-source target is used to get newer upstream sources. Policy 4.9 says: `get-orig-source' (optional) This target fetches the most recent version of the original ^^^ source package from a canonical archive site (via FTP or WWW, for example), does any necessary rearrangement to turn it into the original source tar file format described below, and leaves it in the current directory. So your script is mainly a tool to provide an automated way for someone to get a newer version of upstream source re-packaged exactly the way you have done with the current version. Well, to me, the purpose of the get-orig-source target was to allow anyone to generate the orig tarball of the current version that is/will be uploaded to the archive. If this is what policy states, I suppose I'll just not use the target. Also, I don't want to automate packaging a new tarball too much as there are things that could change. If you want to document how/why you re-packaged the source for Debian, this should be in README.Debian-source. This target may be invoked in any directory, and should take care to clean up any temporary files it may have left. I think this means that you should probably run the download in a temporary directory using mktemp and then create/move the output to the directory just above the current directory. To me, it means running the target from any directory ($HOME, /tmp, etc.). I hope this clarifies most of your questions. Regards, Kapil. -- -- Regards, Andres -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: Writing get-orig-source targets to conform with policy
On Sat, Feb 16, 2008 at 11:10:01PM -0500, Andres Mejia wrote: Second question is regarding a get-orig-source target I have for the package mediatomb. It goes like: # Haven't found a way to use this without running it twice COMPUTED_CHECKSUM = $(shell md5sum $(MEDIATOMB_TARBALL) | cut -d ' ' -f 1) get-orig-source: ifeq ($(CORRECT_CHECKSUM),$(COMPUTED_CHECKSUM)) The problem here is that the get-orig-source target has to be run twice before the checksum passes (unless you happen to have the file in the current directory already). Is there any way around this? The reason is that $(shell ...) is evaluated by make before wget creates the file (I think it happens at the beginning of the rule). Instead I think you should either use a shell test: [ $md50 = $md51 ] || { echo $0: error: ... 2; exit 1; } Or use a 2nd rule which creates the upstream file (using wget), and then get-orig-source depends on that rule and does md5sum; tar xzf; manipulate; tar czf. Justin -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]