You are not logged in.

#1 2005-07-02 14:58:51

kleptophobiac
Member
From: Sunnyvale, CA
Registered: 2004-04-25
Posts: 488

Interactive .install?

I maintain the ABS package ivtv, and I would like to implement a case/esac pair that depends on user input in the ivtv.install file. The reason is that there  are two types of firmware available for these cards, and while both sets of cards will work off of one type of firmware, you can get better performance by using the correct firmware.

I was hoping to have a choice that makes symlinks. Is that possible?

I tried putting one in the .install file, but the script doesn't hold the command line, and so the program exists prematurely.

Offline

#2 2005-07-02 16:25:36

cactus
Taco Eater
From: t͈̫̹ͨa͖͕͎̱͈ͨ͆ć̥̖̝o̫̫̼s͈̭̱̞͍̃!̰
Registered: 2004-05-25
Posts: 4,622
Website

Re: Interactive .install?

interaction in a .install, or pkgbuild, is generally a bad thing. I think it would be better to set a variable in the pkgbuild that the user can change. Just make sure to prepend an underscore to it so it will not conflict with any other pacman/makepkg variables.

_FOO="bar"
echo $_FOO


"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍

Offline

#3 2005-07-02 17:29:28

kleptophobiac
Member
From: Sunnyvale, CA
Registered: 2004-04-25
Posts: 488

Re: Interactive .install?

I figured it was... but having to edit the pkgbuild to get the best possible install seems a little unfriendly.

Offline

#4 2005-07-02 17:31:39

cactus
Taco Eater
From: t͈̫̹ͨa͖͕͎̱͈ͨ͆ć̥̖̝o̫̫̼s͈̭̱̞͍̃!̰
Registered: 2004-05-25
Posts: 4,622
Website

Re: Interactive .install?

the best solution would likely be to have a seperate pkgbuild for each firmware, then.


"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍

Offline

#5 2005-07-03 00:06:49

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: Interactive .install?

how about you make hte script look in /sys and detect the different devices?

Offline

#6 2005-07-03 00:36:04

cactus
Taco Eater
From: t͈̫̹ͨa͖͕͎̱͈ͨ͆ć̥̖̝o̫̫̼s͈̭̱̞͍̃!̰
Registered: 2004-05-25
Posts: 4,622
Website

Re: Interactive .install?

that works fine for the person funning makepkg on their own system, but does nothing for binary ditribution.

That is one issue with pkgbuilds requiring user input and reading info off the system. They work great for interaction on one person's system, but if someone else just tries to install the binary that results from it..bonk!


"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍

Offline

#7 2005-07-03 01:07:06

Dusty
Schwag Merchant
From: Medicine Hat, Alberta, Canada
Registered: 2004-01-18
Posts: 5,986
Website

Re: Interactive .install?

Yeah, PKGBUILDs are meant for batch building, not as custom scripts. In a single case its all right, but for distribution, I'd suggest multiple PKGBUILDs with conflicts and provides properly set.

Dusty

Offline

#8 2005-07-03 02:24:50

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: Interactive .install?

I mean detect in the post install. the post install is the script run on everyone's computer after the package is installed. so if the detection is in there, it would get the appropriate one for that system.

but yeah, seperate packages might be the best way.

Offline

#9 2005-07-03 02:35:18

cactus
Taco Eater
From: t͈̫̹ͨa͖͕͎̱͈ͨ͆ć̥̖̝o̫̫̼s͈̭̱̞͍̃!̰
Registered: 2004-05-25
Posts: 4,622
Website

Re: Interactive .install?

iphitus wrote:

I mean detect in the post install. the post install is the script run on everyone's computer after the package is installed. so if the detection is in there, it would get the appropriate one for that system.

aha. Thanks for the clarification iphitus, that does make a bit more sense. I was assuming you meant detection in the pkgbuild itself..


"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍

Offline

Board footer

Powered by FluxBB