FS#28374 - [pacman] makepkg should clean an existing src directory

Attached to Project: Pacman
Opened by Olivier (olive) - Sunday, 12 February 2012, 10:03 GMT
Last edited by Allan McRae (Allan) - Monday, 20 February 2012, 08:07 GMT
Task Type Bug Report
Category makepkg
Status Closed
Assigned To Allan McRae (Allan)
Architecture All
Severity Medium
Priority Normal
Reported Version 4.0.2
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Description:

Where we build a package, makepkg utar its source in the directory containing the PKGBUIOLD by default, but it is configurable in /etc/makepkg.conf. For that it uses bsdtar, but the last one does not clean an existing src directory, it just overwrite existing files. If we had junk in the src from a previous build, the package is build in a non clean directory. I think makepkg should systematically wipe out any existing src directory before building a package to be sure the package to be build is clean (unless the -e option is specifies, of course).

Additional info:
* package version(s)

pacman 4.0.1-4
This task depends upon

Closed by  Allan McRae (Allan)
Monday, 20 February 2012, 08:07 GMT
Reason for closing:  Duplicate
Additional comments about closing:   FS#17175 
Comment by Uli (Army) - Sunday, 12 February 2012, 13:58 GMT
This also doesn't make sense for e.g. git-packages, because you don't want to download the whole code every time you build a package. You can do this cleanup with a very simple script!
Comment by Olivier (olive) - Sunday, 12 February 2012, 14:51 GMT
@Uli Armbruster. makepkg does an integrity check of the downloaded source file. What's the purpose of this integrity check if the src directory can contain junk from previous builds? It is expected that makepkg produce the same package from the same PKGBUILD.

If for whatever reason you want to keep src files across several builds, the -e option is there and makepkg correctly warn that there is no integrity check and that the result will be from whatever is in the src files. In the latter case there is no bsdtar in the src directory which is reasonable.

Keeping the src directory might be what we want in some cases and the -e option is there for that. But I do not see a valid reason to want bsdtar to overwrite existing file in the src directory and at the same time do not want a clean src directory.
Comment by Techlive Zheng (techlive) - Thursday, 22 March 2012, 23:55 GMT
+1 for removing src before the extraction, or at less a command line switch is provided.

Sometimes, we need to apply a patch which would create a new file or rename an existing file, if we do not prune the exsiting src directory before the extraction and just overwrite the one in the src tarball, these newly created files by the patch applied in the previous building would cause the current patch failed to apply.

For a none vcs package, it is better remove the existing src directory before building, or at less the src tarball destination if it exists.

For a vcs package, the vcs-build directory need to be recreated before the building process.

Loading...