• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Solved Package upgrade deletes config

Rastko

Member

Thanks: 1
Messages: 73

#1
Hi,

Today I made an upgrade of new packages, of which there were many (like all the stuff I use), but the custom configuration appears to be overwritten.

Specifically, I had to manually rewrite the X display manager resources and scripts, and my GWorkspace/WindowMaker integration started to shake, due to the upgrade incompatibilites with the GNUstep theming engine. I had to revert to the standard theme, but it got corrupted. Then I started tweaking the WindowMaker window attributes, and completely messed up my desktop environment.

Not a good thing when upgrading.

[SOLVED] How do I set the WindowMaker attributes back to work with GWorkspace, and how do I prevent overwrite of painstakingly tuned config files and scripts when upgrading packages (pkg upgrade)?

[SOLUTION] devnull the ~/GNUstep/Defaults/WMWindowAttributes, which will pickup the defaults. Seems to have solved this part of problem.
 

SirDice

Administrator
Staff member
Administrator
Moderator

Thanks: 5,508
Messages: 25,688

#2
Ports/packages never remove or modify configuration files if they have been modified. Which specific files have been overwritten?
 

Rastko

Member

Thanks: 1
Messages: 73

#4
Yeah! Some are ... but you see, it's cool to have backups somewhere in a safe place, ... unless you want to be scheduled for a rehearsal. :)
Even if I made backups, I wouldn't know what to do with them, because I wouldn't know what has been overwritten, what has not, and what upgrade will break what.

On that note, is it possible to get the messages from "pkg-upgrade" that fill my terminal buffer and scroll off screen, especially in case of 251 upgrades.
 

getopt

Well-Known Member

Thanks: 294
Messages: 494

