FS#6818 - unable to create empty package

Attached to Project: Pacman
Opened by Roman Kyrylych (Romashka) - Thursday, 05 April 2007, 15:15 GMT
Last edited by Roman Kyrylych (Romashka) - Monday, 20 August 2007, 10:49 GMT
Task Type Bug Report
Category makepkg
Status Closed
Assigned To Roman Kyrylych (Romashka)
Dan McGee (toofishes)
Architecture All
Severity Very Low
Priority Normal
Reported Version 0.8 Voodoo
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

[roman@home test]$ makepkg
==> Entering fakeroot environment
==> Making package: test 0.1-1 (Чтв Кві 5 18:12:33 EEST 2007)
==> Checking Runtime Dependencies...
==> Checking Buildtime Dependencies...
==> Retrieving Sources...
==> Validating source files with md5sums
==> Extracting Sources...
==> Removing existing pkg/ directory...
==> Starting build()...
==> Removing info/doc files...
==> Compressing man pages...
==> Stripping debugging symbols from libraries...
==> Stripping symbols from binaries...
==> Generating .FILELIST file...
tar: *: Cannot stat: No such file or directory
tar: Error exit delayed from previous errors
==> Generating .PKGINFO file...
==> Compressing package...
tar: *: Cannot stat: No such file or directory
tar: Error exit delayed from previous errors
==> ERROR: Failed to create package file.

However package tarball is created and is valid.
I think this indicates that error handling in makepkg needs improvement.
(application/octet-stream)    PKGBUILD (0.3 KiB)
This task depends upon

Closed by  Roman Kyrylych (Romashka)
Monday, 20 August 2007, 10:49 GMT
Reason for closing:  Fixed
Comment by Dan McGee (toofishes) - Thursday, 05 April 2007, 15:31 GMT
Why does this matter?

Feel free to improve the handling of this with a patch, but it is due to the wildcard selector being used and not being expanded.
Comment by Roman Kyrylych (Romashka) - Thursday, 05 April 2007, 16:58 GMT
Here's the fix.
Now output is:
==> Generating .FILELIST file...
tar: *: Warning: Cannot stat: No such file or directory
==> Generating .PKGINFO file...
==> Copying install script...
==> Compressing package...
tar: *: Warning: Cannot stat: No such file or directory
==> Finished making: test (Thu Apr 5 19:57:55 EEST 2007)
Comment by Dan McGee (toofishes) - Sunday, 08 April 2007, 07:13 GMT
I don't know if we always want to treat failed reads as successes. This could come back to bite us later. This one make take some more thought.
Comment by Roman Kyrylych (Romashka) - Sunday, 15 April 2007, 10:05 GMT
Here is the correct fix. It removes warning completely while not ignoring failed reads.
Comment by Dan McGee (toofishes) - Tuesday, 17 April 2007, 03:07 GMT
I don't know that your latest patch works...I couldn't get that find statement to ever print a list of files, which is a problem. I'll look at this more later, it should be a fairly elegant solution that will do it.
Comment by Roman Kyrylych (Romashka) - Tuesday, 17 April 2007, 06:46 GMT
Sure it works - .FILELIST and package tarball contain correct files.
I've tested it both on that testing PKGBUILD and real package (namely opera-static).
Comment by Aaron Griffin (phrakture) - Wednesday, 18 April 2007, 15:14 GMT
You probably want to use "find ." instead of "find *"
Comment by Roman Kyrylych (Romashka) - Wednesday, 18 April 2007, 17:16 GMT
Maybe, though * works anyway.
Did someone test the 2nd patch?
Comment by Dan McGee (toofishes) - Wednesday, 18 April 2007, 18:00 GMT
Yes, of course i tested it.

dmcgee@dublin /var/abs/local/monotone/pkg
$ ls
etc usr

dmcgee@dublin /var/abs/local/monotone/pkg
$ la
.FILELIST .INSTALL .PKGINFO etc usr

dmcgee@dublin /var/abs/local/monotone/pkg
$ tar czf testpkg.tar.gz .PKGINFO .FILELIST .INSTALL $(find . -false -name .PKGINFO .FILELIST .INSTALL 2>/dev/null)

dmcgee@dublin /var/abs/local/monotone/pkg
$ echo $?
0

dmcgee@dublin /var/abs/local/monotone/pkg
$ ls
etc testpkg.tar.gz usr

dmcgee@dublin /var/abs/local/monotone/pkg
$ tar tf testpkg.tar.gz
.PKGINFO
.FILELIST
.INSTALL

Basically what that says- tar never zips up anything except for the three . files. That doesn't work!

Patches need to be tested against ALL cases- packages with AND without files.
Comment by Roman Kyrylych (Romashka) - Wednesday, 18 April 2007, 19:16 GMT
Damn, now I've got it.
The latest version on my HDD is different that in the patch, it contains
tar czf $pkg_file .
(I removed $comp_files variable as useless).
Then I realised that in this way $comp_files won't be put at the beginning of tarball, so I made the final change,
and I guess I overlooked missing files in real package after making the last change. :-/


Comment by Roman Kyrylych (Romashka) - Wednesday, 18 April 2007, 20:22 GMT
Haha, the problem is easily fixed by replacing find with ls. :)
Please check this one.

EDIT: rediffed patch against the latest CVS.
Comment by Glenn Matthys (RedShift) - Sunday, 19 August 2007, 18:01 GMT
Why should we allow empty packages to be built?
Comment by Dan McGee (toofishes) - Sunday, 19 August 2007, 21:59 GMT
This is one of the issues where it isn't too hard to make it possible, so that makes sense. Someone may use a psuedo-package in their local repo for instance, which has versioned dependencies or something.
Comment by Roman Kyrylych (Romashka) - Monday, 20 August 2007, 10:48 GMT
this is fixed in git already.

Loading...