[unMENU] How put comments in package conf files?


Recommended Posts

Joe,

 

I would like to put some comments in the conf files. Whenever is use # unMENU hangs. Is there some sort of comment possible?

 

Thanks in advance

Harald

 

 

I have put comments in the files in the past.  As far as I can remember from when I wrote the code reading in the package files, unless the line in the file has one of the "PACKAGE_xxxxxx" tags it knows, it will be ignored.

 

Can you post an example of a file you were trying to create that hangs?

 

Joe L.

Link to comment

Hi Joe,

 

sure. Do you see these two  comments '#'? I just tried it to be sure and the awk process died. If it doesn't die the Package Manager screen won't show up at least. If you remove the '#' all will be fine:

 

PACKAGE_NAME libxml2 (XML parser library)
PACKAGE_DESCR Libxml2 is the XML C parser library and toolkit.  XML itself is a
PACKAGE_DESCR metalanguage to design markup languages  -- i.e. a text language where
PACKAGE_DESCR structures are added to the content using extra "markup" information
PACKAGE_DESCR enclosed between angle brackets.  HTML is the most well-known markup
PACKAGE_DESCR language.  Though the library is written in C, a variety of language
PACKAGE_DESCR bindings make it available in other environments.
PACKAGE_URL http://slackware.cs.utah.edu/pub/slackware/slackware-current/slackware/l/libxml2-2.6.32-i486-2.tgz
PACKAGE_FILE libxml2-2.6.32-i486-2.tgz
PACKAGE_MD5 437e25e2abb0a557883cf376281b5944
PACKAGE_INSTALLED /usr/lib/libxml2.so
PACKAGE_DEPENDENCIES none
PACKAGE_INSTALLATION installpkg libxml2-2.6.32-i486-2.tgz
#PACKAGE_VERSION_TEST ls -l libxml2.so 2>&1 | grep 'libxml2.so' | awk '{print $4}'
#PACKAGE_VERSION_STRING libxml2.so:
PACKAGE_MEMORY_USAGE n/a

 

Thanks

Harald

 

 

Link to comment

What you asked "How do I put comments in a package.conf file" is not the same as what you are trying to do.  You are trying to not perform the package version test.

 

The PACKAGE_VERSION_TEST tag is required, but you can just use "echo" as the test, and then use a blank PACKAGE_VERSION_STRING

 

Like this:

PACKAGE_VERSION_TEST echo

PACKAGE_VERSION_STRING

 

Another way to handle a library or file that does not have a specific "version' string would be to use a checksum of the installed file

Something like:

PACKAGE_VERSION_TEST md5sum /the/path/to/your/file

PACKAGE_VERSION_STRING the_md5_checksum

 

That way, you can tell if a specific version of a file exists. 

 

To me, putting comments in the file is as easy as putting ANY text in the package-conf file that does not start a line with one of the pre-defined "tags"  Those lines are all ignored.  (Any line that puts a "#" in front of a valid "tag" are also ignored.  The config "tag" keywords must all start at the beginning of a line, even a leading space would make them get ignored.)  In any case, that is why I could add comments and you could not, and why I asked for an example.  We were thinking of two different things.

 

Joe L.

Link to comment

Ah, I see. My problem was not the #. It was the missing tag.

 

When I wrote my first conf I 'commented' (at least I thought so) all lines that were not finished yet. After a crash I stopped using the #.

 

Some days later I was thinking about using comments in conf files and thought that I can't use comments because of the crash.

 

I was counting 1+1 and got 3 ;-)

 

Thanks for your help.

Harald

 

 

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.