Subject: [alpine-devel] saveas uri in APKBUILDs

From: Natanael Copa <[email-masked]>
Date: Fri, 15 Feb 2013 09:40:38 +0100

Hi,

We have a nice feature to download a file with a different name:

  source="saveas-http://$url/newfilename"

I have noticed that Arch Linux has something similar:

  source="newfilename::http://$url"

Do we want to change to same format?

Benefits:
* Easier for Arch users to switch
* Slightly more intuitive?

Drawbacks:
* abuild code probably gets messier
* potensial scripts that parses APKBUILD and uses $source might break.
  (i doubt there are any)

Opinions?

-nc

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---

---

From: Roger Pau Monné <[email-masked]>
Date: Fri, 15 Feb 2013 09:51:01 +0100

> * Slightly more intuitive?

I have no stake in this, but I think the Arch format is more intuitive
than the one used in Alpine.

---

---

From: Francesco <[email-masked]>
Date: Fri, 15 Feb 2013 09:57:33 +0100

> than the one used in Alpine.

I've the same opinion as Roger.
"newfile" is more immediate than "saveas".

My two cents.

-- 
:: Francesco ::
Blog.....http://fc1979.blogspot.com
Twit.....http://twitter.com/fcolista
[email-masked]
[email-masked]
AboutMe..http://about.me/fcolista

---

---

From: Natanael Copa <[email-masked]>
Date: Fri, 15 Feb 2013 11:06:18 +0100

On Fri, 15 Feb 2013 09:57:33 +0100

> "newfile" is more immediate than "saveas".

newfile was only an example.

Other example:

  source="saveas-https://https://github/bar/foo/archive/v1.0/foo-1.0.tar.gz"

vs.

  source="foo-1.0.tar.gz::https://github/bar/foo/archive/v1.0"

I somehow like the former variant because it is very easy to implement code:

  filename=${source##*/}

the latter would need some kind of conditional, if contains :: then, else...:

  case $source in
  *::*) filename=${source/::*/};;
  *) filename=${source##*/};;
  esac

I still think it might be worth do the change unless someone have strong opinions.

-nc

---