 Hello, please welcome our next speaker Florian Festi who will be talking about new features in RPM in Fedora 24 So as you may have noticed we've put a new release actually not in Fedora 24 But in Fedora 23, which basically means the new features can be started to be used now Because it's always takes like a release or something Maybe even two before the builders get up-to-date and you actually can use the stuff without Damaging everything and builds no no work. So if you're talking about 24, it's basically 23 plus one So I'm going to because the last release was pretty big new feature-wise because RPM is known to be rather slow-moving but Not this time. So we'll just start with a lot of a couple of smaller stuff We will just skip over and then go to the two big things we added just file triggers and Boolean dependencies, which we will dedicate a bit more time to because they are More complicated so it's just Dive into one thing we added because I I don't I think Harald wanted this see here Harald. Oh, yeah. Yes. It's probably his fault. So we added remove path Post fixes, which basically allows you to chop up the end of a file name Which allows you multiple file names actually ending up being the same the problem is as we have a shared Install directory for all the sub packages you cannot have the same file with different contents and different sub packages Which is annoying if you want to ship like different configurations for different use cases Of course you want to set conflicts for these packages, but they are just a valid use case and you just couldn't do it and So that's basically the quick fix for this. It's It's still not 100% as it should because there are implications with dependency generators We don't talk about this but so there will probably be We will revisit it and clean it up But for the most simple cases it just works fine. You basically give a list of column separated and File endings that they are basically just chopped off when the packages are assembled As we are as file names. We also enabled Clothing with How does he actually called with this Curly curly braces The net because he can be used either in the API or on the file list So if you have files, which are basically named the same with exception of some middle part You can do that now. It's not a big thing, but I think we broke something Yeah, I think we fixed something else which showed up some packages which used that which actually never worked But it was hidden Didn't work again. So we said well at least as a as an apology We will enable it and it works now And another thing that's actually not in the release, but we've back ported it is just now for for for the jealousy people We're not here but Just as we made it decided they don't need it anymore, but we basically promoted missing okay to being a full File attribute before this you could have a config missing okay Which means you have a config file that you are allowed to delete like in some dot these directory HDPD dot the directory and of course you may want to delete the file and The nice thing is with the config as it is a config file. It's not restored on update but the jealousy people wanted actually not Wanted to use it for different use case and use case was basically having a translation file does then merge it to some library and in some lump some database basically and then you can throw it away to save the space but If it is a config file, it's not restored That means on an update you cannot update a database because the file is not even put there And that was kind of annoying and now you can basically do that So the use cases you have data that needs to be merged on installation and then be thrown away And it's not very much in the rpm spirit, but there are use cases and So we be supported now Then there are a couple other things which are not so much spec related I that Parameters for rpm build so you can actually do everything you do with the normal Building also from an srpm They are you there also is like rebuild and recompile But all the intermediate stage the stages could not be passed to the command line and So we have basically minus hour for rebuild and so you can basically go to any step to the from the source rpm I don't know if it's probably not that important for the for the for the raw workflow But there are other people building packages on that comes from circumstances There's another big thing which are those security. I am a flex that's something that was done from IBM basically it's It's basically Signatures that are put into the file system so the kernel can check that the files didn't change So it's basically one of the power to make trusted computing actually work But I don't know if it's fedora wants to do that My guess is not I'm not sure I have only a very rough idea about the details more under what does it break in the rpm AP? Code stuff not so much. What does it break on your system? When you're doing this when you're calculating the signatures Yeah, right you cannot do it for directory contents because That's not part directory content in that sense. It's not part of offer of our package So the package doesn't know what else what everything ends up in a directory So Yeah, I don't know the IBM guys actually girl did it Yeah, maybe we will send we will end up maybe we will delete it in like three years because no one uses it but It's the first step to actually make Defines more trusted So another thing that actually panel still did it was was doing a check for for for For the encoding it's currently still disabled in a sense It only gives a warning, but I don't know if Fedora at one time is brave enough. They can switch it on and basically prevent Spec files with funny characters from building And make sure they are all properly utf-8 encoded Which is turns up all kind of problems, especially with young don't know how DNF reacts if it gets Crazy stuff from from from rpm because rpm and Used to not care so if you just put some randomly encoded bytes in there you get bytes in bytes out rpm just makes a comparison on the bits and is happy if they match or and if it's something else like a description doesn't even Get it do something with it and some higher level languages like Python are pretty upset if they get wrongly encoded bytes So that's the way to at least Mitigate the problem Then we added what recommends and and what what supplements and whatever stuff Which we should have added like last year when we added the week dependencies, but for some reasons No one noticed that there are missing so I don't know who forgot to check that so we added that and You probably still this time for goddamn again, but I Talk about this next year, so then we come to the The bigger features one of the large one is file triggers That's something we have tried to do for quite a while There has been a previous attempt which didn't work out that great. So it's got deleted again This time we are basically using the same mechanisms we use for normal triggers and Just glorify them to to do more which Has the the thing is normal triggers we always kind of discourage them being used so That the story also thing so there's this old Disney movie the old Disney Robin Hood I don't know if anyone old enough to know that so the cartoon thing and yet There's there's trigger is a character in there and it's basically what what triggers are It's one of the town guards. It's a voucher with a crossbow, which is safe And will will not fire unless you point it into random directions Basically, that's what the triggers are basically are so they are sitting there waiting for the wrong thing walking in front so what our file triggers they are basically scriptlets that are executed if is if files are Installed or removed from given locations so they can basically keep care of Places and files being pushed there and the nice thing is in a In opposite to do normal scriptlets which are basically tied to the package themselves They can be centralized and the files can be elsewhere in other packages So you can basically put the logic in one place where it belongs and and have all the other packages putting just files They're not carrying how it's implemented so you can actually change things like without going through hundreds of packages and just their files so To understand how they work you basically need to know how nervous triggers work So they're all but new but I still will go a bit over them. They are basically Four of them the names are a bit odd because Historical reasons, so I'm sorry, but we're not changing them Get used to them Or look them up if you need one because no one can actually Remember which name actually does what so they are basically can be run before the package installs after package installs before Package uninstalled so after the package uninstalled, but the names are kind of weird also with As they are scriptlets they also inherit all the weirdness of normal scriptlets like to install being done before the array So that's the truth. You all hopefully are familiar with so that's the next thing to keep in mind so there comes some baggage with that but That's how it is. I mean No reason why that should change in rpm So what else on triggers? They get Executed if the matching package gets installed or or uninstalled depending on what type of trigger is this so the execution is Independent of the package that actually contains it so it's something happening when somewhere else something happens. That's the trick The problem is the triggers are also executed if the package containing it or is installed or updated That's done on purpose To allow the scriptlet to to to work on the files that are or packages that have been installed before or to update something In case you need to change the implementation of whatever the trigger does so So if you're if you're taking care of something like updating some cash You can rebuild the cash if the cash former changes Even if only your package changed not you don't have to reinstall all the other packages, which would actually trigger the cash update so that's Something to be aware of that a trigger can fire when you don't expect it so think about the crossbow being pointed in all kind of directions probably yours and and Make sure that you're broken your prick your trigger so they they don't break anything if they get discharged on accident So gun safety them is anything So in file triggers are basically the same thing in opposite to the normal triggers we have One one trigger level less because we don't do anything before the package gets installed because there are no files there And so we kind of figure that's not that useful to Do something with files that are not there yet But in addition to this to those three Times so basically after the files got installed before the files get removed on after the files get removed There's another set of triggers which run Basically At the beginning or the internet transaction so that trigger us we're only run once per transaction The idea here is the problem is one things why by the scripted also fucking annoying is because they're executed so many times Every time you have just been up a bash or whatever and it takes a lot of time So when people are complaining about rpm being slow. Yes rpm does some things very so thoroughly But most of the time is actually spent in some triggers or some scriptlets Colonel I'm looking at you Which Run all kind of software and it just takes time and the less we execute them less Often we have to spin up a bash or whatever that the more quickly we can do updates So that's the idea with the trans triggers so the they're basically either Done after installation of everything or before the transaction For files that are going to be removed or after transaction for files that are then removed So the question is if you're executed after the transaction, how do you know what actually happened? and so we actually Give you the list of files that are affected through the com through the standard in so you can read them If you're interested if you're just updating some kind of cash, you may not be interested in just As they are scripted they share all the other Parameters with the normal scriptlets so you can give an interpreter and stuff like this We added also a priority which allows you to basically order the the file triggers In which to give an order in which they are executed one after the other because that might be Important for some use cases Maybe not Maybe there so we basically have yes So You don't have to but if The the thing with Lua is every script you have to when you have a strip lab you have to ask yourself When is this going to be executed? And if it is executed at the beginning of a transaction with an empty system you cannot call bash because there's no bash there That's basically if you have Installation You have you have you have the normal trigger file triggers which are basically installed before before the file now there's only after the files are laid down so That should probably Yeah, so so if you're if you're a core package which is installed before bash You probably need to use you are so but Maybe if you if you're dead if you're dead core, maybe you can do without file triggers. I don't know Maybe you have other things to do I don't yeah, but for those cases you will you will need a lure Yeah, but it's basically one of those all those all those other scriptlets stuff still applies So that and then lua script scripting is basically one of those other things And yeah Now lua is actually part of rpm itself So it's built in it's it's part of the rpm process Which might come from some magic place like an anaconda or whatever or order the the world outside of your install route And so that's why it's used by we're using lua It's part of rpm. So it can be used even on an empty system. That's the whole what's all fuss is about so and I did a quick trap on the on the on the on the Spec files of fedora of the current fedora tree. It looks like it's pretty Just a lot already the thing is one one thing a eight nine Scriptlets is not much but you have to keep in mind that each of those triggers basically replaces all the script Let's in the all the packages that put files there. So Yeah, and so so even if if the whole distribution in the end has only maybe 30 40 50 of those triggers That's a good. So that's a huge thing because it replaces maybe five ten 20 50 times more and of scriptlets and that's I think where we want to go in the long run And all of those that we have already are basically updating some caches. So they are very simple They're basically just do whatever whatever cash tool update thing. They have they just call it and be done with it With the exception of system D which actually reloads the configuration of the system. They mod you also whatever they are called units So You can choose I Should have looked it up. I've looked into some but I don't remember Yeah, yeah that there should be transaction unless it's a cash that's maybe needed by other scriptlets That's basically the the the the whole script that story again If you need to update something that's needed during the transaction do it now otherwise use the transaction Scriptlet Okay, that's File triggers. There's a bit of documentation. I heard Next thing we need to get going one question one quick question Yeah, so there's a lot of scriptlet which the crossbow is pointing at and Which are likely to get shot So the next next big thing is is the Boolean dependencies if there are no questions left for the file triggers Otherwise we can do question at the end it's One of my big things would I wanted to do for for for like ages and it's finally there It's basically you can now use Boolean expressions within dependencies It is important to understand that the two parades will stay simple. I actually thought about also making them Boolean expressions but Things get crazy if you just true that the thing is With provides being simple The stuff that our PM dust can still basically be done Statically like just checking every Boolean expression if it is true or false If you start having Boolean expression on the other side, you basically have to do what DNF does like real depth solving checking what Stuff actually needs to be what to get to a thing and we said no Basically right now there are four operators. It's and it's or it's if which is basically the reverse Implication and there's if else which basically gives the forward applications as a third term Yes, that that's that's an excellent question did I say I will talk about what requires next year the thing is it currently doesn't really work and One of this is because we need to figure still figure it out and and the next thing is there's there for the reverse Query there's no not really an answer Which which which fits the same question that we had before it basically you can either say well It only fits if you actually really Match the full term or you can say well these are all the terms that might fit somehow some of them might even Prevent that thing from matching if it's in the wrong place of the term, but we will show it to you anyway So that's yeah, I still have to look into this to be honest. So Yeah Yeah, it's an issue and we will document it So I have an example here So you can The thing is It is as a feature. It is much more Complicated than for example the files triggers the file triggers is you have a use case You have script as you need to run and you just use it and it works The problem here is it's more like a toolbox and to be honest. I also have I have a few ideas How it can be used but it's very very unclear What is actually going to be like to be why they're using that in the distribution and what corner cases people might be able to come up to actually Do with it? It also interacts very nicely with the week dependencies. We just added so you have a huge Plectora of things you can do now and it's difficult to get a Crip on what actually should be done. So there might be we can do that in the little discussion there in Question session The example we have here is is the stuff that's actually currently been worked on which are like file language packages And you can basically do Supplement which is a weak reverse dependency. It's basically so it would be part of the of the language pack and it says Supplement which basically means install me if If my main package gets installed and the language I'm providing is also installed So what the people are working right now is basically having? Meta packages that are empty that basically represent The language and although long packs can basically attach to their and be installed automatically if the language support for this Given language is installed on the system. So this is also basically Replacing the if clauses we have in in comms, which has been traditionally used mainly for those language stuff with some exceptions, but I Don't know is it still in there? Do you anyone know about comms? I haven't looked for a while Okay, but Okay, so So I hear Conditionals are still in comms, but they are no longer used because the language Leng pack plug-in does the work because the comp stuff didn't work so well basically for the rows in the back So I was grabbing through through the through the repository and one was wondering home. How is it used must be great and Yeah, there's exactly one package which has one and basically it looks a bit like like this one and that's it. So No one cares So so so at least So so so so instead to to lift myself up a bit I looked what weak depths are actually doing in the distribution and looks like they Arrive there, so there the numbers are Compared to all dependencies in the dispute may be not that big, but it's looks like there's they are gaining subtraction and and and getting used and they are basically are also getting used away That is expected like the reverse Rect dependencies are used much less Only for a few cases which is I've not checked them yet because that's not my problem But so maybe some don't should But they are used much less than the forward ones which are supposed to be used as a default and They are used on both levels. They're slightly stronger ones That are used to basically allow people to be install packages which would otherwise be selected and really the suggests which are basically hints Telling the depth solver which package to choose in case there are multiple options And so both of those are used To a good degree could be more will get more. I'm optimistic about this so but As as in we hear here That's not the thing about one package using it. It's not the real whole picture. There are people are working on this G lip see mainly will is currently working on splitting out basically all the Translations into sub packages which end up like 180 if I thought if I if I if I understood it correctly, so it's it's It's a bunch Of course as always an rpm if you try something completely new you run into issues Turns out some lip solve and especially your vapor query is not yet 100% up to the task and Also rpm pro horribly when they try to generate 180 sub packages out of one macro for some reason there's some buffer that Wasn't just dynamic enough and No, no 768 But as far as I see Lubos fix that and so they're on good track and I hope We will get to the point where we can then standardize that their solution Maybe even put it as a standard macro in rpm upstream And so so other people will have much less work to do to split out their stuff How much is this going to be used still up to debate? That's not really an rpm upstream question My guess is that there rather be maybe a handful of packages were big enough to really split out everything into hundreds of sub packages, but That's up to this for other people to decide how fine that the distribution wants to to train that I Expect there will be at least a handful of packages. Maybe maybe more we'll see So I want to say a bit more how the how it works Because the thing is if you come with with the normal package or mindset and read those relations It's not like like the like the Boolean expressions change much But the the the default mindset at least I have does no longer work So if if you read your three Package X requires this package and for some things these works nicely. It requires this package or this package So so so the the normal flow of reading it like a sentence works But there are some points where it breaks down and you actually have to have a have a model in your mind how it's actually working and and It not just being some English sentence with parentheses is in in between and so the thing You have to realize it's basically whenever there's a name or name and adversion comparison. This is Translated into Boolean value whether you find a match or not So so if you require us package X and package X is there. That's getting a true If packages not there in the to be completed translations Of course always we are always talking of of the future basically after the translation has successfully run If it's not there then it is this is going to be a false and Everything else is just Boolean operation. So the end is just as a normal Boolean end It requires both sides to be true. They're all requires one side to be true and if It's a verse which requires we have to fight for this so So whenever things get fishy you can basically Take a step back and say well, that's all Boolean values and I can figure out what expressions means by just Imagining what's happening if some parts get true or false and how this gets then combined And in the end basically most of the dependencies needs to get true to work or Conflicts need to be false. Of course, otherwise it is a conflict and you cannot install. So it's basically a Requires with a knot in front For those who think that's more easy to understand but most probably don't so The thing that's a bitch. So and then or or is actually pretty simple to understand what's a bit tricky is the if operator Because it works very well if takes out if the whole term is like positive So if you have for example requires package a if package B that's nice and easy if package B is you also require the first package and you Basically, you have to install them both then and if you just install the first packets It doesn't matter because package B is not there and we don't care then But of course we don't care means the requires as a whole is true the whole term has to be true, so the requires is fulfilled and If we now put that in an in an conflicts Being true is not like the default case We are looking for Because of course you have to be false to for the conflict not to effect or not to stop the transaction so if you say conflicts package a if package B and package B is not there then the whole term is true and you have a conflict and That's probably not what you want if you want it fine, but then you have something Weird complicated and you've probably thought about it long enough that you don't need my talk but but if So the general rule is if you can use and instead and Think it's the same thing. It's probably not and you usually should use and So that that's basically the thing to take away So that these ifs as soon as they are used negatively or or in the second example It's proud of some of some or chain where we are you say well If nothing happens, it's okay if it's false because someone of the other packages then should be installed and So so so if the default basically should be zero or false then the if is not typically what you're looking for and If you replace the if by an end and then the whole thing then actually still makes sense then Go go with it is is I don't know Do I need more clarification on this if stuff what it actually does I mean you can do of course So so so truth tables and stuff like this Yeah, there's some documentation dude anyone needs the Morgan's rule just just Hmm so that sort of else is basically you say package a if package B else package C And it's it's chase. Yeah, I should have had an example here On on the documentation page. There's an example for this This basically means if the package is installed and we require this package and it's not installed you still require another package It's Not really necessary to have this as an operator So you can do that otherwise, but it's I think the SunTux is so nice that I just had to add it You can basically make it with a second line How do I get it out of my mind So if The else means if If not, I'm not doing this by heart So but in the end It's it's basically just an it's just basically a compound Which you can have with two lines of thing one and if and I think one and an end or something Which means the same thing, but if if then else is somehow I think cleaner and it shows more That you have an alternative depending on the package is not being there. So so it's nicer. It's syntactic sugar basically So that's basically it Can you speak a bit up? I can't Yeah, that works. Yeah, I hope The The thing is you have to have the parenthesis for these operators have to be basically the beginning of Words there's some special code which allows like basically closing the parenthesis if there's still some open but Yeah, you should test it but Yeah, the thing is I thought about us first the not operator So the I always had the feeling that the not operator is clearly missing The problem is I have not been able to come up with a use case for it And I ask people to come up with a use case in all the use cases. They came up with where we're like don't do this There's you can do that with a different thing which is more clear and and it just complicated things so if you can have if you can come up with a use case where Where the not operator really is? Useful and actually looks more beautiful than an alternative. Please come to me I probably forgot the second part which answer was no Thank you very much