2 2

[alpine-devel] more on setup-apkrepos

Natanael Copa
Details
Message ID
<e05ebff29d19464ac1e524f498eefdca@ytre.org>
Sender timestamp
1298993854
DKIM signature
missing
Download raw message
 Hi,

 I'd like to iron how the setup-apkrepos should work. this is a stopper 
 for alpine-conf-2.6 so some feedback is appreciated.

 I have done some minor cleanups and simplifications in the code. Most 
 of the should not have any visible effect on execution.

 I still have a few things I think we should change though.

 * Too many questions are asked. I just want add a http repo. The 
 setup-* scripts should give the end user what he wants as quick as 
 possible and then get out of the way.

 First I get (from setup-alpine):
 Setup internet apk repositories? [y/N]?

 This could be avoided by adding it as an option to next step (select 
 method: 'none' or 'done')

 Then I get the question:

 How would you like to set up internet apk repositories?

 I think this question is needed. I pick 'f' for automatically find 
 fastest.

 Then I get:

 System release is: edge.  Change? (i.e., to upgrade) [y/N]:

 well, we dont really support downgrades and I already run edge. This 
 question should never have been asked. I select 'N'

 Then I get yet another question:

 Do you want to enable the testing repository? [y/N]:

 I pick 'N' for now.

 Now I get yet another question.
 Do you want to update repository indexes?
 (You must be connected when using remote repositories.) [y/N]:

 I think we dont need to ask for this. If we have any remote repos we 
 can just update it. If there are no remotes there is no reason to ask.

 I pick 'y'

 Finally done!

 phew.

 I got 5 questions. We need get that number down to 1 or maximum 2.

 oh... what if I wanted to just add a http repo for updates + my home 
 made repo? Then I'd need to re-run the setup-apkrepos. I run 
 setup-apkrepos.

 How would you like to set up internet apk repositories?
 I pick 'e' for enter manually.

 Before adding custom mirrors, do you want to clear
 /etc/apk/repositories and start fresh? [y/n]:

 hum, what question is that? and if I dont remember what I had in 
 /etc/apk/repositories? Then I have to ctrl-c, cat the contents and 
 re-run the script. Here I cannot pick default either if unsure. I must 
 make a decision.

 I want keep my previous run so i pick 'n'

 Now I get what I was wanted.
 Please enter a local path or URL to the mirror:

 I enter /home/ncopa/.cache/apks

 Do you want to add another mirror? [y/n]:
 This is actually good, but we could combine that with the above 
 question:

 Enter a local path or URL to the mirror to add (or 'done') [done]:

 Again I get the
 Do you want to update repository indexes?
 (You must be connected when using remote repositories.) [y/N]: y
 Updating repository indexes... done.

 I start to think that we coudl just drop that question and just try 
 update the index. If its not connected to internet the user have most 
 likely chosed to not setup the apkrepos at all and/or error message 
 displayed will be kind of expected.

 Any ideas how we reduce number of questions and try make the script get 
 out of the way?

 -nc


---
Unsubscribe:  alpine-devel+unsubscribe@lists.alpinelinux.org
Help:         alpine-devel+help@lists.alpinelinux.org
---
Jeff Bilyk
Details
Message ID
<AANLkTi=qL1bpSC=jKfVPumpVyk5XaUHyyMhr5c18yDDG@mail.gmail.com>
In-Reply-To
<e05ebff29d19464ac1e524f498eefdca@ytre.org> (view parent)
Sender timestamp
1298997042
DKIM signature
missing
Download raw message
On Tue, Mar 1, 2011 at 10:37 AM, Natanael Copa <ncopa@alpinelinux.org> wrote:
> Hi,
>
> I'd like to iron how the setup-apkrepos should work. this is a stopper for
> alpine-conf-2.6 so some feedback is appreciated.
>
> I have done some minor cleanups and simplifications in the code. Most of the
> should not have any visible effect on execution.
>
> I still have a few things I think we should change though.
>
> * Too many questions are asked. I just want add a http repo. The setup-*
> scripts should give the end user what he wants as quick as possible and then
> get out of the way.
>
> First I get (from setup-alpine):
> Setup internet apk repositories? [y/N]?
>
> This could be avoided by adding it as an option to next step (select method:
> 'none' or 'done')
I like it.
>
> Then I get the question:
>
> How would you like to set up internet apk repositories?
>
> I think this question is needed. I pick 'f' for automatically find fastest.
>
> Then I get:
>
> System release is: edge.  Change? (i.e., to upgrade) [y/N]:
>
> well, we dont really support downgrades and I already run edge. This
> question should never have been asked. I select 'N'
I harmony with keeping script simple, how about always setup
repositories for current release?
>
> Then I get yet another question:
>
> Do you want to enable the testing repository? [y/N]:
>
> I pick 'N' for now.
Regular users most likely aren't a) running edge and b) need testing
repos, so we could probably always add this in commented.
>
> Now I get yet another question.
> Do you want to update repository indexes?
> (You must be connected when using remote repositories.) [y/N]:
>
> I think we dont need to ask for this. If we have any remote repos we can
> just update it. If there are no remotes there is no reason to ask.
We could always *try* to update and if it fails, it fails.
>
> I pick 'y'
>
> Finally done!
>
> phew.
>
> I got 5 questions. We need get that number down to 1 or maximum 2.
>
> oh... what if I wanted to just add a http repo for updates + my home made
> repo? Then I'd need to re-run the setup-apkrepos. I run setup-apkrepos.
>
> How would you like to set up internet apk repositories?
> I pick 'e' for enter manually.
>
> Before adding custom mirrors, do you want to clear
> /etc/apk/repositories and start fresh? [y/n]:
>
> hum, what question is that? and if I dont remember what I had in
> /etc/apk/repositories? Then I have to ctrl-c, cat the contents and re-run
> the script. Here I cannot pick default either if unsure. I must make a
> decision.
How about always preserving existing repos and then appending changes
made through setup-apkrepos?
>
> I want keep my previous run so i pick 'n'
>
> Now I get what I was wanted.
> Please enter a local path or URL to the mirror:
>
> I enter /home/ncopa/.cache/apks
>
> Do you want to add another mirror? [y/n]:
> This is actually good, but we could combine that with the above question:
>
> Enter a local path or URL to the mirror to add (or 'done') [done]:
IMHO developpers who need to add a custom repo probably can just add
the line to /etc/apk/repositories manually.
>
> Again I get the
> Do you want to update repository indexes?
> (You must be connected when using remote repositories.) [y/N]: y
> Updating repository indexes... done.
>
> I start to think that we coudl just drop that question and just try update
> the index. If its not connected to internet the user have most likely chosed
> to not setup the apkrepos at all and/or error message displayed will be kind
> of expected.
>
> Any ideas how we reduce number of questions and try make the script get out
> of the way?
>
> -nc
>
>
> ---
> Unsubscribe:  alpine-devel+unsubscribe@lists.alpinelinux.org
> Help:         alpine-devel+help@lists.alpinelinux.org
> ---
>
>
-- 
Jeff


---
Unsubscribe:  alpine-devel+unsubscribe@lists.alpinelinux.org
Help:         alpine-devel+help@lists.alpinelinux.org
---
Natanael Copa
Details
Message ID
<20110301181129.3e09e920@ncopa-desktop.nor.wtbts.net>
In-Reply-To
<AANLkTi=qL1bpSC=jKfVPumpVyk5XaUHyyMhr5c18yDDG@mail.gmail.com> (view parent)
Sender timestamp
1298999489
DKIM signature
missing
Download raw message
Sorry if i sounded un-satisfied with what has been done with
setup-apkrepos. I do appreciate the hard work that has been put in
there. We just need to optimize it a bit ;)

On Tue, 1 Mar 2011 11:30:42 -0500
Jeff Bilyk <jbilyk@gmail.com> wrote:

