Packaging with CDBS: delete png file from source packages when build package (debian) - packaging

I'm trying to package a source tarball, which contains contain help/C/figures directory with 5 png files.
I want to delete 2 png files from this directory.
Putting the deletion in the clean target could be an option, but I really hate to modify my source tree that much while packaging.
If I delete this 2 files, when I run:
bzr builddeb -- -S -us -uc
This warning show up:
dpkg-source: warning: ignoring deletion of file help/C/figures/mp3.png
dpkg-source: warning: ignoring deletion of file help/C/figures/wav.png
These files is regenerated on build time. So I'd like to have them removed.
So no way to do it with CDBS in debian/rules?

I don't have anything set up to use bzr-builddeb, so I can't test, but I would guess that it passes on extra parameters unchanged to dpkg-buildpackage. If so, you should just be able to add something like:
--source-option=--include-removal
to the bzr builddeb arguments. Would that solve your problem?

Related

Installed package has out-of-date header files

The node-addon-api package is installed and I have been compiling using those header files just fine. But I went to take advantage of a feature and my addon would not compile; the symbol was missing from the headers. After comparing to the header file in their github repository, it was clear that what's installed is not what's current.
The file dates of everything (on a Windows install) is shown as 26-Oct-1985, but I don't know if that's npm just not getting the date right when it writes the file out, or what.
What do I need to do to get the current version in place? npm reports that v.3.0.2 is installed, but even after deleting the directory and letting npm fetch it again, the files are out-of-date.
This was strange; I finally realized that the reason the file kept looking like it was out of date was because the text editor I had it loaded in was not reloading when the file got rewritten by npm -- probably because of the file's datestamp never changing from 26-Oct-85. I discovered this after taking a diff between the installed file and the one in a clone of the package's repo: no difference.

Creating a WiX patch from single file location

I am trying to create a patch for my application. Implementing the example described here worked as expected. However, the files for each version are stored in separate directories. Version 1.0 files are in c:sample\1.0 and 1.1 files are in c:sample\1.1. If I move the files to a single location, create the 1.0 installer, modify the files, and create the 1.1 installer; wixmst output of torch contains no differences. When I run pyro I get:
warning PYRO1079 : The cabinet 'media1.cab' does not contain any files. If this patch contains no files, this warning can likely be safely ignored. Otherwise, try passing -p to torch.exe when first building the transforms, or add a ComponentRef to your PatchFamily authoring to pull changed files into the cabinet.
This is a problem for me because the files for my project are kept in a single git repository. We use branching and tagging to delineate versions. Because of this I only have one directory of files.
I have the .msi and .wixpdb for both versions.
How can I create my patch in this situation?
Pyro requires access to the .wixmst and the old and new files. If you only have one set of files (newer or older) then the patch will obviously find no file differences. That is why you are getting the error from Pyro.
If you use bindpaths to create the original .msi files (and their .wixpdbs) then you can provide the old paths using the -bt switch to pyro and the new paths to the -bu switch. If you didn't use bindpaths and you need to recreate the old directory structure for the old files and create a new directory structure for the new files.
If you can't get the old and new files to be found (bindpaths work best) then you'll have to do admin image type patching.

Editing versus deleting CMakeCache.txt after moving directory

If CMake is re-executed after the source directory is moved, an error like this is given:
CMake Error: The current CMakeCache.txt directory /new-path/CMakeCache.txt is different than the directory /old-path where CMakeCache.txt was created. This may result in binaries being created in the wrong place. If you are not sure, reedit the CMakeCache.txt
What is the best approach to deal with this? It seems that deleting the cache works. Why might I want to edit CMakeCache.txt, rather than just delete it?
I think your best bet is indeed to delete the cache and re-create it. In fact, I tend to go further and remove the entire build tree if I need to move the source, but this is probably overkill.
The CMakeCache.txt file can be edited via the CMake GUI or by hand if you're sure what you're doing, but I find it's not usually worth the effort compared to re-running cmake from scratch. I guess if running CMake takes a significant amount of time (e.g. if you use ExternalProject_Add which could involve downloading and building a third-party resource), it may be preferable to modify the CMakeCache.txt.
This article provides a bit more detail about the CMakeCache.txt file and editing it. In particular it says:
The main reason for editing the cache would be to give CMake the location of a native library such as JPEG, or to stop it from using a native library and use a version of the library in your source tree.
CMake will not alter an existing entry in the cache file itself. If your CMakeLists.txt files change significantly, you will need to remove the relevant entries from the cache file. If you have not already hand-edited the cache file, you could just delete it before re-running CMake.
I applied below two command and worked for me.
flutter clean
flutter pub get
flutter clean + flutter pub get is the easiest solution
I ran into same error while running a CGAL code (which I had already compiled sometime ago) . All I did was create a new directory and copy the ".cpp" file there and run " CGAL_create_CMakelists " and then run cmake command.It worked this way. I don't exactly know but I think the error comes when you run the code which was already compiled and has its build files already in the folder(due to previous compiling).

Creating RPM from current directory

I'm trying to create an rpm from local source. Is it possible to do compilation in a similar to what pdebuild does - just copy the local directory as the source and operate on that copy? Every time I do rpmbuild -ba ... it tries to unpack some archive in RPMBUILD/SOURCE, but I don't want to go that way.
Essentially I'd like to be able to just checkout the repository with the code, do rpmbuild -ba application.spec in that checkout directory and have it do the right thing... Is that possible?
I don't know about a better way than the following:
rpmbuild -bs my_file.spec --define "_sourcedir $PWD"
For my own project, I'm always using a Makefile to define make rpm once and then just use it.
The %setup macro in the spec file is what unpacks the source. Remove that, and your problem goes away, and you can do anything you'd like to fetch the source.

Is there a way for Bazaar to automatically detect and apply changes made in a working directory?

Is there a way for Bazaar to be able to automatically detect changes (adds, removes, renames, etc.) made to part of the working directory and automatically apply them?
I have a directory tree in my repository which is generated by another process so I can't do all the bzr add, bzr delete, and bzr rename commands as the files are changing. Instead, I would like a way to have bzr notice all the changes and apply them after this process is run.
The only way I can think of doing this right now is running bzr status and then manually (or by writing a script) run bzr add and bzr delete on all the files listed. This will work but I am hoping there is an automated method that could also determine if a file was renamed (an added file has the same contents of a delete file).
You don't need to explicitly mark files as deleted. And bzr can detect renames (either with automv plugin or with builtin functionality):
bzr mv --auto
Note that if you moved the files to a new folder that you just created, you have to version it, but without adding its children (--no-recurse), othervise mv --auto might fail to detect renames:
bzr add --no-recurse newfolder
Then you need to add all files which are not part of renames:
bzr add subdir/
Could you just call bzr add * at the end of the process? Your subsequent commit should take care of all additions and removals. This will not detect if a file was renamed/moved by some process other than bzr mv (and I am unaware of any way to do so).
It looks like the automv plug-in will automatically detect renames and moves. This, along with bzr add * should do the trick.