Skip to content

Commit 524bc44

Browse files
authored
Merge pull request #167 from yast/coreutils-cat
adjust testsuite to pass also with newer coreutils-9.6
2 parents a16fc0b + e9308e8 commit 524bc44

8 files changed

Lines changed: 25 additions & 15 deletions

File tree

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
[bash] ShellCommand.cc(shellcommand):78 /bin/cat: tests/missing: No such file or directory
2-
[bash] ShellCommand.cc(shellcommand):78 /bin/cat: tests/missing: No such file or directory
3-
[bash] ShellCommand.cc(shellcommand):78 /bin/cat: tests/missing: No such file or directory
1+
[bash] ShellCommand.cc(shellcommand):78 cat: tests/missing: No such file or directory
2+
[bash] ShellCommand.cc(shellcommand):78 cat: tests/missing: No such file or directory
3+
[bash] ShellCommand.cc(shellcommand):78 cat: tests/missing: No such file or directory

agent-system/testsuite/tests/bash.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
(1)
66
($["exit":0, "stderr":"", "stdout":""])
77
($["exit":0, "stderr":"", "stdout":"Software is like sex. It's better when it's free.\n"])
8-
($["exit":1, "stderr":"/bin/cat: tests/missing: No such file or directory\n", "stdout":""])
8+
($["exit":1, "stderr":"cat: tests/missing: No such file or directory\n", "stdout":""])
99
($["exit":42, "stderr":"", "stdout":"life\n"])
1010
(true)
1111
(true)

agent-system/testsuite/tests/bash.ycp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
}
1616

1717
{
18-
return SCR::Execute (.bash, "/bin/cat tests/missing");
18+
return SCR::Execute (.bash, "cat tests/missing");
1919
}
2020

2121
{
@@ -27,7 +27,7 @@
2727
}
2828

2929
{
30-
return SCR::Execute (.bash_output, "/bin/cat tests/missing");
30+
return SCR::Execute (.bash_output, "cat tests/missing");
3131
}
3232

3333
{
@@ -47,7 +47,7 @@
4747
}
4848

4949
{
50-
any ret = SCR::Execute (.bash_background, "/bin/cat tests/missing") == 0;
50+
any ret = SCR::Execute (.bash_background, "cat tests/missing") == 0;
5151
sleep(1000);
5252
return ret;
5353
}

libycp/src/YCPList.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include "ycp/y2log.h"
2424
#include "ycp/YCPList.h"
2525
#include <algorithm>
26+
#include <functional>
2627
#include "ycp/Bytecode.h"
2728
#include "ycp/Xmlcode.h"
2829
#include "ycp/YCPCodeCompare.h"
@@ -115,7 +116,8 @@ YCPListRep::swap (int x, int y)
115116

116117
bool YCPListRep::contains (const YCPValue& value) const
117118
{
118-
return find_if(begin(), end(), bind2nd(ycp_equal_to(), value)) != end();
119+
using namespace std::placeholders;
120+
return find_if(begin(), end(), std::bind(ycp_equal_to(), _1, value)) != end();
119121
}
120122

121123

libycp/src/include/ycp/YCPCodeCompare.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
* "sort (`a, `b, l, ``( a[0] < b[0] ))"
2929
* Passed to std::sort
3030
*/
31-
class YCPCodeCompare : public std::binary_function <const YCPValue &, const YCPValue &, bool>
31+
class YCPCodeCompare
3232
{
3333
private:
3434
SymbolEntryPtr se1;
@@ -44,8 +44,8 @@ class YCPCodeCompare : public std::binary_function <const YCPValue &, const YCPV
4444
{
4545
}
4646

47-
result_type operator () (first_argument_type a,
48-
second_argument_type b)
47+
bool operator () (const YCPValue & a,
48+
const YCPValue & b)
4949
{
5050
se1->setValue (a);
5151
se2->setValue (b);

libycp/src/include/ycp/ycpless.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
* Compares two YCPValues and returns true if the first value is less than the
3333
* second one, false otherwise. Optionally the comparison is locale aware.
3434
*/
35-
class ycp_less : public std::binary_function<YCPValue, YCPValue, bool>
35+
class ycp_less
3636
{
3737

3838
public:
@@ -57,7 +57,7 @@ class ycp_less : public std::binary_function<YCPValue, YCPValue, bool>
5757
* Compares two YCPValues and returns true if they are equal, false otherwise.
5858
* Optionally the comparison is locale aware.
5959
*/
60-
class ycp_equal_to : public std::binary_function<YCPValue, YCPValue, bool>
60+
class ycp_equal_to
6161
{
6262

6363
public:
@@ -82,7 +82,7 @@ class ycp_equal_to : public std::binary_function<YCPValue, YCPValue, bool>
8282
* Compares two YCPValues and returns true if they are not equal, false
8383
* otherwise. Optionally the comparison is locale aware.
8484
*/
85-
class ycp_not_equal_to : public std::binary_function<YCPValue, YCPValue, bool>
85+
class ycp_not_equal_to
8686
{
8787

8888
public:

package/yast2-core.changes

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
-------------------------------------------------------------------
2+
Mon Jan 20 10:41:17 UTC 2025 - Martin Vidner <mvidner@suse.com>
3+
4+
- adjust testsuite to pass also with newer coreutils-9.6
5+
(gh#yast/yast-core#167)
6+
- Stop using std::binary_function, deprecated since C++11
7+
- 5.0.3.
8+
19
-------------------------------------------------------------------
210
Wed Jan 10 16:22:03 UTC 2024 - Martin Vidner <mvidner@suse.com>
311

package/yast2-core.spec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
%bcond_with werror
2727

2828
Name: yast2-core
29-
Version: 5.0.2
29+
Version: 5.0.3
3030
Release: 0
3131
Url: https://github.com/yast/yast-core
3232

0 commit comments

Comments
 (0)