> On Tue, Mar 1, 2011 at 10:37 AM, Natanael Copa
> <ncopa@alpinelinux.org> wrote:
...
> > Setup internet apk repositories? [y/N]?
> >
> > This could be avoided by adding it as an option to next step
> > (select method: 'none' or 'done')
> I like it.

...

> >
> > System release is: edge.  Change? (i.e., to upgrade) [y/N]:
> >
> > well, we dont really support downgrades and I already run edge. This
> > question should never have been asked. I select 'N'
>
> I harmony with keeping script simple, how about always setup
> repositories for current release?

agree.

> >
> > Then I get yet another question:
> >
> > Do you want to enable the testing repository? [y/N]:
> >
> > I pick 'N' for now.
>
> Regular users most likely aren't a) running edge and b) need testing
> repos, so we could probably always add this in commented.
>

Never thought of that. Great idea! We could actually always add in edge
commented too.

> > Now I get yet another question.
> > Do you want to update repository indexes?
> > (You must be connected when using remote repositories.) [y/N]:
> >
> > I think we dont need to ask for this. If we have any remote repos
> > we can just update it. If there are no remotes there is no reason
> > to ask.
> We could always *try* to update and if it fails, it fails.

exactly.

> >
> > I pick 'y'
> >
> > Finally done!
> >
> > phew.
> >
> > I got 5 questions. We need get that number down to 1 or maximum 2.
> >
> > oh... what if I wanted to just add a http repo for updates + my
> > home made repo? Then I'd need to re-run the setup-apkrepos. I run
> > setup-apkrepos.
> >
> > How would you like to set up internet apk repositories?
> > I pick 'e' for enter manually.
> >
> > Before adding custom mirrors, do you want to clear
> > /etc/apk/repositories and start fresh? [y/n]:
> >
> > hum, what question is that? and if I dont remember what I had in
> > /etc/apk/repositories? Then I have to ctrl-c, cat the contents and
> > re-run the script. Here I cannot pick default either if unsure. I
> > must make a decision.
> How about always preserving existing repos and then appending changes
> made through setup-apkrepos?

yeah that was about what i came to too after a bit thinking.

> > I want keep my previous run so i pick 'n'
> >
> > Now I get what I was wanted.
> > Please enter a local path or URL to the mirror:
> >
> > I enter /home/ncopa/.cache/apks
> >
> > Do you want to add another mirror? [y/n]:
> > This is actually good, but we could combine that with the above
> > question:
> >
> > Enter a local path or URL to the mirror to add (or 'done') [done]:
> IMHO developpers who need to add a custom repo probably can just add
> the line to /etc/apk/repositories manually.

Agree. We can give the option to edit the /etc/apk/repositories
directly.

Thanks alot for the feedback!

So, I think something like this:

Currently confirued APK repositories:
<list from /etc/apk/repositories>

Available apk repository mirrors:
1) http://...
2) http://...
...
f) Autodetect fastest mirror
r) Pick a random mirror
e) Edit /etc/apk/repositories manually
Enter URL or path to add (or 1-9/f/r/e or 'done') [f]:

<presses enter>

Finding fastest mirror... using distrib-coffee.ipsl.jussieu.fr

Currently confirued APK repositories:
<list from /etc/apk/repositories>

Available apk repository mirrors:
1) http://...
2) http://...
...
f) Autodetect fastest mirror
r) Pick a random mirror
e) Edit /etc/apk/repositories manually
Enter URL or path to add (or 1-9/f/r/e or 'done') [done]:



So second time it sets 'done' as default. That way you can just press
<enter> twice and youre done.

If you have a local/internal repo you can just type the url directly
and <enter><enter>

If you want upgrade to edge or run testing you type: <enter>e<enter> and
remove the appripiate comment(s).

Everybody wins!

Unless somebody beats me I'll try implement the above tomorrow.

-nc


---
Unsubscribe:  alpine-devel+unsubscribe@lists.alpinelinux.org
Help:         alpine-devel+help@lists.alpinelinux.org
---