You are not logged in.

#1 2013-01-20 22:20:28

pablox
Member
From: /home/chile/santiago/
Registered: 2008-05-14
Posts: 183
Website

Get filenames from source array

I'm trying to create a package which some of the sources it's on an url, and the rest "comes" with the package.

I managed with a bit of bash-fu apply some of the patches using the source array:

(...)
for file in "${source[@]:1:${#source[@]} -4}; do
  msg "$(patch -uNp1 -i ../${file})"
done
(...)

The problem is that I can't find any sensible way to access to them. If they were included on the package, something like:

(...)
${source[@]:(-3)}
(...)

... would suffice, but since the source it's an url when I try to copy them (through the `install` command) it fails saying that 'cannot stat', which is obvious, since the file `http://pastebin....` doesn't exist. I tried using the `filename::uri`, but it doesn't work either, keeping the same problem "cannot stat `filename::http//.....` ...".

Anyway, I know makepkg can get the "file names" somehow. At least that's what I believe since it actually list the filenames
when checks if the files are found or the validity checks passed:

  (...)
  -> Found patch1.patch
  -> Found patch2.patch
  -> Found another_patch.patch
  -> Found some_downloaded_file
  -> Found another_downloaded_file
  -> Found last_downloaded_file

I can think on a couple of solutions, but they seem a bit overly complicated. Any ideas?


Geeks & Linux Atelier
An eye for an eye ... ends in making everybody blind -- Mahatma Gandhi
dotfiles

Offline

#2 2013-01-20 23:13:24

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: Get filenames from source array

Or you can just do the sane thing and list each patch. PKGBUILDs are documentation as much as they are a recipe to build a package. I suggest you not attempt silly, brittle things like this.

Offline

#3 2013-01-20 23:51:46

pablox
Member
From: /home/chile/santiago/
Registered: 2008-05-14
Posts: 183
Website

Re: Get filenames from source array

I understand, I wanted to have the file on one part (gist in my case), having to replace it every time, generate a new checksum, ecc. I guess I'll have to include it in the makepkg source tarball unless someone else can come with another idea. Thanks for your comments smile

Anyway, I can't list "each" patch in the for loop (above), so that weird array subscript will have to stay, because there are a lot of patches and I'm sure that the first nor latest three packages are actually patches.

PS.- By the way, it's just having every file inside the source tarball the 'sane thing'? I'd expect to find on the wiki, unless I'm the only one crazy that tries to do something like that.


Geeks & Linux Atelier
An eye for an eye ... ends in making everybody blind -- Mahatma Gandhi
dotfiles

Offline

#4 2013-01-21 00:04:40

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,597
Website

Re: Get filenames from source array

The arch kernel package includes patches in the source tarball itself.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

Board footer

Powered by FluxBB