You are not logged in.

#1 2010-08-27 17:55:08

jalu
Member
Registered: 2009-04-05
Posts: 140

[SOLVED] Downloading a source file to a custom file name

I'm writing a package that applies a patch to rsync. The patch file can be downloaded from the following address:
http://gitweb.samba.org/?p=rsync-patche … c41d0eb4f3

I have added this URL to the sources array and makepkg is able to download it, but it is downloaded to a file named ?p=rsync-patches.git;a=blob_plain;f=transliterate.diff;h=75d6dcbda1c17b69c0d754edc7df490074e2fa41;hb=2291d89080c8c06a66e9b01e09a618c41d0eb4f3. This filename is a bit tricky to work with, and I'm guessing not in best practice, as it is not very descriptive.

Assuming it makes sense to do so, my goal is to download the patch to a file named transliterate.diff. Is there any way to tell makepkg to do this?

Last edited by jalu (2010-08-27 19:43:40)

Offline

#2 2010-08-27 18:22:32

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: [SOLVED] Downloading a source file to a custom file name

Download the patch first, give it your preferred file name, and place it in the build directory.

<edit>Actually, scrap that - read man PKGBUILD, the solution is there.

/me hasn't read man PKGBUILD in a long long time. yikes

Offline

#3 2010-08-27 18:39:10

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] Downloading a source file to a custom file name

jalu wrote:

I'm writing a package that applies a patch to rsync. The patch file can be downloaded from the following address:
http://gitweb.samba.org/?p=rsync-patche … c41d0eb4f3

I have added this URL to the sources array and makepkg is able to download it, but it is downloaded to a file named ?p=rsync-patches.git;a=blob_plain;f=transliterate.diff;h=75d6dcbda1c17b69c0d754edc7df490074e2fa41;hb=2291d89080c8c06a66e9b01e09a618c41d0eb4f3. This filename is a bit tricky to work with, and I'm guessing not in best practice, as it is not very descriptive.

Assuming it makes sense to do so, my goal is to download the patch to a file named transliterate.diff. Is there any way to tell makepkg to do this?

Yes, you can apply patches. Even to diffs ;P

Offline

#4 2010-08-27 18:49:24

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Re: [SOLVED] Downloading a source file to a custom file name

You can also circumvent the problem by just using ${source[x]} where x is the position of the file in the source array (starting with zero).

Example


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

#5 2010-08-27 19:43:13

jalu
Member
Registered: 2009-04-05
Posts: 140

Re: [SOLVED] Downloading a source file to a custom file name

Thanks for all the support, everyone.

I ended up using tomk's suggestion. This is exactly what I was looking for, and worked perfectly. I was unaware that PKGBUILD had a man page -- I was relying on the Wiki entry. Thanks!

.:B:., your suggestion is also very interesting. Thanks for your suggestion and example, I'll definitely keep it in mind.

Offline

#6 2010-08-28 22:03:56

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: [SOLVED] Downloading a source file to a custom file name

The wiki is excellent, but don't rely on it. Verify the information you find there against other sources - man pages, for example. smile

Offline

Board footer

Powered by FluxBB