LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old Yesterday, 05:31 PM   #4486
glennmcc
Member
 
Registered: Jan 2021
Location: North Jackson, Ohio (USA)
Distribution: slackware64-15.0
Posts: 532

Rep: Reputation: 306Reputation: 306Reputation: 306Reputation: 306

Quote:
Originally Posted by rizitis View Post
Just an idea for doinst.sh idk if it work but as base idea i think its good
Code:
#!/bin/sh

OLD_CONFIG_DIR="/home/*/.gftp"
NEW_CONFIG_DIR="/home/*/.config/gftp"

migrate_config() {
    for user_dir in $OLD_CONFIG_DIR; do
        if [ -d "$user_dir" ]; then
            mkdir -p "$NEW_CONFIG_DIR"
            mv "$user_dir"/* "$NEW_CONFIG_DIR/"
            chown -R $(basename $user_dir):$(basename $user_dir) "$NEW_CONFIG_DIR"
        fi
    done
}

migrate_config

exit 0
edit: exit 0 I think needed this time...
That did not work.

This does.

Code:
#!/bin/sh
migrate_config() {
    for user_dir in /home/*; do
        if [ -d "$user_dir/.gftp" ]; then
            mv "$user_dir/.gftp" "$user_dir/.config/gftp"
        fi
    done
}
migrate_config
exit 0

Last edited by glennmcc; Yesterday at 05:41 PM.
 
Old Yesterday, 05:35 PM   #4487
glennmcc
Member
 
Registered: Jan 2021
Location: North Jackson, Ohio (USA)
Distribution: slackware64-15.0
Posts: 532

Rep: Reputation: 306Reputation: 306Reputation: 306Reputation: 306
Quote:
Originally Posted by pghvlaans View Post
Would information in the ChangeLog and eventually "changes and hints" not be more appropriate for the gFTP settings change? Currently, shared-mime-info is the only package that touches $HOME at all during installation, and that's just to run update-mime-database, not move directories around.
Perhaps so.

However, since almost no-one ever reads that stuff, having doinst.sh move the dir to the new location
would eliminate the 1000 questions being posted asking...

"why did the upgrade of gFTP lose my existing settings ???"

______

If anyone would like to test it.

http://glennmcc.org/gftp-2.9.1b-x86_64-4.txz
(built on fully upgraded slackware64-current so it will not run on 15.0)

http://glennmcc.org/gftp
(includes modified slackbuild script, doinst.sh & gftp SRC code from https://github.com/masneyb/gftp )

Last edited by glennmcc; Yesterday at 06:35 PM.
 
Old Today, 01:04 AM   #4488
henca
Member
 
Registered: Aug 2007
Location: Linköping, Sweden
Distribution: Slackware
Posts: 982

Rep: Reputation: 668Reputation: 668Reputation: 668Reputation: 668Reputation: 668Reputation: 668
Quote:
Originally Posted by pghvlaans View Post
Currently, shared-mime-info is the only package that touches $HOME at all during installation, and that's just to run update-mime-database, not move directories around.
By definition, any package attempting to modify files in ordinary users home directories will be broken at some circumstances.

The shared-mime-info package will be broken on systems using some kind of catalog service like ldap or nis for users as those users will not be listed in the local file /etc/passwd.

The suggested method for gftp to look in /home/* will be broken for all those cases when home directories are not directly at /home/*. Maybe there are systems with home directories like /home/nfs-server1/* or something completely different. We all know that by default the root account has its home directory at /root.

However, I don't mind much that attempts to modify files in users home directories fail. IMHO no user should have his or her private files modified by a system administrator without prior conscent.

When it comes to system wide configuration files packages usually provide a .new file for manual consideration. Why would any package be more intrusive about files in home directories?

Instead of changing files in user home directories during package installation I would prefer if some script was provided which users later could choose to run manually.

Another thing to consider is those environments with multiple Slackware installations (maybe even different versions of Slackware) sharing the same home directories, maybe from an NFS server. What would happen if a package gets updated on all those machines? Will every machine alter all user home directories? Will those different versions of Slackware have the same plan for those home directories?

regards Henrik
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache 2.4 requests to non-SSL site with "Upgrade-Insecure-Requests: 1" and no trailing / get redirected to default site owendelong Linux - Server 2 06-22-2021 02:08 PM
[SOLVED] Requests for -current (20151216) rworkman Slackware 3441 12-28-2017 03:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 03:46 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration