DE-IBH / apt-dater

terminal-based remote package update manager
GNU General Public License v2.0
101 stars 24 forks source link

Validity error : no DTD found #79

Closed DejavuDmitry closed 9 years ago

DejavuDmitry commented 9 years ago

I have a some bug or something similar.

~/build/apt-dater$ ./src/apt-dater -v
apt-dater 1.0.2 - May 12 2015 16:23:55
~/build/apt-dater$ cat /etc/os-release 
NAME="Ubuntu"
VERSION="15.04 (Vivid Vervet)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 15.04"
VERSION_ID="15.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
~/build/apt-dater$ uname -a
Linux oit-d-iliukhin 3.19.0-16-generic #16-Ubuntu SMP Thu Apr 30 16:09:58 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

~/build/apt-dater$ ./src/apt-dater
validity error : no DTD found!
Error on loading config file /home/dejavu/.config/apt-dater/apt-dater.xml
liske commented 9 years ago

Hi,

you need to make the DTD schema files available at:

$ grep SCHEMA config.h
#define XML_SCHEMA_DIR "/usr/local/share/xml/schema/apt-dater"
#define XML_SCHEMA_URI "file:///usr/local/share/xml/schema/apt-dater"

make install does not copy the files, yet. You can change the schema path by setting the following environment variables:

$ ./configure --help
...
  XMLSCHEMADIR
              XML schema directory (default: DATAROOTDIR/xml/schema/apt-dater)
  XMLSCHEMAURI
              XML schema URI (default: file://XMLSCHEMADIR)
...

HTH, Thomas

DejavuDmitry commented 9 years ago

Hi, Sorry, but what is "DTD schema files"? I haven't /usr/local/share/xml/schema/apt-dater dir in my system.

$ ls -a /usr/local/share/xml/schema/
.  .. 
liske commented 9 years ago

The schema files are schema/*.dtd within the sources. They should be get installed during make install.

DejavuDmitry commented 9 years ago

And if I don't want to install apt-dater in my system. Can i just copy this files into property directory on my system? Just without make install...

liske commented 9 years ago

This will work. The make install for the schema directory just copies the files:

install-data-local:
    $(mkinstalldirs) $(DESTDIR)$(XMLSCHEMADIR)
    for dtd in apt-dater.dtd hosts.dtd report.dtd; do \
        $(INSTALL) "$dtd" "$(DESTDIR)$(XMLSCHEMADIR)/"; \
    done
DejavuDmitry commented 9 years ago

So sad...

dejavu@oit-d-iliukhin:~/build/apt-dater/schema$ sudo make install
make[1]: вход в каталог «/home/dejavu/build/apt-dater/schema»
make[1]: Цель «install-exec-am» не требует выполнения команд.
/bin/bash ../mkinstalldirs /usr/local/share/xml/schema/apt-dater
mkdir -p -- /usr/local/share/xml/schema/apt-dater
for dtd in apt-dater.dtd hosts.dtd report.dtd; do \
    /usr/bin/install -c "td" "/usr/local/share/xml/schema/apt-dater/"; \
done
/usr/bin/install: не удалось выполнить stat для «td»: Нет такого файла или каталога
/usr/bin/install: не удалось выполнить stat для «td»: Нет такого файла или каталога
/usr/bin/install: не удалось выполнить stat для «td»: Нет такого файла или каталога
Makefile:436: ошибка выполнения рецепта для цели «install-data-local»
make[1]: *** [install-data-local] Ошибка 1
make[1]: выход из каталога «/home/dejavu/build/apt-dater/schema»
Makefile:332: ошибка выполнения рецепта для цели «install-am»
make: *** [install-am] Ошибка 2

Manually:

dejavu@oit-d-iliukhin:~/build/apt-dater/schema$ for dtd in apt-dater.dtd hosts.dtd report.dtd; do sudo /usr/bin/install -c "$dtd" "/usr/local/share/xml/schema/apt-dater/"; done
dejavu@oit-d-iliukhin:~/build/apt-dater/schema$ cd -
/home/dejavu/build/apt-dater
dejavu@oit-d-iliukhin:~/build/apt-dater$ ./src/apt-dater 
validity error : no DTD found!
Error on loading config file /home/dejavu/.config/apt-dater/apt-dater.xml
DejavuDmitry commented 9 years ago

No words?

liske commented 9 years ago

Use the environment variables while running ./configure as quoted above (the paths specified at configure-time are used in apt-dater and the example .xml config files):

$ ./configure --help
...
  XMLSCHEMADIR
              XML schema directory (default: DATAROOTDIR/xml/schema/apt-dater)
  XMLSCHEMAURI
              XML schema URI (default: file://XMLSCHEMADIR)
...

There was a missing escape sequence in schema/Makefile.am which has been fixed by 3830e75e7249350f8c7ec43510a1347f6dc673ff.

PS: Please provide error messages in LANG=C.

DejavuDmitry commented 9 years ago

I just can't understand what a must do to get success result...

DejavuDmitry commented 9 years ago

But WHY? What happened?

liske commented 9 years ago

This seems not to be an issue of apt-dater. I've referenced the help text twice howto configure the destination of the XML schema files.

tillo commented 8 years ago

In case you get this bug, like I did, the correct answer is that for a while apt-dater has created an XML config without DTD validation, while now it requires it. It has nothing to do with environment variables.

If you used apt-dater during this time, your current configuration file must be adapted. There are a few other new sections needed to make it run, therefore I suggest you move your current configuration out of the way (mv ~/.config/apt-dater ~/.config/apt-dater.bkp), run apt-dater once to create sane configuration files, and reconfigure it patiently, by comparing the old and new files.

It is at least the second time now that this project has released a minor version without backward config files compatibility (initially there were plaintext config files, then XML without DTD, now XML with DTD, and never a migration routine)... the developers may want to look at http://semver.org/ for sane versioning; it should be at least at version 3.x, while it's still version 1.0. Then again, it's their project... this is just my opinion.