Linux dpkg Software Report

Werner Schram wrschram at gmail.com
Thu Dec 24 11:25:21 UTC 2009


Tim Frost wrote:
> On Tue, 2009-12-22 at 21:25 -0800, Ray Parrish wrote:
>   
>> Hello,
>>
>> I hope I won't get flamed for this, but I have just completed my most 
>> ambitious script to date, and have completed the Linux dpkg Software 
>> Report script which takes output from dpkg, and formats it into html 
>> pages sorted by package section, such as Games, Editors, etc... and also 
>> generates an alphabetical index to the packages.
>>     
>
> Nice effort.
>
>
> One issue with the script as written is that it MUST be invoked with an
> absolute path name (i.e,
> "/home/tim/bin/SoftwareReport/LinuxdpkgSoftwareReport.sh", rather than
> "LinuxdpkgSoftwareReport.sh" or
> "./bin/SoftwareReport/LinuxdpkgSoftwareReport.sh" - which I tried
> first).  This is used to:
> - locate support scripts
> - determine where to write the output files
>
> Ideally, the program should be able to locate itself, and then derive
> the location of the support scripts, based on its location.
>
> It should also use the user's preferred temp directory (or /tmp
> or /var/tmp), rather than writing files to a directory under it's
> install location.
>
> This allows an admin to install the scripts in a system directory such
> as /usr/bin, without needing to compromise system security.
>
> I will see what I can do about these issues, and feed the results back. 
>   
I personally don't like the script writing in its own directory (it is a 
bit of a windows way of doing things). You could let the script accept a 
path to where you want the output to be, so you could call it like:
LinuxdpkgSoftwareReport.sh /home/werner/myLDSRoutput

You should add a version number. That makes it easier for people to see 
if they are using the newest versions, and it helps when someone is 
reporting problems.

You didn't include a licence with your script. It might be intentional, 
but even if you don't really care what people do with your script, you 
can still include the 2-clause or 3-clause BSD licence that says: 'hey, 
you can do with the script what you want, but at least tell people that 
you got it from me'. You can find information about premade licences here:
http://www.opensource.org/licenses/

Werner




More information about the ubuntu-users mailing list