This patchset makes testing easier in IPFire 2.
Since we are now trying to use the nightly builds more, pakfire is now automatically configured to use the packages from the correct tree.
That means that testing add-ons will be easier without any manual changes of any configuration files. Yay.
Additionally, there is now a dropdown on the pakfire page where users can change from one tree to another one which makes testing core updates easier, too.
Please review my changes and let me know if I messed anything up.
Best, -Michael
The tree in which pakfire is looking for packages and Core Updates has been hardcoded into /opt/pakfire/etc/pakfire.conf.
This patch adds a new function which reads the system release from /etc/system-release.
Signed-off-by: Michael Tremer michael.tremer@ipfire.org --- src/pakfire/lib/functions.pl | 41 ++++++++++++++++++++++++++++++++++++ src/pakfire/pakfire.conf | 2 -- 2 files changed, 41 insertions(+), 2 deletions(-)
diff --git a/src/pakfire/lib/functions.pl b/src/pakfire/lib/functions.pl index 61787757e..cda6f00a9 100644 --- a/src/pakfire/lib/functions.pl +++ b/src/pakfire/lib/functions.pl @@ -70,6 +70,9 @@ my $bfile; my %pakfiresettings = (); &General::readhash("${General::swroot}/pakfire/settings", %pakfiresettings);
+# Make version +$Conf::version = &make_version(); + sub message { my $message = shift; @@ -946,4 +949,42 @@ sub status { exit 1; }
+sub get_arch() { + # Append architecture + my ($sysname, $nodename, $release, $version, $machine) = POSIX::uname(); + + # We only support armv5tel for all 32 bit arches + if ($machine =~ m/armv[567]/) { + return "armv5tel"; + + # We only support i586 for 32 bit x86 + } elsif ($machine =~ m/i[0-9]86/) { + return "i586"; + } + + return $machine; +} + +sub make_version() { + my $version = ""; + + # Open /etc/system-release + open(RELEASE, "</etc/system-release"); + my $release = <RELEASE>; + close(RELEASE); + + # Add the main relase + if ($release =~ m/IPFire ([\d.]+)/) { + $version .= $1; + } + + # Append architecture + my $arch = &get_arch(); + if ($arch ne "i586") { + $version .= "-${arch}"; + } + + return $version; +} + 1; diff --git a/src/pakfire/pakfire.conf b/src/pakfire/pakfire.conf index cfe48f575..9930f3771 100644 --- a/src/pakfire/pakfire.conf +++ b/src/pakfire/pakfire.conf @@ -21,8 +21,6 @@
package Conf;
-$version = "@VERSION@"; - $mainserver = "pakfire.ipfire.org";
$cachedir = "/opt/pakfire/cache";
These can no longer be modified in the GUI and are used nowhere.
Signed-off-by: Michael Tremer michael.tremer@ipfire.org --- html/cgi-bin/pakfire.cgi | 16 ---------------- 1 file changed, 16 deletions(-)
diff --git a/html/cgi-bin/pakfire.cgi b/html/cgi-bin/pakfire.cgi index e6f3cda94..7c560bfbf 100644 --- a/html/cgi-bin/pakfire.cgi +++ b/html/cgi-bin/pakfire.cgi @@ -42,8 +42,6 @@ $pakfiresettings{'VALID'} = '';
$pakfiresettings{'INSPAKS'} = ''; $pakfiresettings{'DELPAKS'} = ''; -$pakfiresettings{'AUTOUPDATE'} = 'off'; -$pakfiresettings{'UUID'} = 'on';
sub refreshpage{&Header::openbox( 'Waiting', 1, "<meta http-equiv='refresh' content='1;'>" );print "<center><img src='/images/clock.gif' alt='' /><br/><font color='red'>$Lang::tr{'pagerefresh'}</font></center>";&Header::closebox();}
@@ -144,13 +142,6 @@ END system("$command"); system("/bin/sleep 1"); } elsif ($pakfiresettings{'ACTION'} eq "$Lang::tr{'save'}") { - - if ($pakfiresettings{'AUTOUPDATE'} eq 'on') { - system("/usr/local/bin/pakfire enable updates >/dev/null 2>&1"); - } else { - system("/usr/local/bin/pakfire disable updates >/dev/null 2>&1"); - } - &General::writehash("${General::swroot}/pakfire/settings", %pakfiresettings); }
@@ -159,13 +150,6 @@ END my %selected=(); my %checked=();
-$checked{'AUTOUPDATE'}{'off'} = ''; -$checked{'AUTOUPDATE'}{'on'} = ''; -$checked{'AUTOUPDATE'}{$pakfiresettings{'AUTOUPDATE'}} = "checked='checked'"; -$checked{'UUID'}{'off'} = ''; -$checked{'UUID'}{'on'} = ''; -$checked{'UUID'}{$pakfiresettings{'UUID'}} = "checked='checked'"; - # DPC move error message to top so it is seen! if ($errormessage) { &Header::openbox('100%', 'left', $Lang::tr{'error messages'});
Signed-off-by: Michael Tremer michael.tremer@ipfire.org --- html/cgi-bin/pakfire.cgi | 47 ++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 23 deletions(-)
diff --git a/html/cgi-bin/pakfire.cgi b/html/cgi-bin/pakfire.cgi index 7c560bfbf..f785b2594 100644 --- a/html/cgi-bin/pakfire.cgi +++ b/html/cgi-bin/pakfire.cgi @@ -30,22 +30,23 @@ require "${General::swroot}/lang.pl"; require "${General::swroot}/header.pl"; require "/opt/pakfire/lib/functions.pl";
-my %pakfiresettings=(); +my %cgiparams=(); my $errormessage = ''; my %color = (); +my %pakfiresettings = (); my %mainsettings = ();
&Header::showhttpheaders();
-$pakfiresettings{'ACTION'} = ''; -$pakfiresettings{'VALID'} = ''; +$cgiparams{'ACTION'} = ''; +$cgiparams{'VALID'} = '';
-$pakfiresettings{'INSPAKS'} = ''; -$pakfiresettings{'DELPAKS'} = ''; +$cgiparams{'INSPAKS'} = ''; +$cgiparams{'DELPAKS'} = '';
sub refreshpage{&Header::openbox( 'Waiting', 1, "<meta http-equiv='refresh' content='1;'>" );print "<center><img src='/images/clock.gif' alt='' /><br/><font color='red'>$Lang::tr{'pagerefresh'}</font></center>";&Header::closebox();}
-&Header::getcgihash(%pakfiresettings); +&Header::getcgihash(%cgiparams);
&General::readhash("${General::swroot}/main/settings", %mainsettings); &General::readhash("/srv/web/ipfire/html/themes/".$mainsettings{'THEME'}."/include/colors.txt", %color); @@ -53,17 +54,17 @@ sub refreshpage{&Header::openbox( 'Waiting', 1, "<meta http-equiv='refresh' cont &Header::openpage($Lang::tr{'pakfire configuration'}, 1); &Header::openbigbox('100%', 'left', '', $errormessage);
-if ($pakfiresettings{'ACTION'} eq 'install'){ - $pakfiresettings{'INSPAKS'} =~ s/|/\ /g; - if ("$pakfiresettings{'FORCE'}" eq "on") { - my $command = "/usr/local/bin/pakfire install --non-interactive --no-colors $pakfiresettings{'INSPAKS'} &>/dev/null &"; +if ($cgiparams{'ACTION'} eq 'install'){ + $cgiparams{'INSPAKS'} =~ s/|/\ /g; + if ("$cgiparams{'FORCE'}" eq "on") { + my $command = "/usr/local/bin/pakfire install --non-interactive --no-colors $cgiparams{'INSPAKS'} &>/dev/null &"; system("$command"); system("/bin/sleep 1"); } else { &Header::openbox("100%", "center", $Lang::tr{'request'}); - my @output = `/usr/local/bin/pakfire resolvedeps --no-colors $pakfiresettings{'INSPAKS'}`; + my @output = `/usr/local/bin/pakfire resolvedeps --no-colors $cgiparams{'INSPAKS'}`; print <<END; - <table><tr><td colspan='2'>$Lang::tr{'pakfire install package'}.$pakfiresettings{'INSPAKS'}.$Lang::tr{'pakfire possible dependency'} + <table><tr><td colspan='2'>$Lang::tr{'pakfire install package'}.$cgiparams{'INSPAKS'}.$Lang::tr{'pakfire possible dependency'} <pre> END foreach (@output) { @@ -75,7 +76,7 @@ END <tr><td colspan='2'>$Lang::tr{'pakfire accept all'} <tr><td colspan='2'> <tr><td align='right'><form method='post' action='$ENV{'SCRIPT_NAME'}'> - <input type='hidden' name='INSPAKS' value='$pakfiresettings{'INSPAKS'}' /> + <input type='hidden' name='INSPAKS' value='$cgiparams{'INSPAKS'}' /> <input type='hidden' name='FORCE' value='on' /> <input type='hidden' name='ACTION' value='install' /> <input type='image' alt='$Lang::tr{'install'}' title='$Lang::tr{'install'}' src='/images/go-next.png' /> @@ -92,18 +93,18 @@ END &Header::closepage(); exit; } -} elsif ($pakfiresettings{'ACTION'} eq 'remove') { +} elsif ($cgiparams{'ACTION'} eq 'remove') {
- $pakfiresettings{'DELPAKS'} =~ s/|/\ /g; - if ("$pakfiresettings{'FORCE'}" eq "on") { - my $command = "/usr/local/bin/pakfire remove --non-interactive --no-colors $pakfiresettings{'DELPAKS'} &>/dev/null &"; + $cgiparams{'DELPAKS'} =~ s/|/\ /g; + if ("$cgiparams{'FORCE'}" eq "on") { + my $command = "/usr/local/bin/pakfire remove --non-interactive --no-colors $cgiparams{'DELPAKS'} &>/dev/null &"; system("$command"); system("/bin/sleep 1"); } else { &Header::openbox("100%", "center", $Lang::tr{'request'}); - my @output = `/usr/local/bin/pakfire resolvedeps --no-colors $pakfiresettings{'DELPAKS'}`; + my @output = `/usr/local/bin/pakfire resolvedeps --no-colors $cgiparams{'DELPAKS'}`; print <<END; - <table><tr><td colspan='2'>$Lang::tr{'pakfire uninstall package'}.$pakfiresettings{'DELPAKS'}.$Lang::tr{'pakfire possible dependency'} + <table><tr><td colspan='2'>$Lang::tr{'pakfire uninstall package'}.$cgiparams{'DELPAKS'}.$Lang::tr{'pakfire possible dependency'} <pre> END foreach (@output) { @@ -115,7 +116,7 @@ END <tr><td colspan='2'>$Lang::tr{'pakfire accept all'} <tr><td colspan='2'> <tr><td align='right'><form method='post' action='$ENV{'SCRIPT_NAME'}'> - <input type='hidden' name='DELPAKS' value='$pakfiresettings{'DELPAKS'}' /> + <input type='hidden' name='DELPAKS' value='$cgiparams{'DELPAKS'}' /> <input type='hidden' name='FORCE' value='on' /> <input type='hidden' name='ACTION' value='remove' /> <input type='image' alt='$Lang::tr{'uninstall'}' title='$Lang::tr{'uninstall'}' src='/images/go-next.png' /> @@ -133,15 +134,15 @@ END exit; }
-} elsif ($pakfiresettings{'ACTION'} eq 'update') { +} elsif ($cgiparams{'ACTION'} eq 'update') {
system("/usr/local/bin/pakfire update --force --no-colors &>/dev/null &"); system("/bin/sleep 1"); -} elsif ($pakfiresettings{'ACTION'} eq 'upgrade') { +} elsif ($cgiparams{'ACTION'} eq 'upgrade') { my $command = "/usr/local/bin/pakfire upgrade -y --no-colors &>/dev/null &"; system("$command"); system("/bin/sleep 1"); -} elsif ($pakfiresettings{'ACTION'} eq "$Lang::tr{'save'}") { +} elsif ($cgiparams{'ACTION'} eq "$Lang::tr{'save'}") { &General::writehash("${General::swroot}/pakfire/settings", %pakfiresettings); }
Signed-off-by: Michael Tremer michael.tremer@ipfire.org --- doc/language_issues.de | 5 +++++ doc/language_issues.en | 5 +++++ doc/language_issues.es | 5 +++++ doc/language_issues.fr | 5 +++++ doc/language_issues.it | 5 +++++ doc/language_issues.nl | 5 +++++ doc/language_issues.pl | 5 +++++ doc/language_issues.ru | 5 +++++ doc/language_issues.tr | 5 +++++ doc/language_missings | 40 +++++++++++++++++++++++++++++++++ html/cgi-bin/pakfire.cgi | 48 +++++++++++++++++++++++++++++++++++++++- langs/en/cgi-bin/en.pl | 5 +++++ 12 files changed, 137 insertions(+), 1 deletion(-)
diff --git a/doc/language_issues.de b/doc/language_issues.de index 89a703fcb..361133708 100644 --- a/doc/language_issues.de +++ b/doc/language_issues.de @@ -829,6 +829,11 @@ WARNING: untranslated string: guardian no entries = unknown string WARNING: untranslated string: guardian service = unknown string WARNING: untranslated string: itlb multihit = iTLB MultiHit WARNING: untranslated string: not validating = Not validating +WARNING: untranslated string: pakfire invalid tree = Invalid repository selected +WARNING: untranslated string: pakfire tree = Repository +WARNING: untranslated string: pakfire tree stable = Stable +WARNING: untranslated string: pakfire tree testing = Testing +WARNING: untranslated string: pakfire tree unstable = Unstable WARNING: untranslated string: route config changed = unknown string WARNING: untranslated string: routing config added = unknown string WARNING: untranslated string: routing config changed = unknown string diff --git a/doc/language_issues.en b/doc/language_issues.en index 10c2f87ce..2fd69f430 100644 --- a/doc/language_issues.en +++ b/doc/language_issues.en @@ -1440,12 +1440,17 @@ WARNING: untranslated string: pakfire core update level = Core-Update-Level WARNING: untranslated string: pakfire install description = Please choose one or more items from the list below and <br /> click the plus to install. WARNING: untranslated string: pakfire install package = You want to install the following packages: WARNING: untranslated string: pakfire installed addons = Installed Addons: +WARNING: untranslated string: pakfire invalid tree = Invalid repository selected WARNING: untranslated string: pakfire last core list update = Last core list update made WARNING: untranslated string: pakfire last package update = Last packages list update made WARNING: untranslated string: pakfire last serverlist update = Last server list update made WARNING: untranslated string: pakfire last update = Last update made WARNING: untranslated string: pakfire possible dependency = There may be depending packages, here is a list of packages that need to be installed. WARNING: untranslated string: pakfire system state = System Status +WARNING: untranslated string: pakfire tree = Repository +WARNING: untranslated string: pakfire tree stable = Stable +WARNING: untranslated string: pakfire tree testing = Testing +WARNING: untranslated string: pakfire tree unstable = Unstable WARNING: untranslated string: pakfire uninstall description = Please choose one or more items from the list below and <br /> click the minus to uninstall. WARNING: untranslated string: pakfire uninstall package = You want to uninstall the following packages: WARNING: untranslated string: pakfire working = Pakfire is working ... Please wait until all operations have completed successfully. diff --git a/doc/language_issues.es b/doc/language_issues.es index b97d017c3..af006fcdf 100644 --- a/doc/language_issues.es +++ b/doc/language_issues.es @@ -1233,6 +1233,11 @@ WARNING: untranslated string: ovpn warning rfc3280 = Your host certificate is no WARNING: untranslated string: p2p block = P2P networks WARNING: untranslated string: p2p block save notice = Please reload the firewall ruleset in order to apply your changes. WARNING: untranslated string: pakfire ago = ago. +WARNING: untranslated string: pakfire invalid tree = Invalid repository selected +WARNING: untranslated string: pakfire tree = Repository +WARNING: untranslated string: pakfire tree stable = Stable +WARNING: untranslated string: pakfire tree testing = Testing +WARNING: untranslated string: pakfire tree unstable = Unstable WARNING: untranslated string: please reboot to apply your changes = Please reboot to apply your changes WARNING: untranslated string: pptp netconfig = My Net Config WARNING: untranslated string: pptp peer = Peer diff --git a/doc/language_issues.fr b/doc/language_issues.fr index 8e9d7babb..928c37a46 100644 --- a/doc/language_issues.fr +++ b/doc/language_issues.fr @@ -861,6 +861,11 @@ WARNING: untranslated string: info messages = unknown string WARNING: untranslated string: no data = unknown string WARNING: untranslated string: not validating = Not validating WARNING: untranslated string: pakfire ago = ago. +WARNING: untranslated string: pakfire invalid tree = Invalid repository selected +WARNING: untranslated string: pakfire tree = Repository +WARNING: untranslated string: pakfire tree stable = Stable +WARNING: untranslated string: pakfire tree testing = Testing +WARNING: untranslated string: pakfire tree unstable = Unstable WARNING: untranslated string: route config changed = unknown string WARNING: untranslated string: routing config added = unknown string WARNING: untranslated string: routing config changed = unknown string diff --git a/doc/language_issues.it b/doc/language_issues.it index a4ea5e618..6471e0d41 100644 --- a/doc/language_issues.it +++ b/doc/language_issues.it @@ -1013,6 +1013,11 @@ WARNING: untranslated string: ovpn error dh = The Diffie-Hellman parameter needs WARNING: untranslated string: ovpn error md5 = You host certificate uses MD5 for the signature which is not accepted anymore. <br>Please update to the latest IPFire version and generate a new root and host certificate.</br><br>All OpenVPN clients needs then to be renewed!</br> WARNING: untranslated string: ovpn tls auth = TLS Channel Protection: WARNING: untranslated string: ovpn warning rfc3280 = Your host certificate is not RFC3280 compliant. <br>Please update to the latest IPFire version and generate as soon as possible a new root and host certificate.</br><br>All OpenVPN clients needs then to be renewed!</br> +WARNING: untranslated string: pakfire invalid tree = Invalid repository selected +WARNING: untranslated string: pakfire tree = Repository +WARNING: untranslated string: pakfire tree stable = Stable +WARNING: untranslated string: pakfire tree testing = Testing +WARNING: untranslated string: pakfire tree unstable = Unstable WARNING: untranslated string: please reboot to apply your changes = Please reboot to apply your changes WARNING: untranslated string: pptp netconfig = My Net Config WARNING: untranslated string: pptp peer = Peer diff --git a/doc/language_issues.nl b/doc/language_issues.nl index ca1dee9b5..cc6cbe966 100644 --- a/doc/language_issues.nl +++ b/doc/language_issues.nl @@ -1045,6 +1045,11 @@ WARNING: untranslated string: ovpn generating the root and host certificates = G WARNING: untranslated string: ovpn ha = Hash algorithm WARNING: untranslated string: ovpn tls auth = TLS Channel Protection: WARNING: untranslated string: ovpn warning rfc3280 = Your host certificate is not RFC3280 compliant. <br>Please update to the latest IPFire version and generate as soon as possible a new root and host certificate.</br><br>All OpenVPN clients needs then to be renewed!</br> +WARNING: untranslated string: pakfire invalid tree = Invalid repository selected +WARNING: untranslated string: pakfire tree = Repository +WARNING: untranslated string: pakfire tree stable = Stable +WARNING: untranslated string: pakfire tree testing = Testing +WARNING: untranslated string: pakfire tree unstable = Unstable WARNING: untranslated string: please reboot to apply your changes = Please reboot to apply your changes WARNING: untranslated string: pptp netconfig = My Net Config WARNING: untranslated string: pptp peer = Peer diff --git a/doc/language_issues.pl b/doc/language_issues.pl index b97d017c3..af006fcdf 100644 --- a/doc/language_issues.pl +++ b/doc/language_issues.pl @@ -1233,6 +1233,11 @@ WARNING: untranslated string: ovpn warning rfc3280 = Your host certificate is no WARNING: untranslated string: p2p block = P2P networks WARNING: untranslated string: p2p block save notice = Please reload the firewall ruleset in order to apply your changes. WARNING: untranslated string: pakfire ago = ago. +WARNING: untranslated string: pakfire invalid tree = Invalid repository selected +WARNING: untranslated string: pakfire tree = Repository +WARNING: untranslated string: pakfire tree stable = Stable +WARNING: untranslated string: pakfire tree testing = Testing +WARNING: untranslated string: pakfire tree unstable = Unstable WARNING: untranslated string: please reboot to apply your changes = Please reboot to apply your changes WARNING: untranslated string: pptp netconfig = My Net Config WARNING: untranslated string: pptp peer = Peer diff --git a/doc/language_issues.ru b/doc/language_issues.ru index b76c83e56..a8cdef8b4 100644 --- a/doc/language_issues.ru +++ b/doc/language_issues.ru @@ -1229,6 +1229,11 @@ WARNING: untranslated string: ovpn tls auth = TLS Channel Protection: WARNING: untranslated string: ovpn warning rfc3280 = Your host certificate is not RFC3280 compliant. <br>Please update to the latest IPFire version and generate as soon as possible a new root and host certificate.</br><br>All OpenVPN clients needs then to be renewed!</br> WARNING: untranslated string: p2p block = P2P networks WARNING: untranslated string: p2p block save notice = Please reload the firewall ruleset in order to apply your changes. +WARNING: untranslated string: pakfire invalid tree = Invalid repository selected +WARNING: untranslated string: pakfire tree = Repository +WARNING: untranslated string: pakfire tree stable = Stable +WARNING: untranslated string: pakfire tree testing = Testing +WARNING: untranslated string: pakfire tree unstable = Unstable WARNING: untranslated string: please reboot to apply your changes = Please reboot to apply your changes WARNING: untranslated string: pptp netconfig = My Net Config WARNING: untranslated string: pptp peer = Peer diff --git a/doc/language_issues.tr b/doc/language_issues.tr index ef28f6ac8..c6c6ad599 100644 --- a/doc/language_issues.tr +++ b/doc/language_issues.tr @@ -923,6 +923,11 @@ WARNING: untranslated string: ovpn error dh = The Diffie-Hellman parameter needs WARNING: untranslated string: ovpn error md5 = You host certificate uses MD5 for the signature which is not accepted anymore. <br>Please update to the latest IPFire version and generate a new root and host certificate.</br><br>All OpenVPN clients needs then to be renewed!</br> WARNING: untranslated string: ovpn tls auth = TLS Channel Protection: WARNING: untranslated string: ovpn warning rfc3280 = Your host certificate is not RFC3280 compliant. <br>Please update to the latest IPFire version and generate as soon as possible a new root and host certificate.</br><br>All OpenVPN clients needs then to be renewed!</br> +WARNING: untranslated string: pakfire invalid tree = Invalid repository selected +WARNING: untranslated string: pakfire tree = Repository +WARNING: untranslated string: pakfire tree stable = Stable +WARNING: untranslated string: pakfire tree testing = Testing +WARNING: untranslated string: pakfire tree unstable = Unstable WARNING: untranslated string: please reboot to apply your changes = Please reboot to apply your changes WARNING: untranslated string: processor vulnerability mitigations = Processor Vulnerability Mitigations WARNING: untranslated string: ptr = PTR diff --git a/doc/language_missings b/doc/language_missings index 40724a80b..a427f5706 100644 --- a/doc/language_missings +++ b/doc/language_missings @@ -63,6 +63,11 @@ < notes < not validating < okay +< pakfire invalid tree +< pakfire tree +< pakfire tree stable +< pakfire tree testing +< pakfire tree unstable < quick control < shaping add options < show areas @@ -705,6 +710,11 @@ < ovpn warning rfc3280 < p2p block < p2p block save notice +< pakfire invalid tree +< pakfire tree +< pakfire tree stable +< pakfire tree testing +< pakfire tree unstable < please reboot to apply your changes < pptp netconfig < pptp peer @@ -942,6 +952,11 @@ < dns use protocol for dns queries < not validating < okay +< pakfire invalid tree +< pakfire tree +< pakfire tree stable +< pakfire tree testing +< pakfire tree unstable < standard < strict < working @@ -1182,6 +1197,11 @@ < ovpn error md5 < ovpn tls auth < ovpn warning rfc3280 +< pakfire invalid tree +< pakfire tree +< pakfire tree stable +< pakfire tree testing +< pakfire tree unstable < please reboot to apply your changes < pptp netconfig < pptp peer @@ -1564,6 +1584,11 @@ < ovpn reneg sec < ovpn tls auth < ovpn warning rfc3280 +< pakfire invalid tree +< pakfire tree +< pakfire tree stable +< pakfire tree testing +< pakfire tree unstable < please reboot to apply your changes < pptp netconfig < pptp peer @@ -2285,6 +2310,11 @@ < ovpn warning rfc3280 < p2p block < p2p block save notice +< pakfire invalid tree +< pakfire tree +< pakfire tree stable +< pakfire tree testing +< pakfire tree unstable < please reboot to apply your changes < pptp netconfig < pptp peer @@ -3121,6 +3151,11 @@ < ovpn warning rfc3280 < p2p block < p2p block save notice +< pakfire invalid tree +< pakfire tree +< pakfire tree stable +< pakfire tree testing +< pakfire tree unstable < please reboot to apply your changes < pptp netconfig < pptp peer @@ -3429,6 +3464,11 @@ < ovpn error md5 < ovpn tls auth < ovpn warning rfc3280 +< pakfire invalid tree +< pakfire tree +< pakfire tree stable +< pakfire tree testing +< pakfire tree unstable < please reboot to apply your changes < processor vulnerability mitigations < ptr diff --git a/html/cgi-bin/pakfire.cgi b/html/cgi-bin/pakfire.cgi index f785b2594..dacbe11f4 100644 --- a/html/cgi-bin/pakfire.cgi +++ b/html/cgi-bin/pakfire.cgi @@ -143,7 +143,19 @@ END system("$command"); system("/bin/sleep 1"); } elsif ($cgiparams{'ACTION'} eq "$Lang::tr{'save'}") { - &General::writehash("${General::swroot}/pakfire/settings", %pakfiresettings); + $pakfiresettings{"TREE"} = $cgiparams{"TREE"}; + + # Check for valid input + if ($pakfiresettings{"TREE"} !~ m/^(stable|testing|unstable)$/) { + $errormessage .= $Lang::tr{'pakfire invalid tree'}; + } + + unless ($errormessage) { + &General::writehash("${General::swroot}/pakfire/settings", %pakfiresettings); + + # Update lists + system("/usr/local/bin/pakfire update --force --no-colors &>/dev/null &"); + } }
&General::readhash("${General::swroot}/pakfire/settings", %pakfiresettings); @@ -151,6 +163,12 @@ END my %selected=(); my %checked=();
+$selected{"TREE"} = (); +$selected{"TREE"}{"stable"} = ""; +$selected{"TREE"}{"testing"} = ""; +$selected{"TREE"}{"unstable"} = ""; +$selected{"TREE"}{$pakfiresettings{"TREE"}} = "selected"; + # DPC move error message to top so it is seen! if ($errormessage) { &Header::openbox('100%', 'left', $Lang::tr{'error messages'}); @@ -263,6 +281,34 @@ print <<END; </table> END
+&Header::closebox(); +&Header::openbox("100%", "center", "$Lang::tr{'settings'}"); + +print <<END; + <form method='POST' action='$ENV{'SCRIPT_NAME'}'> + <table width='95%'> + <tr> + <td align='left' width='45%'>$Lang::tr{'pakfire tree'}</td> + <td width="55%" align="left"> + <select name="TREE"> + <option value="stable" $selected{"TREE"}{"stable"}>$Lang::tr{'pakfire tree stable'}</option> + <option value="testing" $selected{"TREE"}{"testing"}>$Lang::tr{'pakfire tree testing'}</option> + <option value="unstable" $selected{"TREE"}{"unstable"}>$Lang::tr{'pakfire tree unstable'}</option> + </select> + </td> + </tr> + <tr> + <td colspan="2"> </td> + </tr> + <tr> + <td colspan="2" align="center"> + <input type="submit" name="ACTION" value="$Lang::tr{'save'}" /> + </td> + </tr> + </table> + </form> +END + &Header::closebox(); &Header::closebigbox(); &Header::closepage(); diff --git a/langs/en/cgi-bin/en.pl b/langs/en/cgi-bin/en.pl index 1f81108f1..a68c8f411 100644 --- a/langs/en/cgi-bin/en.pl +++ b/langs/en/cgi-bin/en.pl @@ -1982,6 +1982,7 @@ 'pakfire install description' => 'Please choose one or more items from the list below and <br /> click the plus to install.', 'pakfire install package' => 'You want to install the following packages: ', 'pakfire installed addons' => 'Installed Addons:', +'pakfire invalid tree' => 'Invalid repository selected', 'pakfire last core list update' => 'Last core list update made', 'pakfire last package update' => 'Last packages list update made', 'pakfire last serverlist update' => 'Last server list update made', @@ -1989,6 +1990,10 @@ 'pakfire possible dependency' => ' There may be depending packages, here is a list of packages that need to be installed.', 'pakfire register' => 'Register at pakfire-server:', 'pakfire system state' => 'System Status', +'pakfire tree' => 'Repository', +'pakfire tree stable' => 'Stable', +'pakfire tree testing' => 'Testing', +'pakfire tree unstable' => 'Unstable', 'pakfire uninstall description' => 'Please choose one or more items from the list below and <br /> click the minus to uninstall.', 'pakfire uninstall package' => 'You want to uninstall the following packages: ', 'pakfire update daily' => 'Search for updates daily:',
Signed-off-by: Michael Tremer michael.tremer@ipfire.org --- src/pakfire/lib/functions.pl | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
diff --git a/src/pakfire/lib/functions.pl b/src/pakfire/lib/functions.pl index cda6f00a9..ddb1e9aad 100644 --- a/src/pakfire/lib/functions.pl +++ b/src/pakfire/lib/functions.pl @@ -965,6 +965,13 @@ sub get_arch() { return $machine; }
+sub get_tree() { + # Return stable if nothing is set + return "stable" unless (defined $pakfiresettings{'TREE'}); + + return $pakfiresettings{'TREE'}; +} + sub make_version() { my $version = "";
@@ -978,6 +985,14 @@ sub make_version() { $version .= $1; }
+ # Append suffix for tree + my $tree = &get_tree(); + if ($tree eq "testing") { + $version .= ".1"; + } elsif ($tree eq "unstable") { + $version .= ".2"; + } + # Append architecture my $arch = &get_arch(); if ($arch ne "i586") {
No functional changes. Just making them shorter.
Signed-off-by: Michael Tremer michael.tremer@ipfire.org --- make.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/make.sh b/make.sh index 34cc35f02..ba393bd65 100755 --- a/make.sh +++ b/make.sh @@ -28,15 +28,17 @@ SNAME="ipfire" # Short name VERSION="2.25" # Version number CORE="142" # Core Level (Filename) PAKFIRE_CORE="141" # Core Level (PAKFIRE) -GIT_BRANCH=`git rev-parse --abbrev-ref HEAD` # Git Branch SLOGAN="www.ipfire.org" # Software slogan CONFIG_ROOT=/var/ipfire # Configuration rootdir NICE=10 # Nice level MAX_RETRIES=1 # prefetch/check loop BUILD_IMAGES=1 # Flash and Xen Downloader KVER=`grep --max-count=1 VER lfs/linux | awk '{ print $3 }'` -GIT_TAG=$(git tag | tail -1) # Git Tag -GIT_LASTCOMMIT=$(git log | head -n1 | cut -d" " -f2 |head -c8) # Last commit + +# Information from Git +GIT_BRANCH="$(git rev-parse --abbrev-ref HEAD)" # Git Branch +GIT_TAG="$(git tag | tail -1)" # Git Tag +GIT_LASTCOMMIT="$(git rev-parse --verify HEAD)" # Last commit
TOOLCHAINVER=20200108
@@ -518,7 +520,7 @@ prepareenv() { SYSTEM_RELEASE="${SYSTEM_RELEASE} - $GIT_BRANCH$GIT_STATUS" ;; *) - SYSTEM_RELEASE="${SYSTEM_RELEASE} - Development Build: $GIT_BRANCH/$GIT_LASTCOMMIT$GIT_STATUS" + SYSTEM_RELEASE="${SYSTEM_RELEASE} - Development Build: $GIT_BRANCH/${GIT_LASTCOMMIT:0:8}$GIT_STATUS" ;; esac
Signed-off-by: Michael Tremer michael.tremer@ipfire.org --- make.sh | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-)
diff --git a/make.sh b/make.sh index ba393bd65..d46282b8e 100755 --- a/make.sh +++ b/make.sh @@ -509,21 +509,25 @@ prepareenv() { rm -f $BASEDIR/build/usr/src/lsalr 2>/dev/null
# Prepare string for /etc/system-release. - SYSTEM_RELEASE="${NAME} ${VERSION} (${BUILD_ARCH})" - if [ "$(git status -s | wc -l)" == "0" ]; then - GIT_STATUS="" - else - GIT_STATUS="-dirty" - fi - case "$GIT_BRANCH" in - core*|beta?|rc?) - SYSTEM_RELEASE="${SYSTEM_RELEASE} - $GIT_BRANCH$GIT_STATUS" - ;; - *) - SYSTEM_RELEASE="${SYSTEM_RELEASE} - Development Build: $GIT_BRANCH/${GIT_LASTCOMMIT:0:8}$GIT_STATUS" - ;; + local system_release="${NAME} ${VERSION} (${BUILD_ARCH})" + + case "${GIT_BRANCH}" in + core*|beta?|rc?) + system_release="${system_release} - ${GIT_BRANCH}" + ;; + *) + system_release="${system_release} - Development Build: ${GIT_BRANCH}/${GIT_LASTCOMMIT:0:8}" + ;; esac
+ # Append -dirty tag for local changes + if [ "$(git status -s | wc -l)" != "0" ]; then + system_release="${system_release}-dirty" + fi + + # Export variable + SYSTEM_RELEASE="${system_release}" + # Setup ccache cache size enterchroot ccache --max-size="${CCACHE_CACHE_SIZE}" >/dev/null }
This will configure Pakfire that people who install a nightly build will also get the packages for this build, etc.
Signed-off-by: Michael Tremer michael.tremer@ipfire.org --- lfs/configroot | 1 + make.sh | 14 ++++++++++++++ 2 files changed, 15 insertions(+)
diff --git a/lfs/configroot b/lfs/configroot index 6092f889b..2c9dbe0e3 100644 --- a/lfs/configroot +++ b/lfs/configroot @@ -133,6 +133,7 @@ $(TARGET) : echo "POLICY=MODE2" >> $(CONFIG_ROOT)/firewall/settings echo "POLICY1=MODE2" >> $(CONFIG_ROOT)/firewall/settings echo "USE_ISP_NAMESERVERS=on" >> $(CONFIG_ROOT)/dns/settings + echo "TREE=$(PAKFIRE_TREE)" >> $(CONFIG_ROOT)/pakfire/settings
# Install snort to suricata converter. cp $(DIR_SRC)/config/suricata/convert-snort /usr/sbin/convert-snort diff --git a/make.sh b/make.sh index d46282b8e..277ac8633 100755 --- a/make.sh +++ b/make.sh @@ -528,6 +528,19 @@ prepareenv() { # Export variable SYSTEM_RELEASE="${system_release}"
+ # Decide on PAKFIRE_TREE + case "${GIT_BRANCH}" in + core*) + PAKFIRE_TREE="stable" + ;; + master) + PAKFIRE_TREE="testing" + ;; + *) + PAKFIRE_TREE="unstable" + ;; + esac + # Setup ccache cache size enterchroot ccache --max-size="${CCACHE_CACHE_SIZE}" >/dev/null } @@ -545,6 +558,7 @@ enterchroot() { PATH="${PATH}" \ SYSTEM_RELEASE="${SYSTEM_RELEASE}" \ PAKFIRE_CORE="${PAKFIRE_CORE}" \ + PAKFIRE_TREE="${PAKFIRE_TREE}" \ NAME="${NAME}" \ SNAME="${SNAME}" \ VERSION="${VERSION}" \
Hello Michael,
thanks for this awesome patchset and functionality.
This hopefully will make testing and getting feedback for new core updates or updated packages much easier and speed up testing and deployment of them.
I had a look on the single patches and so far they looks good for me.
Best regards,
-Stefan
Reviewed-by: Stefan Schantl stefan.schantl@ipfire.org
This patchset makes testing easier in IPFire 2.
Since we are now trying to use the nightly builds more, pakfire is now automatically configured to use the packages from the correct tree.
That means that testing add-ons will be easier without any manual changes of any configuration files. Yay.
Additionally, there is now a dropdown on the pakfire page where users can change from one tree to another one which makes testing core updates easier, too.
Please review my changes and let me know if I messed anything up.
Best, -Michael