Adding modified or new text files to my PPA package is simple enough:
Step 1:
apt-get source [foo-package]
cd [foo-package]
Step 2: add or modify new text files containing the changes
Step 3 - update the changelog:
dch -i
Step 4 - create a patch
dpkg-source --commit
Step 5 - create a source package
debuild -S
Step 6 - upload to launchpad
cd ..
dput [myppa]/[foo_source.changes]
However, I now need to add a new icon file (a .png file) to the existing package.
So at step 2 - just copied into the [foo-package]
At step 4 - I get the following errors:
dpkg-source: error: cannot represent change to foo-package/foo-icon.png: binary file contents changed
dpkg-source: error: unrepresentable changes to source
If I attempt to move to step 5 I get the following additional errors to the above:
dpkg-source: error: add foo-package/foo-icon.png in debian/source/include-binaries if you want to store the modified binary in the Debian tar-ball
...
dpkg-buildpackage -rfakeroot -d -us -uc -S failed
Any ideas how do I add a binary icon file to my existing PPA package?
More information
By running:
debuild -S --source-option=--include-binaries
This then allows for the source package to be built and step 6 is possible.
However this isnt really the answer - because I subsequently cannot then make further code changes (step 2) because I'm still getting the same errors.
It doesnt look like I can do dpkg-source --commit --source-option=--include-binaries
because this just gives errors:
dpkg-source --commit --source-option=--include-binaries
dpkg-source: warning: --source-option=--include-binaries is not a valid option for Dpkg::Source::Package::V3::quilt
dpkg-source: error: cannot represent change to foo-package/foo-icon.png: binary file contents changed
dpkg-source: error: unrepresentable changes to source
What I did:
Confirmed that it correctly pushes and builds on Launchpad fossfreedom
Just get dpkg-source --commit to ignore binary files with the
extend-diff-ignore
switchHere's another simpler way to do it: you basically tell dpkg-source to ignore what it can't comprehend (i.e., binary files), and to mind its own business ;)
After adding a binary file(s) the first time, the key is to use
dpkg-source --commit
with the--extend-diff-ignore
switch, along with the appropriate paths/filenames to ignore (Perl regex format).For example, suppose you stick a bunch of PNGs in the
llyrics
directory, and then you modify some text files. The correct commit call is:Follow that with:
to get your PPA upload.
Let's test this with the
rhythmbox-plugin-llyrics
package from fossfreedom's "playground" PPA:Get source:
apt-get source rhythmbox-plugin-llyrics
Modify a text file and add a PNG:
Add to changelog and increment version with
dch -v 0.1-3ubuntu6~izx1
Commit text changes while ignoring the PNG with:
Build source/changes:
And...voila! (Launchpad-built deb--note the ~200k size difference...)
This is a little bit harder than just adding a file.
First, you would need to rebuild the .orig.tar.gz with the included binaries in the new source package, and likely would need to increment the software version (
package_1.0.0.orig.tar.gz
->package_1.0.1.orig.tar.gz
or something) both in the tar, and in thedebian/changelog
.After modifying the orig.tar.gz with the new files (do NOT include debian/ files in the orig.tar.gz), you would then add a
debian/changelog
entry, changing the version to increment it as you did to the orig.tar.gz.Then rebuild the source package (
debuild -S
), and upload the new source package to the PPA. That new source package will overwrite the "older" one in the PPA.From Chat: