From 4c7fa778d4029d359f4401d271d152c65f599a03 Mon Sep 17 00:00:00 2001 From: ms Date: Sat, 22 Sep 2007 10:48:09 +0000 Subject: [PATCH] Pakfire an den neuen Server angepasst. Die Pakete wurden nicht richtig gebaut, da die speiziellen Scripts nicht beruecksichtigt wurden. Fix in der mpfire makefile. syslogdctrl sollte nun die Direktiven besser ersetzen. git-svn-id: http://svn.ipfire.org/svn/ipfire/trunk@906 ea5c0bd1-69bd-2848-81d8-4f18e57aeed8 --- doc/packages-list.txt | 2 -- lfs/Config | 2 +- lfs/mpfire | 2 +- src/misc-progs/syslogdctrl.c | 13 +++++++++---- src/pakfire/lib/functions.pl | 16 ++++++++-------- src/pakfire/lib/functions.sh | 9 ++------- src/paks/clamav/install.sh | 2 +- src/paks/default/install.sh | 2 -- src/paks/default/update.sh | 2 -- 9 files changed, 22 insertions(+), 28 deletions(-) diff --git a/doc/packages-list.txt b/doc/packages-list.txt index 38a82a144..d1d58659e 100644 --- a/doc/packages-list.txt +++ b/doc/packages-list.txt @@ -216,9 +216,7 @@ * rtorrent-0.7.6 * samba-3.0.25c * screen-4.0.2 -* sdparm-0.90 * sdparm-1.01 -* sdparm-1.02 * sed-4.1.5 * setserial-2.17 * shadow-4.0.15 diff --git a/lfs/Config b/lfs/Config index afa3a17cb..e7d2fca79 100644 --- a/lfs/Config +++ b/lfs/Config @@ -178,7 +178,7 @@ define PAK # Bringing the files to their right place. @rm -rf /install/packages/package @mkdir -p /install/packages/package - if [ -e "/usr/src/src/paks $(PROG)" ]; then \ + if [ -e "/usr/src/src/paks/$(PROG)" ]; then \ cp -f /usr/src/src/paks/$(PROG)/{,un}install.sh /usr/src/src/paks/$(PROG)/update.sh \ /install/packages/package; \ else \ diff --git a/lfs/mpfire b/lfs/mpfire index c8906bc55..848e42794 100644 --- a/lfs/mpfire +++ b/lfs/mpfire @@ -65,5 +65,5 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) install -v -m 644 $(DIR_SRC)/config/mpfire/webradio /var/ipfire/mpfire/ chown root.nobody /var/ipfire/mpfire/{mpd.conf,playlist.m3u} chown nobody.nobody /var/ipfire/mpfire/{settings,webradio} - chown root.nobody /var/ipfire/mpfire/db/mpd.db + chown root.nobody /var/ipfire/mpfire/db/mpd.db @$(POSTBUILD) diff --git a/src/misc-progs/syslogdctrl.c b/src/misc-progs/syslogdctrl.c index 6991ccf35..9880ee2ee 100644 --- a/src/misc-progs/syslogdctrl.c +++ b/src/misc-progs/syslogdctrl.c @@ -30,7 +30,7 @@ int main(void) { - char buffer[STRING_SIZE], hostname[STRING_SIZE], varmessages[STRING_SIZE]; + char buffer[STRING_SIZE], command[STRING_SIZE], hostname[STRING_SIZE], varmessages[STRING_SIZE]; int config_fd,rc,fd,pid; struct stat st; struct keyvalue *kv = NULL; @@ -111,10 +111,8 @@ int main(void) snprintf(buffer, STRING_SIZE - 1, "/bin/sed -e 's/^#\\?\\(\\*\\.\\*[[:blank:]]\\+@\\).\\+$/\\1%s/' /etc/syslog.conf >&%d", hostname, config_fd ); else snprintf(buffer, STRING_SIZE - 1, "/bin/sed -e 's/^#\\?\\(\\*\\.\\*[[:blank:]]\\+@.\\+\\)$/#\\1/' /etc/syslog.conf >&%d", config_fd ); - - snprintf(buffer, STRING_SIZE - 1, "/bin/sed -e 's#\\.\\*/var/log/messages\\.\\*#%s /var/log/messages#' /etc/syslog.conf >&%d", varmessages, config_fd ); - /* if the return code isn't 0 failsafe */ + /* if the return code isn't 0 failsafe */ if ((rc = unpriv_system(buffer,99,99)) != 0) { fprintf(stderr, "sed returned bad exit code: %d\n", rc); @@ -123,6 +121,13 @@ int main(void) exit(ERR_CONFIG); } close(config_fd); + + /* Replace the logging option*/ + + safe_system("grep -v '/var/log/messages' < /etc/syslog.conf.new > /etc/syslog.conf.tmp && mv /etc/syslog.conf.tmp /etc/syslog.conf.new"); + snprintf(command, STRING_SIZE-1, "printf '%s /var/log/messages' >> /etc/syslog.conf.new", varmessages ); + safe_system(command); + if (rename("/etc/syslog.conf.new", "/etc/syslog.conf") == -1) { perror("Unable to replace old config file"); diff --git a/src/pakfire/lib/functions.pl b/src/pakfire/lib/functions.pl index dc38c00b1..b53e91729 100644 --- a/src/pakfire/lib/functions.pl +++ b/src/pakfire/lib/functions.pl @@ -166,10 +166,10 @@ sub fetchfile { &General::readhash("${General::swroot}/proxy/advanced/settings", \%proxysettings); if ($proxysettings{'UPSTREAM_PROXY'}) { - logger("DOWNLOAD INFO: Upstream proxy: \"$proxysettings{'UPSTREAM_PROXY'}\"") unless ($bfile =~ /^counter\?.*/); + logger("DOWNLOAD INFO: Upstream proxy: \"$proxysettings{'UPSTREAM_PROXY'}\"") unless ($bfile =~ /^counter.py\?.*/); if ($proxysettings{'UPSTREAM_USER'}) { $ua->proxy("http","http://$proxysettings{'UPSTREAM_USER'}:$proxysettings{'UPSTREAM_PASSWORD'}@"."$proxysettings{'UPSTREAM_PROXY'}/"); - logger("DOWNLOAD INFO: Logging in with: \"$proxysettings{'UPSTREAM_USER'}\" - \"$proxysettings{'UPSTREAM_PASSWORD'}\"") unless ($bfile =~ /^counter\?.*/); + logger("DOWNLOAD INFO: Logging in with: \"$proxysettings{'UPSTREAM_USER'}\" - \"$proxysettings{'UPSTREAM_PASSWORD'}\"") unless ($bfile =~ /^counter.py\?.*/); } else { $ua->proxy("http","http://$proxysettings{'UPSTREAM_PROXY'}/"); } @@ -179,7 +179,7 @@ sub fetchfile { my $url = "http://$host/$file"; my $response; - unless ($bfile =~ /^counter\?.*/) { + unless ($bfile =~ /^counter.py\?.*/) { my $result = $ua->head($url); my $remote_headers = $result->headers; $total_size = $remote_headers->content_length; @@ -201,7 +201,7 @@ sub fetchfile { } if ($response->is_success) { - unless ($bfile =~ /^counter\?.*/) { + unless ($bfile =~ /^counter.py\?.*/) { if (open(FILE, ">$Conf::tmpdir/$bfile")) { print FILE $final_data; close(FILE); @@ -644,7 +644,7 @@ sub setuppak { my $return = system("cd $Conf::tmpdir && NAME=$pak ./install.sh >> $Conf::logdir/install-$pak.log 2>&1"); $return %= 255; if ($pakfiresettings{'UUID'} ne "off") { - fetchfile("cgi-bin/counter?ver=$Conf::version&uuid=$Conf::uuid&ipak=$pak&return=$return", "$Conf::mainserver"); + fetchfile("counter.py?ver=$Conf::version&uuid=$Conf::uuid&ipak=$pak&return=$return", "$Conf::mainserver"); } if ($return == 0) { move("$Conf::tmpdir/ROOTFILES", "$Conf::dbdir/rootfiles/$pak"); @@ -705,7 +705,7 @@ sub upgradepak { my $return = system("cd $Conf::tmpdir && NAME=$pak ./update.sh >> $Conf::logdir/update-$pak.log 2>&1"); $return %= 255; if ($pakfiresettings{'UUID'} ne "off") { - fetchfile("cgi-bin/counter?ver=$Conf::version&uuid=$Conf::uuid&upak=$pak&return=$return", "$Conf::mainserver"); + fetchfile("counter.py?ver=$Conf::version&uuid=$Conf::uuid&upak=$pak&return=$return", "$Conf::mainserver"); } if ($return == 0) { move("$Conf::tmpdir/ROOTFILES", "$Conf::dbdir/rootfiles/$pak"); @@ -730,7 +730,7 @@ sub removepak { my $return = system("cd $Conf::tmpdir && NAME=$pak ./uninstall.sh >> $Conf::logdir/uninstall-$pak.log 2>&1"); $return %= 255; if ($pakfiresettings{'UUID'} ne "off") { - fetchfile("cgi-bin/counter?ver=$Conf::version&uuid=$Conf::uuid&dpak=$pak&return=$return", "$Conf::mainserver"); + fetchfile("counter.py?ver=$Conf::version&uuid=$Conf::uuid&dpak=$pak&return=$return", "$Conf::mainserver"); } if ($return == 0) { open(FILE, "<$Conf::dbdir/rootfiles/$pak"); @@ -793,7 +793,7 @@ sub senduuid { $Conf::uuid = `cat $Conf::dbdir/uuid`; } logger("Sending my uuid: $Conf::uuid"); - fetchfile("cgi-bin/counter?ver=$Conf::version&uuid=$Conf::uuid", "$Conf::mainserver"); + fetchfile("counter.py?ver=$Conf::version&uuid=$Conf::uuid", "$Conf::mainserver"); system("rm -f $Conf::tmpdir/counter* 2>/dev/null"); } } diff --git a/src/pakfire/lib/functions.sh b/src/pakfire/lib/functions.sh index 536dda89a..aad067faf 100644 --- a/src/pakfire/lib/functions.sh +++ b/src/pakfire/lib/functions.sh @@ -25,20 +25,15 @@ extract_files() { echo "...Finished." } -reload_all() { - reload_modules - reload_libs -} - reload_libs() { echo "(Re-)Initializing the lib-cache..." - ldconfig + ldconfig -vv echo "...Finished." } reload_modules() { echo "(Re-)Initializing the module-dependencies..." - depmod -a + depmod -va echo "...Finished." } diff --git a/src/paks/clamav/install.sh b/src/paks/clamav/install.sh index cdfc81cd1..4c704dc0a 100644 --- a/src/paks/clamav/install.sh +++ b/src/paks/clamav/install.sh @@ -3,6 +3,6 @@ extract_files -chown clamav:clamav /usr/share/clamav +chown clamav:clamav /usr/share/clamav -Rv /usr/local/bin/clamavctrl enable diff --git a/src/paks/default/install.sh b/src/paks/default/install.sh index 988c9e2c0..a47a7831d 100644 --- a/src/paks/default/install.sh +++ b/src/paks/default/install.sh @@ -2,5 +2,3 @@ . /opt/pakfire/lib/functions.sh extract_files - -reload_all diff --git a/src/paks/default/update.sh b/src/paks/default/update.sh index 988c9e2c0..a47a7831d 100644 --- a/src/paks/default/update.sh +++ b/src/paks/default/update.sh @@ -2,5 +2,3 @@ . /opt/pakfire/lib/functions.sh extract_files - -reload_all -- 2.39.2