FS#46382 - [systemd] PKGBUILD: rm -rf _directories_we_need_later?

Attached to Project: Arch Linux
Opened by Que Quotion (quequotion) - Monday, 21 September 2015, 21:12 GMT
Last edited by Dave Reisner (falconindy) - Tuesday, 22 September 2015, 18:39 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To Thomas Bächler (brain0)
Dave Reisner (falconindy)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
Maybe, instead of "rm -rf".... these should be "mkdir" ?

### split out manpages for sysvcompat
rm -rf "$srcdir/_sysvcompat"
install -dm755 "$srcdir"/_sysvcompat/usr/share/man/man8/
mv "$pkgdir"/usr/share/man/man8/{telinit,halt,reboot,poweroff,runlevel,shutdown}.8 \
"$srcdir"/_sysvcompat/usr/share/man/man8

### split off runtime libraries
rm -rf "$srcdir/_libsystemd"
install -dm755 "$srcdir"/_libsystemd/usr/lib
cd "$srcdir"/_libsystemd
mv "$pkgdir"/usr/lib/lib{systemd,udev}*.so* usr/lib

Failure in package() for both systemd-sysvcompat and libsystemd because these directories don't exist.

I tried with mkdir and successfully built both packages.

Additional info:
* package version(s)
* config and/or log files etc.


Steps to reproduce:

Try to build libsystemd or systemd-sysvcompat from ABS.
This task depends upon

Closed by  Dave Reisner (falconindy)
Tuesday, 22 September 2015, 18:39 GMT
Reason for closing:  Fixed
Additional comments about closing:  systemd-226-2
Comment by Que Quotion (quequotion) - Monday, 21 September 2015, 21:13 GMT
Oops, wrong category.

No chance to fix that?
Comment by Dave Reisner (falconindy) - Monday, 21 September 2015, 22:18 GMT
These packages build without problems if you build the entire suite of packages, and don't try to cherrypick individual ones...
Comment by Dave Reisner (falconindy) - Monday, 21 September 2015, 22:19 GMT
Additionally, isn't this something you should have encountered when you filed  FS#46214 ? Did you not think/work through your suggested fixed entirely?
Comment by Doug Newgard (Scimmia) - Monday, 21 September 2015, 22:49 GMT
Ideally, package functions should never make changes to $srcdir.
Comment by Que Quotion (quequotion) - Tuesday, 22 September 2015, 12:15 GMT
I'm reporting it because it's a problem; not because I think it's a problem.

This was not a problem when I reported the other bug; the PKGBUILD has changed since then.
Comment by Que Quotion (quequotion) - Tuesday, 22 September 2015, 12:17 GMT
Also, this was not caused by the solution to the other bug. I can understand why you bring it up--only because I am personally associated with both bugs--but my proposal for the other bug was not the cause of this one.
Comment by Dave Reisner (falconindy) - Tuesday, 22 September 2015, 12:29 GMT
> This was not a problem when I reported the other bug; the PKGBUILD has changed since then.
> Also, this was not caused by the solution to the other bug.

But the only changes were a version bump and the pkgname -> pkgbase bump. Can you point to the specific commit which caused this? I don't think you really can, because the code in question has existed since we split systemd into multiple packages...
Comment by Que Quotion (quequotion) - Tuesday, 22 September 2015, 13:41 GMT
Do we have to do this? I'm not doing this for fun; I'm doing it to have a better repository.

You're right, they aren't recent changes. I'm not sure why this wasn't a problem before--maybe I ended up packaging everything because packaging just what I need was broken.

What's gone wrong is that files are moved into place in package_systemd() that will later be packaged by package_libsystemd() and/or package_systemd-sysvcompat().

This is unnecessary and could be done better.

It is safer and more logical to remove the unneeded files from the systemd package and package the files needed for libsystemd and sysvcompat from $srcdir.

If a user is building only one of the packages, the files won't be there to be packaged.

If you need me to make a diff for you, I'm already working on it.

Your implication that using "makepkg --pkg" is the problem is offensive. You can't dictate that users must install all of the packages of a split package (or every split package).
Comment by Dave Reisner (falconindy) - Tuesday, 22 September 2015, 13:50 GMT
> If you need me to make a diff for you, I'm already working on it.
I don't. I expect that I'd spend as much time testing it as I would writing it myself.

> You can't dictate that users must install all of the packages of a split package (or every split package).
Oh, sure I can (by removing the split). However, I'm doing no such thing. I'm only suggesting that you *create* all the packages. You don't need to install them all.
Comment by Dave Reisner (falconindy) - Tuesday, 22 September 2015, 14:06 GMT Comment by Que Quotion (quequotion) - Tuesday, 22 September 2015, 14:23 GMT
>I don't.
Why do you have this attitude? I am proposing to improve this package.
Split packages need better standards, especially if they are going into the core repository.

See attached patch for improvements. You can test it if you like, but I already have.

It's six lines shorter and avoids making changes in $srcdir.
Comment by Que Quotion (quequotion) - Tuesday, 22 September 2015, 14:25 GMT
>makepkg in the future

The very next comment on that asks for the missing rationale.
Comment by Dave Reisner (falconindy) - Tuesday, 22 September 2015, 18:37 GMT
> You can test it if you like, but I already have.
Your patched PKGBUILD still fails if you run 'makepkg -Rf --pkg libsystemd' (or systemd-sysvcompat) twice.

Loading...