[opensuse-packaging] /var/adm/update-scripts mechanism changed?
Hi, guys, Currently I'm (re-)working on steam package in games:tools repository, which is a wrapper, using /var/adm/update-scripts mechanism to fill contents downloaded online into directories pre-created in %install section of specfile. And I found something interesting: In 13.1, the scripts is executed _before_ %install section. Which means, if you don't create the directories again in your script, it will fail. AKA, the `touch` way has gone. Verify here: https://build.opensuse.org/package/show/home:MargueriteSu:branches:games:too... Install the package in your 13.1, if you see "failed /usr/share/doc/packages/steam/steam_* (no such file or directory)", congrats! It indicates it's executed _before_ %install section, after a while (unpacking steam_1.0.0.44.tar.gz and copy), you'll see your %install section is processed. And if you `rpm -qf /usr/bin/steam`, it doesn't belong to any package. Any one tell something about the change? Marguerite -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
On Sat, Nov 23, 2013 at 12:30:06AM +0800, Marguerite Su wrote:
Currently I'm (re-)working on steam package in games:tools repository, which is a wrapper, using /var/adm/update-scripts mechanism to fill contents downloaded online into directories pre-created in %install section of specfile.
And I found something interesting:
In 13.1, the scripts is executed _before_ %install section.
Which means, if you don't create the directories again in your script, it will fail. AKA, the `touch` way has gone.
Verify here: https://build.opensuse.org/package/show/home:MargueriteSu:branches:games:too...
Install the package in your 13.1, if you see "failed /usr/share/doc/packages/steam/steam_* (no such file or directory)", congrats!
It indicates it's executed _before_ %install section, after a while (unpacking steam_1.0.0.44.tar.gz and copy), you'll see your %install section is processed. And if you `rpm -qf /usr/bin/steam`, it doesn't belong to any package.
Well, it's not packaged, so why should 'rpm -qf /usr/bin/steam' return anything? There's somthing wrong with your spec file: $ rpm -qpl steam-1.0.0.44-4.1.i586.rpm /usr/bin/* /usr/lib/steam /usr/lib/steam/* /usr/share/applications/steam.desktop /usr/share/doc/packages/steam /usr/share/doc/packages/steam/* /usr/share/icons/hicolor/16x16/apps/steam.png /usr/share/icons/hicolor/24x24/apps/steam.png /usr/share/icons/hicolor/256x256/apps/steam.png /usr/share/icons/hicolor/32x32/apps/steam.png /usr/share/icons/hicolor/48x48/apps/steam.png /usr/share/man/man6/steam.*.gz /usr/share/pixmaps/steam.png /usr/share/pixmaps/steam_tray_mono.png /var/adm/update-messages/steam-1.0.0.44-4.1-1 /var/adm/update-scripts/steam-1.0.0.44-4.1-fetch-steam.sh.txt I don't think you really want those '*' files. Cheers, Michael. -- Michael Schroeder mls@suse.de SUSE LINUX Products GmbH, GF Jeff Hawn, HRB 16746 AG Nuernberg main(_){while(_=~getchar())putchar(~_-1/(~(_|32)/13*2-11)*13);} -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
On Fri, Nov 22, 2013 at 05:40:48PM +0100, Michael Schroeder wrote:
On Sat, Nov 23, 2013 at 12:30:06AM +0800, Marguerite Su wrote:
Currently I'm (re-)working on steam package in games:tools repository, which is a wrapper, using /var/adm/update-scripts mechanism to fill contents downloaded online into directories pre-created in %install section of specfile.
And I found something interesting:
In 13.1, the scripts is executed _before_ %install section.
Which means, if you don't create the directories again in your script, it will fail. AKA, the `touch` way has gone.
Verify here: https://build.opensuse.org/package/show/home:MargueriteSu:branches:games:too...
Install the package in your 13.1, if you see "failed /usr/share/doc/packages/steam/steam_* (no such file or directory)", congrats!
It indicates it's executed _before_ %install section, after a while (unpacking steam_1.0.0.44.tar.gz and copy), you'll see your %install section is processed. And if you `rpm -qf /usr/bin/steam`, it doesn't belong to any package.
Well, it's not packaged, so why should 'rpm -qf /usr/bin/steam' return anything?
There's somthing wrong with your spec file:
$ rpm -qpl steam-1.0.0.44-4.1.i586.rpm /usr/bin/* [...]
Also, %{_docdir}/steam/ is marked as ghost, so installing the rpm will not create the directory. M. -- Michael Schroeder mls@suse.de SUSE LINUX Products GmbH, GF Jeff Hawn, HRB 16746 AG Nuernberg main(_){while(_=~getchar())putchar(~_-1/(~(_|32)/13*2-11)*13);} -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
On Sat, Nov 23, 2013 at 12:47 AM, Michael Schroeder <mls@suse.de> wrote:
Also, %{_docdir}/steam/ is marked as ghost, so installing the rpm will not create the directory.
It was marked %ghost by the original packager because: The content in this directory doesn't exist when the %install section is finished. (at least on 12.3) %install section just created the directory. The contents are filled in later in %post section (something like that). Without a %ghost the package will fail to build. That's the black magic. And /usr/lib/steam is also marked %ghost, but it is created and owned by steam package. We write such things in %files section simply because we want the rpm to own all the things, the directories created in %install section, and the filled contents in %post section. Marguerite -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
And I said this /var/adm/update-scripts mechanism is changed because: (1/1) 正在安装:steam-1.0.0.44-4.1 .....................................................[完毕] 正在运行:steam-1.0.0.44-4.1-fetch-steam.sh.txt (steam, /var/adm/update-scripts) note: No proxy is used. Please set the environment variable "http_proxy" note: to your favorite proxy, if you want to use a proxy for the download. note: note: bash: export http_proxy="http://proxy.example.com:3128/" note: tcsh: setenv http_proxy "http://proxy.example.com:3128/" EULA: Fetching ... /var/adm/update-scripts/steam-1.0.0.44-4.1-fetch-steam.sh.txt: line 47: /usr/share/doc/packages/steam/subscriber-agreement: No such file or directory done steam_1.0.0.44.tar.gz (http://repo.steampowered.com/steam/pool/steam/s/steam/steam_1.0.0.44.tar.gz): Fetching ... done install -d -m 755 /usr/bin/ install -p -m 755 steam /usr/bin/ install -p -m 755 steamdeps /usr/bin/ install -d -m 755 /usr/share/doc/steam/ install -p -m 644 README steam_install_agreement.txt /usr/share/doc/steam/ install -d -m 755 /usr/share/man/man6/ install -m 644 steam.6 /usr/share/man/man6/ install -d -m 755 /usr/share/icons/hicolor/16x16/apps/ install -p -m 644 icons/16/steam.png /usr/share/icons/hicolor/16x16/apps/ install -d -m 755 /usr/share/icons/hicolor/24x24/apps/ install -p -m 644 icons/24/steam.png /usr/share/icons/hicolor/24x24/apps/ install -d -m 755 /usr/share/icons/hicolor/256x256/apps/ install -p -m 644 icons/256/steam.png /usr/share/icons/hicolor/256x256/apps/ install -d -m 755 /usr/share/icons/hicolor/32x32/apps/ install -p -m 644 icons/32/steam.png /usr/share/icons/hicolor/32x32/apps/ install -d -m 755 /usr/share/icons/hicolor/48x48/apps/ install -p -m 644 icons/48/steam.png /usr/share/icons/hicolor/48x48/apps/ install -d -m 755 /usr/share/pixmaps/ install -p -m 644 icons/48/steam.png /usr/share/pixmaps/ install -p -m 644 icons/48/steam_tray_mono.png /usr/share/pixmaps install -d -m 755 /usr/lib/steam/ install -p -m 644 bootstraplinux_ubuntu12_32.tar.xz /usr/lib/steam/ install -d -m 755 /usr/share/applications/ install -p -m 644 steam.desktop /usr/share/applications/ *** Steam bootstrap files installed. Run the executable to complete the installation.*** 正在运行:steam-1.0.0.44-4.1-fetch-steam.sh.txt (steam, /var/adm/update-scripts) ......[完毕] 接收到了来自以下软件包的更新通知: steam-1.0.0.44-4.1.x86_64 (/var/adm/update-messages/steam-1.0.0.44-4.1-1) 现在查看通知吗? [y/n] (n): y 1. clearly, we can see the script is run before %install section 2. and %_docdir/steam is actually created in %install section. 3. before in 12.3, openSUSE will not prompt you about "view update message now? [y/n](n)" Marguerite -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
On Sat, Nov 23, 2013 at 02:03:26AM +0800, Marguerite Su wrote:
1. clearly, we can see the script is run before %install section
That's not clear to me. And there is no %install section run when a package gets installed, rpm simply unpacks the cpio payload. You can use 'rpm2cpio steam-1.0.0.44-7.1.x86_64.rpm | cpio --list' to check what's in your rpm, on Friday it just contained the /var/adm/update-* files and no /usr/share/doc/steam directory M. -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
Hi, Michael, On Mon, Nov 25, 2013 at 6:49 PM, Michael Schroeder <mls@suse.de> wrote:
On Sat, Nov 23, 2013 at 02:03:26AM +0800, Marguerite Su wrote:
1. clearly, we can see the script is run before %install section
That's not clear to me. And there is no %install section run when a package gets installed, rpm simply unpacks the cpio payload. You can use 'rpm2cpio steam-1.0.0.44-7.1.x86_64.rpm | cpio --list' to check what's in your rpm, on Friday it just contained the /var/adm/update-* files and no /usr/share/doc/steam directory
M.
Sorry I was trolling, and you made me know my stupid. You explanation is very clear, now I know I was reseaching on a problem that doesn't exist at all. Thanks for your hints! Helped a lot! Marguerite -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
Hello, Am Samstag, 23. November 2013 schrieb Marguerite Su:
And /usr/lib/steam is also marked %ghost, but it is created and owned by steam package.
We write such things in %files section simply because we want the rpm to own all the things, the directories created in %install section, and the filled contents in %post section.
A maybe silly question - why don't you package those directories as %dir /usr/lib/steam if they are created in %post anyway (aka "always there")? That avoids the black magic and also cleans up when removing the package (only empty directories are removed AFAIK). BTW: Directories can be owned by multiple packages without conflicts (the permissions should of course match ;-) Regards, Christian Boltz --
oder das absolut berauschende ;-)) [ -d "/test/" ] || echo mkd Danke, zum Glück muß ich heute nicht mehr mit dem Auto fahren :-) [> Thomas Preissler und Al Bogner in suse-linux]
-- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
Hi, Michael, On Sat, Nov 23, 2013 at 12:40 AM, Michael Schroeder <mls@suse.de> wrote:
There's somthing wrong with your spec file:
I don't think you really want those '*' files.
Well my work mostly concentrates on the script itself instead of the specfile. This is from the original packager. So why he used this syntax? simple, because it worked (at least on 12.3) So this is not something _wrong_. But as I'm also a heavy /var/adm/update-scripts packager, I can tell truth about this: It's not _wrong_, but something _not reliable_. The * syntax works sometimes, and fails sometimes. But unluckily we don't know when is "sometimes". eg: Last time I researched on this * syntax in such dummy package, steam package worked with this syntax, but my own package, wps in home:MargueriteSu, failed. So I had to create another script to get the complete filelist and use -f %{name}.filelist to add them into %files section in my wps.spec, and documented the scripts in README.SuSE. Well, now steam failed on this too...so I have to fix it. Marguerite -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
On Friday 2013-11-22 18:51, Marguerite Su wrote:
So this is not something _wrong_. It's not _wrong_, but something _not reliable_.
The * syntax works sometimes, and fails sometimes. But unluckily we don't know when is "sometimes".
%files /foo/* always works. Either * matches some files, in which case they are gobbled up, or if * matches no file, then * stays unexpanded, and rpmbuild would throw an error _because_ "/foo/*" does not exist. Now in your case, you have a verbatim file "/foo/*" which is matched by, surprise, /foo/*, and you create it here: install -d %{buildroot}%{_prefix}/lib/steam ==> touch %{buildroot}%{_prefix}/lib/steam/* So that is unlikely to work on 12.3 too. -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
participants (4)
-
Christian Boltz
-
Jan Engelhardt
-
Marguerite Su
-
Michael Schroeder