N.,
When we first had our son he slept in a swing all the time. He seemed very fussy if he wasn't in a constant motion (swing or a bouncy seat) and that continued for awhile. I had the same concern about him forming a habbit, so at about 8-10 weeks I started putting him in a swing, wait for him to fall asleep, then turn the swing off. Then slowly I started moving him to the crib after he'd fall asleep in a swing. Then from time to time, after I noticed him forming some sort of sleeping schedule at night, I started to try to put him straight into the crib after a night-time feeding when he would doze off at the breast or a bottle. Slowly I started making sure he was a little awake, when I put him in a crib, but he knew the routine by then, so he'd fall asleep on his own. There were still times when I felt like we were going one step forward two steps back, but that was OK, because I still kept trying. His healthy sleeping habbits, and consequently mine(!), were and still are very important to me.
If you have issues with him sleeping in his own crib and would like a helpful book, I would recommend checking out a book that really helped me at one point: "Good night, sleep tight : The Sleep Lady's gentle guide to helping your child go to sleep, stay asleep, and wake up happy" by Kim West with Joanne Kenen.
Good luck! You've got nothing to worry about a 5-week old sleeping in a swing. Make him happy and get some sleep yourself! You're doing great! :)