- Logikal Blog - http://logikalblog.com -

Your Very First Import to SourceForge

Posted By roland On November 25, 2008 @ 9:22 pm In Information Technology | No Comments

I recently created a project on SourceForge.net. The project is called xpnsqt. I don’t really expect anyone to work on it, nor do I care. I needed to write something to replace the expense tracking stuff I had developed in Lotus Approach years ago. Other than playing either “Starcraft” or “Lords of the Realm”, I don’t boot Windows. I don’t often have the time or desire to play games anymore, so Windows doesn’t see much usage anymore.

Rewriting the Lotus Approach stuff kept getting put off. I kept waiting for some OpenSource product which would let me do what Lotus Approach had done. Total development time for the original application with Lotus Approach was roughly 45 minutes. I had never used Lotus Approach prior to that. The application itself is quite simple. There are three database tables: categories, payees, and expenses. The first two tables are foreign keys for the expense table. They help ensure I record expenses consistently for the report I generate and hand to my tax person. The report is a simple control break report. Select all expenses flag as being tax deductions/business expenses, sort them by category then date, dump off with totals for each category and a grand total at the end.

Qt seems to be all the rage with C++ development. Having written two books on the Zinc Application Framework many years ago, I’m not new to cross platform development. The difference with Qt is you get a free version of the product with your Ubuntu (or probably any other Linux) installation. I purchased a couple of books on Qt and set about redeveloping this application using Qt and Postgresql.

“Foundations of Qt Development” ISBN-13 978-1-59059-831-3

This is a tome you don’t want to wade into unless you want to spend an inordinate amount of time discussing lists and other theories you should have learned long ago in college. I made it a whopping 65 pages into this 500+ page tome and pretty much parked it on that book shelf which is almost impossible to get to in my office. If I have trouble sleeping some night I might pull it out rather than taking drugs.

“C++ GUI Programming with Qt 4″ ISBN-13 978-0-13-235416-5

I made a good faith effort with this book. Like most seasoned developers, I learn by keying code in which was printed in the book, compiling it, debugging my typos, testing the run, then tweaking. This is the traditional learning path for every seasoned developer I have ever known. The first two chapters of this book allowed you to do just that. Then, it appears Prentice Hall’s design gestapo got into their act. The book made a dramatic switch to “snippets”. Yes, they provide a location to download the complete set of source code, but that is only useful if you are attempting to fix a problem and already know the product. It is not conducive to a learning experience. As a result, I was forced to use the book only for reference. The chapter on database access (yes, chapter) spends an inordinate amount of time showing you how to use a couple of SQL classes which simply aren’t ready for prime time. They don’t correctly handle an empty table condition. They didn’t at the time of writing either since the example program made a point of slamming data into the table before using those classes. In the end, I used little bits and spent a lot of time using the Yahoo search engine.

When it was all done, I had something serviceable. I’m not completely happy with the way the report was handled. You have to either spend a lot of time hacking your own HTML tags or you endure a broken print engine. I opted to endure a broken print engine.

Broken how you ask?

Old School. A standard 11 inch form has 66 lines at 6 lines per inch which was the standard print height. You kept track of your detail lines and made a point of not printing more than 55 of them before inserting a form feed and new page headings. When you printed, you dumped this file in raw ASCII to a printer. The printer (even today’s postcript printers) understand a stream in raw ASCII containing a form feed character.

QTextEdit class. No method of a raw ASCII dump. No matter how you set your printer object up, you cannot get there from here.

Result: I print one set of page headings and let form breaks happen wherever they happen without printing new headings. Why? Since the printing engine in the library is rendering things graphically, I cannot ASS-U-ME we will get 66 lines on the destination. I have no way of making the page break happen other than counting and spitting out a lot of blank lines. Those blank lines look really stupid when you are viewing the report in the QTextEdit class. The class does have built in PDF generation support, but ASS-U-MEs it is starting with the supported HTML subset. In other words, it isn’t smart enough to understand a form feed character either.

Sighhhhhhhhhhhhhhhhh

So. After entering all of my expenses thus far this year and otherwise exercising the application, I made the decision to create a SourceForge project out of it so that others may get some use from this code. Some young geek who actually likes adding code to spit out HTML tags might choose to fix the report. (Must not be a lot of those geeks because there are now several class libraries which are Qt extensions for reporting.)

Once I had been approved for a new project by SourceForge, they sent an email with instructions about doing some admin things. The link to the CVS page had links to CVS documentation. NOT ONE OF THESE LINKS ACTUALLY WORKED. I opened a trouble ticket with SourceForge and have been trading quite a few emails. Nothing actually solved the issue. I run 64-bit software, and judging from the responses I’m seeing, they are testing with 32-bit.

I’ve used quite a few version control systems in my day, but never CVS. Now I’m starting to understand why. After much Web searching I have concluded that either every person in the universe is using a dramatically different version of CVS than came with Ubuntu 8.10, or all the on-line doc is wrong. (Jury still out on SourceForge doc since it is unreachable.) Nearly ever piece of doc I found showed this example:

$ cd tc
$ cvs import -m “Created directory structure” yoyodyne/dir yoyo start

It’s just plain wrong. It is missing a parameter. I changed the username to drunken_coder in the following example, but this is what you can expect when you have an SSH client installed along with CVS on your 64-bit Ubuntu 8.10 system.

roland@roland-desktop:~/junk/xpnsqt$ cvs -z3 -d:ext:drunken_coder@xpnsqt.cvs.sourceforge.net:/cvsroot/xpnsqt import -m “Initial Version” xpnsqt LOGIKAL V_1_0
The authenticity of host ‘xpnsqt.cvs.sourceforge.net (216.34.181.110)’ can’t be established.
RSA key fingerprint is dc:a3:df:84:00:c6:65:b4:93:a6:2e:22:b1:d1:91:b8.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added ‘xpnsqt.cvs.sourceforge.net,216.34.181.110′ (RSA) to the list of known hosts.
roland_hughes@xpnsqt.cvs.sourceforge.net’s password:
N xpnsqt/ui_TaxYearDialog.h
N xpnsqt/ReportBrowserDialog.h

No conflicts created by this import

Notice the parameters:

-z3
because sourceforge said to use it.

-d:ext:drunken_coder@xpnsqt.cvs.sourceforge.net:/cvsroot/xpnsqt

cvs repository ext:username@repository:/root/path
the ext tells cvs to use ssh

import
command

-m “Initial Version”
log message

xpnsqt
module

LOGIKAL
vendor tag

V_1_0
release tag

The module parameter is needed and ends up creating another directory under the repository path you listed. Now my repository has /cvsroot/xpnsqt/xpnsqt. Had I been a little more educated at the time I would have stopped with cvsroot so I dumped everything in the top, or used InitialRelase so everything was isolated off. Admittedly, I’m used to much more robust version control software. With CMS, we dump everything into one project repository and create classes which contain generations. When you don’t have an OS which implements file versioning, I guess this is the best you can do.

If anybody else is starting a new OpenSource project on SourceForge and is befuddled on how to do the very first import, hope this helps. As with most things in the Linux/Unix development world, it is expert friendly.


Article printed from Logikal Blog: http://logikalblog.com

URL to article: http://logikalblog.com/2008/11/25/your-very-first-import-to-sourceforge/

Click here to print.