Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Portage & Programming
  • Search

Sdrcs - My first real project

Problems with emerge or ebuilds? Have a basic programming question about C, PHP, Perl, BASH or something else?
Post Reply
Advanced search
20 posts • Page 1 of 1
Author
Message
Dralnu
Veteran
Veteran
User avatar
Posts: 1919
Joined: Wed May 24, 2006 5:33 pm

Sdrcs - My first real project

  • Quote

Post by Dralnu » Wed Mar 14, 2007 4:36 am

I'm waiting awhile to release this. I havn't felt a real need to release it, plus there are several other projects out there that do the same thing just fine.

A few features it has:

Handles checkin, checkout, and commits
Fairly easy to configure
Print out the entries in the repository

What hasn't been implemented:

automatic patching (don't really know a good way to do this, honestly)
Find a prettier way to handle version numbers (current format for release versions is xx.xx)
easier method of forking a project and maintaining the trees seperatly, and allowing the generation of diffs as ongoing between the two
Last edited by Dralnu on Thu Oct 11, 2007 5:35 am, edited 7 times in total.
The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner.
Top
desultory
Bodhisattva
Bodhisattva
User avatar
Posts: 9410
Joined: Fri Nov 04, 2005 6:07 pm

  • Quote

Post by desultory » Wed Mar 14, 2007 5:15 am

This might be obvious, but it is the most useful advice I can offer given the somewhat vague description you gave. Unless you are following a specific coding standard use whatever structure is most convenient for you to write, maintain and use.
Top
Dralnu
Veteran
Veteran
User avatar
Posts: 1919
Joined: Wed May 24, 2006 5:33 pm

  • Quote

Post by Dralnu » Wed Mar 14, 2007 5:23 am

No standard. Just trying to learn mostly.

The reason I was looking for suggestions was that I didn't know the best way to handle this. I think I'll throw the methods into a file, and keep the rest in a main file.
The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner.
Top
desultory
Bodhisattva
Bodhisattva
User avatar
Posts: 9410
Joined: Fri Nov 04, 2005 6:07 pm

  • Quote

Post by desultory » Wed Mar 14, 2007 5:56 am

Generally, I prefer to separate things according to logical structure, unless it interferes with clarity or maintenance, or I have some other reason to keep everything in one script.
Top
Dralnu
Veteran
Veteran
User avatar
Posts: 1919
Joined: Wed May 24, 2006 5:33 pm

  • Quote

Post by Dralnu » Wed Mar 14, 2007 6:11 am

Ok, thanks.

Right now, though, I am going through and having problems with some of the layout, but before I go much farther what I'm making is a revision control system that isn't networked, but made for a lone dev (seemed like a useful project in the long run, and I don't see the point in making a program I won't use).

I'm debating, though - put code into a central repository, or have it structured out into, say, your code is in /home/user/projects/code/foo, and the revision control system drops this into /home/user/projects/code/foo/repository, or to drop it all into a single directory (its using tar, btw), or keep revisions avalible locally (drop them into ~/projects/foo/repository) and have the releases put into a rep (~/repository).

And suggestions? It seems to me the later would be the more ideal move since you can keep your code close at hand and tar/untar it as needed (might work it out to make it possible to open multiple archives), and keep the releases in a central place to make them easy to find.
The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner.
Top
Dralnu
Veteran
Veteran
User avatar
Posts: 1919
Joined: Wed May 24, 2006 5:33 pm

  • Quote

Post by Dralnu » Wed Mar 14, 2007 6:12 am

desultory wrote:Generally, I prefer to separate things according to logical structure, unless it interferes with clarity or maintenance, or I have some other reason to keep everything in one script.
Thats what I'm thinking about doing, the problem is, though, that there are several methods that require other methods, which makes nesting them a bit touchy at times. I think I can handle it, though.
The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner.
Top
Dralnu
Veteran
Veteran
User avatar
Posts: 1919
Joined: Wed May 24, 2006 5:33 pm

  • Quote

Post by Dralnu » Thu Mar 15, 2007 12:02 am

FYI - ran a test - it works. I'm so happy right now.

Well, the commit test ran smoothly. I still need to handle versioning automatically, but that can come later (I'm going to have to code in some no-clobber code for this).

I'm going to place the rep in the dir the code is in. Keep it close at hand.
The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner.
Top
Mindwolf.com
n00b
n00b
Posts: 3
Joined: Mon Mar 19, 2007 11:12 pm
Contact:
Contact Mindwolf.com
Website

  • Quote

Post by Mindwolf.com » Tue Mar 20, 2007 12:02 am

Off topic about your project, but if Ruby is so similar to C, why not just use C? Is there any point using Ruby exclusively?
Top
Dralnu
Veteran
Veteran
User avatar
Posts: 1919
Joined: Wed May 24, 2006 5:33 pm

  • Quote

Post by Dralnu » Tue Mar 20, 2007 12:38 am

Mindwolf.com wrote:Off topic about your project, but if Ruby is so similar to C, why not just use C? Is there any point using Ruby exclusively?
Learning Ruby.

I might redo it in C later, but right now I'm rather enjoying Ruby.
The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner.
Top
Dralnu
Veteran
Veteran
User avatar
Posts: 1919
Joined: Wed May 24, 2006 5:33 pm

  • Quote

Post by Dralnu » Tue Mar 20, 2007 12:47 am

Some advancements - it pretty much works. I'm still missing part of the script with commit and the version numbering system, but right now the thing works. Lets just call it. 0.1 for now. I'm going to release it at some point in time, as well, on Sourceforge.
The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner.
Top
papal_authority
Veteran
Veteran
User avatar
Posts: 1823
Joined: Wed Mar 31, 2004 4:07 am
Location: Canada

  • Quote

Post by papal_authority » Fri May 04, 2007 3:23 am

I tried to like Ruby, but it seemed to really want to force OO programming on you. Not as badly as Java does perhaps, but enough to irritate me. Coupled with that weird "capitalized names are constants" thing, it was too much for me. Again just personal opinion, I'm sure the language is great for some people :)
The free market gave me gonorrhea.
Top
Dralnu
Veteran
Veteran
User avatar
Posts: 1919
Joined: Wed May 24, 2006 5:33 pm

  • Quote

Post by Dralnu » Fri May 04, 2007 3:07 pm

papal_authority wrote:I tried to like Ruby, but it seemed to really want to force OO programming on you. Not as badly as Java does perhaps, but enough to irritate me. Coupled with that weird "capitalized names are constants" thing, it was too much for me. Again just personal opinion, I'm sure the language is great for some people :)
It has caused me some headaches, but for most of what I've done with it, its done well. Its fairly simple to learn, and doesn't take long to start figuring out.
The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner.
Top
alistair
Retired Dev
Retired Dev
User avatar
Posts: 869
Joined: Fri Jul 15, 2005 12:53 am

  • Quote

Post by alistair » Wed May 30, 2007 4:27 am

papal_authority wrote:I tried to like Ruby, but it seemed to really want to force OO programming on you. Not as badly as Java does perhaps, but enough to irritate me. Coupled with that weird "capitalized names are constants" thing, it was too much for me. Again just personal opinion, I'm sure the language is great for some people :)
How does Java force OO on you more than ruby?
______________
Help the gentoo-java project. Visit Gentoo Java Project

what good are admin powers if you don't abuse them for personal gain - mark_alec
Top
papal_authority
Veteran
Veteran
User avatar
Posts: 1823
Joined: Wed Mar 31, 2004 4:07 am
Location: Canada

  • Quote

Post by papal_authority » Wed May 30, 2007 4:50 am

alistair wrote:
papal_authority wrote:I tried to like Ruby, but it seemed to really want to force OO programming on you. Not as badly as Java does perhaps, but enough to irritate me. Coupled with that weird "capitalized names are constants" thing, it was too much for me. Again just personal opinion, I'm sure the language is great for some people :)
How does Java force OO on you more than ruby?

Code: Select all

class JavaIsGhei {  
  public static void main(String args[]) {
    System.out.println("Java is ghei!");
  }
}

Code: Select all

#!/usr/bin/ruby

puts 'Ruby is slightly less ghei'
The free market gave me gonorrhea.
Top
Dralnu
Veteran
Veteran
User avatar
Posts: 1919
Joined: Wed May 24, 2006 5:33 pm

  • Quote

Post by Dralnu » Thu May 31, 2007 7:18 pm

Alright:

So far, I've scrapped the old code I was using and went back to the version I'm using to all my work. I've put the code I was working on back someplace to use for refrence (a few functions in it are rather handy).

My main problems now are:

Try to get a list of files, figure out which is the newest (based on either a date/time, or by version number), and then taking it to be the one to extract.
I get that working, and I think I'll be pretty much 90% done (the remaining 10% being cleaning up the code, and trying to speed it up)
The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner.
Top
yardbird
l33t
l33t
User avatar
Posts: 689
Joined: Sat Apr 20, 2002 7:02 pm
Location: nl.leiden

  • Quote

Post by yardbird » Sun Jun 03, 2007 5:31 pm

papal_authority wrote:
alistair wrote: How does Java force OO on you more than ruby?

Code: Select all

class JavaIsGhei {  
  public static void main(String args[]) {
    System.out.println("Java is ghei!");
  }
}

Code: Select all

#!/usr/bin/ruby

puts 'Ruby is slightly less ghei'
PWNED.

:lol:
Albert Einstein wrote:I consider it [...] urgently necessary for [...] workers to get together, both to protect their own economic status and [...] to secure their influence in the political field.
http://www.bluescarni.info
Top
Dralnu
Veteran
Veteran
User avatar
Posts: 1919
Joined: Wed May 24, 2006 5:33 pm

  • Quote

Post by Dralnu » Wed Jul 04, 2007 6:01 pm

Hrm. So I have come across a problem. I'm trying to grab from a list the one with the highest number in it. The pertenant block of code is as such:

Code: Select all

puts "Extracing latest development version...\n\n"
#                       system("#{$utar_command} #{$repository_location}#{tarname}-#{}.tar.bz2")
                         puts Dir.entries("#{$rep_loc}")
                         puts "\n\nExtraction completed into working directory."
This is what I want done:

take a list of directory entries, find the one with either A) the highest number (for the development versions, which is stored in YYYYMMDDHHmm format...) from the list, and unless otherwise specificed, use it or B) Take a number of a version (in x.x format, for the time being), and take the newest release and extract it (unless otherwise specified, of course).

