View Single Post
Posts: 2,225 | Thanked: 3,822 times | Joined on Jun 2010 @ Florida
#1
Over the years I have run into many packages that insist that they need package X or Y when I don't want it installed, and am fairly confident that what they claim to depend on, I don't need to use. Sometimes the maintainers are very understanding and are open to suggestions or fixing it, sometimes the packages really need it, but either way, the reality is sometimes you want to install a package, which in turn tries to pull in another package as a dependency, and you want to avoid that - this script is for those times.

[edit2]
It takes the name of the package to fake, and optionally parameters to specify the section (default section is "metapackages"), hard/versioned package faking, or to print the basic help text.

The hard/versioned faking requires the package to take on the same name as the real/faked package, whereas without that option it does soft/non-versioned/provides faking where the package generated is named fkdep-[faked-package-name] and just puts the faked package name into the 'Provides' field.

The section parameter allows you to pick another section (e.g. to allow the N900's HAM to install it, which only does it if the section field is in the 'user' area (starts with 'user/')).

The help argument just causes it to print basic help/usage text, and exit. If it's present, the rest of the arguments are, consequently, noops, since the script prints usage text as soon as it detects the argument, and exits right after that.
[/edit2]

[edit2] This following paragraph describes version 1.0 [/edit2]
It takes the first parameter given to it, and (after checking to make sure the name given is a valid deb package name, and that such a package is not already installed) generates a metapackage .deb which will have the name of the package passed in listed in the 'provides' field. If run as root it will install it, if not, it will leave it in a temporary directory for you to install/check manually.

A little bit of background: I wanted this to have no dependencies beyond what's on the N900 already in the stock install, which was a problem because a .deb file is actually an 'ar' archive containing two .tar.gz archives and one text file. Fortunately it turned out that the 'ar' 'common' format, which is what 'deb' files are, is trivial. It's essentially all of the files concatenated, with some metadata prepended to each file.

http://en.wikipedia.org/wiki/Ar_%28U...format_details

As a result, it is fairly straightforward to implement it using cat, printf/echo, ls+awk / wc to get the file size, and expr [edit3]or the shell's own arithmetic expansion[/edit3] to do modulo-2 on the file size, because file entries have to be 2-byte aligned.

I was going to wait until this was uploaded to the repository[edit3](as of 2015-02-19 I have uploaded it to the repos)[/edit3], but I was starting to hijack the thread where I originally brought it up already, so I didn't want to keep doing that, so here it is.

https://github.com/mentalisttraceur/fkdep

[edit1]Changed title from WIP to Announce. I was calling it a WIP because a single bug was reported, which I wanted to investigate. I had already tested it, but I was waiting until I got around to testing once more on a completely stock N900 setup. It worked fine there too, so I'm very confident it's usable as is now.[/edit1]
__________________
If you want to donate in support of anything that I do, you can do so with either of these options:
PayPal | Bitcoin: 1J4XG2z97iFEKNZXThHdFHq6AeyWEHs8BJ | [Will add other donation options eventually]

Last edited by Mentalist Traceur; 2015-02-19 at 08:25. Reason: (Not enough room in the edit field. Besides typo/grammar, really minor tweaks, edits are marked inline to my post)
 

The Following 11 Users Say Thank You to Mentalist Traceur For This Useful Post: