Git Product home page Git Product logo

yast-core's Introduction

YaST Core

Workflow Status Jenkins Status

The core part of YaST providing the components system, the agents infrastructure and the implementation of the YCP language for backward compatibility.

Further information about YaST core can be found in the included documentation. For more general information about YaST, check its homepage.

yast-core's People

Contributors

adrianschroeter avatar ancorgs avatar andreas-schwab avatar aschnell avatar coolo avatar cornelius avatar dgdavid avatar dirkmueller avatar dmacvicar avatar dmajda avatar gabi2 avatar ggardet avatar jdsn avatar jreidinger avatar jsrain avatar jsuchome avatar kkaempf avatar kobliha avatar lslezak avatar marxin avatar mchf avatar mlandres avatar mvidner avatar schubi2 avatar shundhammer avatar teclator avatar tgoettlicher avatar yast-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

yast-core's Issues

Incorrect theme when invoked via KDE Wayland.

yast/yast-installation#1077 (comment) demonstrates the correct appearance when using X11, whereas undermentioned is incorrect (default) colouration, expectedly inherited from the superuser:

image

  1. change root global theme to test whether inheritance is correct hypothesis
PS /home/rokejulianlockhart> sudo lookandfeeltool --apply org.kde.breezedark.desktop
[sudo] password for root: 
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, xcb.

NativeCommandExitException: Program "sudo" ended with non-zero exit code: 1.

Wrong comment_before returned for <fun_def>

Consider the following file:

{
  void f() {
    return nil;
  }
}

XML that ycpc produces when called by Y2R seems to contain wrong comment_before for <fun_def> โ€” it contains two newlines, instead of just one:

<?xml version="1.0" encoding="UTF-8"?>
<ycp version="2.15.8.39280">
  <block kind="file">
    <symbols>
      <symbol global="1" category="filename" type="&lt;unspec&gt;" name="/tmp/y2r20130708-17363-etpazd"/>
      <symbol category="function" type="void ()" name="f"/>
    </symbols>
    <statements>
      <stmt><fun_def name="f" comment_before="&#xA;  &#xA;   ">
    <block kind="def" comment_before=" ">
      <statements>
        <stmt><return comment_before="&#xA;    " comment_after="&#xA;  "><yconst comment_before=" "><const type="void"/></yconst></return></stmt>
      </statements>
    </block>
</fun_def></stmt>
    </statements>
  </block>
</ycp>

It seems that part of comment_before is appended twice. If I replace function definition with structurally similar while statement, comment_before is correct:

{
  while (false) {
    y2milestone("m1");
  }
}
<?xml version="1.0" encoding="UTF-8"?>
<ycp version="2.15.8.39280">
  <block kind="file">
    <symbols>
      <symbol global="1" category="filename" type="&lt;unspec&gt;" name="/tmp/y2r20130708-18310-90tn7r"/>
    </symbols>
    <statements>
      <stmt><while comment_before="&#xA;  " comment_after="&#xA;">
  <cond><yconst comment_before=" "><const type="bool" value="false"/></yconst></cond>
  <do><block kind="stmt" comment_before=" ">
  <statements>
    <stmt><builtin name="y2milestone" comment_before="&#xA;    " comment_after="&#xA;  " args="1"><element><yconst><const type="string" value="m1"/></yconst></element></builtin></stmt>
  </statements>
</block>
  </do>
</while></stmt>
    </statements>
  </block>
</ycp>

XML serializer does not escape some characters

When executed in comment-enabled mode, some unusual (but legal) whitespace characters are emitted unescaped into XML comment_before and comment_after attributes. One such example is form-feed (0x0C), which caused trouble in Y2R because Nokogiri didn't parse the XML which contained it correctly.

If fixed all form feed cahracter occurences in the following pull requests:

It would still be good to fix the XML serializer to skip all such characters (as they apparently can't be included even by reference like &#12;). See http://www.w3.org/TR/xml/#charsets for the list of allowed ones.

tests fail in 2038

While working on reproducible builds for openSUSE, I found that yast2-core fails to build in 2038.

# of expected passes           522
# of unexpected failures       1

To reproduce, use

osc build --vm-type=kvm --clean --noservice --build-opt=--vm-custom-opt="-rtc base=2038-01-25T00:00:00" --alternative-project home:bmwiedemann:reproducible openSUSE_Tumbleweed

[y2r_fixes] xml parse tree writes non-C numbers

It writes 0,5 instead of 0.5:

$ cat half.ycp 
{
  float half = 0.5;
}
$ LANG=cs_CZ.UTF-8 ycpc -c -x -o /dev/stdout half.ycp |& grep assign
  <stmt><assign name="half"><const type="float" value="0,5"/></assign></stmt>

One consequence is a failing test yast2/library/types/testsuite/tests/String.rb

Lost comments

Given the following YCP code:

{list l=[/*b1*/1/*a1*/,/*b2*/2/*a2*/,/*b3*/3/*a3*/];}

I get the following XML from ycpc in comment-enabled mode:

<?xml version="1.0" encoding="UTF-8"?>
<ycp version="2.15.8.39280">
  <block kind="file">
    <symbols>
      <symbol global="1" category="filename" type="&lt;unspec&gt;" name="/tmp/y2r20130711-8472-1qg7ee"/>
      <symbol category="variable" type="list" name="l"/>
    </symbols>
    <statements>
      <stmt><assign name="l" comment_before=" "><list size="3" comment_before="/*a3*/"><element><yconst comment_before="/*b1*/"><const type="int" value="1"/></yconst></element><element><yconst comment_before="/*b2*/"><const type="int" value="2"/></yconst></element><element><yconst comment_before="/*b3*/"><const type="int" value="3"/></yconst></element></list></assign></stmt>
    </statements>
  </block>
</ycp>

Comments /*a1*/ and /*a2*/ are missing.

ABI-incompatible language bindings are loaded unconditionally

To facilitate implementing YaST modules in various languages, yast2-core loads the optional language binding libraries, /usr/lib*/YaST2/plugin/libpy2lang_*.so, packaged in yast2-*-bindings.rpm.

But these are loaded even when we have compiled an incompatible core (eg. lexer_comments, because of adding comment members to YCode) and want to run that from the working copy. This is the cause of @dmajda's crash. We've worked around it by using ./configure --prefix=/nosuchpath in his WC. (Another workaround is to uninstall the bindings)

Also, IIUC, this was the cause of the crashes in Jenkins last week. @jreidinger can you confirm that and comment on my proposed solution?:

I think we should have a switch to enable/disable the language plugin loading. It should stay enabled by default for compatibility. I propose an environment variable, Y2DISABLELANGUAGEPLUGINS=..., to be checked in Y2LanguageLoader::Y2LanguageLoader ().

Fails to build with GCC 13

Fails due to the following header changes:
https://gcc.gnu.org/gcc-13/porting_to.html#header-dep-changes

$ osc co openSUSE:Factory/yast2-core
$ cd $_
$ osc build --alternative-project devel:gcc:next
...
[   26s] y2changes.cc: In function 'std::string y2_changesfmt_prefix(logcategory_t)':
[   26s] y2changes.cc:135:24: error: 'time' was not declared in this scope; did you mean 'utimes'?
[   26s]   135 |     time_t timestamp = time (NULL);
[   26s]       |                        ^~~~
[   26s]       |                        utimes
[   26s] y2changes.cc:136:29: error: 'localtime' was not declared in this scope
[   26s]   136 |     struct tm *brokentime = localtime (&timestamp);
[   26s]       |                             ^~~~~~~~~
[   26s] y2changes.cc:138:5: error: 'strftime' was not declared in this scope; did you mean 'st_ctime'?
[   26s]   138 |     strftime (date, sizeof (date), Y2CHANGES_DATE, brokentime);
[   26s]       |     ^~~~~~~~
[   26s]       |     st_ctime
[   26s] make[4]: *** [Makefile:569: y2changes.lo] Error 1

Losing comments for <locale>

Consider the following YCP code:

{
  textdomain "foo";

  string s = /* before */ _("bar");
}

When I run ycpc -cx on it with Y2PARSECOMMENTS=1, I get the following XML:

<?xml version="1.0" encoding="UTF-8"?>
<ycp version="2.15.8.39280">
  <block kind="file">
    <symbols>
      <symbol global="1" category="filename" type="&lt;unspec&gt;" name="../testcases/units.ycp"/>
      <symbol category="variable" type="string" name="s"/>
    </symbols>
    <statements>
      <stmt><textdomain name="foo" comment_before=" &#xA;  "/></stmt>
      <stmt><assign name="s" comment_before=" &#xA;&#xA;   " comment_after="&#xA;"><locale domain="foo" text="bar"/></assign></stmt>
    </statements>
  </block>
</ycp>

The XML does not contain the /* before */ comment.

The minimal testcase comes form String.ycp.

EOF in a string makes the parser loop

With yast2-core from YaST:Head:ruby, I found this while typing this into @kobliha's y2r-editor:

{
  // unterminated string before EOF
  any hello = "World!

It hangs the editor, and ycpc -c shows an endless stream of

snippets/string-loop.ycp:4  [Parser] unterminated string constant

Only kill -9 helped.

ag_ini do not delete file after writing the file

// Write a value into file
SCR::Write(".network.value.\"eth0\".IPADDR", "1")
SCR::Write(".network", nil)

// delete the file
SCR::Write(".network.section.\"eth0\"", nil)
SCR::Write(".network", nil)

In this case, /etc/sysconfig/network/ifcfg-eth0 should be written (it is) and removed subsequently. But when the script is done, the file is still present.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.