#5
On that note, is it possible to get the messages from "pkg-upgrade" that fill my terminal buffer and scroll off screen, especially in case of 251 upgrades.
Yes, it is possible. Just scroll back. Or see grep pkg /var/log/*.
And with a backup you always could do a diff on a directory.
 

Rastko

Member

Thanks: 1
Messages: 73

#6
Yes, it is possible. Just scroll back. Or see grep pkg /var/log/*.
And with a backup you always could do a diff on a directory.
What I meant what was "maintainer" messages, like the ones found in pkg-message, which describe release errata...
 

Maxnix

Well-Known Member

Thanks: 140
Messages: 251

#8
xdm resource files and scripts in /usr/local/etc/X11/xdm
Previously, the directory for xdm config files was (only?) /usr/local/lib/X11/xdm; now it has been changed (more coherently IMO) to /usr/local/etc/X11/xdm
 

tobik@

Daemon
Developer

Thanks: 1,184
Messages: 1,775

#9
Previously, the directory for xdm config files was (only?) /usr/local/lib/X11/xdm; now it has been changed (more coherently IMO) to /usr/local/etc/X11/xdm
Yeah, but I wish that there would've been an UPDATING entry for it...
 

Maxnix

Well-Known Member

Thanks: 140
Messages: 251

#10
Yeah, but I wish that there would've been an UPDATING entry for it...
Indeed. I discovered this looking at xdm after the upgrade and thinking: "What? The default configuration?!" o_O. Fortunately, pkg info -l xdm was my friend. ;)
 

Maxnix

Well-Known Member

Thanks: 140
Messages: 251

#12
pkg info -D <pkg name> will show the pkg-messages for the given installed package.
Yup, but there are no messages for xdm, unfortunately... :( How tobik@ said, an entry in UPDATING would have been righteous.
 

Rastko

Member

Thanks: 1
Messages: 73

#13
Previously, the directory for xdm config files was (only?) /usr/local/lib/X11/xdm; now it has been changed (more coherently IMO) to /usr/local/etc/X11/xdm
Oh my gosh, you're right. lib/ -> etc/. What an easy thing to miss, given the BSDs non-standard file layout. Nothing was overwritten (SirDice).

Marking as solved, and thanks for the -D option, I get lost in all the pkg commands, mixing query, search, info all the time. I know what they are, just cannot intuitively guess that one of them could have a particular switch.
 

SirDice

Administrator
Staff member
Administrator
Moderator

Thanks: 5,508
Messages: 25,688

#14
and thanks for the -D option, I get lost in all the pkg commands, mixing query, search, info all the time. I know what they are, just cannot intuitively guess that one of them could have a particular switch.
You can create aliases for custom queries, there are already quite a few of them defined in /usr/local/etc/pkg.conf. You could add something like this:
Code:
ALIAS : {
  message: info -D
}
Code:
root@armitage:~ # pkg message sshguard
sshguard-2.0.0_1:
Always:
##########################################################################
  Sshguard installed successfully.

  You can start sshguard as a daemon by using the
  rc.d script installed at /usr/local/etc/rc.d/sshguard .

  See sshguard-setup(7) and http://www.sshguard.net/docs/setup for additional info.

  Please note that a few rc script parameters have been renamed to
  better reflect the documentation:

  sshguard_safety_thresh -> sshguard_danger_thresh
  sshguard_pardon_min_interval -> sshguard_release_interval
  sshguard_prescribe_interval -> sshguard_reset_interval
##########################################################################
A cleverly chosen alias is easier to remember :)
 

Rastko

Member

Thanks: 1
Messages: 73

#15
You can create aliases for custom queries, there are already quite a few of them defined in /usr/local/etc/pkg.conf. You could add something like this:
Code:
ALIAS : {
  message: info -D
}
Code:
root@armitage:~ # pkg message sshguard
sshguard-2.0.0_1:
Always:
##########################################################################
  Sshguard installed successfully.

  You can start sshguard as a daemon by using the
  rc.d script installed at /usr/local/etc/rc.d/sshguard .

  See sshguard-setup(7) and http://www.sshguard.net/docs/setup for additional info.

  Please note that a few rc script parameters have been renamed to
  better reflect the documentation:

  sshguard_safety_thresh -> sshguard_danger_thresh
  sshguard_pardon_min_interval -> sshguard_release_interval
  sshguard_prescribe_interval -> sshguard_reset_interval
##########################################################################
A cleverly chosen alias is easier to remember :)
Ah! Cool.
 

Rastko

Member

Thanks: 1
Messages: 73

#16
Not being aware of this functionality, I started writing intricate shell scripts for pkg, like this one, hahaha:

Code:
#!/bin/sh
#
#	Executable definition file for pe class (OO paradigm)

# REQUIRE (with execution)
. ./pe_h.sh # declaration of class "pe" (OO paradigm)

 # partial class pe
{

# METHODS (OO paradigm)
pe () { # Constructor
	CMDQUER="pkg query -e" # front-end stub
	CMDLIST="pkg search -q -g '*'"
	QS=$PARAM1
	EF=$PARAM2
	QFREGEX="[n?v?o?p?m?c?e?w?V?l?s?a?q?k?M?t?R\??#?]"
	EVREGEX="(,|:| )? ?[n?|o?|p?|m?|c?|e?|w?|s?|a?|q?|k?|t?|y?|M?|#?] ?(EQ|LT|NE|IS|IN|GT)? ?[[:alnum:]\*]*"
	PNREGEX="[[:alnum:]_?|-]+[[:alpha:]]{1}[[:alnum:]]+"
	readonly QFREGEX; 
	readonly EVREGEX
} # NOTE: this works because fn defs are executable statements

pe_synt () { # Syntax (here-doc)

	cat <<- "SYNTAX"
	
--------------------
(f)ront(e)end(to)pkg
--------------------

Query (format)
--------------
 SINGLE:
  n(ame) v(ersion) o(rigin) p(refix) m(aint)
 c(omment) d(e)script w(ww) V(ital) l(icense)
  s(ize) a(utomatic) q(arch) loc(k)ed M(essage)
  t(ime) R(epo)
  ?|#[drCFODLUGBbA]
   ? = EXISTS(), # = COUNT()
   d(eps)  r(ev) C(at) F(iles) O(pts) D(irs)
   L(ic) U(sr) G(rp) B(libdep) b(lib) A(nn)
 MULTI (only one of):
 [drCFODLUGBbA][novps] (see above)
   n(ame),o(rig),v(ers),p(ath),s(um)

Evaulation (filter)
-------------------
 SPEC[ ]OP[ ]VAL [,|: ...]
  
  SPEC is one of [nopmcewsaqkMt#] (see above)
  OP is one of IS,IN(glob),EQ,NE,LT,GT(int)
  VAL is glob or int

		SYNTAX
} 

pe_qfsb () { # Builds query format string with regex 
	# NOTE: local variables are exactly local vars and
	# globals before definition will initialize locals and
	# non-locals (input/output) are assumed to exist at runtime
	local QF # string builder
	local QP # token builder 
	local QPP # special tokens builder
	local WORD # regex of raw format string
	 
	 # -o adds IFS, good because spaces are optional
	WORD=$(echo $QS | grep -E -o $QFREGEX)
	
	for I in $WORD; { #or do
		# specifiers with additional flags
		if test ${I} = "s"; 
		then QPP="b"; 
		else QPP=""; 
		fi; 
		
		QP=%${I}${QPP}; # build token
		QF=${QF}${QP}"___"; # build string
	} # or done

	QFORM=$QF # assign built string to actual query format
}

pe_evsb () { # Builds filter string with regex
        local EX # string builder
        local ET # builder token (one for everything)
	local WORD # regex of raw filter string

	# -o adds IFS, good because spaces are optional
	WORD=$(echo $EF | grep -E -o "$EVREGEX");
	EX="%" #  beggining of filter is always a specifier
	
	for I in $WORD; {
		case $I in # in case of operators, else any...
			# token delim is optional in input;
			# operator parsing adds a space  and 
			# concat ops add a space and a %
			#	for the next specifier
				"EQ") EO=" = ";;
				"LT") EO=" < ";;
				"GT") EO=" > ";;
				"NE") EO=" != ";;
				"IS") EO=" ~ ";;
				"IN") EO=" !~ ";;
				",") EO=" && %";;
				":") EO=" || %";;
				*) EO=$I;;
			esac # and that's all folks		
		
		EX="${EX}${EO}"; # build string
        }

        EFORM=$EX; # assign built string to actual filter
}

pe_list () {
# TODO...
}

pe_strlen () {
	PE_OPARAM1=$(echo $PE_IPARAM1 | grep -o -E "." | grep -c -E ".*");
	echo $PE_OPARAM1;
}

pe_run () {
	for I in $(eval "$CMDQUER '$EFORM' $QFORM");
	{
		echo $I;echo;
	}
}



} # /CLASS pe (OO paradigm)


return 0 # special "sh" command to return to sourcing module (OO paradigm)