I've made (some) progress (I figured out the Dir.entries bit, so you have to give me credit for SOME work...).

OR, does anyone know of a good tutorial on this kind of thing? I'm honestly fairly lost here (even though I'm sure its a simple solution), so at least a point in the right direction would be nice.
The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner.
Top
Dralnu
Veteran
Veteran
User avatar
Posts: 1919
Joined: Wed May 24, 2006 5:33 pm

  • Quote

Post by Dralnu » Thu Jul 12, 2007 6:48 pm

ALRIGHT! I've pretty much gotten it to work. Its not perfect, but it WORKS! The code is kind of ugly, and I've got some doc work to do, but so far, IT WORKS. I'm proud of myself.







Thanks to the folks on #ruby on irc.freenode.net for their help. I had plenty of headdesk moments with it, and they helped me alot.
The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner.
Top
Wietze
n00b
n00b
User avatar
Posts: 37
Joined: Fri Jun 10, 2005 6:42 pm

  • Quote

Post by Wietze » Tue Sep 18, 2007 7:03 pm

Could you release the specs of what it does plz ?
Top
Dralnu
Veteran
Veteran
User avatar
Posts: 1919
Joined: Wed May 24, 2006 5:33 pm

  • Quote

Post by Dralnu » Wed Sep 19, 2007 4:28 pm

Wietze wrote:Could you release the specs of what it does plz ?
Pretty much: It tars a directory/file and throws it into a directory. Fairly simple.
The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner.
Top
Post Reply

20 posts • Page 1 of 1

Return to “Portage & Programming”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy