Re: PKGSRCGFE=PKGSRC GRAPHICAL FRONT END

2008-12-08 Thread Dmitri Nikulin
Hi Savio,

The code is not that bad for a prototype, but GUIs in C are generally
unnecessarily difficult. The efficiency and performance of C is not
necessary for an administrative GUI. I suspect if you rewrite it in a
more high-level language such as Python or Ruby, you'll pay an
up-front rewrite cost but save yourself a lot of trouble with
maintenance and debugging in the long run, and learn a new language on
the way. It's certainly worth mastering C, but that should happen with
low level code, not brute-forcing arbitrary projects into C.

Best of luck in your development efforts!

-- 
Dmitri Nikulin

Centre for Synchrotron Science
Monash University
Victoria 3800, Australia


Re: PKGSRCGFE=PKGSRC GRAPHICAL FRONT END

2008-12-07 Thread grfgguvf

dark0s Optik writes:


I don't know who can interest, but I want also comunicate that I'd
like attach my next
program pkgsrcgfe at beginning of february 2009.
The program will contain:

1) Commented code
2) Modularized code
3) Possibility of choice between multiple mirrors
4) Save button working

and it will have always DragonFlyBSD license.

regards,
savio


Hi Savio..

I have created a branch of your pkgsrcgfe on GitHub (free git hosting 
service). I think others are interested, so it is better to use a public 
repository, instead of attachments to a newsgroup, because that way, others 
can see development in real-time and start contributing. There is a common 
advice to open-source developers which says:


Release early, release often.

I did not make any changes yet, but I have been planning on writing a 
textual frontend to pkgsrc (like Aptitude in Debian), so that one can make 
multiple changes and then execute them at once, instead of waiting for the 
previous command to finish before you can install something else. And, I 
think it makes sense maybe to have one codebase for these and have options 
to build either the text or the graphical interface. Here's the URL:


http://github.com/grfgguvf/pkgsrcgfe-grfgguvf/tree/master

PS Please CC me if you want to be absolutely sure I catch any replies..




Re: PKGSRCGFE=PKGSRC GRAPHICAL FRONT END

2008-12-07 Thread dark0s Optik
I'm quite sure that GTK+ 2.x library has got functions for all operations,
and also for operations that you want to implement.
I didn't understand that you intend with

one can make multiple changes and then execute them at once

because I don't know Aptitude, but we can boundle strive us to realize
a graphical user interface that it has that feature. I'd like implement a GUI
because it's easest to use, and that is important for managing large
numbers of servers
in enterprise server farm.

savio

2008/12/7  [EMAIL PROTECTED]:
 dark0s Optik writes:

 I don't know who can interest, but I want also comunicate that I'd
 like attach my next
 program pkgsrcgfe at beginning of february 2009.
 The program will contain:

 1) Commented code
 2) Modularized code
 3) Possibility of choice between multiple mirrors
 4) Save button working

 and it will have always DragonFlyBSD license.

 regards,
 savio

 Hi Savio..

 I have created a branch of your pkgsrcgfe on GitHub (free git hosting
 service). I think others are interested, so it is better to use a public
 repository, instead of attachments to a newsgroup, because that way, others
 can see development in real-time and start contributing. There is a common
 advice to open-source developers which says:

 Release early, release often.

 I did not make any changes yet, but I have been planning on writing a
 textual frontend to pkgsrc (like Aptitude in Debian), so that one can make
 multiple changes and then execute them at once, instead of waiting for the
 previous command to finish before you can install something else. And, I
 think it makes sense maybe to have one codebase for these and have options
 to build either the text or the graphical interface. Here's the URL:

 http://github.com/grfgguvf/pkgsrcgfe-grfgguvf/tree/master

 PS Please CC me if you want to be absolutely sure I catch any replies..





Re: PKGSRCGFE=PKGSRC GRAPHICAL FRONT END

2008-11-16 Thread dark0s Optik
Ok, thank you, in next thread with code attached I will search
follow this suggestions.

N.B. I'd like know if pkg_add work.

savio

2008/11/15, Dennis Melentyev [EMAIL PROTECTED]:
 Hi Saverio,

 It is a good idea to write a GUI frontend and written code is much
 better than just an idea to write it, but I still see a long way to
 go.

 Please let me comment your code a little.

 And (I'd like to emphasize this) it is absolutely not an attempt to
 hurt you, but rather friendly general comments for future improvement
 of you coding skills. Please, do not take it personally.

 Current code is good for the proof-of-concept project. To make it into
 production, you'll have to work a lot on architecture and
 components.
 I'd suggest to freeze it to the current functionality, fix every
 possible bug and start the next version of it, with following notes in
 mind.

 Typical problems are:
 1. Heavy use of hardcoded magic constants.
 2. The code is too linear: Doing everything in main() is not the
 best practice. You have to separate logic into specific functions.
 Even if there is only one call for some function.
 This will improve code readability and let you maintain your code more
 easily in the future.
 3. I hardly can see the reason for this construction:
   for (i = 1; i = 4; i++) {
 switch (i) {
   case 1: page = gtk_vbox_new(TRUE, 0);
 

 This saves you nothing. Just make it four separate functions and call
 them in a sequence. Or, refactor code to have some common part and
 some conditional part within a cycle.
 Something like:
 for (i=0; iLAST_PAGE; I++) {
/* prepare page-specific data */
   switch(i) {
 case 1:
   page = ;
   psgfe_add_button(BUTTON_ONE);
   psgfe_add_button(BUTTON_TWO);
   psgfe_add_button(BUTTON_THREE);
   break;
 case 2:
   page = ;
   psgfe_add_button(BUTTON_ONE_A);
   psgfe_add_button(BUTTON_TWO_A);
   psgfe_add_button(BUTTON_THREE_A);
   break;
 ...
default:
   /* Report a missed case and kill the program */
   assert(...);
   }

/* Put page-independent code here */
 }

 4. Absolutely no diagnostics. This hurts you in the first place. There
 is no way to understand what happen to the user when he reports a
 problem. Just consider -d or -v option in most programs.

 5. Almost no error handling:
 fd = g_open(/usr/pkg/share/pkgsrcgfe/mirror.conf, O_RDONLY);
 if (fd  0) perror(fd  0);
 lseek(fd, 0, SEEK_SET);

 perror() does not aborts execution. Even more, it does output to
 strerr, but you will miss it in X environment most of the time.
 lseek() could fail also. As well as read(), malloc() and many other
 calls.

 Also, you leak a file handle each time a mirror.conf is opened. There
 are no g_close() or something like that.

 6. The only comments in the code is a license block.
 Be verbose in comments. This does not affect performance, but help
 others _AND_ yourself to read and understand the code.

 Didn't tried to dig any deeper, but hope, this friendly
 suggestions/notes will help you for mutual benefit of the community.

 Thanks for the efforts and good luck in this great project!

 2008/11/15 dark0s Optik [EMAIL PROTECTED]:
 I modified program and I tell you test it, especially if it download
 package
 in pkg_add operation and if it works.
 I have a very very slow internet connection and cannot test it fastly.

 The file mirror.conf must be located in /usr/pkg/share/pkgsrcgfe directory
 and contains mirror where pkg_add must to connect. If you want change
 mirror, then you must edit mirror.conf, but you write only one row without
 '\n' character.

 I must complete yet this program:
 1) save button in mirror.conf window don't work, I must permits writing
 and
 saving mirror.conf from dialog window
 2) I'd like write multiple mirror in mirror.conf

 I ask you tell me any thing don't work.

 Regards,
 savio




 --
 Dennis Melentyev



-- 
only the paranoid will survive


Re: PKGSRCGFE=PKGSRC GRAPHICAL FRONT END

2008-11-15 Thread dark0s Optik
I modified program and I tell you test it, especially if it download package
in pkg_add operation and if it works.
I have a very very slow internet connection and cannot test it fastly.

The file mirror.conf must be located in /usr/pkg/share/pkgsrcgfe directory
and contains mirror where pkg_add must to connect. If you want change
mirror, then you must edit mirror.conf, but you write only one row without
'\n' character.

I must complete yet this program:
1) save button in mirror.conf window don't work, I must permits writing and
saving mirror.conf from dialog window
2) I'd like write multiple mirror in mirror.conf

I ask you tell me any thing don't work.

Regards,
savio


pkgsrcgfe.c
Description: Binary data


mirror.conf
Description: Binary data


Re: PKGSRCGFE=PKGSRC GRAPHICAL FRONT END

2008-11-15 Thread Dennis Melentyev
Hi Saverio,

It is a good idea to write a GUI frontend and written code is much
better than just an idea to write it, but I still see a long way to
go.

Please let me comment your code a little.

And (I'd like to emphasize this) it is absolutely not an attempt to
hurt you, but rather friendly general comments for future improvement
of you coding skills. Please, do not take it personally.

Current code is good for the proof-of-concept project. To make it into
production, you'll have to work a lot on architecture and
components.
I'd suggest to freeze it to the current functionality, fix every
possible bug and start the next version of it, with following notes in
mind.

Typical problems are:
1. Heavy use of hardcoded magic constants.
2. The code is too linear: Doing everything in main() is not the
best practice. You have to separate logic into specific functions.
Even if there is only one call for some function.
This will improve code readability and let you maintain your code more
easily in the future.
3. I hardly can see the reason for this construction:
  for (i = 1; i = 4; i++) {
switch (i) {
  case 1: page = gtk_vbox_new(TRUE, 0);


This saves you nothing. Just make it four separate functions and call
them in a sequence. Or, refactor code to have some common part and
some conditional part within a cycle.
Something like:
for (i=0; iLAST_PAGE; I++) {
   /* prepare page-specific data */
  switch(i) {
case 1:
  page = ;
  psgfe_add_button(BUTTON_ONE);
  psgfe_add_button(BUTTON_TWO);
  psgfe_add_button(BUTTON_THREE);
  break;
case 2:
  page = ;
  psgfe_add_button(BUTTON_ONE_A);
  psgfe_add_button(BUTTON_TWO_A);
  psgfe_add_button(BUTTON_THREE_A);
  break;
...
   default:
  /* Report a missed case and kill the program */
  assert(...);
  }

   /* Put page-independent code here */
}

4. Absolutely no diagnostics. This hurts you in the first place. There
is no way to understand what happen to the user when he reports a
problem. Just consider -d or -v option in most programs.

5. Almost no error handling:
fd = g_open(/usr/pkg/share/pkgsrcgfe/mirror.conf, O_RDONLY);
if (fd  0) perror(fd  0);
lseek(fd, 0, SEEK_SET);

perror() does not aborts execution. Even more, it does output to
strerr, but you will miss it in X environment most of the time.
lseek() could fail also. As well as read(), malloc() and many other
calls.

Also, you leak a file handle each time a mirror.conf is opened. There
are no g_close() or something like that.

6. The only comments in the code is a license block.
Be verbose in comments. This does not affect performance, but help
others _AND_ yourself to read and understand the code.

Didn't tried to dig any deeper, but hope, this friendly
suggestions/notes will help you for mutual benefit of the community.

Thanks for the efforts and good luck in this great project!

2008/11/15 dark0s Optik [EMAIL PROTECTED]:
 I modified program and I tell you test it, especially if it download package
 in pkg_add operation and if it works.
 I have a very very slow internet connection and cannot test it fastly.

 The file mirror.conf must be located in /usr/pkg/share/pkgsrcgfe directory
 and contains mirror where pkg_add must to connect. If you want change
 mirror, then you must edit mirror.conf, but you write only one row without
 '\n' character.

 I must complete yet this program:
 1) save button in mirror.conf window don't work, I must permits writing and
 saving mirror.conf from dialog window
 2) I'd like write multiple mirror in mirror.conf

 I ask you tell me any thing don't work.

 Regards,
 savio




-- 
Dennis Melentyev


Re: PKGSRCGFE=PKGSRC GRAPHICAL FRONT END

2008-11-12 Thread dark0s Optik
I think that I can solve problem with pkg_add in pkgsrcgfe in some day.

savio

2008/11/11, dark0s Optik [EMAIL PROTECTED]:
 The code is attached and is DragonFlyBSD licensed.
 I must add mirror button for choose mirror in pkg_add operation.
 The code must have improving.
 Can you tell me suggestions and other all things.
 I hope that it can serve for spread DragonFly.

 savio

 2008/11/11, Steve O'Hara-Smith [EMAIL PROTECTED]:
 On Tue, 11 Nov 2008 00:13:02 +0100
 dark0s Optik [EMAIL PROTECTED] wrote:

 My code can't be included in DragonflyBSD directly, because it need
 for Gtk+ 2, Glib and related library. What is pattern for copyright
 me.

  It's sounding to me like a good idea would be to commit it to
 pkgsrc-wip where it can be picked up by other pkgsrc users and tried on
 other pkgsrc platforms.

 --
 C:WIN  |   Directable Mirror Arrays
 The computer obeys and wins.| A better way to focus the
 sun
 You lose and Bill collects. |licences available see
 |http://www.sohara.org/



 --
 only the paranoid will survive



-- 
only the paranoid will survive


Re: PKGSRCGFE=PKGSRC GRAPHICAL FRONT END

2008-11-11 Thread Robert Luciani
 My code can't be included in DragonflyBSD directly, because it need
 for Gtk+ 2, Glib and related library. What is pattern for copyright
 me.
 
 In both cases DragonFlyBSD can have benefit
 
 savio
 

Hi Savio,

Why don't you upload the code somewhere first so our users can test it.
I think that would be nice, before any code is included anywhere.

-- 
Robert Luciani
Chalmers University of Technology, SWE
Department of Computer Science and Engineering
http://www.rluciani.com/[EMAIL PROTECTED]


Re: PKGSRCGFE=PKGSRC GRAPHICAL FRONT END

2008-11-11 Thread dark0s Optik
The code is attached and is DragonFlyBSD licensed.
I must add mirror button for choose mirror in pkg_add operation.
The code must have improving.
Can you tell me suggestions and other all things.
I hope that it can serve for spread DragonFly.

savio

2008/11/11, Steve O'Hara-Smith [EMAIL PROTECTED]:
 On Tue, 11 Nov 2008 00:13:02 +0100
 dark0s Optik [EMAIL PROTECTED] wrote:

 My code can't be included in DragonflyBSD directly, because it need
 for Gtk+ 2, Glib and related library. What is pattern for copyright
 me.

   It's sounding to me like a good idea would be to commit it to
 pkgsrc-wip where it can be picked up by other pkgsrc users and tried on
 other pkgsrc platforms.

 --
 C:WIN  |   Directable Mirror Arrays
 The computer obeys and wins.| A better way to focus the sun
 You lose and Bill collects. |licences available see
 |http://www.sohara.org/



-- 
only the paranoid will survive


pkgsrcgfe.c
Description: Binary data


Re: PKGSRCGFE=PKGSRC GRAPHICAL FRONT END

2008-11-11 Thread Steve O'Hara-Smith
On Tue, 11 Nov 2008 00:13:02 +0100
dark0s Optik [EMAIL PROTECTED] wrote:

 My code can't be included in DragonflyBSD directly, because it need
 for Gtk+ 2, Glib and related library. What is pattern for copyright
 me.

It's sounding to me like a good idea would be to commit it to
pkgsrc-wip where it can be picked up by other pkgsrc users and tried on
other pkgsrc platforms.

-- 
C:WIN  |   Directable Mirror Arrays
The computer obeys and wins.| A better way to focus the sun
You lose and Bill collects. |licences available see
|http://www.sohara.org/


Re: PKGSRCGFE=PKGSRC GRAPHICAL FRONT END

2008-11-10 Thread Jeremy C. Reed
 Hi all, I write a lightweight GUI for PkgSrc for DrgonFlyBSD in C
 language named pkgsrcgfe, that is to say PkgSrc Graphical Front End.
 It is a simple and little program that it permits to handle
 graphically pkg_search, pkg_add, pkg_info and pkg_delete.
 I written this program for DragonFly and I'd like release it for
 DragonFly project.
 I want to know:
 1) what is DragonFlyBSD BSD license

http://cvsweb.dragonflybsd.org/cvsweb/src/COPYRIGHT

 2) how can I write me name in license

Contributed by .

 3) I tell at DragonFly users testing it