[opensuse-packaging] How do I create a directory in $HOME on installation
Hi, I need to create a directory in the users homes on rpm installation, can anybody point me in the right direction? Thanks Dave P -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
On Mon, Nov 02, 2009 at 09:27:09AM +0200, Dave Plater wrote:
Hi, I need to create a directory in the users homes on rpm installation, can anybody point me in the right direction?
You don't. Create the directory on first program start if not present. Ciao, Marcus -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
On 11/02/2009 09:35 AM, Marcus Meissner wrote:
On Mon, Nov 02, 2009 at 09:27:09AM +0200, Dave Plater wrote:
Hi, I need to create a directory in the users homes on rpm installation, can anybody point me in the right direction?
You don't.
Create the directory on first program start if not present.
Ciao, Marcus
It's for a workaround while the Rosegarden developers decide how they're going to approach the problem. I've tried this in %post :- mkdir -p /home/$USER/rosegarden chown $USER:users /home/$USER/rosegarden Which seems to work but I'm not that familiar with environment variables in linux. Regards Dave P -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
On Mon, Nov 02, 2009 at 09:52:39AM +0200, Dave Plater wrote:
On 11/02/2009 09:35 AM, Marcus Meissner wrote:
On Mon, Nov 02, 2009 at 09:27:09AM +0200, Dave Plater wrote:
Hi, I need to create a directory in the users homes on rpm installation, can anybody point me in the right direction?
You don't.
Create the directory on first program start if not present.
Ciao, Marcus
It's for a workaround while the Rosegarden developers decide how they're going to approach the problem. I've tried this in %post :- mkdir -p /home/$USER/rosegarden chown $USER:users /home/$USER/rosegarden
Which seems to work but I'm not that familiar with environment variables in linux.
The issue is, you do this for one user, in a totally unsafe way. A workaround would be to have a wrapper script /usr/bin/rosegarden (and move the old to rosegarden.bin) something like: #!/bin/sh mkdir $HOME/rosegarden exec /usr/bin/rosegarden.bin "$@" Ciao, Marcus -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
On 11/02/2009 10:03 AM, Marcus Meissner wrote:
On Mon, Nov 02, 2009 at 09:52:39AM +0200, Dave Plater wrote:
On 11/02/2009 09:35 AM, Marcus Meissner wrote:
On Mon, Nov 02, 2009 at 09:27:09AM +0200, Dave Plater wrote:
Hi, I need to create a directory in the users homes on rpm installation, can anybody point me in the right direction?
You don't.
Create the directory on first program start if not present.
Ciao, Marcus
It's for a workaround while the Rosegarden developers decide how they're going to approach the problem. I've tried this in %post :- mkdir -p /home/$USER/rosegarden chown $USER:users /home/$USER/rosegarden
Which seems to work but I'm not that familiar with environment variables in linux.
The issue is, you do this for one user, in a totally unsafe way.
A workaround would be to have a wrapper script /usr/bin/rosegarden (and move the old to rosegarden.bin)
something like: #!/bin/sh mkdir $HOME/rosegarden exec /usr/bin/rosegarden.bin "$@"
Ciao, Marcus
Thanks I'll try that. Regards Dave P -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
Am Montag, 2. November 2009 08:27:09 schrieb Dave Plater:
Hi, I need to create a directory in the users homes on rpm installation, can anybody point me in the right direction?
This is horrible evil and can't work in all cases (for example if root has no write access to the home directory of the user, like with remote homes on NFS and friends). We have mechanisms to create directories on desktop start, but it is usually better when your application handles this itself. bye adrian -- Adrian Schroeter SUSE Linux Products GmbH email: adrian@suse.de -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
On Mon, Nov 02, 2009 at 08:42:09AM +0100, Adrian Schröter wrote:
Am Montag, 2. November 2009 08:27:09 schrieb Dave Plater:
Hi, I need to create a directory in the users homes on rpm installation, can anybody point me in the right direction?
This is horrible evil and can't work in all cases (for example if root has no write access to the home directory of the user, like with remote homes on NFS and friends).
Or if you add users after the installation
We have mechanisms to create directories on desktop start, but it is usually better when your application handles this itself.
That would be the best option. What you could do is also add the directory to /etc/skel. This might be gaining time if a lot needs to be placed the first time in that directory. If you do that a new user will have the required directory in his ~/. However there must be a check in the program to see if the directory exists and if not, it must be made with the apropriate files. So the /etc/skel is additional to what you must do anyway and one can wonder if it is needed at all. houghi -- To have a nice mailinglist experience, follow the guidelines below:
Please do not toppost. Please turn off HTML Read http://en.opensuse.org/Opensuse_mailing_list_netiquette Read http://www.catb.org/~esr/faqs/smart-questions.html -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
On 11/02/2009 01:22 PM, houghi wrote:
On Mon, Nov 02, 2009 at 08:42:09AM +0100, Adrian Schröter wrote:
Am Montag, 2. November 2009 08:27:09 schrieb Dave Plater:
Hi, I need to create a directory in the users homes on rpm installation, can anybody point me in the right direction?
This is horrible evil and can't work in all cases (for example if root has no write access to the home directory of the user, like with remote homes on NFS and friends).
Or if you add users after the installation
We have mechanisms to create directories on desktop start, but it is usually better when your application handles this itself.
That would be the best option. What you could do is also add the directory to /etc/skel. This might be gaining time if a lot needs to be placed the first time in that directory. If you do that a new user will have the required directory in his ~/.
However there must be a check in the program to see if the directory exists and if not, it must be made with the apropriate files. So the /etc/skel is additional to what you must do anyway and one can wonder if it is needed at all.
houghi
I used the script Marcus provided, as a wrapper and included the -p switch to mkdir. It works well and solves the problem. Thanks Dave P -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
On 11/02/2009 12:51 PM, Dave Plater wrote:
I used the script Marcus provided, as a wrapper and included the -p switch to mkdir. It works well and solves the problem. Thanks Dave P
Please report a bug to rosegarden developers. This kind of wrapper script shouldn't be needed because application should create directories it needs at the first start. -- Best Regards / S pozdravom, Pavol RUSNAK SUSE LINUX, s.r.o openSUSE Boosters Team Lihovarska 1060/12 PGP 0xA6917144 19000 Praha 9, CR prusnak[at]suse.cz http://www.suse.cz -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
On 11/02/2009 02:08 PM, Pavol Rusnak wrote:
On 11/02/2009 12:51 PM, Dave Plater wrote:
I used the script Marcus provided, as a wrapper and included the -p switch to mkdir. It works well and solves the problem. Thanks Dave P
Please report a bug to rosegarden developers. This kind of wrapper script shouldn't be needed because application should create directories it needs at the first start.
This is the pre alpha svn version I'm building in my home:plater project and I'm in constant contact with the rosegarden developers. I needed the wrapper as a workaround until the said developers decide how to address the problem of creating the directory. I have an openSUSE user who is finding bugs and helping to ensure that when the program is ready for release it will be first class. It, rosegarden-qt4 already fixes a few problems with released rosegarden4-1.7.3 (which I maintain). Regards Dave P -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
participants (5)
-
Adrian Schröter
-
Dave Plater
-
houghi
-
Marcus Meissner
-
Pavol Rusnak