summaryrefslogtreecommitdiff
path: root/components/services
diff options
context:
space:
mode:
authorRamiro Estrugo <ramiro@src.gnome.org>2001-04-11 12:38:38 +0000
committerRamiro Estrugo <ramiro@src.gnome.org>2001-04-11 12:38:38 +0000
commit083b8c44257b35fca9559a6dc89859098c200762 (patch)
tree476af77db447b9afd7228cf79f7be621fb779bd9 /components/services
parent25f98470b78550ea4c04328a1a3538dc60e3de47 (diff)
downloadnautilus-083b8c44257b35fca9559a6dc89859098c200762.tar.gz
Remove nautilus-installer.
* Makefile.am: Remove nautilus-installer. * acconfig.h: Remove EAZEL_SERVICES, PAM and RPM defines. * components/Makefile.am: Remove rpmview and services directories. * nautilus.spec.in: Remove all the trilobite stuff. * configure.in: Remove eazel services, installer, rpm checks, pam checks and authenticate helper * helper-utilities/Makefile.am: * helper-utilities/authenticate/.cvsignore: * helper-utilities/authenticate/Makefile.am: * helper-utilities/authenticate/nautilus-authenticate-fork.c: * helper-utilities/authenticate/nautilus-authenticate-pam.c: * helper-utilities/authenticate/nautilus-authenticate.c: * helper-utilities/authenticate/nautilus-authenticate.h: Retire. Its not used. If its ever needed again, it can be resurrected in trilobite. * components/rpmview/.cvsignore: * components/rpmview/Makefile.am: * components/rpmview/Nautilus_View_rpm.oaf.in: * components/rpmview/main.c: * components/rpmview/nautilus-rpm-verify-window.c: * components/rpmview/nautilus-rpm-verify-window.h: * components/rpmview/nautilus-rpm-view-install.c: * components/rpmview/nautilus-rpm-view-install.h: * components/rpmview/nautilus-rpm-view-private.h: * components/rpmview/nautilus-rpm-view.c: * components/rpmview/nautilus-rpm-view.h: * components/services/.cvsignore: * components/services/Makefile.am: * components/services/clone/.cvsignore: * components/services/clone/Makefile.am: * components/services/clone/eazel-clone-lib.c: * components/services/clone/eazel-clone-lib.h: * components/services/clone/eazel-clone.c: * components/services/docs/directories: * components/services/docs/eazel-services-framework-draft: * components/services/docs/install-user-settings: * components/services/docs/installer-dep-check: * components/services/docs/installer-rpm-cases: * components/services/docs/installer-rpmsearch: * components/services/docs/packagexml.dtd: * components/services/install-view/.cvsignore: * components/services/install-view/Makefile.am: * components/services/install-view/Nautilus_View_install.oaf.in: * components/services/install-view/callbacks.c: * components/services/install-view/callbacks.h: * components/services/install-view/forms.c: * components/services/install-view/forms.h: * components/services/install-view/main.c: * components/services/install-view/nautilus-service-install-view.c: * components/services/install-view/nautilus-service-install-view.h: * components/services/install/.cvsignore: * components/services/install/Makefile.am: * components/services/install/command-line/.cvsignore: * components/services/install/command-line/Makefile.am: * components/services/install/command-line/eazel-alt-install-corba.c: * components/services/install/command-line/eazel-gen-pre-xml.sh: * components/services/install/command-line/eazel-gen-xml.c: * components/services/install/command-line/eazel-test-inventory.c: * components/services/install/command-line/eazel-test-packsys.c: * components/services/install/command-line/eazel-test-softcat.c: * components/services/install/command-line/eazel-test-types.c: * components/services/install/command-line/genpkg_list.example: * components/services/install/idl/.cvsignore: * components/services/install/idl/Makefile.am: * components/services/install/idl/trilobite-eazel-install.idl: * components/services/install/lib/.cvsignore: * components/services/install/lib/Makefile.am: * components/services/install/lib/eazel-install-corba-callback.c: * components/services/install/lib/eazel-install-corba-callback.h: * components/services/install/lib/eazel-install-corba-types.c: * components/services/install/lib/eazel-install-corba-types.h: * components/services/install/lib/eazel-install-corba.c: * components/services/install/lib/eazel-install-logic2.c: * components/services/install/lib/eazel-install-logic2.h: * components/services/install/lib/eazel-install-metadata.c: * components/services/install/lib/eazel-install-metadata.h: * components/services/install/lib/eazel-install-object.c: * components/services/install/lib/eazel-install-private.h: * components/services/install/lib/eazel-install-problem.c: * components/services/install/lib/eazel-install-problem.h: * components/services/install/lib/eazel-install-protocols.c: * components/services/install/lib/eazel-install-protocols.h: * components/services/install/lib/eazel-install-public.h: * components/services/install/lib/eazel-install-query-lex.l: * components/services/install/lib/eazel-install-query-parse.h: * components/services/install/lib/eazel-install-query.h: * components/services/install/lib/eazel-install-rpm-signature.c: * components/services/install/lib/eazel-install-rpm-signature.h: * components/services/install/lib/eazel-install-tests.c: * components/services/install/lib/eazel-install-tests.h: * components/services/install/lib/eazel-install-xml-package-list.c: * components/services/install/lib/eazel-install-xml-package-list.h: * components/services/install/lib/eazel-package-system-dpkg.c: * components/services/install/lib/eazel-package-system-dpkg.h: * components/services/install/lib/eazel-package-system-private.h: * components/services/install/lib/eazel-package-system-rpm3-private.h: * components/services/install/lib/eazel-package-system-rpm3.c: * components/services/install/lib/eazel-package-system-rpm3.h: * components/services/install/lib/eazel-package-system-rpm4.c: * components/services/install/lib/eazel-package-system-rpm4.h: * components/services/install/lib/eazel-package-system-skeleton.c: * components/services/install/lib/eazel-package-system-skeleton.h: * components/services/install/lib/eazel-package-system-types.c: * components/services/install/lib/eazel-package-system-types.h: * components/services/install/lib/eazel-package-system.c: * components/services/install/lib/eazel-package-system.h: * components/services/install/lib/eazel-softcat-private.h: * components/services/install/lib/eazel-softcat.c: * components/services/install/lib/eazel-softcat.h: * components/services/install/lib/libeazelinstall.h: * components/services/install/lib/makefile.staticlib.in: * components/services/install/server/.cvsignore: * components/services/install/server/Makefile.am: * components/services/install/server/Trilobite_Service_install.oaf.in: * components/services/install/server/main.c: * components/services/install/server/trilobite-eazel-install-service.png: * components/services/inventory-view/.cvsignore: * components/services/inventory-view/Makefile.am: * components/services/inventory-view/Nautilus_View_inventory.oaf.in: * components/services/inventory-view/main.c: * components/services/inventory-view/nautilus-inventory-config-page.c: * components/services/inventory-view/nautilus-inventory-disable-page.c: * components/services/inventory-view/nautilus-inventory-disable-page.h: * components/services/inventory-view/nautilus-inventory-enable-page.c: * components/services/inventory-view/nautilus-inventory-enable-page.h: * components/services/inventory-view/nautilus-inventory-view-private.h: * components/services/inventory-view/nautilus-inventory-view.c: * components/services/inventory-view/nautilus-inventory-view.h: * components/services/inventory/.cvsignore: * components/services/inventory/Makefile.am: * components/services/inventory/Trilobite_Service_inventory.oaf.in: * components/services/inventory/eazel-inventory-client.c: * components/services/inventory/eazel-inventory-collect-hardware.c: * components/services/inventory/eazel-inventory-collect-hardware.h: * components/services/inventory/eazel-inventory-collect-software.c: * components/services/inventory/eazel-inventory-collect-software.h: * components/services/inventory/eazel-inventory-service-interface.idl: * components/services/inventory/eazel-inventory-service.c: * components/services/inventory/eazel-inventory-service.h: * components/services/inventory/eazel-inventory-upload-callback.c: * components/services/inventory/eazel-inventory-upload-callback.h: * components/services/inventory/eazel-inventory-utils.c: * components/services/inventory/eazel-inventory-utils.h: * components/services/inventory/eazel-inventory.c: * components/services/inventory/eazel-inventory.h: * components/services/inventory/main.c: * components/services/login/.cvsignore: * components/services/login/Makefile.am: * components/services/login/nautilus-view/.cvsignore: * components/services/login/nautilus-view/Makefile.am: * components/services/login/nautilus-view/Nautilus_View_change-password.oaf.in: * components/services/login/nautilus-view/main.c: * components/services/login/nautilus-view/nautilus-change-password-view.c: * components/services/login/nautilus-view/nautilus-change-password-view.h: * components/services/login/nautilus-view/password-box.c: * components/services/login/nautilus-view/password-box.h: * components/services/nautilus-dependent-shared/.cvsignore: * components/services/nautilus-dependent-shared/Makefile.am: * components/services/nautilus-dependent-shared/eazel-services-extensions.c: * components/services/nautilus-dependent-shared/eazel-services-extensions.h: * components/services/nautilus-dependent-shared/eazel-services-footer.c: * components/services/nautilus-dependent-shared/eazel-services-footer.h: * components/services/nautilus-dependent-shared/eazel-services-header.c: * components/services/nautilus-dependent-shared/eazel-services-header.h: * components/services/nautilus-dependent-shared/icons/.cvsignore: * components/services/nautilus-dependent-shared/icons/Makefile.am: * components/services/nautilus-dependent-shared/icons/config-gather.png: * components/services/nautilus-dependent-shared/icons/eazel-logo-left-side-repeat.png: * components/services/nautilus-dependent-shared/icons/eazel-logo-right-side-logo.png: * components/services/nautilus-dependent-shared/icons/eazel-services-header-middle-fill.png: * components/services/nautilus-dependent-shared/icons/eazel-services-logo-tile.png: * components/services/nautilus-dependent-shared/icons/inventory-service-icon.png: * components/services/nautilus-dependent-shared/icons/register.png: * components/services/nautilus-dependent-shared/icons/service-summary-large-grey-section.png: * components/services/nautilus-dependent-shared/icons/service-summary-large-teal-section.png: * components/services/nautilus-dependent-shared/icons/service-summary-logo-bottom.png: * components/services/nautilus-dependent-shared/icons/service-summary-short-grey-section.png: * components/services/nautilus-dependent-shared/icons/service-watch.png: * components/services/nautilus-dependent-shared/icons/services-warning.png: * components/services/nautilus-dependent-shared/icons/softcat-service-icon.png: * components/services/nautilus-dependent-shared/icons/summary-service-normal-fill.png: * components/services/nautilus-dependent-shared/icons/summary-service-normal-left-bumper.png: * components/services/nautilus-dependent-shared/icons/summary-service-normal-right-bumper.png: * components/services/nautilus-dependent-shared/icons/summary-service-prelight-fill.png: * components/services/nautilus-dependent-shared/icons/summary-service-prelight-left-bumper.png: * components/services/nautilus-dependent-shared/icons/summary-service-prelight-right-bumper.png: * components/services/nautilus-dependent-shared/icons/summary-service-remainder-fill.png: * components/services/nautilus-dependent-shared/icons/summary-service-remainder-left-bumper.png: * components/services/nautilus-dependent-shared/icons/summary-service-remainder-right-bumper.png: * components/services/nautilus-dependent-shared/icons/time-sync-service-icon.png: * components/services/nautilus-dependent-shared/icons/vault-service-icon.png: * components/services/nautilus-dependent-shared/test-footer-header.c: * components/services/summary/.cvsignore: * components/services/summary/Makefile.am: * components/services/summary/Nautilus_View_services-summary.oaf.in: * components/services/summary/eazel-summary-shared.c: * components/services/summary/eazel-summary-shared.h: * components/services/summary/icons/.cvsignore: * components/services/summary/icons/Makefile.am: * components/services/summary/icons/active-fill.png: * components/services/summary/icons/active-inactive-bridge.png: * components/services/summary/icons/active-left-bumper.png: * components/services/summary/icons/active-prelight-bridge.png: * components/services/summary/icons/active-right-bumper.png: * components/services/summary/icons/fill-background.png: * components/services/summary/icons/inactive-active-bridge.png: * components/services/summary/icons/inactive-fill.png: * components/services/summary/icons/inactive-left-bumper.png: * components/services/summary/icons/inactive-right-bumper.png: * components/services/summary/icons/prelight-active-bridge.png: * components/services/summary/icons/prelight-fill.png: * components/services/summary/icons/prelight-left-bumper.png: * components/services/summary/icons/prelight-right-bumper.png: * components/services/summary/main.c: * components/services/summary/nautilus-summary-callbacks.c: * components/services/summary/nautilus-summary-callbacks.h: * components/services/summary/nautilus-summary-dialogs.c: * components/services/summary/nautilus-summary-dialogs.h: * components/services/summary/nautilus-summary-footer.c: * components/services/summary/nautilus-summary-footer.h: * components/services/summary/nautilus-summary-menu-items.c: * components/services/summary/nautilus-summary-menu-items.h: * components/services/summary/nautilus-summary-view-private.h: * components/services/summary/nautilus-summary-view-ui.xml: * components/services/summary/nautilus-summary-view.c: * components/services/summary/nautilus-summary-view.h: * components/services/summary/nautilus-tabs.c: * components/services/summary/nautilus-tabs.h: * components/services/summary/redirects.xml: * components/services/summary/services.xml: * components/services/summary/tests.txt: * components/services/time/.cvsignore: * components/services/time/Makefile.am: * components/services/time/command-line/.cvsignore: * components/services/time/command-line/Makefile.am: * components/services/time/command-line/main.c: * components/services/time/idl/.cvsignore: * components/services/time/idl/Makefile.am: * components/services/time/idl/trilobite-eazel-time-service.idl: * components/services/time/nautilus-view/.cvsignore: * components/services/time/nautilus-view/Makefile.am: * components/services/time/nautilus-view/main.c: * components/services/time/nautilus-view/trilobite-eazel-time-view.c: * components/services/time/nautilus-view/trilobite-eazel-time-view.h: * components/services/time/nautilus-view/trilobite-eazel-time-view.oafinfo: * components/services/time/service/.cvsignore: * components/services/time/service/Makefile.am: * components/services/time/service/main.c: * components/services/time/service/trilobite-eazel-time-service-private.h: * components/services/time/service/trilobite-eazel-time-service-public.h: * components/services/time/service/trilobite-eazel-time-service.c: * components/services/time/service/trilobite-eazel-time-service.oafinfo: * components/services/time/service/trilobite-eazel-time-service.png: * components/services/trilobite/.cvsignore: * components/services/trilobite/Makefile.am: * components/services/trilobite/doc/gconf.txt: * components/services/trilobite/helper/.cvsignore: * components/services/trilobite/helper/Makefile.am: * components/services/trilobite/helper/README: * components/services/trilobite/helper/eazel-helper.c: * components/services/trilobite/helper/eazel-helper.pam: * components/services/trilobite/helper/eazel-helper.security.in: * components/services/trilobite/idl/.cvsignore: * components/services/trilobite/idl/Makefile.am: * components/services/trilobite/idl/trilobite-service.idl: * components/services/trilobite/libtrilobite/.cvsignore: * components/services/trilobite/libtrilobite/Makefile.am: * components/services/trilobite/libtrilobite/libtrilobite-service.h: * components/services/trilobite/libtrilobite/libtrilobite.h: * components/services/trilobite/libtrilobite/makefile.staticlib.in: * components/services/trilobite/libtrilobite/trilobite-core-distribution.c: * components/services/trilobite/libtrilobite/trilobite-core-distribution.h: * components/services/trilobite/libtrilobite/trilobite-core-messaging.c: * components/services/trilobite/libtrilobite/trilobite-core-messaging.h: * components/services/trilobite/libtrilobite/trilobite-core-network-slim.c: * components/services/trilobite/libtrilobite/trilobite-core-network.c: * components/services/trilobite/libtrilobite/trilobite-core-network.h: * components/services/trilobite/libtrilobite/trilobite-core-utils.c: * components/services/trilobite/libtrilobite/trilobite-core-utils.h: * components/services/trilobite/libtrilobite/trilobite-i18n.h: * components/services/trilobite/libtrilobite/trilobite-md5-tools.c: * components/services/trilobite/libtrilobite/trilobite-md5-tools.h: * components/services/trilobite/libtrilobite/trilobite-redirect.c: * components/services/trilobite/libtrilobite/trilobite-redirect.h: * components/services/trilobite/libtrilobite/trilobite-root-client-private.h: * components/services/trilobite/libtrilobite/trilobite-root-client-public.h: * components/services/trilobite/libtrilobite/trilobite-root-client.c: * components/services/trilobite/libtrilobite/trilobite-root-helper.c: * components/services/trilobite/libtrilobite/trilobite-root-helper.h: * components/services/trilobite/libtrilobite/trilobite-service-passwordquery-private.h: * components/services/trilobite/libtrilobite/trilobite-service-passwordquery-public.h: * components/services/trilobite/libtrilobite/trilobite-service-passwordquery.c: * components/services/trilobite/libtrilobite/trilobite-service-private.h: * components/services/trilobite/libtrilobite/trilobite-service-public.h: * components/services/trilobite/libtrilobite/trilobite-service.c: * components/services/trilobite/sample/.cvsignore: * components/services/trilobite/sample/Makefile.am: * components/services/trilobite/sample/command-line/.cvsignore: * components/services/trilobite/sample/command-line/Makefile.am: * components/services/trilobite/sample/command-line/main.c: * components/services/trilobite/sample/idl/.cvsignore: * components/services/trilobite/sample/idl/Makefile.am: * components/services/trilobite/sample/idl/sample-service.idl: * components/services/trilobite/sample/lib/.cvsignore: * components/services/trilobite/sample/lib/Makefile.am: * components/services/trilobite/sample/lib/sample-service-public.h: * components/services/trilobite/sample/nautilus-view/.cvsignore: * components/services/trilobite/sample/nautilus-view/Makefile.am: * components/services/trilobite/sample/nautilus-view/Nautilus_View_service-sample.oaf.in: * components/services/trilobite/sample/nautilus-view/icons/.cvsignore: * components/services/trilobite/sample/nautilus-view/icons/Makefile.am: * components/services/trilobite/sample/nautilus-view/main.c: * components/services/trilobite/sample/nautilus-view/nautilus-sample-service-view.c: * components/services/trilobite/sample/nautilus-view/nautilus-sample-service-view.h: * components/services/trilobite/sample/service/.cvsignore: * components/services/trilobite/sample/service/Makefile.am: * components/services/trilobite/sample/service/Trilobite_Service_sample.oaf.in: * components/services/trilobite/sample/service/main.c: * components/services/trilobite/sample/service/sample-service-impl.c: * components/services/trilobite/utils/.cvsignore: * components/services/trilobite/utils/Makefile.am: * components/services/trilobite/utils/eazel-helper-test.c: * nautilus-installer/.cvsignore: * nautilus-installer/Makefile.am: * nautilus-installer/install-lib/.cvsignore: * nautilus-installer/install-lib/Makefile.am: * nautilus-installer/libtrilobite/.cvsignore: * nautilus-installer/libtrilobite/Makefile.am: * nautilus-installer/nautilus-installer.glade: * nautilus-installer/package-list.xml.in: * nautilus-installer/src/.cvsignore: * nautilus-installer/src/HACKING: * nautilus-installer/src/Makefile.am: * nautilus-installer/src/bootstrap-background.xpm: * nautilus-installer/src/callbacks.c: * nautilus-installer/src/callbacks.h: * nautilus-installer/src/create-eazel-installer.sh: * nautilus-installer/src/error-symbol.xpm: * nautilus-installer/src/evil.xpm: * nautilus-installer/src/fake-stock.c: * nautilus-installer/src/fake-stock.h: * nautilus-installer/src/gnome-dialog-util.c: * nautilus-installer/src/gnome-dialog-util.h: * nautilus-installer/src/gnome-dialog.c: * nautilus-installer/src/gnome-dialog.h: * nautilus-installer/src/gnome-druid-page.c: * nautilus-installer/src/gnome-druid-page.h: * nautilus-installer/src/gnome-druid.c: * nautilus-installer/src/gnome-druid.h: * nautilus-installer/src/gnome-messagebox.c: * nautilus-installer/src/gnome-messagebox.h: * nautilus-installer/src/gnome-types.h: * nautilus-installer/src/gtk-hackery.c: * nautilus-installer/src/installer.c: * nautilus-installer/src/installer.h: * nautilus-installer/src/link.sh: * nautilus-installer/src/main.c: * nautilus-installer/src/nautilus-druid-page-eazel.c: * nautilus-installer/src/nautilus-druid-page-eazel.h: * nautilus-installer/src/nautilus-druid.c: * nautilus-installer/src/nautilus-druid.h: * nautilus-installer/src/package-list-depends.xml: * nautilus-installer/src/package-tree.c: * nautilus-installer/src/package-tree.h: * nautilus-installer/src/prescript: * nautilus-installer/src/proxy.c: * nautilus-installer/src/proxy.h: * nautilus-installer/src/rpmsearch.cgi: * nautilus-installer/src/support.c: * nautilus-installer/src/support.h: Retire. These now live in the trilobite module.
Diffstat (limited to 'components/services')
-rw-r--r--components/services/.cvsignore2
-rw-r--r--components/services/Makefile.am14
-rw-r--r--components/services/clone/.cvsignore7
-rw-r--r--components/services/clone/Makefile.am51
-rw-r--r--components/services/clone/eazel-clone-lib.c381
-rw-r--r--components/services/clone/eazel-clone-lib.h34
-rw-r--r--components/services/clone/eazel-clone.c556
-rw-r--r--components/services/docs/directories44
-rw-r--r--components/services/docs/eazel-services-framework-draft148
-rw-r--r--components/services/docs/install-user-settings22
-rw-r--r--components/services/docs/installer-dep-check85
-rw-r--r--components/services/docs/installer-rpm-cases111
-rw-r--r--components/services/docs/installer-rpmsearch55
-rw-r--r--components/services/docs/packagexml.dtd21
-rw-r--r--components/services/install-view/.cvsignore6
-rw-r--r--components/services/install-view/Makefile.am69
-rw-r--r--components/services/install-view/Nautilus_View_install.oaf.in27
-rw-r--r--components/services/install-view/callbacks.c719
-rw-r--r--components/services/install-view/callbacks.h60
-rw-r--r--components/services/install-view/forms.c512
-rw-r--r--components/services/install-view/forms.h36
-rw-r--r--components/services/install-view/main.c116
-rw-r--r--components/services/install-view/nautilus-service-install-view.c1115
-rw-r--r--components/services/install-view/nautilus-service-install-view.h158
-rw-r--r--components/services/install/.cvsignore2
-rw-r--r--components/services/install/Makefile.am1
-rw-r--r--components/services/install/command-line/.cvsignore11
-rw-r--r--components/services/install/command-line/Makefile.am92
-rw-r--r--components/services/install/command-line/eazel-alt-install-corba.c1069
-rwxr-xr-xcomponents/services/install/command-line/eazel-gen-pre-xml.sh5
-rw-r--r--components/services/install/command-line/eazel-gen-xml.c63
-rw-r--r--components/services/install/command-line/eazel-test-inventory.c79
-rw-r--r--components/services/install/command-line/eazel-test-packsys.c624
-rw-r--r--components/services/install/command-line/eazel-test-softcat.c202
-rw-r--r--components/services/install/command-line/eazel-test-types.c184
-rw-r--r--components/services/install/command-line/genpkg_list.example39
-rw-r--r--components/services/install/idl/.cvsignore2
-rw-r--r--components/services/install/idl/Makefile.am5
-rw-r--r--components/services/install/idl/trilobite-eazel-install.idl308
-rw-r--r--components/services/install/lib/.cvsignore13
-rw-r--r--components/services/install/lib/Makefile.am155
-rw-r--r--components/services/install/lib/eazel-install-corba-callback.c707
-rw-r--r--components/services/install/lib/eazel-install-corba-callback.h171
-rw-r--r--components/services/install/lib/eazel-install-corba-types.c650
-rw-r--r--components/services/install/lib/eazel-install-corba-types.h47
-rw-r--r--components/services/install/lib/eazel-install-corba.c604
-rw-r--r--components/services/install/lib/eazel-install-logic2.c3435
-rw-r--r--components/services/install/lib/eazel-install-logic2.h43
-rw-r--r--components/services/install/lib/eazel-install-metadata.c298
-rw-r--r--components/services/install/lib/eazel-install-metadata.h42
-rw-r--r--components/services/install/lib/eazel-install-object.c2230
-rw-r--r--components/services/install/lib/eazel-install-private.h118
-rw-r--r--components/services/install/lib/eazel-install-problem.c1859
-rw-r--r--components/services/install/lib/eazel-install-problem.h228
-rw-r--r--components/services/install/lib/eazel-install-protocols.c712
-rw-r--r--components/services/install/lib/eazel-install-protocols.h48
-rw-r--r--components/services/install/lib/eazel-install-public.h345
-rw-r--r--components/services/install/lib/eazel-install-query-lex.l96
-rw-r--r--components/services/install/lib/eazel-install-query-parse.h26
-rw-r--r--components/services/install/lib/eazel-install-query.h52
-rw-r--r--components/services/install/lib/eazel-install-rpm-signature.c396
-rw-r--r--components/services/install/lib/eazel-install-rpm-signature.h32
-rw-r--r--components/services/install/lib/eazel-install-tests.c42
-rw-r--r--components/services/install/lib/eazel-install-tests.h35
-rw-r--r--components/services/install/lib/eazel-install-xml-package-list.c1017
-rw-r--r--components/services/install/lib/eazel-install-xml-package-list.h50
-rw-r--r--components/services/install/lib/eazel-package-system-dpkg.c497
-rw-r--r--components/services/install/lib/eazel-package-system-dpkg.h58
-rw-r--r--components/services/install/lib/eazel-package-system-private.h109
-rw-r--r--components/services/install/lib/eazel-package-system-rpm3-private.h98
-rw-r--r--components/services/install/lib/eazel-package-system-rpm3.c2056
-rw-r--r--components/services/install/lib/eazel-package-system-rpm3.h71
-rw-r--r--components/services/install/lib/eazel-package-system-rpm4.c320
-rw-r--r--components/services/install/lib/eazel-package-system-rpm4.h56
-rw-r--r--components/services/install/lib/eazel-package-system-skeleton.c214
-rw-r--r--components/services/install/lib/eazel-package-system-skeleton.h57
-rw-r--r--components/services/install/lib/eazel-package-system-types.c2120
-rw-r--r--components/services/install/lib/eazel-package-system-types.h466
-rw-r--r--components/services/install/lib/eazel-package-system.c676
-rw-r--r--components/services/install/lib/eazel-package-system.h164
-rw-r--r--components/services/install/lib/eazel-softcat-private.h51
-rw-r--r--components/services/install/lib/eazel-softcat.c1178
-rw-r--r--components/services/install/lib/eazel-softcat.h127
-rw-r--r--components/services/install/lib/libeazelinstall.h29
-rw-r--r--components/services/install/lib/makefile.staticlib.in37
-rw-r--r--components/services/install/server/.cvsignore11
-rw-r--r--components/services/install/server/Makefile.am71
-rw-r--r--components/services/install/server/Trilobite_Service_install.oaf.in30
-rw-r--r--components/services/install/server/main.c172
-rw-r--r--components/services/install/server/trilobite-eazel-install-service.pngbin3473 -> 0 bytes
-rw-r--r--components/services/inventory-view/.cvsignore6
-rw-r--r--components/services/inventory-view/Makefile.am50
-rw-r--r--components/services/inventory-view/Nautilus_View_inventory.oaf.in27
-rw-r--r--components/services/inventory-view/main.c46
-rw-r--r--components/services/inventory-view/nautilus-inventory-config-page.c190
-rw-r--r--components/services/inventory-view/nautilus-inventory-disable-page.c161
-rw-r--r--components/services/inventory-view/nautilus-inventory-disable-page.h62
-rw-r--r--components/services/inventory-view/nautilus-inventory-enable-page.c265
-rw-r--r--components/services/inventory-view/nautilus-inventory-enable-page.h61
-rw-r--r--components/services/inventory-view/nautilus-inventory-view-private.h37
-rw-r--r--components/services/inventory-view/nautilus-inventory-view.c185
-rw-r--r--components/services/inventory-view/nautilus-inventory-view.h53
-rw-r--r--components/services/inventory/.cvsignore16
-rw-r--r--components/services/inventory/Makefile.am117
-rw-r--r--components/services/inventory/Trilobite_Service_inventory.oaf.in30
-rw-r--r--components/services/inventory/eazel-inventory-client.c138
-rw-r--r--components/services/inventory/eazel-inventory-collect-hardware.c525
-rw-r--r--components/services/inventory/eazel-inventory-collect-hardware.h31
-rw-r--r--components/services/inventory/eazel-inventory-collect-software.c147
-rw-r--r--components/services/inventory/eazel-inventory-collect-software.h29
-rw-r--r--components/services/inventory/eazel-inventory-service-interface.idl25
-rw-r--r--components/services/inventory/eazel-inventory-service.c488
-rw-r--r--components/services/inventory/eazel-inventory-service.h71
-rw-r--r--components/services/inventory/eazel-inventory-upload-callback.c207
-rw-r--r--components/services/inventory/eazel-inventory-upload-callback.h55
-rw-r--r--components/services/inventory/eazel-inventory-utils.c346
-rw-r--r--components/services/inventory/eazel-inventory-utils.h41
-rw-r--r--components/services/inventory/eazel-inventory.c177
-rw-r--r--components/services/inventory/eazel-inventory.h67
-rw-r--r--components/services/inventory/main.c158
-rw-r--r--components/services/login/.cvsignore2
-rw-r--r--components/services/login/Makefile.am1
-rw-r--r--components/services/login/nautilus-view/.cvsignore6
-rw-r--r--components/services/login/nautilus-view/Makefile.am58
-rw-r--r--components/services/login/nautilus-view/Nautilus_View_change-password.oaf.in30
-rw-r--r--components/services/login/nautilus-view/main.c107
-rw-r--r--components/services/login/nautilus-view/nautilus-change-password-view.c600
-rw-r--r--components/services/login/nautilus-view/nautilus-change-password-view.h60
-rw-r--r--components/services/login/nautilus-view/password-box.c332
-rw-r--r--components/services/login/nautilus-view/password-box.h67
-rw-r--r--components/services/nautilus-dependent-shared/.cvsignore7
-rw-r--r--components/services/nautilus-dependent-shared/Makefile.am55
-rw-r--r--components/services/nautilus-dependent-shared/eazel-services-extensions.c516
-rw-r--r--components/services/nautilus-dependent-shared/eazel-services-extensions.h116
-rw-r--r--components/services/nautilus-dependent-shared/eazel-services-footer.c370
-rw-r--r--components/services/nautilus-dependent-shared/eazel-services-footer.h70
-rw-r--r--components/services/nautilus-dependent-shared/eazel-services-header.c204
-rw-r--r--components/services/nautilus-dependent-shared/eazel-services-header.h71
-rw-r--r--components/services/nautilus-dependent-shared/icons/.cvsignore2
-rw-r--r--components/services/nautilus-dependent-shared/icons/Makefile.am33
-rw-r--r--components/services/nautilus-dependent-shared/icons/config-gather.pngbin6759 -> 0 bytes
-rw-r--r--components/services/nautilus-dependent-shared/icons/eazel-logo-left-side-repeat.pngbin197 -> 0 bytes
-rw-r--r--components/services/nautilus-dependent-shared/icons/eazel-logo-right-side-logo.pngbin885 -> 0 bytes
-rw-r--r--components/services/nautilus-dependent-shared/icons/eazel-services-header-middle-fill.pngbin291 -> 0 bytes
-rw-r--r--components/services/nautilus-dependent-shared/icons/eazel-services-logo-tile.pngbin202 -> 0 bytes
-rw-r--r--components/services/nautilus-dependent-shared/icons/inventory-service-icon.pngbin4434 -> 0 bytes
-rw-r--r--components/services/nautilus-dependent-shared/icons/register.pngbin1921 -> 0 bytes
-rw-r--r--components/services/nautilus-dependent-shared/icons/service-summary-large-grey-section.pngbin272 -> 0 bytes
-rw-r--r--components/services/nautilus-dependent-shared/icons/service-summary-large-teal-section.pngbin239 -> 0 bytes
-rw-r--r--components/services/nautilus-dependent-shared/icons/service-summary-logo-bottom.pngbin1377 -> 0 bytes
-rw-r--r--components/services/nautilus-dependent-shared/icons/service-summary-short-grey-section.pngbin224 -> 0 bytes
-rw-r--r--components/services/nautilus-dependent-shared/icons/service-watch.pngbin9907 -> 0 bytes
-rw-r--r--components/services/nautilus-dependent-shared/icons/services-warning.pngbin1892 -> 0 bytes
-rw-r--r--components/services/nautilus-dependent-shared/icons/softcat-service-icon.pngbin4526 -> 0 bytes
-rw-r--r--components/services/nautilus-dependent-shared/icons/summary-service-normal-fill.pngbin205 -> 0 bytes
-rw-r--r--components/services/nautilus-dependent-shared/icons/summary-service-normal-left-bumper.pngbin236 -> 0 bytes
-rw-r--r--components/services/nautilus-dependent-shared/icons/summary-service-normal-right-bumper.pngbin224 -> 0 bytes
-rw-r--r--components/services/nautilus-dependent-shared/icons/summary-service-prelight-fill.pngbin229 -> 0 bytes
-rw-r--r--components/services/nautilus-dependent-shared/icons/summary-service-prelight-left-bumper.pngbin264 -> 0 bytes
-rw-r--r--components/services/nautilus-dependent-shared/icons/summary-service-prelight-right-bumper.pngbin255 -> 0 bytes
-rw-r--r--components/services/nautilus-dependent-shared/icons/summary-service-remainder-fill.pngbin214 -> 0 bytes
-rw-r--r--components/services/nautilus-dependent-shared/icons/summary-service-remainder-left-bumper.pngbin245 -> 0 bytes
-rw-r--r--components/services/nautilus-dependent-shared/icons/summary-service-remainder-right-bumper.pngbin236 -> 0 bytes
-rw-r--r--components/services/nautilus-dependent-shared/icons/time-sync-service-icon.pngbin3305 -> 0 bytes
-rw-r--r--components/services/nautilus-dependent-shared/icons/vault-service-icon.pngbin3993 -> 0 bytes
-rw-r--r--components/services/nautilus-dependent-shared/test-footer-header.c98
-rw-r--r--components/services/summary/.cvsignore6
-rw-r--r--components/services/summary/Makefile.am77
-rw-r--r--components/services/summary/Nautilus_View_services-summary.oaf.in27
-rw-r--r--components/services/summary/eazel-summary-shared.c384
-rw-r--r--components/services/summary/eazel-summary-shared.h82
-rw-r--r--components/services/summary/icons/.cvsignore2
-rw-r--r--components/services/summary/icons/Makefile.am22
-rw-r--r--components/services/summary/icons/active-fill.pngbin416 -> 0 bytes
-rw-r--r--components/services/summary/icons/active-inactive-bridge.pngbin937 -> 0 bytes
-rw-r--r--components/services/summary/icons/active-left-bumper.pngbin438 -> 0 bytes
-rw-r--r--components/services/summary/icons/active-prelight-bridge.pngbin964 -> 0 bytes
-rw-r--r--components/services/summary/icons/active-right-bumper.pngbin918 -> 0 bytes
-rw-r--r--components/services/summary/icons/fill-background.pngbin368 -> 0 bytes
-rw-r--r--components/services/summary/icons/inactive-active-bridge.pngbin745 -> 0 bytes
-rw-r--r--components/services/summary/icons/inactive-fill.pngbin421 -> 0 bytes
-rw-r--r--components/services/summary/icons/inactive-left-bumper.pngbin424 -> 0 bytes
-rw-r--r--components/services/summary/icons/inactive-right-bumper.pngbin886 -> 0 bytes
-rw-r--r--components/services/summary/icons/prelight-active-bridge.pngbin742 -> 0 bytes
-rw-r--r--components/services/summary/icons/prelight-fill.pngbin419 -> 0 bytes
-rw-r--r--components/services/summary/icons/prelight-left-bumper.pngbin414 -> 0 bytes
-rw-r--r--components/services/summary/icons/prelight-right-bumper.pngbin887 -> 0 bytes
-rw-r--r--components/services/summary/main.c130
-rw-r--r--components/services/summary/nautilus-summary-callbacks.c317
-rw-r--r--components/services/summary/nautilus-summary-callbacks.h43
-rw-r--r--components/services/summary/nautilus-summary-dialogs.c300
-rw-r--r--components/services/summary/nautilus-summary-dialogs.h36
-rw-r--r--components/services/summary/nautilus-summary-footer.c101
-rw-r--r--components/services/summary/nautilus-summary-footer.h31
-rw-r--r--components/services/summary/nautilus-summary-menu-items.c186
-rw-r--r--components/services/summary/nautilus-summary-menu-items.h36
-rw-r--r--components/services/summary/nautilus-summary-view-private.h124
-rw-r--r--components/services/summary/nautilus-summary-view-ui.xml26
-rw-r--r--components/services/summary/nautilus-summary-view.c1047
-rw-r--r--components/services/summary/nautilus-summary-view.h60
-rw-r--r--components/services/summary/nautilus-tabs.c926
-rw-r--r--components/services/summary/nautilus-tabs.h64
-rw-r--r--components/services/summary/redirects.xml56
-rw-r--r--components/services/summary/services.xml330
-rw-r--r--components/services/summary/tests.txt7
-rw-r--r--components/services/time/.cvsignore2
-rw-r--r--components/services/time/Makefile.am2
-rw-r--r--components/services/time/command-line/.cvsignore12
-rw-r--r--components/services/time/command-line/Makefile.am66
-rw-r--r--components/services/time/command-line/main.c169
-rw-r--r--components/services/time/idl/.cvsignore2
-rw-r--r--components/services/time/idl/Makefile.am6
-rw-r--r--components/services/time/idl/trilobite-eazel-time-service.idl24
-rw-r--r--components/services/time/nautilus-view/.cvsignore11
-rw-r--r--components/services/time/nautilus-view/Makefile.am73
-rw-r--r--components/services/time/nautilus-view/main.c118
-rw-r--r--components/services/time/nautilus-view/trilobite-eazel-time-view.c484
-rw-r--r--components/services/time/nautilus-view/trilobite-eazel-time-view.h63
-rw-r--r--components/services/time/nautilus-view/trilobite-eazel-time-view.oafinfo26
-rw-r--r--components/services/time/service/.cvsignore10
-rw-r--r--components/services/time/service/Makefile.am81
-rw-r--r--components/services/time/service/main.c128
-rw-r--r--components/services/time/service/trilobite-eazel-time-service-private.h38
-rw-r--r--components/services/time/service/trilobite-eazel-time-service-public.h68
-rw-r--r--components/services/time/service/trilobite-eazel-time-service.c630
-rw-r--r--components/services/time/service/trilobite-eazel-time-service.oafinfo27
-rw-r--r--components/services/time/service/trilobite-eazel-time-service.pngbin3473 -> 0 bytes
-rw-r--r--components/services/trilobite/.cvsignore2
-rw-r--r--components/services/trilobite/Makefile.am1
-rw-r--r--components/services/trilobite/doc/gconf.txt39
-rw-r--r--components/services/trilobite/helper/.cvsignore6
-rw-r--r--components/services/trilobite/helper/Makefile.am49
-rw-r--r--components/services/trilobite/helper/README22
-rw-r--r--components/services/trilobite/helper/eazel-helper.c170
-rw-r--r--components/services/trilobite/helper/eazel-helper.pam5
-rw-r--r--components/services/trilobite/helper/eazel-helper.security.in4
-rw-r--r--components/services/trilobite/idl/.cvsignore2
-rw-r--r--components/services/trilobite/idl/Makefile.am6
-rw-r--r--components/services/trilobite/idl/trilobite-service.idl55
-rw-r--r--components/services/trilobite/libtrilobite/.cvsignore12
-rw-r--r--components/services/trilobite/libtrilobite/Makefile.am108
-rw-r--r--components/services/trilobite/libtrilobite/libtrilobite-service.h42
-rw-r--r--components/services/trilobite/libtrilobite/libtrilobite.h46
-rw-r--r--components/services/trilobite/libtrilobite/makefile.staticlib.in31
-rw-r--r--components/services/trilobite/libtrilobite/trilobite-core-distribution.c458
-rw-r--r--components/services/trilobite/libtrilobite/trilobite-core-distribution.h82
-rw-r--r--components/services/trilobite/libtrilobite/trilobite-core-messaging.c129
-rw-r--r--components/services/trilobite/libtrilobite/trilobite-core-messaging.h29
-rw-r--r--components/services/trilobite/libtrilobite/trilobite-core-network-slim.c178
-rw-r--r--components/services/trilobite/libtrilobite/trilobite-core-network.c197
-rw-r--r--components/services/trilobite/libtrilobite/trilobite-core-network.h38
-rw-r--r--components/services/trilobite/libtrilobite/trilobite-core-utils.c293
-rw-r--r--components/services/trilobite/libtrilobite/trilobite-core-utils.h68
-rw-r--r--components/services/trilobite/libtrilobite/trilobite-i18n.h44
-rw-r--r--components/services/trilobite/libtrilobite/trilobite-md5-tools.c428
-rw-r--r--components/services/trilobite/libtrilobite/trilobite-md5-tools.h48
-rw-r--r--components/services/trilobite/libtrilobite/trilobite-redirect.c299
-rw-r--r--components/services/trilobite/libtrilobite/trilobite-redirect.h51
-rw-r--r--components/services/trilobite/libtrilobite/trilobite-root-client-private.h31
-rw-r--r--components/services/trilobite/libtrilobite/trilobite-root-client-public.h81
-rw-r--r--components/services/trilobite/libtrilobite/trilobite-root-client.c340
-rw-r--r--components/services/trilobite/libtrilobite/trilobite-root-helper.c634
-rw-r--r--components/services/trilobite/libtrilobite/trilobite-root-helper.h116
-rw-r--r--components/services/trilobite/libtrilobite/trilobite-service-passwordquery-private.h38
-rw-r--r--components/services/trilobite/libtrilobite/trilobite-service-passwordquery-public.h86
-rw-r--r--components/services/trilobite/libtrilobite/trilobite-service-passwordquery.c373
-rw-r--r--components/services/trilobite/libtrilobite/trilobite-service-private.h43
-rw-r--r--components/services/trilobite/libtrilobite/trilobite-service-public.h107
-rw-r--r--components/services/trilobite/libtrilobite/trilobite-service.c635
-rw-r--r--components/services/trilobite/sample/.cvsignore3
-rw-r--r--components/services/trilobite/sample/Makefile.am1
-rw-r--r--components/services/trilobite/sample/command-line/.cvsignore6
-rw-r--r--components/services/trilobite/sample/command-line/Makefile.am39
-rw-r--r--components/services/trilobite/sample/command-line/main.c140
-rw-r--r--components/services/trilobite/sample/idl/.cvsignore2
-rw-r--r--components/services/trilobite/sample/idl/Makefile.am6
-rw-r--r--components/services/trilobite/sample/idl/sample-service.idl13
-rw-r--r--components/services/trilobite/sample/lib/.cvsignore8
-rw-r--r--components/services/trilobite/sample/lib/Makefile.am44
-rw-r--r--components/services/trilobite/sample/lib/sample-service-public.h73
-rw-r--r--components/services/trilobite/sample/nautilus-view/.cvsignore6
-rw-r--r--components/services/trilobite/sample/nautilus-view/Makefile.am51
-rw-r--r--components/services/trilobite/sample/nautilus-view/Nautilus_View_service-sample.oaf.in27
-rw-r--r--components/services/trilobite/sample/nautilus-view/icons/.cvsignore2
-rw-r--r--components/services/trilobite/sample/nautilus-view/icons/Makefile.am8
-rw-r--r--components/services/trilobite/sample/nautilus-view/main.c29
-rw-r--r--components/services/trilobite/sample/nautilus-view/nautilus-sample-service-view.c23
-rw-r--r--components/services/trilobite/sample/nautilus-view/nautilus-sample-service-view.h29
-rw-r--r--components/services/trilobite/sample/service/.cvsignore6
-rw-r--r--components/services/trilobite/sample/service/Makefile.am53
-rw-r--r--components/services/trilobite/sample/service/Trilobite_Service_sample.oaf.in30
-rw-r--r--components/services/trilobite/sample/service/main.c150
-rw-r--r--components/services/trilobite/sample/service/sample-service-impl.c379
-rw-r--r--components/services/trilobite/utils/.cvsignore5
-rw-r--r--components/services/trilobite/utils/Makefile.am40
-rw-r--r--components/services/trilobite/utils/eazel-helper-test.c136
296 files changed, 0 insertions, 48965 deletions
diff --git a/components/services/.cvsignore b/components/services/.cvsignore
deleted file mode 100644
index 282522db0..000000000
--- a/components/services/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-Makefile
-Makefile.in
diff --git a/components/services/Makefile.am b/components/services/Makefile.am
deleted file mode 100644
index 333336cab..000000000
--- a/components/services/Makefile.am
+++ /dev/null
@@ -1,14 +0,0 @@
-NULL=
-
-if BUILD_RPM_COMPONENTS
-INSTALL_SERVICE=install inventory install-view inventory-view clone
-endif
-
-
-SUBDIRS = \
- trilobite \
- nautilus-dependent-shared \
- $(INSTALL_SERVICE) \
- login \
- summary \
- $(NULL)
diff --git a/components/services/clone/.cvsignore b/components/services/clone/.cvsignore
deleted file mode 100644
index 4af857316..000000000
--- a/components/services/clone/.cvsignore
+++ /dev/null
@@ -1,7 +0,0 @@
-Makefile.in
-Makefile
-.deps
-.libs
-eazel-clone
-*.la
-*.lo
diff --git a/components/services/clone/Makefile.am b/components/services/clone/Makefile.am
deleted file mode 100644
index 371ee7336..000000000
--- a/components/services/clone/Makefile.am
+++ /dev/null
@@ -1,51 +0,0 @@
-include $(top_srcdir)/Makefile.shared
-
-INCLUDES = \
- -DPREFIX=\"$(prefix)\" \
- -DG_LOG_DOMAIN=\"EazelClone\" \
- -I$(top_srcdir) \
- -I$(top_builddir) \
- -I$(top_srcdir)/components/services/trilobite/libtrilobite \
- -I$(top_builddir)/components/services/trilobite/libtrilobite \
- -I$(top_srcdir)/components/services/trilobite \
- -I$(top_builddir)/components/services/trilobite \
- -I$(top_srcdir)/components/services/install/lib \
- -I$(top_builddir)/components/services/install/lib \
- -DGNOMELOCALEDIR=\""$(datadir)/locale"\" \
- $(EEL_INCLUDEDIR) \
- $(LIBRSVG_INCLUDEDIR) \
- $(GNOME_CFLAGS) \
- $(GCONF_CFLAGS) \
- $(VFS_CFLAGS) \
- $(XML_CFLAGS) \
- $(GHTTP_CFLAGS) \
- $(NULL)
-
-LDADD = \
- $(top_builddir)/components/services/trilobite/libtrilobite/libtrilobite.la \
- $(top_builddir)/components/services/install/lib/libeazelinstall.la \
- $(top_builddir)/components/services/install/lib/libeazelpackagesystem.la \
- $(top_builddir)/components/services/clone/libeazelinstallclone.la \
- $(EEL_LIBS) \
- $(LIBRSVG_LIBS) \
- $(BONOBO_LIBS) \
- $(GNOME_LIBS) \
- $(GCONF_LIBS) \
- $(VFS_LIBS) \
- $(GHTTP_LIBS) \
- $(RPM_LIBS) \
- $(NULL)
-
-bin_PROGRAMS = eazel-clone
-
-eazel_clone_SOURCES = \
- eazel-clone.c \
- $(NULL)
-
-lib_LTLIBRARIES = libeazelinstallclone.la
-
-libeazelinstallclone_la_SOURCES = \
- eazel-clone-lib.h \
- eazel-clone-lib.c \
- $(NULL)
-
diff --git a/components/services/clone/eazel-clone-lib.c b/components/services/clone/eazel-clone-lib.c
deleted file mode 100644
index ebd1583b3..000000000
--- a/components/services/clone/eazel-clone-lib.c
+++ /dev/null
@@ -1,381 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Copyright (C) 2001 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: Eskil Heyn Olsen <eskil@eazel.com>
- *
- */
-
-#include <config.h>
-#include <gnome.h>
-#include <liboaf/liboaf.h>
-#include <bonobo.h>
-#include <sys/utsname.h>
-
-#include "eazel-clone-lib.h"
-#include <eazel-package-system.h>
-#include <eazel-install-xml-package-list.h>
-#include <libtrilobite/libtrilobite.h>
-
-#include <unistd.h>
-
-typedef struct {
- PackageData *installed;
- PackageData *inventory;
- EazelSoftCatSense sense;
-} PackagePair;
-
-/* Ripped from eazel-install-public.h */
-
-typedef enum {
- EAZEL_INSTALL_STATUS_NEW_PACKAGE,
- EAZEL_INSTALL_STATUS_UPGRADES,
- EAZEL_INSTALL_STATUS_DOWNGRADES,
- EAZEL_INSTALL_STATUS_QUO
-} EazelInstallStatus;
-
-
-GList*
-eazel_install_clone_load_inventory (char *input_file)
-{
- FILE *f;
- GList *result = NULL;
-
- if (input_file==NULL) {
- f = stdin;
- } else {
- f = fopen (input_file, "rt");
- }
-
- if (f==NULL) {
- trilobite_debug ("Could not access file %s", input_file==NULL ? "(stdin)":input_file);
- } else {
- char *tmp;
- size_t size, rsize;
-
- fseek (f, 0, SEEK_END);
- size = ftell (f);
- fseek (f, 0, SEEK_SET);
- tmp = g_new (char, size);
- rsize = fread (tmp, 1, size, f);
- if (rsize != size) {
- trilobite_debug ("read too little (%d, expected %d)", rsize, size);
- } else {
- result = parse_memory_xml_package_list (tmp, size);
- }
- g_free (tmp);
- }
-
- trilobite_debug ("%d category (%s), %d packages",
- g_list_length (result),
- ((CategoryData*)(result->data))->name,
- g_list_length (((CategoryData*)(result->data))->packages));
-
- /* FIXME: I leak the glist and the one categorydata element here */
- return ((CategoryData*)(result->data))->packages;
-}
-
-/* Ripped and modified from eazel-install-logic2.c */
-
-static EazelInstallStatus
-eazel_install_clone_check_existing (EazelPackageSystem *packsys,
- PackageData *pack,
- PackagePair **pair)
-{
- GList *existing_packages;
- GList *borked_packages = NULL;
- EazelInstallStatus result;
-
- g_assert (pair);
- g_assert ((*pair)==NULL);
- g_assert (pack);
- g_assert (IS_PACKAGEDATA (pack));
-
-#if EC_DEBUG & 0x4
- trilobite_debug ("check_existing %p %s", pack, pack->name);
-#endif
- result = EAZEL_INSTALL_STATUS_NEW_PACKAGE;
- /* query for existing package of same name */
- existing_packages = eazel_package_system_query (packsys,
- NULL,
- pack->name,
- EAZEL_PACKAGE_SYSTEM_QUERY_MATCHES,
- PACKAGE_FILL_NO_DEPENDENCIES|
- PACKAGE_FILL_NO_TEXT|
- PACKAGE_FILL_NO_DIRS_IN_PROVIDES);
-
- /* If error, handle it */
- if (packsys->err) {
-#if EC_DEBUG & 0x4
- switch (packsys->err->e) {
- case EazelPackageSystemError_DB_ACCESS:
- if (strcmp (packsys->err->u.db_access.path, "/")==0) {
- trilobite_debug ("some package dbs is locked by another process",
- packsys->err->u.db_access.pid);
- pack->status = PACKAGE_PACKSYS_FAILURE;
- g_free (packsys->err);
- return result;
- break;
- }
- }
-#endif
- }
- if (existing_packages) {
- /* Get the existing package, set it's modify flag and add it */
- GList *iterator;
- PackageData *survivor = NULL;
- gboolean abort = FALSE;
- int res;
-
- if (g_list_length (existing_packages)>1) {
-#if EC_DEBUG & 0x4
- trilobite_debug ("there are %d existing packages called %s",
- g_list_length (existing_packages),
- pack->name);
-#endif
- /* Verify them all, to find one that is not damaged. Mark the rest
- as invalid so the client can suggest the user should delete them */
- for (iterator = existing_packages; iterator; iterator = g_list_next (iterator)) {
- PackageData *existing_package = PACKAGEDATA (iterator->data);
- char *name = packagedata_get_readable_name (existing_package);
- GList *foo = NULL;
-
- foo = g_list_prepend (foo, existing_package);
- if (eazel_package_system_verify (packsys, NULL, foo)) {
- /* I18N note: "%is is ok" in the sense that %s=package name and the
- package is intact */
- g_message (_("%s is ok"), name);
- if (survivor == NULL) {
- survivor = existing_package;
- } else {
- abort = TRUE;
- }
- } else {
- /* I18N note: "%is is not ok" in the sense that %s=package name and the
- package is not intact */
- g_message ("%s is not ok", name);
- existing_package->status = PACKAGE_INVALID;
- /* I add the borked packages later, so they'll show up
- earlier in the tree */
- borked_packages = g_list_prepend (borked_packages, existing_package);
- }
- g_list_free (foo);
- g_free (name);
- }
- } else {
- survivor = PACKAGEDATA (g_list_first (existing_packages)->data);
- }
-
- if (abort) {
- trilobite_debug ("*********************************************************");
- trilobite_debug ("This is a bad bad case, see bug 3511");
- trilobite_debug ("To circumvent this problem, as root, execute this command");
- trilobite_debug ("(which is dangerous by the way....)");
- trilobite_debug ("rpm -e --nodeps `rpm -q %s`", pack->name);
-
- g_list_free (borked_packages);
-
- /* Cancel the package, mark all the existing as invalid */
- pack->status = PACKAGE_CANCELLED;
- for (iterator = existing_packages; iterator; iterator = g_list_next (iterator)) {
- PackageData *existing_package = PACKAGEDATA (iterator->data);
- existing_package->status = PACKAGE_INVALID;
- packagedata_add_pack_to_modifies (pack, existing_package);
- gtk_object_unref (GTK_OBJECT (existing_package));
- }
- }
-
- if (abort==FALSE && survivor) {
- g_assert (pack->version);
- g_assert (survivor->version);
-
- res = eazel_package_system_compare_version (packsys,
- pack->version,
- survivor->version);
-
- if (survivor->epoch > 0) {
-#if EC_DEBUG & 0x4
- g_warning ("modified package has epoch %d, new package has %d",
- survivor->epoch,
- pack->epoch);
-#endif
- gtk_object_set_data (GTK_OBJECT (packsys),
- "ignore-epochs", GINT_TO_POINTER (1));
- }
-
- /* check against minor version */
- if (res==0) {
-#if EC_DEBUG & 0x4
- trilobite_debug ("versions are equal (%s), comparing minors", pack->version);
-#endif
- if (pack->minor && survivor->minor) {
-#if EC_DEBUG & 0x4
- trilobite_debug ("minors are %s for new and %s for installed)",
- pack->minor, survivor->minor);
-#endif
- res = eazel_package_system_compare_version (packsys,
- pack->minor,
- survivor->minor);
- } else if (!pack->minor && survivor->minor) {
- /* If the given packages does not have a minor,
- but the installed has, assume we're fine */
- /* FIXME: bugzilla.eazel.com
- This is a patch, it should be res=1, revert when
- softcat is updated to have revisions for all packages
- (post PR3) */
- res = 1;
- } else {
- /* Eh, do nothing just to be safe */
- res = 0;
- }
- }
-
- (*pair) = g_new0 (PackagePair, 1);
- (*pair)->inventory = pack;
- (*pair)->installed = survivor;
-
- /* Set the modify_status flag */
- if (res == 0) {
- (*pair)->sense = EAZEL_SOFTCAT_SENSE_EQ;
- survivor->modify_status = PACKAGE_MOD_UNTOUCHED;
- } else if (res > 0) {
- (*pair)->sense = EAZEL_SOFTCAT_SENSE_GT;
- survivor->modify_status = PACKAGE_MOD_UPGRADED;
- } else {
- (*pair)->sense = EAZEL_SOFTCAT_SENSE_LT;
- survivor->modify_status = PACKAGE_MOD_DOWNGRADED;
- }
-
- /* Calc the result */
- if (res == 0) {
- result = EAZEL_INSTALL_STATUS_QUO;
- } else if (res > 0) {
- result = EAZEL_INSTALL_STATUS_UPGRADES;
- } else {
- result = EAZEL_INSTALL_STATUS_DOWNGRADES;
- }
-
- if (result != EAZEL_INSTALL_STATUS_QUO) {
- survivor->status = PACKAGE_RESOLVED;
- }
- pack->status = PACKAGE_ALREADY_INSTALLED;
- }
-
- /* Now add the borked packages */
- for (iterator = borked_packages; iterator; iterator = g_list_next (iterator)) {
- PackageData *existing_package = PACKAGEDATA (iterator->data);
- packagedata_add_pack_to_modifies (pack, existing_package);
- gtk_object_unref (GTK_OBJECT (existing_package));
-
- }
- g_list_free (borked_packages);
-
- /* Free the list structure from _simple_query */
- g_list_free (existing_packages);
- } else {
-#if EC_DEBUG & 0x4
- if (pack->minor) {
- trilobite_debug (_("%s installs version %s-%s"),
- pack->name,
- pack->version,
- pack->minor);
- } else {
- trilobite_debug (_("%s installs version %s"),
- pack->name,
- pack->version);
- }
-
-#endif
- }
-
- return result;
-}
-
-void
-eazel_install_clone_compare_inventory (GList *inventory,
- GList **install,
- GList **upgrade,
- GList **downgrade)
-{
- GList *iterator;
- EazelPackageSystem *packsys = eazel_package_system_new (NULL);
-
- g_assert (install);
- g_assert ((*install)==NULL);
- g_assert (upgrade);
- g_assert ((*upgrade)==NULL);
- g_assert (downgrade);
- g_assert ((*downgrade)==NULL);
-
- for (iterator = inventory; iterator; iterator = g_list_next (iterator)) {
- PackageData *package;
- PackagePair *pair = NULL;
- EazelInstallStatus res;
-
- package = PACKAGEDATA (iterator->data);
- res = eazel_install_clone_check_existing (packsys, package, &pair);
- switch (res) {
- case EAZEL_INSTALL_STATUS_QUO:
- break;
- case EAZEL_INSTALL_STATUS_NEW_PACKAGE:
- (*install) = g_list_prepend ((*install), package);
- break;
- case EAZEL_INSTALL_STATUS_UPGRADES:
- (*upgrade) = g_list_prepend ((*upgrade), package);
- break;
- case EAZEL_INSTALL_STATUS_DOWNGRADES:
- (*downgrade) = g_list_prepend ((*downgrade), package);
- break;
- }
- if (pair) {
- gtk_object_unref (GTK_OBJECT (pair->installed));
- g_free (pair);
- }
- }
- gtk_object_unref (GTK_OBJECT (packsys));
-}
-
-void
-eazel_install_clone_create_inventory (char **mem, long *size)
-{
- GList *packages;
- EazelPackageSystem *packsys = eazel_package_system_new (NULL);
- xmlDocPtr doc;
- xmlNodePtr ptr, node;
-
- packages = eazel_package_system_query (packsys,
- NULL,
- "",
- EAZEL_PACKAGE_SYSTEM_QUERY_SUBSTR,
- PACKAGE_FILL_MINIMAL);
-
- /* FIXME: must strip dupes here.
- for p and q where p->name == q->name,
- verify both, and only list the ones that pass */
-
- ptr = eazel_install_packagelist_to_xml (packages, FALSE);
- doc = xmlNewDoc ("1.0");
- doc->root = xmlNewDocNode (doc, NULL, "CATEGORIES", NULL);
- node = xmlNewChild (doc->root, NULL, "CATEGORY", NULL);
- xmlSetProp (node, "name", "inventory");
- xmlAddChild (node, ptr);
- xmlDocDumpMemory (doc, (xmlChar**)mem, (int*)size);
- xmlFreeDoc (doc);
-
- gtk_object_unref (GTK_OBJECT (packsys));
-}
diff --git a/components/services/clone/eazel-clone-lib.h b/components/services/clone/eazel-clone-lib.h
deleted file mode 100644
index 99af6b2e9..000000000
--- a/components/services/clone/eazel-clone-lib.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Copyright (C) 2001 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: Eskil Heyn Olsen <eskil@eazel.com>
- *
- */
-
-#include <config.h>
-#include <glib.h>
-
-GList* eazel_install_clone_load_inventory (char *input_file);
-
-void eazel_install_clone_compare_inventory (GList *inventory,
- GList **install,
- GList **update,
- GList **downgrade);
-
-void eazel_install_clone_create_inventory (char **mem, long *size);
diff --git a/components/services/clone/eazel-clone.c b/components/services/clone/eazel-clone.c
deleted file mode 100644
index 4899467e5..000000000
--- a/components/services/clone/eazel-clone.c
+++ /dev/null
@@ -1,556 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Copyright (C) 2001 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: Eskil Heyn Olsen <eskil@eazel.com>
- *
- */
-
-#include <config.h>
-#include <gnome.h>
-#include <liboaf/liboaf.h>
-#include <bonobo.h>
-#include <sys/utsname.h>
-
-#include <eazel-package-system-types.h>
-#include <eazel-install-corba-types.h>
-#include <eazel-install-corba-callback.h>
-#include <eazel-install-problem.h>
-
-#include <libtrilobite/libtrilobite.h>
-#include <trilobite-eazel-install.h>
-#include "eazel-clone-lib.h"
-#include <unistd.h>
-
-CORBA_ORB orb;
-CORBA_Environment ev;
-int cli_result = 0;
-
-/* Popt stuff */
-int arg_dry_run = 0,
- arg_debug = 0,
- arg_no_auth = 0,
- arg_dump = 0,
- arg_downgrade = 0;
-
-char *arg_server = NULL,
- *arg_cgi = NULL,
- *arg_file = NULL,
- *arg_root = NULL,
- *arg_username = NULL;
-
-static const struct poptOption options[] = {
- {"cgi-path", '\0', POPT_ARG_STRING, &arg_cgi, 0, N_("Specify search cgi"), NULL},
- {"debug", '\0', POPT_ARG_NONE, &arg_debug, 0 , N_("Show debug output"), NULL},
- {"downgrade", '\0', POPT_ARG_NONE, &arg_downgrade, 0 , N_("Allow downgrade"), NULL},
- {"file",'\0', POPT_ARG_STRING, &arg_file, 0, N_("Inventory xml to clone from (if omitted, file will be read from standard in)"), NULL},
- {"no-auth", '\0', POPT_ARG_NONE, &arg_no_auth, 0, N_("don't use eazel auth stuff"), NULL},
- {"root", '\0', POPT_ARG_STRING, &arg_root, 0, N_("Set root"), NULL},
- {"server", '\0', POPT_ARG_STRING, &arg_server, 0, N_("Specify server"), NULL},
- {"test", 't', POPT_ARG_NONE, &arg_dry_run, 0, N_("Test run"), NULL},
- {"username", '\0', POPT_ARG_STRING, &arg_username, 0, N_("Allow username"), NULL},
- {"dump", '\0', POPT_ARG_NONE, &arg_dump, 0, N_("dump inventory"), NULL},
- {NULL, '\0', 0, NULL, 0}
-};
-
-#define check_ev(s) \
-if (ev._major!=CORBA_NO_EXCEPTION) { \
- fprintf (stderr, "*** %s: Caught exception %s\n", \
- s, CORBA_exception_id (&ev)); \
-}
-
-static void
-set_parameters_from_command_line (GNOME_Trilobite_Eazel_Install service)
-{
- if (arg_debug) {
- GNOME_Trilobite_Eazel_Install__set_debug (service, TRUE, &ev);
- check_ev ("set_debug");
- }
-
- GNOME_Trilobite_Eazel_Install__set_protocol (service, GNOME_Trilobite_Eazel_PROTOCOL_HTTP, &ev);
- check_ev ("set_protocol");
-
- if (arg_downgrade) {
- GNOME_Trilobite_Eazel_Install__set_downgrade (service, TRUE, &ev);
- check_ev ("downgrade");
- }
- if (arg_server) {
- char *colon = strchr (arg_server, ':');
- if (colon) {
- char *host;
- int port;
-
- host = g_new0(char, (colon - arg_server) + 1);
- strncpy (host, arg_server, colon - arg_server);
- colon++;
- port = atoi (colon);
- GNOME_Trilobite_Eazel_Install__set_server (service, host, &ev);
- check_ev ("set_server");
- GNOME_Trilobite_Eazel_Install__set_server_port (service, port, &ev);
- check_ev ("set_port");
- g_free (host);
- } else {
- GNOME_Trilobite_Eazel_Install__set_server (service, arg_server, &ev);
- check_ev ("set_server");
- }
- GNOME_Trilobite_Eazel_Install__set_auth (service, FALSE, &ev);
- check_ev ("set_auth");
- } else if (arg_no_auth==0) {
- char *host, *p;
- int port;
-
- host = g_strdup (trilobite_get_services_address ());
- if ((p = strchr (host, ':')) != NULL) {
- *p = 0;
- port = atoi (p+1);
- } else {
- port = 80;
- }
- GNOME_Trilobite_Eazel_Install__set_auth (service, TRUE, &ev);
- check_ev ("set_auth");
- GNOME_Trilobite_Eazel_Install__set_server (service, host, &ev);
- check_ev ("set_server");
- GNOME_Trilobite_Eazel_Install__set_server_port (service, port, &ev);
- check_ev ("set_port");
- g_free (host);
- }
-
- if (arg_username) {
- GNOME_Trilobite_Eazel_Install__set_username (service, arg_username, &ev);
- check_ev ("set_username");
- }
-
- if (arg_cgi) {
- GNOME_Trilobite_Eazel_Install__set_cgi (service, arg_cgi, &ev);
- check_ev ("set_cgi");
- }
-
- if (arg_no_auth) {
- GNOME_Trilobite_Eazel_Install__set_auth (service, FALSE, &ev);
- check_ev ("set_auth");
- }
-
- if (arg_dry_run) {
- GNOME_Trilobite_Eazel_Install__set_test_mode (service, TRUE, &ev);
- }
-
- if (arg_root) {
- if (arg_root[0]=='~') {
- char *tmp = g_strdup_printf ("%s/%s", g_get_home_dir (),
- arg_root+1);
- free (arg_root);
- arg_root = strdup (tmp);
- g_free (tmp);
- } else if (arg_root[0]!='/' || arg_root[0]=='.') {
- char *tmp = g_strdup_printf ("%s%s%s", g_get_current_dir (),
- arg_root[0]=='.' ? "" : "/",
- arg_root+1);
- free (arg_root);
- arg_root = strdup (tmp);
- g_free (tmp);
- }
- }
-}
-
-static void
-eazel_file_conflict_check_signal (EazelInstallCallback *service,
- const PackageData *pack,
- gpointer unused)
-{
- char *tmp = packagedata_get_readable_name (pack);
- printf ("I: FILE CONFLICT CHECKING \"%s\"\n", tmp);
- fflush (stdout);
- g_free (tmp);
-}
-
-static void
-eazel_file_uniqueness_check_signal (EazelInstallCallback *service,
- const PackageData *pack,
- gpointer unused)
-{
- char *tmp = packagedata_get_readable_name (pack);
- fprintf (stdout, "I: FILE UNIQUENESS CHECKING \"%s\"\n", tmp);
- fflush (stdout);
- g_free (tmp);
-}
-
-static void
-eazel_feature_consistency_check_signal (EazelInstallCallback *service,
- const PackageData *pack,
- gpointer unused)
-{
- char *tmp = packagedata_get_readable_name (pack);
- printf ("I: FEATURE CONSISTENCY CHECKING \"%s\"\n", tmp);
- fflush (stdout);
- g_free (tmp);
-}
-
-static void
-eazel_download_progress_signal (EazelInstallCallback *service,
- const PackageData *pack,
- int amount,
- int total,
- gpointer unused)
-{
- char *tmp = packagedata_get_readable_name (pack);
- printf ("I: DOWNLOADING \"%s\" %d %d\n", tmp, amount, total);
- fflush (stdout);
- g_free (tmp);
-}
-
-static void
-eazel_install_progress_signal (EazelInstallCallback *service,
- const PackageData *package,
- int package_num, int num_packages,
- int amount, int total,
- int total_size_completed, int total_size,
- gpointer unused)
-{
- char *tmp = packagedata_get_readable_name (package);
- fprintf (stdout, "I: INSTALLING \"%s\" %d %d %d %d %d %d\n",
- tmp,
- package_num, num_packages,
- amount, total,
- total_size_completed, total_size);
- fflush (stdout);
- g_free (tmp);
-}
-
-static void
-eazel_uninstall_progress_signal (EazelInstallCallback *service,
- const PackageData *package,
- int package_num, int num_packages,
- int amount, int total,
- int total_size_completed, int total_size,
- gpointer unused)
-{
- char *tmp = packagedata_get_readable_name (package);
- fprintf (stdout, "I: UNINSTALLING \"%s\" %d %d %d %d %d %d\n",
- tmp,
- package_num, num_packages,
- amount, total,
- total_size_completed, total_size);
- fflush (stdout);
- g_free (tmp);
-}
-
-static void download_failed (EazelInstallCallback *service,
- const PackageData *package,
- gpointer unused)
-{
- char *tmp = packagedata_get_readable_name (package);
- fprintf (stdout, "I: DOWNLOAD FAILED \"%s\"\n", tmp);
- fflush (stdout);
- g_free (tmp);
-}
-
-/*
- This dumps the entire tree for the failed package.
- */
-static void
-install_failed (EazelInstallCallback *service,
- PackageData *package,
- EazelInstallProblem *problem)
-{
- char *tmp = packagedata_get_readable_name (package);
- fprintf (stdout, "I: INSTALL FAILED \"%s\"\n", tmp);
- fflush (stdout);
- g_free (tmp);
-}
-
-static void
-uninstall_failed (EazelInstallCallback *service,
- PackageData *package,
- EazelInstallProblem *problem)
-{
- char *tmp = packagedata_get_readable_name (package);
- fprintf (stdout, "I: UNINSTALL FAILED \"%s\"\n", tmp);
- fflush (stdout);
- g_free (tmp);
-}
-
-static gboolean
-eazel_preflight_check_signal (EazelInstallCallback *service,
- EazelInstallCallbackOperation op,
- const GList *packages,
- int total_bytes,
- int total_packages,
- gpointer unused)
-{
- switch (op) {
- case EazelInstallCallbackOperation_INSTALL:
- fprintf (stdout, "I: PREPARING INSTALL %d %d\n",
- total_packages, total_bytes);
- break;
- case EazelInstallCallbackOperation_UNINSTALL:
- fprintf (stdout, "I: PREPARING UNINSTALL %d %d\n",
- total_packages, total_bytes);
- break;
- case EazelInstallCallbackOperation_REVERT:
- fprintf (stdout, "I: PREPARING REVERT %d %d\n",
- total_packages, total_bytes);
- break;
- }
-
- return TRUE;
-}
-
-static gboolean
-eazel_save_transaction_signal (EazelInstallCallback *service,
- EazelInstallCallbackOperation op,
- const GList *packages,
- gpointer unused)
-{
- return FALSE;
-}
-
-static void
-dep_check (EazelInstallCallback *service,
- const PackageData *package,
- const PackageData *needs_package,
- gpointer unused)
-{
- char *pack, *needs;
- pack = packagedata_get_readable_name (package);
- needs = packagedata_get_readable_name (needs_package);
- fprintf (stdout, "I: DEPENDENCY : \"%s\" \"%s\"\n", pack, needs);
- fflush (stdout);
- g_free (pack);
- g_free (needs);
-}
-
-static void
-md5_check_failed (EazelInstallCallback *service,
- const PackageData *package,
- const char *actual_md5,
- gpointer unused)
-{
- char *tmp = packagedata_get_readable_name (package);
- fprintf (stdout, "I: MD5 FAILURE \"%s\"\n", tmp);
- fflush (stdout);
- g_free (tmp);
-}
-
-
-static void
-delete_files (EazelInstallCallback *service)
-{
- eazel_install_callback_delete_files (service, &ev);
-}
-
-static void
-done (EazelInstallCallback *service,
- gboolean result,
- EazelInstallProblem *problem)
-{
- if (result) {
- fprintf (stdout, "I: DONE: OK\n");
- } else {
- cli_result = 2;
- fprintf (stdout, "I: DONE: FAILED\n");
- }
- trilobite_main_quit ();
- fflush (stdout);
-}
-
-static char *
-get_password_dude (TrilobiteRootClient *root_client, const char *prompt, void *user_data)
-{
- char * passwd;
-
- passwd = getpass ("Q: ROOT PASSWORD: ");
- return g_strdup (passwd);
-}
-
-static TrilobiteRootClient *
-set_root_client (BonoboObjectClient *service)
-{
- TrilobiteRootClient *root_client;
-
- if (bonobo_object_client_has_interface (service, "IDL:Trilobite/PasswordQuery:1.0", &ev)) {
- root_client = trilobite_root_client_new ();
- gtk_signal_connect (GTK_OBJECT (root_client), "need_password", GTK_SIGNAL_FUNC (get_password_dude),
- NULL);
-
- if (! trilobite_root_client_attach (root_client, service)) {
- fprintf (stderr, "*** unable to attach root client to Trilobite/PasswordQuery!");
- }
-
- return root_client;
- } else {
- fprintf (stderr, "*** Object does not support IDL:Trilobite/PasswordQuery:1.0");
- return NULL;
- }
-}
-
-static void
-do_clone (EazelInstallCallback *cb,
- EazelInstallProblem *problem)
-{
- GList *inventory;
- GList *install = NULL;
- GList *upgrade = NULL;
- GList *downgrade = NULL;
-
- inventory = eazel_install_clone_load_inventory (arg_file);
-
- if (inventory == NULL) {
- cli_result = 1;
- } else {
- CategoryData *cat = categorydata_new ();
- GList *categories = NULL;
- GList *iterator;
-
- cat->name = g_strdup ("clone");
-
- eazel_install_clone_compare_inventory (inventory,
- &install,
- &upgrade,
- &downgrade);
-
- fprintf (stderr, "D: %d installs, %d upgrade, %d downgrades\n",
- g_list_length (install),
- g_list_length (upgrade),
- g_list_length (downgrade));
-
- for (iterator = install; iterator; iterator = g_list_next (iterator)) {
- PackageData *pack = PACKAGEDATA (iterator->data);
- fprintf (stderr, "D: installing %s\n", packagedata_get_readable_name (pack));
- cat->packages = g_list_prepend (cat->packages, pack);
- }
- for (iterator = upgrade; iterator; iterator = g_list_next (iterator)) {
- PackageData *pack = PACKAGEDATA (iterator->data);
- fprintf (stderr, "D: upgrading %s\n", packagedata_get_readable_name (pack));
- cat->packages = g_list_prepend (cat->packages, pack);
- }
- if (arg_downgrade) {
- for (iterator = downgrade; iterator; iterator = g_list_next (iterator)) {
- PackageData *pack = PACKAGEDATA (iterator->data);
- fprintf (stderr, "D: downgrading %s\n", packagedata_get_readable_name (pack));
- cat->packages = g_list_prepend (cat->packages, pack);
- }
- }
- categories = g_list_prepend (categories, cat);
-
- eazel_install_callback_install_packages (cb, categories, NULL, &ev);
- }
-}
-
-int main(int argc, char *argv[]) {
- poptContext ctxt;
- EazelInstallCallback *cb;
- EazelInstallProblem *problem = NULL;
-
- CORBA_exception_init (&ev);
-
- /* Seems that bonobo_main doens't like
- not having gnome_init called, dies in a
- X call, yech */
-
-#ifdef ENABLE_NLS /* sadly we need this ifdef because otherwise the following get empty statement warnings */
- bindtextdomain (PACKAGE, GNOMELOCALEDIR);
- textdomain (PACKAGE);
-#endif
-
-#if 0
- gnomelib_register_popt_table (oaf_popt_options, oaf_get_popt_table_name ());
- orb = oaf_init (argc, argv);
- gnome_init_with_popt_table ("Eazel Install", "1.0", argc, argv, options, 0, &ctxt);
- if (!bonobo_init (NULL, NULL, NULL)) {
- g_error ("Could not init bonobo");
- }
-#else
- trilobite_init ("Eazel Install", "1.0", NULL, options, argc, argv);
- ctxt = trilobite_get_popt_context ();
-#endif
-
- bonobo_activate ();
-
- cb = eazel_install_callback_new ();
- problem = eazel_install_problem_new ();
- gtk_object_ref (GTK_OBJECT (problem));
-
- set_parameters_from_command_line (eazel_install_callback_corba_objref (cb));
- set_root_client (eazel_install_callback_bonobo (cb));
-
- /* Set up signal connections */
- gtk_signal_connect (GTK_OBJECT (cb), "file_conflict_check",
- GTK_SIGNAL_FUNC (eazel_file_conflict_check_signal),
- NULL);
- gtk_signal_connect (GTK_OBJECT (cb), "file_uniqueness_check",
- GTK_SIGNAL_FUNC (eazel_file_uniqueness_check_signal),
- NULL);
- gtk_signal_connect (GTK_OBJECT (cb), "feature_consistency_check",
- GTK_SIGNAL_FUNC (eazel_feature_consistency_check_signal),
- NULL);
-
- gtk_signal_connect (GTK_OBJECT (cb), "download_progress",
- GTK_SIGNAL_FUNC (eazel_download_progress_signal),
- NULL);
- gtk_signal_connect (GTK_OBJECT (cb), "preflight_check",
- GTK_SIGNAL_FUNC (eazel_preflight_check_signal),
- NULL);
- gtk_signal_connect (GTK_OBJECT (cb), "save_transaction",
- GTK_SIGNAL_FUNC (eazel_save_transaction_signal),
- NULL);
- gtk_signal_connect (GTK_OBJECT (cb), "install_progress",
- GTK_SIGNAL_FUNC (eazel_install_progress_signal),
- NULL);
- gtk_signal_connect (GTK_OBJECT (cb), "md5_check_failed",
- GTK_SIGNAL_FUNC (md5_check_failed),
- "");
- gtk_signal_connect (GTK_OBJECT (cb), "install_failed",
- GTK_SIGNAL_FUNC (install_failed),
- problem);
- gtk_signal_connect (GTK_OBJECT (cb), "uninstall_progress",
- GTK_SIGNAL_FUNC (eazel_uninstall_progress_signal),
- NULL);
- gtk_signal_connect (GTK_OBJECT (cb), "uninstall_failed",
- GTK_SIGNAL_FUNC (uninstall_failed),
- problem);
- gtk_signal_connect (GTK_OBJECT (cb), "download_failed",
- GTK_SIGNAL_FUNC (download_failed),
- NULL);
- gtk_signal_connect (GTK_OBJECT (cb), "dependency_check",
- GTK_SIGNAL_FUNC (dep_check),
- NULL);
- gtk_signal_connect (GTK_OBJECT (cb), "done",
- GTK_SIGNAL_FUNC (done),
- problem);
-
- if (arg_dump) {
- char *mem;
- long size;
- eazel_install_clone_create_inventory (&mem, &size);
- fprintf (stdout, mem);
- } else {
- do_clone (cb, problem);
- if (!cli_result) {
- trilobite_main ();
- }
- delete_files (cb);
- }
-
- eazel_install_callback_unref (GTK_OBJECT (cb));
- gtk_object_unref (GTK_OBJECT (problem));
-
- /* Corba cleanup */
- CORBA_exception_free (&ev);
-
- return cli_result;
-};
diff --git a/components/services/docs/directories b/components/services/docs/directories
deleted file mode 100644
index 5d0c0ee30..000000000
--- a/components/services/docs/directories
+++ /dev/null
@@ -1,44 +0,0 @@
-docs/ - documentation
-
-install/ - install service
-install/command-line/ - command-line installer
-install/idl/ - Install service IDL
-install/lib/ - install service libraries
-install/nautilus-view/ - Nautilus install view
-install/server/ - back-end implementation for install service
-
-login/ - Login code
-login/nautilus-view - change password view
-
-nautilus-dependent-shared/ - shared code that depends on libnautilus-extensions
-nautilus-dependent-shared/icons - icons related to various services
-
-summary/ - summary view and related
-summary/lib -
-summary/nautilus-view - Actual summary view code
-summary/nautilus-view/icons - images needed for the summary view
-summary/nautilus-view/icons/gray_tab_pieces - the images for drawing the grey summary view tabs
-summary/nautilus-view/tests - test data for the summary view
-
-time/ - time service (status unknown)
-time/command-line/ - command-line version of time service
-time/idl/ - IDL for time service
-time/nautilus-view/ - Nautilus View for time service
-time/service/ - back-end implementation for time service
-
-
-trilobite - general framework stuff for services
-trilobite/doc - documentation
-trilobite/helper - helper program for executing priveleged operations
-trilobite/idl - IDL files for trilobite service framework
-trilobite/libtrilobite - library of shared core code for service components
-trilobite/sample - sample service
-trilobite/sample/command-line - command-line version of sample service
-trilobite/sample/idl - IDL files for sample service
-trilobite/sample/lib - library for sample service
-trilobite/sample/nautilus-view - Nautilus view for sample service
-trilobite/sample/nautilus-view/icons - icons directory for sample service
-trilobite/sample/service - back-end implementation for sample service
-
-vault - code related to the vault (online storage) service
-vault/command-line - command-line tool for accessing the vault
diff --git a/components/services/docs/eazel-services-framework-draft b/components/services/docs/eazel-services-framework-draft
deleted file mode 100644
index 6d98c9c52..000000000
--- a/components/services/docs/eazel-services-framework-draft
+++ /dev/null
@@ -1,148 +0,0 @@
-Nautilus Services Framework thoughts
-Eskil Olsen (eskil@eazel.com)
-May 2000
-
-Nautilus Services packaging :
-
-Packages
---------
-Two base packages:
- eazel-services
- nautilus
-
-we should keep the seperate services in seperate packages, that way
-people can install the service they actually want, and loose the rest.
-
-package eazel-services
-----------------------
-should contain the IDL specs for the toplevel interface(s), and the
-shared functions eg. for authentication for root access.
-
-package nautilus
-----------------
-
-the nautilus fm itself
-
--
-
-Then if we keep each service in its own package (two a piece), we'll
-get
-
-timeservice:
- eazel-service-time
- nautilus-eazel-service-time-view
-
-where eazel-service-time should contain the corba object plus the
-command line thingy. nautilus-eazel-service-time-view should contain
-the relevant nautilus components.
-
-In this way, people can install just the cli tools and skip the
-graphical tool. The tradeoff is the vast number of rpms, it'll be just
-a minumum for 4 for having just nautilus and one service.On the other
-hand, you can install naughtyloos with just 1 rpm and not have too
-much superfluous stuff, and that you can install the services (cli
-versions only) without all the gui stuff.
-
-Another benefit is the ability to update the individual services
-without too much download.
-
-The alternative is keeping one gigantic rpm with nautilus and all the
-eazel services. Here the downsides are massive downloads when updating
-even small parts, lack of ability to only install the parts you want.
-The upside is, fewer packages to confuse the user.
-
-
-
-
-Nautilus Services source directory structure :
-
-eazel-services
---------------
-/ the standard automake hell
-/idl the idl for the toplevel eazel service object
-/libnautilusservices the shared lib with some common methods (like prompting for root access)
-
-eazel-service-time
-------------------
-/ the standard automake hell
-/idl the idl for the service
-/src the corba object and the cli tool
-
-nautilus-eazel-service-time-view
---------------------------------
-/ the standard automake hell
-/src the nautilus view component
-
-
-
-Naming :
-
-the idl files
--------------
-
-to avoid the impending namespace conflict that the $prefix/gnome/idl
-system will cause, the idl files should be named uniquely:
-
- top idl file nautilus-service.idl
- service specific idl nautilus-<company>-<name>-service.idl
- eg. nautilus-eazel-time-service.idl
-
-IDL interfaces && modules
--------------------------
-
-There is already a module Nautilus, in which we could place the
-Service interface (note, this does not have to be done in the same
-file as the existing Nautilus module is defined). This could also be
-encapsulated as a module within the Nautilus module.
-
-Alternatively, we could make a module specifically for the
-services. This would cut down on the long variablenames.
-
-So something like this for the toplevel
-
-module Nautilus {
- interface Service {
- ... toplevel calls ...
- };
-};
-
-The time service (nautilus-eazel-time-service.idl) :
-
-module Nautilus {
- module Eazel {
- interface Time : Service {
- ...
- };
-};
-
-The time service (nautilus-eazel-install-service.idl) :
-
-module Nautilus {
- Module Eazel {
- interface Installer : Nautilus::Service {
- ...
- };
- };
-};
-
-So the scheme for service IDL's would be
-
-module Nautilus {
- module <CompanyName> {
- interface <ServiceName> : Nautilus::Service {
- };
- };
-};
-
-
-
-The Shared Library :
-
-
-Contents
---------
-
-The shared library should contain methods that many of the services
-will need. This is quite unspecified currently, but eg call to check
-for distribution type, root access, query/cache for root password and
-such should go here.
diff --git a/components/services/docs/install-user-settings b/components/services/docs/install-user-settings
deleted file mode 100644
index ac225dfa9..000000000
--- a/components/services/docs/install-user-settings
+++ /dev/null
@@ -1,22 +0,0 @@
-These are the settings that the libeazelinstall/nautilusview should have access to.
-
-libeazelinstall:
-
-name values userlevel default
-rpmrc filename hacker /usr/lib/rpm/rpmrc
-protocol [http|ftp] hacker http
-logfile string intermediate ~/.nautilus/update.log
-verbose-log boolean intermediate false
-force-install boolean hacker false
-upgrade-install boolean hacker true
-rpm-server string intermediate something.eazel.com
-rpm-sever-port int intermediate 80 (for http)
-transaction boolean hacker true
-transctiondir string intermediate ~/.nautilus/transactions
-tmpdir string intermediate /tmp/eazel-update.$UID/
-
-install-view:
-
-name values userlevel default
-unlink-file yes/no/ask novice ask
-save-transactionyes/no/ask novice ask
diff --git a/components/services/docs/installer-dep-check b/components/services/docs/installer-dep-check
deleted file mode 100644
index db759afb0..000000000
--- a/components/services/docs/installer-dep-check
+++ /dev/null
@@ -1,85 +0,0 @@
-
-ensure_deps_helper (GList &packages, GList &failedpackages)
-1. load package headers for unloaded, bind packages[x] to header[x], set state to unresolved
-2. add to transaction set
-3. depcheck
-4. if ok - return (failedpackages = NULL)
- if fail - ensure_deps_are_fetched (packages, &tmp_extra, &tmp_failed)
- 5. add tmp_extra to packages
- 6. if tmp_failed - prune_packages (tmp_failed, packages, failedpacakges)
-7 call ensure_deps_helper (packages, &failedpackages)
-
-ensure_deps (GList &packages, GList &failedpackages)
-1. copy pacakges into tmp
-2. ensure_deps_helper (tmp, tmp_failed)
-3. for each (packages) if in tmp_failed
- 4 emit_signal
- 5 remove from tmp_failed
- 6 move from packages to failedpackages
-7. for each (tmp_failed)
- 8. delete
-
-
-rpm_install (GList packages)
- |
- |- while ( (state = ensure_deps (&packages, &out_files)) == rerun) {
- | | merge packages with outfiles
- | | free outfiles
- | | }
- | |
- | |- add files to TransactionSet
- | |- dep order
- | |- dep_check
- | if ok
- | |- free stuff, and return ok
- | if fail
- | |- free stuff
- | |- loop dep_conflicts {
- | | |- call state = fetch_packages (dep_conflicts[x])
- | | | |- http_fetch or such, dep on topts
- | | |- if (state == no_matching)
- | | | |- emit signal install_failed (package, DEP_FAIL)
- | | | |- remove from packages
- | | |- if (state == ok)
- | | |- add conflicts to out_files
- | |- return rerun
- |
- |- do_rpm_install (packages)
- |- read headers
- | if (source)
- | |- emit signal install_failed (package, DEP_SRC_NO_SUPPORTED)
- |
- |- add to set
- |- run transaction set
-
-
-GList *load_rpm_headers (GList *packages) {
-}
-
-free_rpm_header_list (GList *headers);
-
-gboolean is_source_rpm (struct header header) {
-}
-
-add_headers_to_transaction_set (GList *headers, rpmTransactionSet set) {
-}
-
-bool ensure_deps_are_fetched (service, GList **packages, GList **output_files) {
-}
-
-bool rpm_install (service, GList *packages) {
-}
-
-bool fetch_deps (service, struct DepConflicts, int num_conflicts) {
-}
-
-bool do_rpm_install (service, GList filename) {
-}
-
-
------------------------
-fetch_packages (service, packages, conflicts, &failedpackages)
- |
- |-for_each conflict {
- |- packagedata *pack = packagedata from packages that matches conflict[0];
- |- call http_fetch_file_with_special_tricky_url
diff --git a/components/services/docs/installer-rpm-cases b/components/services/docs/installer-rpm-cases
deleted file mode 100644
index 249608616..000000000
--- a/components/services/docs/installer-rpm-cases
+++ /dev/null
@@ -1,111 +0,0 @@
-x)
-Description : short description
-
-Longer blurp : a more verbose description of the problem
-
-Solution : what the problem handler should do
-
-Problem tree : how will the error tree look
-
-every leaf has the format. The three glists of the package
-are shown via -d- (depend), -m- (modifies) and -b- (breaks)
-name[-version-release] (status/modification-status)
-
-Problem : the text message the problem handler will blurp
-
-Status : the status of this case in the problem handler/library
-
----
-Description : package not installed
-
-Solution : install it
-
-Problem tree :
-name-version-release (RESOLVED/INSTALLED)
-
-Problem : none
-
----
-Description : package already installed with older version
-
-Solution : update it
-
-Problem tree :
-name-version-release (ALREADY_INSTALLED/INSTALLED)
- \m-name-version-release (RESOLVED/UPGRADED)
-
-Problem : none
-
----
-Description : package already installed with same version
-
-Solution : do not install
-
-Problem tree :
-name-version-release (ALREADY_INSTALLED/UNTOUCHED)
-
-Problem : <package> is already installed
-
----
-Description : package already installed with newer version
-
-Problem tree :
-name-version-release (ALREADY_INSTALLED/INSTALLED)
- \m-name-version-release (RESOLVED/DOWNGRADED)
-
----
-Description : package could not be found on server
-Problem tree:
-name (CANNOT_OPEN/UNTOUCHED)
-
----
-Description : a dependency is missing
-
----
-Description : package breaks another package
-
----
-Description : a dependency breaks another package
-
----
-Description : a package in the tree causes circular dependecy
-Longer blurp : If you're installing package A which requires B,
- where B updates from version 1 to 2, you can risk package
- C requires B-1. Thus you end in the case where both B-1 and B-2
- are needed.
-
----
-Description : a package is a source package
-
----
-Description : a package A has a file conflict with another package B
-
-Longer blurp : Package A provides a file that another package
- B (which is already installed)
-
-Solution : first try and update B, if not, try and remove B, if not
- force remove B.
-
-Problem tree :
-name-version-release (A) (UNKNOWN_STATUS/UNTOUCHED)
- \b-name-version-release (B) (FILE_CONFLICT/UNTOUCHED)
-
-Problem : <A package> had a file conflict with <B package>
-
----
-Description : a package A has a file conflict with another package B (2)
-
-Longer blurp : Package A provides a file that another package
- B, both packages were requested for install
-
-Problem tree :
-name-version-release (A) (FILE_CONFLICT/UNTOUCHED)
- \b-name-version-release (B) (FILE_CONFLICT/UNTOUCHED)
-
-Problem : <A package> had a file conflict with <B package>
-
----
-Description : updating package A will break B
-
----
-Description :
diff --git a/components/services/docs/installer-rpmsearch b/components/services/docs/installer-rpmsearch
deleted file mode 100644
index bf5a2e65f..000000000
--- a/components/services/docs/installer-rpmsearch
+++ /dev/null
@@ -1,55 +0,0 @@
-This is a description of the requirements for the rpmsearch.cgi script.
-Eskil Olsen, updated 20000710.
-
-The rpmsearch.cgi script needs to support the following ;
-
-Main entry points ;
-
-?name=; Package name, case sensitive and excact match, eg. "gconf" must not match "GConf", and
- "GConf" should match "GConf" but not "GConf-devel".
-?provides=; Find a package that provides the given file.
-
-For ?name=; the following attributes must be supported, attributes marked with (!) will
-always be given ;
-
-&version[=|>=|>]; The package must have version equal, equal or greater or greater then the given version number.
-
-(
- Optional of interest, in case of provides conflict (eg. more then one rpm provides libbla.a)
-
- For ?provides=; the following attributes must be supported, attributes marked with (!) will
- always be given ;
-
- &forpackage=; SoftCat must know, that for "forpackage", if there are more then one
- rpm (A and B) that provides the given file, A is the most appropriate.
-)
-
-For ?name; and ?provide=; the following attributes must be supported. Again (!) identifies
-always given attributes.
-
-&arch=; (!) The package must be for the given architechture. The arch is given as a string, matching the strings
- given by uname(1). If no package matches the arch, but a package for "noarch" is present,
- return this. The arch "src" is a special arch.
-&distro=""; (!) The package must be for the given distributions. Currently that string will most likely be in the
- format of "RedHat Linux x.y". If needed, the version of the distro can be moved to seperate fields.
-&protocol=; (!) Designates the protocol used in the returned URL. Will currently be either "http" or "ftp".
-
-
-Samples;
-
-given rpmsearch.cgi?name=glib&version>1.2.0&arch=i386&distro="RedHat Linux 6.2"&protocol=http;
-return http://blech.blah/path/glib-1.2.8-1.i386.rpm
-
-given rpmsearch.cgi?name=libgtop-devel&version=1.0.7&arch=i386&distro="RedHat Linux 6.2"&protocol=http;
-return http://blech.blah/path/libgtop-devel-1.0.7-1.i386.rpm
-
-given rpmsearch.cgi?provides=libgtop.a&arch=i386&distro="RedHat Linux 6.2"&protocol=http;
-return http://blech.blah/path/libgtop-devel-1.0.7-1.i386.rpm
-
-given rpmsearch.cgi?name=gimp-data&arch=i386&distro="RedHat Linux 6.2"&protocol=http;
-return http://blech.blah/path/gimp-extras-1.0.7-1.noarch.rpm
-
-given rpmsearch.cgi?name=nautilus&arch=src&distro="RedHat Linux 6.2"&protocol=http;
-return http://blech.blah/path/nautilus-0.1-1.src.rpm
-
-
diff --git a/components/services/docs/packagexml.dtd b/components/services/docs/packagexml.dtd
deleted file mode 100644
index e0b705f64..000000000
--- a/components/services/docs/packagexml.dtd
+++ /dev/null
@@ -1,21 +0,0 @@
-<!ELEMENT CATEGORIES (CATEGORY)*>
-
-<!ELEMENT CATEGORY (PACKAGES)*>
-<!ATTLIST CATEGORY NAME CDATA>
-
-<!ELEMENT PACKAGES (PACKAGE)*>
-
-<!ELEMENT PACKAGE (NAME | VERSION | MINOR | ARCH | BYTESIZE | SUMMARY)*>
-
-<!ELEMENT NAME (#PCDATA)>
-
-<!ELEMENT VERSION (#PCDATA)>
-
-<!ELEMENT MINOR (#PCDATA)>
-
-<!ELEMENT ARCH (#PCDATA)>
-
-<!ELEMENT BYTESIZE (#PCDATA)>
-
-<!ELEMENT SUMMARY (#PCDATA)>
-
diff --git a/components/services/install-view/.cvsignore b/components/services/install-view/.cvsignore
deleted file mode 100644
index 14c2af5d6..000000000
--- a/components/services/install-view/.cvsignore
+++ /dev/null
@@ -1,6 +0,0 @@
-Makefile
-Makefile.in
-.deps
-.libs
-nautilus-service-install-view
-Nautilus_View_install.oaf
diff --git a/components/services/install-view/Makefile.am b/components/services/install-view/Makefile.am
deleted file mode 100644
index 021cc6cfe..000000000
--- a/components/services/install-view/Makefile.am
+++ /dev/null
@@ -1,69 +0,0 @@
-NULL =
-
-INCLUDES = \
- -DPREFIX=\"$(prefix)\" \
- -DG_LOG_DOMAIN=\"Nautilus-service-install\" \
- -I$(top_srcdir) \
- -I$(top_srcdir)/components/services/install/lib \
- -I$(top_srcdir)/components/services/trilobite \
- -I$(top_srcdir)/components/services/trilobite/libtrilobite \
- -I$(top_builddir)/components/services/install/lib \
- -I$(top_builddir)/components/services/trilobite \
- -I$(top_builddir)/components/services/trilobite/libtrilobite \
- -I$(top_srcdir)/components/services/nautilus-dependent-shared \
- -I$(top_builddir)/components/services/install/lib \
- -I$(top_builddir)/components/services/inventory/ \
- -I$(top_builddir) \
- $(EEL_INCLUDEDIR) \
- $(LIBRSVG_INCLUDEDIR) \
- $(GCONF_CFLAGS) \
- -DGNOMELOCALEDIR=\""$(datadir)/locale"\" \
- $(GNOMEUI_CFLAGS) \
- $(VFS_CFLAGS) \
- $(XML_CFLAGS) \
- $(NULL)
-
-bin_PROGRAMS = nautilus-service-install-view
-
-noinst_HEADERS = \
- nautilus-service-install-view.h \
- callbacks.h \
- forms.h \
- $(NULL)
-
-nautilus_service_install_view_SOURCES = \
- nautilus-service-install-view.c \
- main.c \
- callbacks.c \
- forms.c \
- $(NULL)
-
-nautilus_service_install_view_LDADD = \
- $(top_builddir)/libnautilus/libnautilus.la \
- $(top_builddir)/components/services/install/lib/libeazelinstall.la \
- $(top_builddir)/components/services/install/lib/libeazelpackagesystem.la \
- $(top_builddir)/components/services/trilobite/libtrilobite/libtrilobite.la \
- $(top_builddir)/components/services/nautilus-dependent-shared/libnautilusdepshared.a \
- $(top_builddir)/components/services/inventory/libtrilobite-inventory-service.la \
- $(EEL_LIBS) \
- $(LIBRSVG_LIBS) \
- $(BONOBO_LIBS) \
- $(GCONF_LIBS) \
- $(GNOMEUI_LIBS) \
- $(OAF_LIBS) \
- $(AMMONITE_LIBS) \
- $(VFS_LIBS) \
- $(RPM_LIBS) \
- $(NULL)
-
-oafdir = $(datadir)/oaf
-oaf_in_files = \
- Nautilus_View_install.oaf.in \
- $(NULL)
-oaf_DATA = $(oaf_in_files:.oaf.in=.oaf)
-
-@XML_I18N_MERGE_OAF_RULE@
-
-
-EXTRA_DIST = $(oaf_in_files) $(oaf_DATA)
-
diff --git a/components/services/install-view/Nautilus_View_install.oaf.in b/components/services/install-view/Nautilus_View_install.oaf.in
deleted file mode 100644
index 2f38d40a6..000000000
--- a/components/services/install-view/Nautilus_View_install.oaf.in
+++ /dev/null
@@ -1,27 +0,0 @@
-<oaf_info>
-
-<oaf_server iid="OAFIID:nautilus_service_install_view_factory:e59e53d1-e3d1-46fe-ae28-3ec5c56b7d32" type="exe" location="nautilus-service-install-view">
- <oaf_attribute name="repo_ids" type="stringv">
- <item value="IDL:GNOME/ObjectFactory:1.0"/>
- </oaf_attribute>
- <oaf_attribute name="name" type="string" _value="Nautilus Service Install View Factory"/>
- <oaf_attribute name="description" type="string" _value="Service Install View Component's Factory"/>
-</oaf_server>
-
-<oaf_server iid="OAFIID:nautilus_service_install_view:886546ca-1115-4ea4-8d30-8cefa2f5070b" type="factory" location="OAFIID:nautilus_service_install_view_factory:e59e53d1-e3d1-46fe-ae28-3ec5c56b7d32">
- <oaf_attribute name="repo_ids" type="stringv">
- <item value="IDL:Bonobo/Unknown:1.0"/>
- <item value="IDL:Bonobo/Control:1.0"/>
- <item value="IDL:Nautilus/View:1.0"/>
- </oaf_attribute>
- <oaf_attribute name="name" type="string" _value="Nautilus Service Install View"/>
- <oaf_attribute name="description" type="string" _value="Service Install View Component"/>
- <oaf_attribute name="bonobo:supported_uri_schemes" type="stringv">
- <item value="eazel-install"/>
- </oaf_attribute>
- <oaf_attribute name="nautilus:view_as_name" type="string" _value="Install"/>
- <oaf_attribute name="nautilus:view_as_label" type="string" _value="View as Install"/>
- <oaf_attribute name="nautilus:viewer_label" type="string" _value="Install Viewer"/>
-</oaf_server>
-
-</oaf_info>
diff --git a/components/services/install-view/callbacks.c b/components/services/install-view/callbacks.c
deleted file mode 100644
index 3810269d9..000000000
--- a/components/services/install-view/callbacks.c
+++ /dev/null
@@ -1,719 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 8; tab-width: 8 -*- */
-
-/*
- * Copyright (C) 2000, 2001 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: J Shane Culpepper <pepper@eazel.com>
- * Robey Pointer <robey@eazel.com>
- */
-
-#include <config.h>
-
-#include "nautilus-service-install-view.h"
-#include "eazel-services-extensions.h"
-#include "forms.h"
-#include "callbacks.h"
-#include "eazel-install-metadata.h" /* eazel_install_configure_check_jump_after_install */
-#include "libtrilobite/libammonite-gtk.h"
-#include "eazel-inventory.h"
-#include <stdio.h>
-#include <errno.h>
-#include <libeazelinstall.h>
-#include <eel/eel-label.h>
-
-#define MAX_DESCRIBE_MENUS 3
-
-/* do what gnome ought to do automatically */
-static void
-reply_callback (int reply, gboolean *answer)
-{
- *answer = (reply == 0);
-}
-
-/* keep this info for secret later use */
-void
-nautilus_service_install_dependency_check (EazelInstallCallback *cb, const PackageData *package,
- const PackageData *needs, NautilusServiceInstallView *view)
-{
- char *key, *value;
-
- /* add to deps hash for later */
- if (g_hash_table_lookup_extended (view->details->deps, needs->name, (void **)&key, (void **)&value)) {
- g_hash_table_remove (view->details->deps, key);
- g_free (key);
- g_free (value);
- }
- g_hash_table_insert (view->details->deps, g_strdup (needs->name), g_strdup (package->name));
-
- /* this stuff flies by so fast, it's probably enough to just say "info" */
- value = g_strdup (_("Getting package information ..."));
- show_overall_feedback (view, value);
- g_free (value);
-}
-
-/* keep the user up-to-date on the install service's long-ass contemplations */
-void
-nautilus_service_install_conflict_check (EazelInstallCallback *cb, const PackageData *pack,
- NautilusServiceInstallView *view)
-{
- char *out;
-
- if (view->details->installer == NULL) {
- g_warning ("Got conflict check after unref!");
- return;
- }
-
- g_assert (pack->name != NULL);
- out = g_strdup_printf (_("Checking \"%s\" for conflicts..."), pack->name);
- show_overall_feedback (view, out);
- g_free (out);
-}
-
-gboolean
-nautilus_service_install_save_transaction (EazelInstallCallback *service,
- EazelInstallCallbackOperation op,
- const GList *packages,
- NautilusServiceInstallView *view)
-{
- return FALSE;
-}
-
-
-gboolean
-nautilus_service_install_preflight_check (EazelInstallCallback *cb,
- EazelInstallCallbackOperation op,
- const GList *packages,
- int total_bytes,
- int total_packages,
- NautilusServiceInstallView *view)
-{
- gboolean answer;
- PackageData *package;
- GList *package_list;
- GList *iter;
- char *out;
- char *extra;
- unsigned long total_k;
-
- if (view->details->cancelled) {
- /* user has already hit the cancel button */
- view->details->cancelled_before_downloads = TRUE;
- return FALSE;
- }
-
- /* assemble initial list of packages to browse */
- package_list = flatten_packagedata_dependency_tree ((GList *)packages);
- package_list = g_list_reverse (package_list);
-
- view->details->download_bytes_total = view->details->download_bytes_sofar = 0;
- for (iter = g_list_first (package_list); iter != NULL; iter = g_list_next (iter)) {
- package = PACKAGEDATA (iter->data);
- view->details->download_bytes_total += (package->filesize > 0 ? package->filesize : package->bytesize);
-
- if (package->toplevel) {
- nautilus_service_install_check_for_desktop_files (view,
- cb,
- package);
- }
- }
-
- /* draw the query box, and spin in gtk_main waiting for an answer */
- make_query_box (view, op, package_list);
- gtk_widget_hide (view->details->overall_feedback_text);
- gtk_widget_hide (view->details->spacing);
- gtk_widget_hide (view->details->package_details);
- gtk_widget_hide (view->details->pane);
-
- nautilus_view_report_load_complete (view->details->nautilus_view);
- gtk_widget_ref (GTK_WIDGET (view));
- while (view->details->preflight_status == PREFLIGHT_UNKNOWN) {
- while (gtk_events_pending ()) {
- gtk_main_iteration ();
- }
- }
- if (view->details->preflight_status == PREFLIGHT_PANIC_BUTTON) {
- /* user destroyed the view!
- * hold on to our ref (it's probably the last one) and bail out as quickly as possible.
- */
- g_list_free (package_list);
- return FALSE;
- }
- gtk_widget_unref (GTK_WIDGET (view));
-
- gtk_widget_hide (view->details->query_pane);
- gtk_widget_show (view->details->spacing);
- gtk_widget_show (view->details->package_details);
- gtk_widget_show (view->details->pane);
- nautilus_view_report_load_underway (view->details->nautilus_view);
- answer = (view->details->preflight_status == PREFLIGHT_OK) ? TRUE : FALSE;
-
- if (!answer) {
- g_list_free (package_list);
- view->details->cancelled = TRUE;
- view->details->cancelled_before_downloads = TRUE;
- /* EVIL EVIL hack that causes the next dialog to show up instead of being hidden */
- sleep (1);
- while (gtk_events_pending ())
- gtk_main_iteration ();
- return answer;
- }
-
- total_k = (view->details->download_bytes_total+512)/1024;
- /* arbitrary dividing line */
- if (total_k > 4096) {
- extra = g_strdup_printf ("%ld MB", (total_k+512)/1024);
- } else {
- extra = g_strdup_printf ("%ld KB", total_k);
- }
-
- if (g_list_length (package_list) == 1) {
- out = g_strdup_printf (_("Downloading 1 package (%s)"), extra);
- } else {
- out = g_strdup_printf (_("Downloading %d packages (%s)"), g_list_length (package_list), extra);
- }
- show_overall_feedback (view, out);
- g_free (out);
- g_free (extra);
-
- g_list_free (package_list);
- view->details->current_package = 0;
- return answer;
-}
-
-void
-nautilus_service_install_download_progress (EazelInstallCallback *cb, const PackageData *pack, int amount, int total,
- NautilusServiceInstallView *view)
-{
- char *out;
- const char *needed_by;
- InstallMessage *im = view->details->current_im;
- float fake_amount;
-
- if (amount > total) {
- /* work around temporary EI bug where amount is sometimes total+1k */
- return;
- }
-
- if (view->details->installer == NULL) {
- g_warning ("Got download notice after unref!");
- return;
- }
-
- /* install lib better damn well know the name of the package by the time we download it! */
- g_assert (pack->name != NULL);
- view->details->downloaded_anything = TRUE;
-
- if (amount == 0) {
- /* could be a redundant zero-trigger for the same rpm... */
- if (view->details->current_rpm && (strcmp (view->details->current_rpm, pack->name) == 0)) {
- return;
- }
-
- if (view->details->cylon_timer) {
- gtk_timeout_remove (view->details->cylon_timer);
- view->details->cylon_timer = 0;
- }
-
- g_free (view->details->current_rpm);
- view->details->current_rpm = g_strdup (pack->name);
-
- if (pack->toplevel) {
- update_package_info_display (view, pack, _("Downloading \"%s\""));
- }
-
- /* new progress message and bar */
- im = view->details->current_im = install_message_new (view, pack->name);
- gtk_progress_set_percentage (GTK_PROGRESS (im->progress_bar), 0.0);
- out = g_strdup_printf (_("0K of %dK"), total/1024);
- eel_label_set_text (EEL_LABEL (im->progress_label), out);
- g_free (out);
- view->details->last_k = 0;
-
- needed_by = g_hash_table_lookup (view->details->deps, pack->name);
- if (needed_by != NULL) {
- out = g_strdup_printf (_("The package \"%s\" requires \"%s\" to run.\nDownloading \"%s\" now."),
- needed_by, pack->name, pack->name);
- } else {
- out = g_strdup_printf (_("Attempting to download package \"%s\"."), pack->name);
- }
- eel_label_set_text (EEL_LABEL (im->label), out);
- g_free (out);
- } else if (amount == total) {
- /* done! */
- if (view->details->current_rpm == NULL) {
- /* redundant 100% signal */
- return;
- }
- current_progress_bar_complete (view, _("Complete"));
- gtk_progress_set_percentage (GTK_PROGRESS (im->progress_bar), 1.0);
- needed_by = g_hash_table_lookup (view->details->deps, pack->name);
- if (needed_by != NULL) {
- out = g_strdup_printf (_("The package \"%s\" requires \"%s\" to run.\n\"%s\" has been successfully downloaded."),
- needed_by, pack->name, pack->name);
- } else {
- out = g_strdup_printf (_("The package \"%s\" has been successfully downloaded."), pack->name);
- }
- eel_label_set_text (EEL_LABEL (im->label), out);
- g_free (out);
- g_free (view->details->current_rpm);
- view->details->current_rpm = NULL;
- view->details->current_im = NULL;
- /* update downloaded bytes */
- view->details->download_bytes_sofar += (pack->filesize > 0 ? pack->filesize : pack->bytesize);
- gtk_progress_set_percentage (GTK_PROGRESS (view->details->total_progress_bar),
- (float) view->details->download_bytes_sofar /
- (float) view->details->download_bytes_total);
- } else {
- /* could be a leftover event, after user hit STOP (in which case, current_im = NULL) */
- if ((im != NULL) && (im->progress_bar != NULL)) {
- gtk_progress_set_percentage (GTK_PROGRESS (im->progress_bar),
- (float) amount / (float) total);
- if ((amount/1024) >= view->details->last_k + 10) {
- out = g_strdup_printf (_("%dK of %dK"), amount/1024, total/1024);
- eel_label_set_text (EEL_LABEL (im->progress_label), out);
- g_free (out);
- view->details->last_k = (amount/1024);
- }
- }
-
- /* so, for PR3, we are given a "size" field in the softcat XML which is actually
- * the size of the decompressed files. so this little hocus-pocus scales the
- * actual size (which we know once we start downloading the file) to match the
- * previously-assumed size
- */
- fake_amount = (float)amount * (float)(pack->filesize > 0 ? pack->filesize : pack->bytesize) / (float)total;
- gtk_progress_set_percentage (GTK_PROGRESS (view->details->total_progress_bar),
- ((float) view->details->download_bytes_sofar + fake_amount) /
- (float) view->details->download_bytes_total);
- }
-}
-
-void
-nautilus_service_install_download_failed (EazelInstallCallback *cb, const PackageData *pack,
- NautilusServiceInstallView *view)
-{
- char *out, *tmp;
-
- /* no longer "loading" anything */
- nautilus_view_report_load_complete (view->details->nautilus_view);
-
- tmp = packagedata_get_readable_name (pack);
- out = g_strdup_printf (_("Download of package \"%s\" failed!"), tmp);
- g_free (tmp);
- if (view->details->current_im != NULL) {
- eel_label_set_text (EEL_LABEL (view->details->current_im->label), out);
- }
- g_free (out);
-}
-
-static void
-previous_install_finished (NautilusServiceInstallView *view)
-{
- InstallMessage *im;
- char *needed_by;
- char *out;
-
- im = view->details->current_im;
- if (im != NULL) {
- current_progress_bar_complete (view, _("Complete"));
- gtk_progress_set_percentage (GTK_PROGRESS (im->progress_bar), 1.0);
-
- needed_by = g_hash_table_lookup (view->details->deps, view->details->current_rpm);
- if (needed_by != NULL) {
- out = g_strdup_printf (_("The package \"%s\" requires \"%s\" to run.\n\"%s\" has been successfully downloaded and installed."),
- needed_by, view->details->current_rpm, view->details->current_rpm);
- } else {
- out = g_strdup_printf (_("\"%s\" has been successfully downloaded and installed."), view->details->current_rpm);
- }
- eel_label_set_text (EEL_LABEL (im->label), out);
- g_free (out);
- }
- g_free (view->details->current_rpm);
- view->details->current_rpm = NULL;
- view->details->current_im = NULL;
-}
-
-void
-nautilus_service_install_progress (EazelInstallCallback *cb, const PackageData *pack,
- int current_package, int total_packages,
- int package_progress, int package_total,
- int total_progress, int total_total,
- NautilusServiceInstallView *view)
-{
- InstallMessage *im;
- gfloat overall_complete, complete;
- char *out;
- char *needed_by;
-
- im = view->details->current_im;
- if (current_package != view->details->current_package) {
- /* no longer "loading" anything */
- nautilus_view_report_load_complete (view->details->nautilus_view);
-
- /* starting a new package -- create new progress indicator */
- out = g_strdup_printf (_("Installing package %d of %d"), current_package, total_packages);
- show_overall_feedback (view, out);
- g_free (out);
-
- /* new behavior: sometimes the previous package wasn't quite closed out -- do it now */
- if (im != NULL) {
- previous_install_finished (view);
- }
-
- /* if you're looking for the place where we notice that one of nautilus's core
- * packages is being upgraded, this is it. this is an evil, evil way to do it,
- * but nobody's come up with anything better yet.
- */
- if (pack->name) {
- if ((g_strncasecmp (pack->name, "nautilus", 8) == 0) ||
- (g_strncasecmp (pack->name, "gnome-vfs", 9) == 0) ||
- (g_strncasecmp (pack->name, "oaf", 3) == 0)) {
- view->details->core_package = TRUE;
- }
- }
-
- g_free (view->details->current_rpm);
- view->details->current_rpm = g_strdup (pack->name);
- view->details->current_im = im = install_message_new (view, pack->name);
- gtk_progress_set_percentage (GTK_PROGRESS (im->progress_bar), 0.0);
- needed_by = g_hash_table_lookup (view->details->deps, pack->name);
- if (needed_by != NULL) {
- out = g_strdup_printf (_("The package \"%s\" requires \"%s\" to run.\n\"%s\" is now being installed."),
- needed_by, pack->name, pack->name);
- } else {
- out = g_strdup_printf (_("Now installing package \"%s\"."), pack->name);
- }
- eel_label_set_text (EEL_LABEL (im->label), out);
- g_free (out);
-
- view->details->current_package = current_package;
-
- if (pack->toplevel) {
- update_package_info_display (view, pack, _("Installing \"%s\""));
- }
- }
-
- complete = (gfloat) package_progress / package_total;
- overall_complete = (gfloat) total_progress / total_total;
- gtk_progress_set_percentage (GTK_PROGRESS (im->progress_bar), complete);
- gtk_progress_set_percentage (GTK_PROGRESS (view->details->total_progress_bar), overall_complete);
- out = g_strdup_printf (_("%d%%"), (int)(complete*100.0));
- eel_label_set_text (EEL_LABEL (im->progress_label), out);
- g_free (out);
-
- if ((package_progress == package_total) && (package_total > 0)) {
- /* done with another package! */
- previous_install_finished (view);
- }
-}
-
-void
-nautilus_service_install_failed (EazelInstallCallback *cb,
- PackageData *package,
- NautilusServiceInstallView *view)
-{
- char *tmp, *message;
-
- g_assert (NAUTILUS_IS_SERVICE_INSTALL_VIEW (view));
-
- if (package->status == PACKAGE_ALREADY_INSTALLED) {
- view->details->already_installed = TRUE;
- return;
- }
-
- /* override the "success" result for install_done signal */
- view->details->failures++;
-
- tmp = packagedata_get_readable_name (package);
- message = g_strdup_printf (_("Installation failed on %s"), tmp);
- show_overall_feedback (view, message);
- g_free (tmp);
- g_free (message);
-
- /* Get the new set of problem cases */
- eazel_install_problem_tree_to_case (view->details->problem,
- package,
- FALSE,
- &(view->details->problem_cases));
-}
-
-/* most likely OBSOLETE */
-static gboolean
-nautilus_service_install_solve_cases (NautilusServiceInstallView *view)
-{
- gboolean answer = FALSE;
- GtkWidget *toplevel;
- GString *messages;
- GList *strings;
- GtkWidget *dialog;
-
- messages = g_string_new ("");
-
- if (view->details->problem_cases) {
- GList *iterator;
- /* Create string versions to show the user */
- g_string_sprintfa (messages, "%s\n%s\n\n",
- _("I ran into problems while installing."),
- _("I'd like to try the following :"));
- strings = eazel_install_problem_cases_to_string (view->details->problem,
- view->details->problem_cases);
- for (iterator = strings; iterator; iterator = g_list_next (iterator)) {
- g_string_sprintfa (messages, " \xB7 %s\n", (char*)(iterator->data));
- }
- g_list_foreach (strings, (GFunc)g_free, NULL);
- g_list_free (strings);
- g_string_sprintfa (messages, "\n%s",
- _("Is this ok ?"));
-
- toplevel = gtk_widget_get_toplevel (view->details->message_box);
- if (GTK_IS_WINDOW (toplevel)) {
- dialog = gnome_question_dialog_parented (messages->str, (GnomeReplyCallback)reply_callback,
- &answer, GTK_WINDOW (toplevel));
- } else {
- dialog = gnome_question_dialog (messages->str, (GnomeReplyCallback)reply_callback, &answer);
- }
- gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
- gnome_dialog_run_and_close (GNOME_DIALOG (dialog));
- g_string_free (messages, TRUE);
- }
-
- return answer;
-}
-
-static void
-inventory_service_callback (EazelInventory *inventory,
- gboolean succeeded,
- gpointer callback_data)
-{
- NautilusServiceInstallView *view;
-
- view = NAUTILUS_SERVICE_INSTALL_VIEW (callback_data);
-
- gtk_object_unref (GTK_OBJECT (inventory));
-
- nautilus_view_go_back (view->details->nautilus_view);
-}
-
-void
-nautilus_service_install_done (EazelInstallCallback *cb, gboolean success, NautilusServiceInstallView *view)
-{
- CORBA_Environment ev;
- GtkWidget *toplevel;
- GtkWidget *dialog;
- char *message;
- char *name;
- GString *real_message;
- gboolean answer = FALSE;
- gboolean question_dialog;
- GList *packlist, *iter;
- PackageData *pack;
- int num_desktop_files = 0;
- gboolean display_desktop_files = FALSE;
- EazelInventory *inventory_service;
-
- g_assert (NAUTILUS_IS_SERVICE_INSTALL_VIEW (view));
-
- if (view->details->preflight_status == PREFLIGHT_PANIC_BUTTON) {
- /* user actually destroyed us -- panic! */
- return;
- }
-
- /* 'success' will be FALSE if even *one* package failed. need to check for that. */
-
- packlist = ((CategoryData *) view->details->categories->data)->packages;
-
-#if 1
- for (iter = g_list_first (packlist); iter != NULL; iter = g_list_next (iter)) {
- pack = PACKAGEDATA (iter->data);
- trilobite_debug ("package %s status %d", pack->name, pack->status);
- }
-#endif
-
- /* no longer "loading" anything */
- nautilus_view_report_load_complete (view->details->nautilus_view);
-
- gtk_progress_set_percentage (GTK_PROGRESS (view->details->total_progress_bar), success ? 1.0 : 0.0);
-
- g_free (view->details->current_rpm);
- view->details->current_rpm = NULL;
-
- if (view->details->cancelled) {
- message = _("Installation cancelled.");
- } else if (view->details->already_installed) {
- message = _("This package has already been installed.");
- } else if (success) {
- message = _("Installation complete.");
- } else {
- /* FIXME 5906: this isn't really working right yet, so fix it later */
- if (1 || ((guint) view->details->failures == g_list_length (packlist))) {
- message = _("Installation failed.");
- answer = nautilus_service_install_solve_cases (view);
- } else {
- /* some succeeded; some failed */
- real_message = g_string_new (_("Some packages installed successfully:"));
- for (iter = g_list_first (packlist); iter != NULL; iter = g_list_next (iter)) {
- pack = PACKAGEDATA (iter->data);
- if (pack->status == PACKAGE_RESOLVED) {
- name = packagedata_get_readable_name (pack);
- g_string_sprintfa (real_message, "\n \xB7 %s", name);
- g_free (name);
- }
- }
- g_string_sprintfa (real_message, _("\nSome packages failed:"));
- for (iter = g_list_first (packlist); iter != NULL; iter = g_list_next (iter)) {
- pack = PACKAGEDATA (iter->data);
- if (pack->status != PACKAGE_RESOLVED) {
- name = packagedata_get_readable_name (pack);
- g_string_sprintfa (real_message, "\n \xB7 %s", name);
- g_free (name);
- }
- }
-
- message = real_message->str;
- g_string_free (real_message, FALSE);
- answer = nautilus_service_install_solve_cases (view);
- }
- }
-
- show_overall_feedback (view, message);
-
- if (answer) {
- eazel_install_problem_handle_cases (view->details->problem,
- view->details->installer,
- &(view->details->problem_cases),
- &(view->details->categories),
- NULL,
- NULL);
- } else {
- real_message = g_string_new (message);
- question_dialog = TRUE;
- answer = FALSE;
-
-
- if (success && view->details->desktop_files &&
- !view->details->cancelled &&
- !view->details->already_installed) {
- num_desktop_files = g_list_length (view->details->desktop_files);
- if (num_desktop_files <= MAX_DESCRIBE_MENUS) {
- display_desktop_files = TRUE;
- } else {
- display_desktop_files = FALSE;
- }
- }
- if (view->details->cancelled_before_downloads ||
- view->details->already_installed ||
- (eazel_services_get_user_level () < EAZEL_USER_LEVEL_ADVANCED)) {
- /* don't ask about erasing rpms */
- question_dialog = FALSE;
- answer = TRUE;
- } else if (view->details->downloaded_anything) {
- if (view->details->cancelled || view->details->failures) {
- g_string_sprintfa (real_message, "\n%s", _("Erase the RPM files?"));
- } else {
- g_string_sprintfa (real_message, "\n%s", _("Erase the leftover RPM files?"));
- }
- } else {
- question_dialog = FALSE;
- }
-
- toplevel = gtk_widget_get_toplevel (view->details->message_box);
- if (GTK_IS_WINDOW (toplevel)) {
- if (question_dialog) {
- dialog = gnome_question_dialog_parented (real_message->str,
- (GnomeReplyCallback)reply_callback,
- &answer, GTK_WINDOW (toplevel));
- } else {
- dialog = gnome_ok_dialog_parented (real_message->str, GTK_WINDOW (toplevel));
- }
- } else {
- if (question_dialog) {
- dialog = gnome_question_dialog (real_message->str,
- (GnomeReplyCallback)reply_callback, &answer);
- } else {
- dialog = gnome_ok_dialog (real_message->str);
- }
- }
-
- if (display_desktop_files) {
- /* okay, at this point we've succeeded and have some
- * package info stuff to display
- */
- gtk_object_unref (GTK_OBJECT (dialog));
- dialog = gnome_dialog_new (_("Installation complete."),
- _("Ok"), NULL);
- nautilus_install_service_add_menu_launchers (view, dialog);
- }
-
- gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
- gnome_dialog_run_and_close (GNOME_DIALOG (dialog));
- g_string_free (real_message, TRUE);
-
- if (answer) {
- CORBA_exception_init (&ev);
- eazel_install_callback_delete_files (cb, &ev);
- CORBA_exception_free (&ev);
- }
-
- if (success && view->details->core_package) {
- message = _("A core package of Nautilus has been\n"
- "updated. You should restart Nautilus.\n\n"
- "Do you wish to do that now?");
- if (GTK_IS_WINDOW (toplevel)) {
- dialog = gnome_question_dialog_parented (message,
- (GnomeReplyCallback)reply_callback,
- &answer, GTK_WINDOW (toplevel));
- } else {
- dialog = gnome_question_dialog (message, (GnomeReplyCallback)reply_callback,
- &answer);
- }
- gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
- gnome_dialog_run_and_close (GNOME_DIALOG (dialog));
-
- if (answer) {
- if (execlp ("nautilus", "nautilus", "--restart", NULL) < 0) {
- g_message ("Exec error %s", strerror (errno));
- }
- }
- }
-
- /* send them to the predetermined "next" url
- * -- but only if they haven't set jump-after-install off
- */
- if ((view->details->username != NULL) &&
- (strcasecmp (view->details->username, EAZELPROXY_USERNAME_ANONYMOUS) == 0)) {
- /* send anonymous users elsewhere, so they won't have to login */
- message = g_strdup (NEXT_URL_ANONYMOUS);
- } else {
- message = g_strdup (NEXT_URL);
- }
- message = NULL;
- if (eazel_install_configure_check_jump_after_install (&message)) {
- if (message != NULL) {
- nautilus_view_open_location_in_this_window (view->details->nautilus_view, message);
- } else {
- inventory_service = eazel_inventory_get ();
-
- if (inventory_service) {
- eazel_inventory_upload (inventory_service,
- inventory_service_callback, view);
- }
- }
- }
- g_free (message);
- }
-}
diff --git a/components/services/install-view/callbacks.h b/components/services/install-view/callbacks.h
deleted file mode 100644
index 10bc457b7..000000000
--- a/components/services/install-view/callbacks.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-
-/*
- * Copyright (C) 2000, 2001 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: J Shane Culpepper <pepper@eazel.com>
- * Robey Pointer <robey@eazel.com>
- */
-
-#ifndef _CALLBACKS_H_
-#define _CALLBACKS_H_
-
-void nautilus_service_install_conflict_check (EazelInstallCallback *cb, const PackageData *pack,
- NautilusServiceInstallView *view);
-void nautilus_service_install_dependency_check (EazelInstallCallback *cb, const PackageData *package,
- const PackageData *needs, NautilusServiceInstallView *view);
-gboolean nautilus_service_install_preflight_check (EazelInstallCallback *cb,
- EazelInstallCallbackOperation op,
- const GList *packages,
- int total_bytes,
- int total_packages,
- NautilusServiceInstallView *view);
-gboolean nautilus_service_install_save_transaction (EazelInstallCallback *cb,
- EazelInstallCallbackOperation op,
- const GList *packages,
- NautilusServiceInstallView *view);
-void nautilus_service_install_download_progress (EazelInstallCallback *cb, const PackageData *pack,
- int amount, int total,
- NautilusServiceInstallView *view);
-void nautilus_service_install_download_failed (EazelInstallCallback *cb, const PackageData *pack,
- NautilusServiceInstallView *view);
-void nautilus_service_install_progress (EazelInstallCallback *cb, const PackageData *pack,
- int current_package, int total_packages,
- int package_progress, int package_total,
- int total_progress, int total_total,
- NautilusServiceInstallView *view);
-void nautilus_service_install_failed (EazelInstallCallback *cb,
- PackageData *package,
- NautilusServiceInstallView *view);
-void nautilus_service_install_done (EazelInstallCallback *cb,
- gboolean success,
- NautilusServiceInstallView *view);
-
-
-#endif /* _CALLBACKS_H_ */
diff --git a/components/services/install-view/forms.c b/components/services/install-view/forms.c
deleted file mode 100644
index 1f803b78e..000000000
--- a/components/services/install-view/forms.c
+++ /dev/null
@@ -1,512 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 8; tab-width: 8 -*- */
-
-/*
- * Copyright (C) 2000, 2001 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: J Shane Culpepper <pepper@eazel.com>
- * Robey Pointer <robey@eazel.com>
- */
-
-#include <config.h>
-
-#include "nautilus-service-install-view.h"
-#include "forms.h"
-#include "callbacks.h"
-#include "eazel-services-header.h"
-#include "eazel-services-extensions.h"
-#include <stdio.h>
-#include <eel/eel-background.h>
-#include <eel/eel-label.h>
-#include <eel/eel-viewport.h>
-
-
-/* gtk rulez */
-static GtkWidget *
-add_padding_to_box (GtkWidget *box, int pad_x, int pad_y)
-{
- GtkWidget *filler;
-
- filler = gtk_label_new ("");
- gtk_widget_set_usize (filler, pad_x ? pad_x : 1, pad_y ? pad_y : 1);
- gtk_widget_show (filler);
- gtk_box_pack_start (GTK_BOX (box), filler, FALSE, FALSE, 0);
- return filler;
-}
-
-static gboolean
-line_expose (GtkWidget *widget, GdkEventExpose *event)
-{
- gdk_window_clear_area (widget->window, event->area.x, event->area.y, event->area.width, event->area.height);
- gdk_gc_set_clip_rectangle (widget->style->fg_gc[widget->state], &event->area);
- gdk_draw_line (widget->window, widget->style->fg_gc[widget->state],
- event->area.x, widget->allocation.height/2,
- event->area.x + event->area.width, widget->allocation.height/2);
- gdk_gc_set_clip_rectangle (widget->style->fg_gc[widget->state], NULL);
-
- return TRUE;
-}
-
-static GtkWidget *
-horizontal_line_new (int height)
-{
- GtkWidget *line;
- EelBackground *background;
-
- line = gtk_drawing_area_new ();
- gtk_drawing_area_size (GTK_DRAWING_AREA (line), 100, 1);
- gtk_signal_connect (GTK_OBJECT (line), "expose_event", GTK_SIGNAL_FUNC (line_expose), NULL);
- gtk_widget_set_usize (line, -2, height);
-
- background = eel_get_widget_background (line);
- eel_background_set_color (background, EAZEL_SERVICES_BACKGROUND_COLOR_SPEC);
-
- return line;
-}
-
-void
-install_message_destroy (InstallMessage *im)
-{
- g_free (im->package_name);
- g_free (im);
-}
-
-InstallMessage *
-install_message_new (NautilusServiceInstallView *view, const char *package_name)
-{
- InstallMessage *im, *im2;
- GtkWidget *bogus_label;
- GList *iter;
-
- im = NULL;
-
- for (iter = g_list_first (view->details->message); iter != NULL; iter = g_list_next (iter)) {
- im = (InstallMessage *)(iter->data);
- if (strcmp (im->package_name, package_name) == 0) {
- break;
- }
- }
- if (iter != NULL) {
- /* trash the old one */
- gtk_container_remove (GTK_CONTAINER (view->details->message_box), im->hbox);
- if (im->line != NULL) {
- gtk_container_remove (GTK_CONTAINER (view->details->message_box), im->line);
- } else if (iter->prev) {
- /* remove the line from the one above, if present */
- im2 = (InstallMessage *)(iter->prev->data);
- gtk_container_remove (GTK_CONTAINER (view->details->message_box), im2->line);
- im2->line = NULL;
- }
- view->details->message = g_list_remove (view->details->message, im);
- install_message_destroy (im);
- }
-
- im = g_new0 (InstallMessage, 1);
- im->label = eazel_services_label_new (NULL, 0, 0.0, 0.5, 0, 0,
- EAZEL_SERVICES_BODY_TEXT_COLOR_RGB,
- EAZEL_SERVICES_BACKGROUND_COLOR_RGB,
- NULL, -2, FALSE);
- eel_label_set_justify (EEL_LABEL (im->label), GTK_JUSTIFY_LEFT);
- gtk_widget_show (im->label);
- im->progress_bar = gtk_progress_bar_new ();
- gtk_progress_bar_set_bar_style (GTK_PROGRESS_BAR (im->progress_bar), GTK_PROGRESS_CONTINUOUS);
- gtk_progress_bar_set_orientation (GTK_PROGRESS_BAR (im->progress_bar), GTK_PROGRESS_LEFT_TO_RIGHT);
- gtk_progress_bar_update (GTK_PROGRESS_BAR (im->progress_bar), 0.0);
- gtk_widget_set_usize (im->progress_bar, -2, PROGRESS_BAR_HEIGHT);
- gtk_widget_show (im->progress_bar);
-
- im->progress_label = eazel_services_label_new (NULL, 0, 0.0, 0.0, 0, 0,
- EAZEL_SERVICES_BODY_TEXT_COLOR_RGB,
- EAZEL_SERVICES_BACKGROUND_COLOR_RGB,
- NULL, -2, TRUE);
- eel_label_set_justify (EEL_LABEL (im->progress_label), GTK_JUSTIFY_LEFT);
- gtk_widget_show (im->progress_label);
-
- bogus_label = gtk_label_new ("");
- gtk_widget_show (bogus_label);
-
- im->vbox = gtk_vbox_new (FALSE, 0);
- gtk_box_pack_start (GTK_BOX (im->vbox), im->progress_bar, FALSE, FALSE, 0);
- add_padding_to_box (im->vbox, 0, 5);
- gtk_box_pack_start (GTK_BOX (im->vbox), im->progress_label, FALSE, FALSE, 0);
- gtk_widget_show (im->vbox);
-
- im->hbox = gtk_hbox_new (FALSE, 0);
- add_padding_to_box (im->hbox, 20, 0);
- gtk_box_pack_start (GTK_BOX (im->hbox), im->label, FALSE, FALSE, 0);
- gtk_box_pack_start (GTK_BOX (im->hbox), bogus_label, TRUE, TRUE, 0);
- gtk_box_pack_start (GTK_BOX (im->hbox), im->vbox, FALSE, FALSE, 0);
- add_padding_to_box (im->hbox, 20, 0);
- gtk_widget_show (im->hbox);
-
- /* show the middle header in case this is the first install message */
- gtk_widget_show (view->details->middle_title);
- gtk_widget_show (view->details->total_progress_bar);
-
-#if 0
- if (g_list_length (view->details->message) == STATUS_ROWS) {
- gtk_widget_set_usize (view->details->pane, -2, view->details->pane->allocation.height);
- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (view->details->pane),
- GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);
- }
-#endif
-
- /* add this, and possibly a separating line, to the message box */
- if (g_list_length (view->details->message) > 0) {
- /* draw line */
- im->line = horizontal_line_new (6);
- gtk_widget_show (im->line);
- gtk_box_pack_end (GTK_BOX (view->details->message_box), im->line, FALSE, FALSE, 0);
- } else {
- im->line = NULL;
- }
- gtk_box_pack_end (GTK_BOX (view->details->message_box), im->hbox, FALSE, FALSE, 5);
-
- gtk_adjustment_changed (gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (view->details->pane)));
-
- im->package_name = g_strdup (package_name);
- view->details->message = g_list_prepend (view->details->message, im);
-
- return im;
-}
-
-void
-generate_install_form (NautilusServiceInstallView *view)
-{
- GtkWidget *temp_box;
- GtkWidget *title;
- GtkWidget *viewport;
- GtkWidget *filler;
- EelBackground *background;
-
- /* allocate the parent box to hold everything */
- view->details->form = gtk_vbox_new (FALSE, 0);
- gtk_container_add (GTK_CONTAINER (view), view->details->form);
-
- /* Setup the title */
- title = eazel_services_header_title_new (_("Easy Install"));
- gtk_box_pack_start (GTK_BOX (view->details->form), title, FALSE, FALSE, 0);
- gtk_widget_show (title);
-
- /* Add package information */
-
- add_padding_to_box (view->details->form, 0, 6);
-
- /* Package Name */
- temp_box = gtk_hbox_new (FALSE, 0);
- gtk_box_pack_start (GTK_BOX (view->details->form), temp_box, FALSE, FALSE, 0);
- gtk_widget_show (temp_box);
- view->details->package_name = eazel_services_label_new (NULL, 0, 0.0, 0.0, 0, 0,
- EAZEL_SERVICES_BODY_TEXT_COLOR_RGB,
- EAZEL_SERVICES_BACKGROUND_COLOR_RGB,
- NULL, 4, TRUE);
- eel_label_set_justify (EEL_LABEL (view->details->package_name), GTK_JUSTIFY_LEFT);
- gtk_box_pack_start (GTK_BOX (temp_box), view->details->package_name, FALSE, FALSE, 15);
- gtk_widget_show (view->details->package_name);
-
- /* Package Version */
- temp_box = gtk_hbox_new (FALSE, 0);
- gtk_box_pack_start (GTK_BOX (view->details->form), temp_box, FALSE, FALSE, 2);
- gtk_widget_show (temp_box);
- view->details->package_version = eazel_services_label_new (NULL, 0, 0.0, 0.0, 0, 0,
- EAZEL_SERVICES_BODY_TEXT_COLOR_RGB,
- EAZEL_SERVICES_BACKGROUND_COLOR_RGB,
- NULL, -2, TRUE);
- eel_label_set_justify (EEL_LABEL (view->details->package_version), GTK_JUSTIFY_LEFT);
- gtk_box_pack_start (GTK_BOX (temp_box), view->details->package_version, FALSE, FALSE, 15);
- gtk_widget_show (view->details->package_version);
-
- add_padding_to_box (view->details->form, 0, 4);
-
- /* generate the overall progress bar */
- temp_box = gtk_hbox_new (FALSE, 0);
- gtk_box_pack_start (GTK_BOX (view->details->form), temp_box, FALSE, FALSE, 2);
- gtk_widget_show (temp_box);
- view->details->total_progress_bar = gtk_progress_bar_new ();
- gtk_widget_set_usize (view->details->total_progress_bar, -2, PROGRESS_BAR_HEIGHT);
- add_padding_to_box (temp_box, 30, 0);
- gtk_box_pack_start (GTK_BOX (temp_box), view->details->total_progress_bar, FALSE, FALSE, 0);
- /* show the progress bar only when ready */
- gtk_widget_hide (view->details->total_progress_bar);
-
- /* add a label for progress messages, but don't show it until there's a message */
- temp_box = gtk_hbox_new (FALSE, 0);
- gtk_box_pack_start (GTK_BOX (view->details->form), temp_box, FALSE, FALSE, 2);
- gtk_widget_show (temp_box);
- view->details->overall_feedback_text = eazel_services_label_new (NULL, 0, 0.0, 0.0, 0, 0,
- EAZEL_SERVICES_BODY_TEXT_COLOR_RGB,
- EAZEL_SERVICES_BACKGROUND_COLOR_RGB,
- NULL, -2, FALSE);
- eel_label_set_justify (EEL_LABEL (view->details->overall_feedback_text), GTK_JUSTIFY_LEFT);
- eel_label_set_text (EEL_LABEL (view->details->overall_feedback_text), " ");
- gtk_widget_show (view->details->overall_feedback_text);
- add_padding_to_box (temp_box, 30, 0);
- gtk_box_pack_start (GTK_BOX (temp_box), view->details->overall_feedback_text, TRUE, TRUE, 0);
-
- view->details->spacing = add_padding_to_box (view->details->form, 0, 10);
-
- /* Package Description */
- temp_box = gtk_hbox_new (FALSE, 0);
- gtk_box_pack_start (GTK_BOX (view->details->form), temp_box, FALSE, FALSE, 2);
- gtk_widget_show (temp_box);
-
- view->details->package_details = eazel_services_label_new (NULL, 0, 0.0, 0.0, 0, 0,
- EAZEL_SERVICES_BODY_TEXT_COLOR_RGB,
- EAZEL_SERVICES_BACKGROUND_COLOR_RGB,
- NULL, -2, FALSE);
- eel_label_set_justify (EEL_LABEL (view->details->package_details), GTK_JUSTIFY_LEFT);
- eel_label_set_wrap (EEL_LABEL (view->details->package_details), TRUE);
-
- gtk_box_pack_start (GTK_BOX (temp_box), view->details->package_details, FALSE, FALSE, 15);
- gtk_widget_show (view->details->package_details);
-
- /* query pane: for asking the user questions during the preflight signal */
- view->details->query_pane = gtk_scrolled_window_new (NULL, NULL);
- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (view->details->query_pane),
- GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
- viewport = eel_viewport_new (NULL, NULL);
- gtk_viewport_set_shadow_type (GTK_VIEWPORT (viewport), GTK_SHADOW_NONE);
- gtk_container_add (GTK_CONTAINER (view->details->query_pane), viewport);
- gtk_widget_show (viewport);
- background = eel_get_widget_background (viewport);
- eel_background_set_color (background, EAZEL_SERVICES_BACKGROUND_COLOR_SPEC);
- gtk_widget_hide (view->details->query_pane);
- gtk_box_pack_start (GTK_BOX (view->details->form), view->details->query_pane, TRUE, TRUE, 0);
-
- temp_box = gtk_hbox_new (FALSE, 0);
- gtk_container_add (GTK_CONTAINER (viewport), temp_box);
- view->details->query_box = gtk_vbox_new (FALSE, 0);
- add_padding_to_box (temp_box, 30, 0);
- gtk_box_pack_start (GTK_BOX (temp_box), view->details->query_box, FALSE, FALSE, 0);
- gtk_widget_show (view->details->query_box);
- gtk_widget_show (temp_box);
-
- /* filler blob to separate the top from the bottom */
- gtk_box_pack_start (GTK_BOX (view->details->form), gtk_label_new (""), TRUE, FALSE, 0);
-
- /* add a table at the bottom of the screen to hold current progresses */
- view->details->message_box = gtk_vbox_new (FALSE, 0);
- filler = gtk_label_new ("");
- gtk_widget_show (filler);
- gtk_box_pack_end (GTK_BOX (view->details->message_box), filler, TRUE, TRUE, 0);
-
- view->details->pane = gtk_scrolled_window_new (NULL, NULL);
- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (view->details->pane),
- GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
- viewport = eel_viewport_new (NULL, NULL);
- gtk_viewport_set_shadow_type (GTK_VIEWPORT (viewport), GTK_SHADOW_NONE);
- gtk_container_add (GTK_CONTAINER (view->details->pane), viewport);
- gtk_widget_show (viewport);
- gtk_container_add (GTK_CONTAINER (viewport), view->details->message_box);
- gtk_widget_show (view->details->message_box);
- background = eel_get_widget_background (viewport);
- eel_background_set_color (background, EAZEL_SERVICES_BACKGROUND_COLOR_SPEC);
- gtk_widget_set_usize (view->details->pane, -2, MESSAGE_BOX_HEIGHT);
- gtk_widget_show (view->details->pane);
- gtk_box_pack_end (GTK_BOX (view->details->form), view->details->pane, FALSE, FALSE, 2);
-
- /* Setup the progress header */
- /* FIXME: the middle header is all fubar now, so we just say "messages", but the spec
- * shows "progress" over the 2nd column of the message box. it's just too hard to get
- * it aligned currently.
- */
- view->details->middle_title = eazel_services_header_middle_new (_("Messages"), "");
- gtk_box_pack_end (GTK_BOX (view->details->form), view->details->middle_title, FALSE, FALSE, 0);
- /* don't show the progress header until there's still to go there */
-
- gtk_widget_show (view->details->form);
-}
-
-/* utility routine to show an error message */
-void
-show_overall_feedback (NautilusServiceInstallView *view, char *progress_message)
-{
- eel_label_set_text (EEL_LABEL (view->details->overall_feedback_text), progress_message);
- gtk_widget_show (view->details->overall_feedback_text);
-}
-
-void
-update_package_info_display (NautilusServiceInstallView *view, const PackageData *pack, const char *format)
-{
- char *out;
-
- out = g_strdup_printf (format, pack->name);
- eel_label_set_text (EEL_LABEL (view->details->package_name), out);
- g_free (out);
-
- if ((pack->description != NULL) &&
- (strchr (pack->description, '\n') != NULL)) {
- eel_label_set_wrap (EEL_LABEL (view->details->package_details), FALSE);
- } else {
- eel_label_set_wrap (EEL_LABEL (view->details->package_details), TRUE);
- }
- eel_label_set_text (EEL_LABEL (view->details->package_details), pack->description);
- out = g_strdup_printf (_("Version: %s"), pack->version);
- eel_label_set_text (EEL_LABEL (view->details->package_version), out);
- g_free (out);
-}
-
-/* replace the current progress bar (in the message box) with a centered label saying "Complete!" */
-void
-current_progress_bar_complete (NautilusServiceInstallView *view, const char *text)
-{
- /* can't figure out a decent way to do this yet... :( */
- if (view->details->current_im != NULL) {
- eel_label_set_text (EEL_LABEL (view->details->current_im->progress_label), text);
- gtk_widget_queue_resize (view->details->message_box);
- }
-}
-
-static void
-button_ok_clicked (GtkWidget *button, NautilusServiceInstallView *view)
-{
- view->details->preflight_status = PREFLIGHT_OK;
-}
-
-static void
-button_cancel_clicked (GtkWidget *button, NautilusServiceInstallView *view)
-{
- view->details->preflight_status = PREFLIGHT_CANCEL;
-}
-
-void
-make_query_box (NautilusServiceInstallView *view, EazelInstallCallbackOperation op, GList *package_list)
-{
- GtkWidget *top_label;
- GtkWidget *bottom_label;
- GtkWidget *bottom_label_2;
- GtkWidget *hbox_list;
- GtkWidget *vbox_list;
- GtkWidget *list_label;
- GtkWidget *hbox_buttons;
- GtkWidget *button_ok;
- GtkWidget *button_cancel;
- char *text, *text2;
- GList *iter;
- unsigned long total_k;
- PackageData *package;
- int max_width;
- GtkRequisition requisition;
-
- switch (op) {
- case EazelInstallCallbackOperation_INSTALL:
- text = _("These packages are ready to be downloaded and installed:");
- text2 = _("If you wish to download and install these packages, click Continue.");
- break;
- case EazelInstallCallbackOperation_UNINSTALL:
- text = _("These packages are ready to be uninstalled:");
- text2 = _("If you wish to uninstall these packages, click Continue.");
- break;
- case EazelInstallCallbackOperation_REVERT:
- text = _("These packages are ready to be reverted:");
- text2 = _("If you wish to revert these packages, click Continue.");
- break;
- default:
- text = "???";
- text2 = "";
- }
- top_label = eazel_services_label_new (NULL, 0, 0.0, 0.0, 0, 0,
- EAZEL_SERVICES_BODY_TEXT_COLOR_RGB,
- EAZEL_SERVICES_BACKGROUND_COLOR_RGB,
- NULL, -1, FALSE);
- eel_label_set_text (EEL_LABEL (top_label), text);
- eel_label_set_justify (EEL_LABEL (top_label), GTK_JUSTIFY_LEFT);
- gtk_widget_show (top_label);
-
- bottom_label_2 = eazel_services_label_new (NULL, 0, 0.0, 0.0, 0, 0,
- EAZEL_SERVICES_BODY_TEXT_COLOR_RGB,
- EAZEL_SERVICES_BACKGROUND_COLOR_RGB,
- NULL, -1, FALSE);
- eel_label_set_text (EEL_LABEL (bottom_label_2), text2);
- eel_label_set_justify (EEL_LABEL (bottom_label_2), GTK_JUSTIFY_LEFT);
- gtk_widget_show (bottom_label_2);
-
- /* build up vbox list of packages */
- vbox_list = gtk_vbox_new (FALSE, 0);
- for (iter = g_list_first (package_list); iter != NULL; iter = g_list_next (iter)) {
- package = PACKAGEDATA (iter->data);
- text = packagedata_get_readable_name (package);
- list_label = eazel_services_label_new (NULL, 0, 0.0, 0.0, 0, 0,
- EAZEL_SERVICES_BODY_TEXT_COLOR_RGB,
- EAZEL_SERVICES_BACKGROUND_COLOR_RGB,
- NULL, -1, TRUE);
- eel_label_set_text (EEL_LABEL (list_label), text);
- eel_label_set_justify (EEL_LABEL (list_label), GTK_JUSTIFY_LEFT);
- gtk_widget_show (list_label);
- gtk_box_pack_start (GTK_BOX (vbox_list), list_label, FALSE, FALSE, 0);
- g_free (text);
- }
- gtk_widget_show (vbox_list);
-
- /* hbox around the list to offset it */
- hbox_list = gtk_hbox_new (FALSE, 0);
- gtk_box_pack_start (GTK_BOX (hbox_list), vbox_list, FALSE, FALSE, 20);
- gtk_widget_show (hbox_list);
-
- /* bottom label -- confirmation question */
- total_k = (view->details->download_bytes_total+512)/1024;
- /* arbitrary dividing line */
- if (total_k > 4096) {
- text = g_strdup_printf (_("for a total of %ld MB."), (total_k+512)/1024);
- } else {
- text = g_strdup_printf (_("for a total of %ld KB."), total_k);
- }
- bottom_label = eazel_services_label_new (NULL, 0, 0.0, 0.0, 0, 0,
- EAZEL_SERVICES_BODY_TEXT_COLOR_RGB,
- EAZEL_SERVICES_BACKGROUND_COLOR_RGB,
- NULL, -1, FALSE);
- eel_label_set_text (EEL_LABEL (bottom_label), text);
- eel_label_set_justify (EEL_LABEL (bottom_label), GTK_JUSTIFY_LEFT);
- gtk_widget_show (bottom_label);
- g_free (text);
-
- /* buttons */
- button_ok = gtk_button_new_with_label (_("Continue"));
- gtk_signal_connect (GTK_OBJECT (button_ok), "clicked", GTK_SIGNAL_FUNC (button_ok_clicked), view);
- gtk_widget_show (button_ok);
-
- button_cancel = gtk_button_new_with_label (_("Cancel"));
- gtk_signal_connect (GTK_OBJECT (button_cancel), "clicked", GTK_SIGNAL_FUNC (button_cancel_clicked), view);
- gtk_widget_show (button_cancel);
-
- gtk_widget_size_request (button_ok, &requisition);
- max_width = button_ok->requisition.width;
- gtk_widget_size_request (button_cancel, &requisition);
- if (requisition.width > max_width) {
- max_width = requisition.width;
- }
- gtk_widget_set_usize (button_ok, max_width+10, -2);
- gtk_widget_set_usize (button_cancel, max_width+10, -2);
-
- hbox_buttons = gtk_hbox_new (FALSE, 0);
- list_label = gtk_label_new ("");
- gtk_widget_show (list_label);
- gtk_box_pack_start (GTK_BOX (hbox_buttons), list_label, TRUE, TRUE, 0);
- gtk_box_pack_start (GTK_BOX (hbox_buttons), button_cancel, FALSE, FALSE, 10);
- gtk_box_pack_start (GTK_BOX (hbox_buttons), button_ok, FALSE, FALSE, 0);
- gtk_widget_show (hbox_buttons);
-
- gtk_box_pack_start (GTK_BOX (view->details->query_box), top_label, FALSE, FALSE, 0);
- gtk_box_pack_start (GTK_BOX (view->details->query_box), hbox_list, FALSE, FALSE, 10);
- gtk_box_pack_start (GTK_BOX (view->details->query_box), bottom_label, FALSE, FALSE, 0);
- gtk_box_pack_start (GTK_BOX (view->details->query_box), bottom_label_2, FALSE, FALSE, 15);
- gtk_box_pack_start (GTK_BOX (view->details->query_box), hbox_buttons, FALSE, FALSE, 0);
- add_padding_to_box (view->details->query_box, 0, 10);
- gtk_widget_show (view->details->query_pane);
-
- gtk_container_set_focus_child (GTK_CONTAINER (view->details->form), button_ok);
-}
diff --git a/components/services/install-view/forms.h b/components/services/install-view/forms.h
deleted file mode 100644
index ab7483a8d..000000000
--- a/components/services/install-view/forms.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-
-/*
- * Copyright (C) 2000, 2001 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: J Shane Culpepper <pepper@eazel.com>
- * Robey Pointer <robey@eazel.com>
- */
-
-#ifndef _FORMS_H_
-#define _FORMS_H_
-
-void install_message_destroy (InstallMessage *im);
-InstallMessage *install_message_new (NautilusServiceInstallView *view, const char *package_name);
-void generate_install_form (NautilusServiceInstallView *view);
-void show_overall_feedback (NautilusServiceInstallView *view, char *progress_message);
-void update_package_info_display (NautilusServiceInstallView *view, const PackageData *pack, const char *format);
-void current_progress_bar_complete (NautilusServiceInstallView *view, const char *text);
-void make_query_box (NautilusServiceInstallView *view, EazelInstallCallbackOperation op, GList *package_list);
-
-#endif /* _FORMS_H_ */
diff --git a/components/services/install-view/main.c b/components/services/install-view/main.c
deleted file mode 100644
index 2a166098f..000000000
--- a/components/services/install-view/main.c
+++ /dev/null
@@ -1,116 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Maciej Stachowiak <mjs@eazel.com>
- * J Shane Culpepper <pepper@eazel.com>
- */
-
-/* main.c - main function and object activation function for services
- content view component. */
-
-#include <config.h>
-#include <gnome.h>
-#include <liboaf/liboaf.h>
-#include <bonobo.h>
-#include "nautilus-service-install-view.h"
-#include <libtrilobite/libammonite.h>
-#include <gconf/gconf.h>
-
-static int object_count = 0;
-
-static gboolean
-quit_timer (void *unused)
-{
- gtk_main_quit ();
- return FALSE;
-}
-
-static void
-service_install_object_destroyed (GtkObject *obj)
-{
- object_count--;
- if (object_count <= 0) {
- /* timing issues: let the install view handle its own shutdown before
- * pulling the plug...
- */
- gtk_timeout_add (5, quit_timer, NULL);
- }
-}
-
-static BonoboObject *
-service_install_make_object (BonoboGenericFactory *factory,
- const char *iid,
- void *closure)
-{
-
- NautilusServiceInstallView *view;
- NautilusView *nautilus_view;
-
- if (strcmp (iid, "OAFIID:nautilus_service_install_view:886546ca-1115-4ea4-8d30-8cefa2f5070b")) {
- return NULL;
- }
-
- view = NAUTILUS_SERVICE_INSTALL_VIEW (gtk_object_new (NAUTILUS_TYPE_SERVICE_INSTALL_VIEW, NULL));
-
- object_count++;
-
- nautilus_view = nautilus_service_install_view_get_nautilus_view (view);
-
- gtk_signal_connect (GTK_OBJECT (nautilus_view), "destroy", service_install_object_destroyed, NULL);
-
- return BONOBO_OBJECT (nautilus_view);
-}
-
-int
-main (int argc, char *argv[])
-{
- BonoboGenericFactory *factory;
- CORBA_ORB orb;
- char *registration_id;
-
- /* Disable session manager connection */
- gnome_client_disable_master_connection ();
-
- gnomelib_register_popt_table (oaf_popt_options, oaf_get_popt_table_name ());
- orb = oaf_init (argc, argv);
-
- gnome_init ("nautilus-service-install-view", VERSION,
- argc, argv);
- gdk_rgb_init ();
-
- bonobo_init (orb, CORBA_OBJECT_NIL, CORBA_OBJECT_NIL);
- gconf_init (argc, argv, NULL);
-
- ammonite_init (bonobo_poa());
-
- /* log to stderr, for now (but leave debug mode off) */
- trilobite_set_log_handler (stderr, G_LOG_DOMAIN);
-
- registration_id = oaf_make_registration_id ("OAFIID:nautilus_service_install_view_factory:e59e53d1-e3d1-46fe-ae28-3ec5c56b7d32", getenv ("DISPLAY"));
- factory = bonobo_generic_factory_new_multi (registration_id,
- service_install_make_object,
- NULL);
- g_free (registration_id);
-
- do {
- bonobo_main ();
- } while (object_count > 0);
-
- return 0;
-}
diff --git a/components/services/install-view/nautilus-service-install-view.c b/components/services/install-view/nautilus-service-install-view.c
deleted file mode 100644
index 615b88a6b..000000000
--- a/components/services/install-view/nautilus-service-install-view.c
+++ /dev/null
@@ -1,1115 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 8; tab-width: 8 -*- */
-
-/*
- * Copyright (C) 2000, 2001 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: J Shane Culpepper <pepper@eazel.com>
- * Robey Pointer <robey@eazel.com>
- */
-
-#include <config.h>
-
-#include "nautilus-service-install-view.h"
-#include "forms.h"
-#include "callbacks.h"
-
-#include "eazel-services-header.h"
-#include "eazel-services-extensions.h"
-#include <libeazelinstall.h>
-#include "libtrilobite/libtrilobite.h"
-#include "libtrilobite/libammonite-gtk.h"
-
-#include <gnome-xml/tree.h>
-#include <libgnomevfs/gnome-vfs-utils.h>
-#include <eel/eel-background.h>
-#include <eel/eel-gtk-extensions.h>
-#include <eel/eel-gtk-macros.h>
-#include <eel/eel-glib-extensions.h>
-#include <eel/eel-string.h>
-#include <eel/eel-label.h>
-#include <eel/eel-gdk-extensions.h>
-#include <eel/eel-password-dialog.h>
-#include <eel/eel-stock-dialogs.h>
-#include <eel/eel-viewport.h>
-#include <eel/eel-clickable-image.h>
-#include <stdio.h>
-#include <fcntl.h>
-#include <dirent.h>
-#include <unistd.h>
-#include <sys/stat.h>
-
-/* for uname */
-#include <sys/utsname.h>
-
-#define PASSWORD_PROMPT _("Please enter your root password to continue installing. (This password is not saved or transmitted outside of your system.)")
-
-static void nautilus_service_install_view_initialize_class (NautilusServiceInstallViewClass *klass);
-static void nautilus_service_install_view_initialize (NautilusServiceInstallView *view);
-static void service_install_load_location_callback (NautilusView *nautilus_view,
- const char *location,
- NautilusServiceInstallView *view);
-static void service_install_stop_loading_callback (NautilusView *nautilus_view,
- NautilusServiceInstallView *view);
-
-EEL_DEFINE_CLASS_BOILERPLATE (NautilusServiceInstallView, nautilus_service_install_view, GTK_TYPE_EVENT_BOX)
-
-
-static gboolean
-deps_destroy_foreach (char *key, char *value)
-{
- g_free (key);
- g_free (value);
- return TRUE;
-}
-
-static void
-nautilus_service_install_view_destroy (GtkObject *object)
-{
- NautilusServiceInstallView *view;
- CORBA_Environment ev;
-
- view = NAUTILUS_SERVICE_INSTALL_VIEW (object);
- if (view->details->preflight_status == PREFLIGHT_UNKNOWN) {
- view->details->preflight_status = PREFLIGHT_PANIC_BUTTON;
- }
-
- CORBA_exception_init (&ev);
- if (view->details->installer != NULL) {
- GNOME_Trilobite_Eazel_Install_stop (eazel_install_callback_corba_objref (view->details->installer), &ev);
- }
- CORBA_exception_free (&ev);
-
- if (view->details->root_client != NULL) {
- trilobite_root_client_unref (GTK_OBJECT (view->details->root_client));
- }
-
- if (view->details->installer != NULL) {
- /* this will unref the installer too, which will indirectly cause any ongoing download to abort */
- eazel_install_callback_unref (GTK_OBJECT (view->details->installer));
- }
-
- EEL_CALL_PARENT (GTK_OBJECT_CLASS, destroy, (object));
-}
-
-static void
-nautilus_service_install_view_finalize (GtkObject *object)
-{
- NautilusServiceInstallView *view;
-
- view = NAUTILUS_SERVICE_INSTALL_VIEW (object);
-
- g_free (view->details->uri);
- g_free (view->details->current_rpm);
- g_free (view->details->remembered_password);
- g_hash_table_foreach_remove (view->details->deps, (GHRFunc)deps_destroy_foreach, NULL);
- g_hash_table_destroy (view->details->deps);
- g_list_foreach (view->details->message, (GFunc)install_message_destroy, NULL);
- g_list_free (view->details->message);
- g_free (view->details->username);
- g_free (view->details);
-
- EEL_CALL_PARENT (GTK_OBJECT_CLASS, finalize, (object));
-}
-
-static void
-nautilus_service_install_view_initialize_class (NautilusServiceInstallViewClass *klass)
-{
-
- GtkObjectClass *object_class;
- GtkWidgetClass *widget_class;
-
- object_class = GTK_OBJECT_CLASS (klass);
- widget_class = GTK_WIDGET_CLASS (klass);
- parent_class = gtk_type_class (gtk_event_box_get_type ());
- object_class->destroy = nautilus_service_install_view_destroy;
- object_class->finalize = nautilus_service_install_view_finalize;
-}
-
-static void
-nautilus_service_install_view_initialize (NautilusServiceInstallView *view)
-{
-
- EelBackground *background;
-
- view->details = g_new0 (NautilusServiceInstallViewDetails, 1);
- view->details->nautilus_view = nautilus_view_new (GTK_WIDGET (view));
- gtk_signal_connect (GTK_OBJECT (view->details->nautilus_view),
- "load_location",
- GTK_SIGNAL_FUNC (service_install_load_location_callback),
- view);
- gtk_signal_connect (GTK_OBJECT (view->details->nautilus_view),
- "stop_loading",
- GTK_SIGNAL_FUNC (service_install_stop_loading_callback),
- view);
-
- background = eel_get_widget_background (GTK_WIDGET (view));
- eel_background_set_color (background, EAZEL_SERVICES_BACKGROUND_COLOR_SPEC);
-
- view->details->core_package = FALSE;
- view->details->deps = g_hash_table_new (g_str_hash, g_str_equal);
-
- gtk_widget_show (GTK_WIDGET (view));
-}
-
-
-NautilusView *
-nautilus_service_install_view_get_nautilus_view (NautilusServiceInstallView *view)
-{
- return view->details->nautilus_view;
-}
-
-
-static PackageData *
-create_package (char *name, int local_file)
-{
- struct utsname buf;
- PackageData *pack;
-
- g_assert (name);
-
- uname (&buf);
- pack = packagedata_new ();
- if (local_file) {
- pack->filename = g_strdup (name);
- } else if (strncmp (name, "rpm_id%3D", 9) == 0) {
- pack->eazel_id = g_strdup (name+9);
- } else if (strncmp (name, "rpm_id=", 7) == 0) {
- pack->eazel_id = g_strdup (name+7);
- } else if (strncmp (name, "product_id%3D", 13) == 0) {
- pack->suite_id = g_strdup_printf ("P:%s", name+13);
- } else if (strncmp (name, "product_id=", 11) == 0) {
- pack->suite_id = g_strdup_printf ("P:%s", name+11);
- } else if (strncmp (name, "suite_id%3D", 11) == 0) {
- pack->suite_id = g_strdup_printf ("S:%s", name+11);
- } else if (strncmp (name, "suite_id=", 9) == 0) {
- pack->suite_id = g_strdup_printf ("S:%s", name+9);
- } else if (strncmp (name, "product_name%3D", 15) == 0) {
- pack->suite_id = g_strdup_printf ("N:%s", name+15);
- } else if (strncmp (name, "product_name=", 13) == 0) {
- pack->suite_id = g_strdup_printf ("N:%s", name+13);
- } else if (strncmp (name, "suite_name%3D", 13) == 0) {
- pack->suite_id = g_strdup_printf ("X:%s", name+13);
- } else if (strncmp (name, "suite_name=", 11) == 0) {
- pack->suite_id = g_strdup_printf ("X:%s", name+11);
- } else {
- pack->name = g_strdup (name);
- }
- pack->archtype = g_strdup (buf.machine);
-#ifdef ASSUME_ix86_IS_i386
- if (strlen (pack->archtype)==4 && pack->archtype[0]=='i' &&
- pack->archtype[1]>='3' && pack->archtype[1]<='9' &&
- pack->archtype[2]=='8' && pack->archtype[3]=='6') {
- g_free (pack->archtype);
- pack->archtype = g_strdup ("i386");
- }
-#endif
- pack->distribution = trilobite_get_distribution ();
- pack->toplevel = TRUE;
-
- return pack;
-}
-
-/* quick & dirty: parse the url into (host, port) and a category list */
-/* format:
- * "eazel-install:" [ "//" [ username "@" ] [ "hostname" [ ":" port ] ] "/" ]
- * package-name [ "?version=" version ] ( ";" package-name [ "?version=" version ] )*
- *
- * eazel-install:xfig
- * eazel-install://anonymous@/freeamp
- * eazel-install://example.com:8888/nautilus?version=1.0;xpdf;sephiroth?version=0.4
- */
-/* returns TRUE if a hostname was parsed from the uri */
-static gboolean
-nautilus_install_parse_uri (const char *uri, NautilusServiceInstallView *view,
- char **host, int *port, char **username)
-{
- char *p, *q, *pnext, *package_name, *host_spec, *rest, *ptr;
- GList *packages = NULL;
- PackageData *pack;
- gboolean result = FALSE;
- gboolean another_package;
-
- view->details->categories = NULL;
-
- p = strchr (uri, ':');
- if (! p) {
- /* bad mojo */
- return result;
- }
- p++;
-
- /* "//[user@]host[:port]" spec? */
- if ((*p == '/') && (*(p+1) == '/')) {
- p += 2;
-
- q = strchr (p, '/');
- if (! q) {
- q = p + strlen(p);
- }
- host_spec = g_strndup (p, q - p);
-
- /* optional "user@" */
- p = strchr (host_spec, '@');
- if (p) {
- *p = 0;
- g_free (*username);
- *username = host_spec;
- if (*(p+1)) {
- g_free (*host);
- *host = g_strdup (p+1);
- result = TRUE;
- }
- } else {
- g_free (*host);
- *host = host_spec;
- result = TRUE;
- }
-
- if (*host) {
- /* optional ":port" */
- p = strchr (*host, ':');
- if (p) {
- *p = 0;
- *port = atoi (p+1);
- }
- }
-
- /* push p to past the trailing '/' */
- p = (*q) ? q+1 : q;
- }
-
- /* full path specified? local file instead of server */
- if (*p == '/') {
- view->details->using_local_file = 1;
- }
-
- if (*p) {
- rest = g_strdup (p);
- ptr = rest;
- do {
- pnext = strchr (ptr, ';');
- if ((pnext != NULL) && (*(pnext+1) != '\0')) {
- another_package = TRUE;
- *pnext++ = '\0';
- } else {
- another_package = FALSE;
- }
-
- trilobite_debug ("package '%s'", ptr);
- /* version name specified? */
- q = strchr (ptr, '?');
- if (q) {
- *q++ = 0;
- if (strncmp (q, "version=", 8) == 0) {
- q += 8;
- }
- }
-
- package_name = gnome_vfs_unescape_string_for_display (ptr);
- pack = create_package (package_name, view->details->using_local_file);
- if (q) {
- pack->version = g_strdup (q);
- }
- packages = g_list_prepend (packages, pack);
- g_free (package_name);
-
- if (pnext != NULL) {
- ptr = pnext;
- }
- } while (another_package);
- g_free (rest);
- }
-
- trilobite_debug ("host '%s:%d' username '%s'", *host ? *host : "(default)", *host ? *port : 0,
- *username ? *username : "(default)");
-
- /* add to categories */
- if (packages) {
- CategoryData *category;
-
- category = categorydata_new ();
- category->packages = packages;
- view->details->categories = g_list_prepend (view->details->categories, category);
- }
- return result;
-}
-
-void
-nautilus_service_install_check_for_desktop_files (NautilusServiceInstallView *view,
- EazelInstallCallback *cb,
- PackageData *package)
-{
- GList *iterator;
-
- for (iterator = package->provides; iterator; iterator = g_list_next (iterator)) {
- char *fname = (char*)(iterator->data);
- char *ptr;
-
- ptr = strrchr (fname, '.');
- if (ptr && ((strcmp (ptr, ".desktop") == 0) ||
- (strcmp (ptr, ".kdelink") == 0))) {
- view->details->desktop_files = g_list_prepend (view->details->desktop_files,
- g_strdup (fname));
- }
- }
-}
-
-/* Get a description of the application pointed to by a given dentry and path fragment */
-static char*
-nautilus_install_service_describe_menu_entry (GnomeDesktopEntry *dentry,
- const char *path_prefix,
- const char *path_fragment)
-{
- char *slash;
- char *addition = NULL, *addition_tmp;
- char *fragment_tmp;
-
- char **pieces;
- char *so_far;
- int i;
- char *dir, *file, *menu;
- GnomeDesktopEntry *dir_dentry;
-
- fragment_tmp = g_strdup (path_fragment);
- slash = strrchr (fragment_tmp, G_DIR_SEPARATOR);
- if (slash != NULL) {
- *slash = '\0';
- }
- pieces = g_strsplit (fragment_tmp, "/", 128); /* FIXME "/" -> G_DIR_SEPARATOR */
- g_free (fragment_tmp);
- so_far = g_strdup (path_prefix);
-
- for (i=0; pieces[i] != NULL; i++) {
-
- dir = g_strconcat (so_far, pieces[i], "/", NULL);
- file = g_strconcat (dir, ".directory", NULL);
-
- g_free (so_far);
- so_far = dir;
-
- dir_dentry = gnome_desktop_entry_load (file);
- g_free (file);
-
- menu = NULL;
- if (dir_dentry != NULL) {
- menu = dir_dentry->name;
- } else {
- menu = pieces[i];
- }
-
- if (addition == NULL) {
- addition = g_strdup_printf
- (_("%s is in GNOME (footprint) > %s"),
- dentry->name, menu);
- } else {
- addition_tmp = g_strconcat (addition, " > ", dir_dentry->name, NULL);
- g_free (addition);
- addition = addition_tmp;
- }
-
- /* menu doesn't need to be freed, because it points into another structure */
-
- if (dir_dentry != NULL) {
- gnome_desktop_entry_free (dir_dentry);
- }
- }
- g_free (so_far);
- g_strfreev (pieces);
-
- if (addition == NULL) {
- addition = g_strdup_printf (_("%s is in the GNOME (footprint) menu.\n"), dentry->name);
- } else {
- addition_tmp = g_strconcat (addition, ".\n", NULL);
- g_free (addition);
- addition = addition_tmp;
- }
-
- return addition;
-
-}
-
-static char *
-describe_dentry (GnomeDesktopEntry *dentry, char *fname) {
- char *addition = NULL;
- if (dentry->is_kde) {
- addition = g_strdup_printf (_("%s is in the KDE menu.\n"), dentry->name);
- } else {
- /* match desktop files against a set of paths that the panel is known to
- * put in the menu. */
- char *desktop_prefixes[] = {
- "/gnome/apps/",
- "/applnk/",
- NULL,
- };
- int i;
-
- for (i=0; desktop_prefixes[i] != NULL; i++) {
- char *gnomeapp = desktop_prefixes[i];
- char *apps_ptr = strstr (fname, gnomeapp);
- if (apps_ptr) {
- char *full_prefix = g_strndup (fname, (apps_ptr)-fname +
- strlen (gnomeapp));
- addition = nautilus_install_service_describe_menu_entry
- (dentry, full_prefix, apps_ptr+strlen (gnomeapp));
- g_free (full_prefix);
- if (addition != NULL) {
- break;
- }
- }
- }
- }
-
- return addition;
-}
-
-static void
-drag_data_get (GtkWidget *widget,
- GdkDragContext *context,
- GtkSelectionData *selection_data,
- guint info,
- guint time,
- gpointer data)
-{
- char *uri = g_strdup_printf ("file://%s", (char *)data);
-
- gtk_selection_data_set (selection_data, selection_data->target,
- 8, uri, strlen (uri));
-
- g_free (uri);
-}
-
-static void
-drag_data_delete (GtkWidget *widget,
- GdkDragContext *context,
- gpointer data)
-{
- g_free (data);
-}
-
-static void
-launcher_clicked_callback (GtkWidget *button,
- gpointer user_data)
-{
- gnome_desktop_entry_launch ((GnomeDesktopEntry *)user_data);
-}
-
-#define ICON_SIZE 48 /* the algorithm depends on icons fitting into a square space */
-#define DEFAULT_ICON "gnome-logo-icon-transparent.png"
-
-static GtkWidget *
-make_dragable_icon_well (NautilusServiceInstallView *view,
- GnomeDesktopEntry *dentry,
- char *dentry_path) {
- GtkWidget *aspectframe;
- GtkWidget *eventbox;
- GtkWidget *image;
- GtkWidget *box;
- GdkPixbuf *icon;
- char *icon_name;
- GdkPixmap *drag_pixmap;
- GdkBitmap *drag_mask;
- int width, height;
- GdkPixbuf *scaledicon;
- EelBackground *background;
- static GtkTargetEntry target_table[] = {
- { "text/uri-list", 0, 0 }
- };
-
- icon_name = dentry->icon;
-
- if (icon_name == NULL) {
- /* use some sane default */
- icon_name = DEFAULT_ICON;
- }
-
-
- icon = gdk_pixbuf_new_from_file (icon_name);
- if (icon == NULL) {
- /* can even load the backup image
- * fail... */
- return NULL;
- }
-
- /* set up the "well" aspect frame */
- aspectframe = gtk_aspect_frame_new (NULL, 0.5, 0.0, 1, TRUE);
- gtk_frame_set_shadow_type (GTK_FRAME (aspectframe), GTK_SHADOW_IN);
- background = eel_get_widget_background (GTK_WIDGET (aspectframe));
- eel_background_set_color (background, EAZEL_SERVICES_BACKGROUND_COLOR_SPEC);
-
- /* scale icon to fit in an ICON_SIZExICON_SIZE box */
- width = gdk_pixbuf_get_width (icon);
- height = gdk_pixbuf_get_height (icon);
- if (width == height) {
- width = ICON_SIZE;
- height = ICON_SIZE;
- } else if (width > height) {
- height = (((double)height)/width)*ICON_SIZE;
- width = ICON_SIZE;
- } else if (width < height) {
- height = ICON_SIZE;
- width = (((double)width)/height)*ICON_SIZE;
- }
- scaledicon = gdk_pixbuf_scale_simple (icon,
- width, height, GDK_INTERP_BILINEAR);
-
- image = eel_clickable_image_new (NULL, scaledicon);
- eel_clickable_image_set_prelight (EEL_CLICKABLE_IMAGE (image),
- TRUE);
-
- eventbox = gtk_event_box_new ();
- background = eel_get_widget_background (GTK_WIDGET (eventbox));
- eel_background_set_color (background, EAZEL_SERVICES_BACKGROUND_COLOR_SPEC);
- gtk_widget_show (eventbox);
- box = gtk_hbox_new (FALSE, 0);
- gtk_container_set_border_width (GTK_CONTAINER (box), 3);
- gtk_widget_show (box);
- gtk_container_add (GTK_CONTAINER (box), image);
- gtk_container_add (GTK_CONTAINER (eventbox), box);
- gtk_container_add (GTK_CONTAINER (aspectframe), eventbox);
-
- /* setup drag and drop */
- gtk_drag_source_set(eventbox, GDK_BUTTON1_MASK | GDK_BUTTON3_MASK,
- target_table, 1, GDK_ACTION_COPY | GDK_ACTION_MOVE);
- gdk_pixbuf_render_pixmap_and_mask (icon,
- &drag_pixmap, &drag_mask, 128);
- gtk_drag_source_set_icon (eventbox,
- gtk_widget_get_colormap (GTK_WIDGET (view)),
- drag_pixmap, drag_mask);
- gdk_pixmap_unref (drag_pixmap);
- gdk_pixmap_unref (drag_mask);
- gdk_pixbuf_unref (icon);
- gtk_signal_connect (GTK_OBJECT (eventbox), "drag_data_get",
- GTK_SIGNAL_FUNC (drag_data_get),
- g_strdup (dentry_path));
- gtk_signal_connect (GTK_OBJECT (eventbox), "drag_data_delete",
- GTK_SIGNAL_FUNC (drag_data_delete), NULL);
- gtk_signal_connect (GTK_OBJECT (image), "clicked",
- GTK_SIGNAL_FUNC (launcher_clicked_callback), dentry);
-
- gtk_widget_show (image);
-
- return aspectframe;
-
-}
-
-/* Get the toplevel menu name for the desktop file installed */
-void
-nautilus_install_service_add_menu_launchers (NautilusServiceInstallView *view, GtkWidget *dialog)
-{
- GList *iterator;
- char *fname;
- char *label_text;
- char *menu_description;
- GtkWidget *button, *label;
- gboolean have_icon;
- GnomeDesktopEntry *dentry;
- GtkWidget *buttonbox;
- GtkWidget *iconwell;
- GtkWidget *table;
- GtkWidget *info_icon;
- GtkWidget *alignment;
- GtkWidget *hseparator;
- char *s;
- int num_launchers;
- int i;
-
- num_launchers = g_list_length (view->details->desktop_files);
-
- table = gtk_table_new (num_launchers*3+1, 3, FALSE);
- gtk_table_set_row_spacings (GTK_TABLE (table), 10);
- gtk_table_set_col_spacings (GTK_TABLE (table), 10);
- gtk_widget_show (table);
- gtk_container_add (GTK_CONTAINER (GNOME_DIALOG (dialog)->vbox), table);
-
- s = gnome_unconditional_pixmap_file("gnome-info.png");
- if (s != NULL) {
- info_icon = eel_image_new (s);
- g_free (s);
- gtk_widget_show (info_icon);
- gtk_table_attach (GTK_TABLE (table), info_icon,
- 0, 1, 0, 1,
- (GtkAttachOptions) (GTK_FILL),
- (GtkAttachOptions) (GTK_FILL | GTK_FILL),
- 0, 0);
- }
-
- label = eel_label_new (_("Installation Complete"));
- eel_label_set_is_smooth (EEL_LABEL (label), FALSE);
- eel_label_set_wrap (EEL_LABEL (label), FALSE);
- eel_label_make_bold (EEL_LABEL (label));
- gtk_widget_show (label);
- alignment = gtk_alignment_new (0.0, 0.5, 0.0, 0.0);
- gtk_container_add (GTK_CONTAINER (alignment), label);
- gtk_widget_show (alignment);
- gtk_table_attach (GTK_TABLE (table), alignment,
- 1, 3, 0, 1,
- (GtkAttachOptions) (GTK_FILL),
- (GtkAttachOptions) (GTK_FILL | GTK_FILL),
- 0, 0);
-
-
- i=-1;
- for (iterator = view->details->desktop_files; iterator; iterator = g_list_next (iterator)) {
- i++;
- fname = (char*)(iterator->data);
- have_icon = FALSE;
- dentry = gnome_desktop_entry_load (fname);
- menu_description = describe_dentry (dentry, fname);
-
- if (menu_description == NULL) {
- /* Hmmm - we can't find where in the menu this lives.
- * This probably means its something like an applet.
- * We can't show much useable info here.
- * Lets just skip this entry.
- */
- gnome_desktop_entry_free (dentry);
- continue;
- }
-
- hseparator = gtk_hseparator_new ();
- gtk_widget_show (hseparator);
- gtk_table_attach (GTK_TABLE (table), hseparator,
- 1, 3, i*3+1, i*3+2,
- (GtkAttachOptions) (GTK_FILL),
- (GtkAttachOptions) (GTK_FILL | GTK_FILL),
- 0, 0);
-
-
- /* set up the icon well */
- iconwell = make_dragable_icon_well (view, dentry, fname);
- if (iconwell != NULL) {
- gtk_table_attach (GTK_TABLE (table), iconwell,
- 1, 2, i*3+2, i*3+3,
- (GtkAttachOptions) (GTK_FILL),
- (GtkAttachOptions) (GTK_FILL | GTK_FILL),
- 0, 0);
- gtk_widget_show (iconwell);
- }
-
- /* set up the text */
- if (iconwell != NULL) {
- label_text = g_strdup_printf (_("%sTo start %s, click "
- "the Launch button below, or to create "
- "a shortcut, drag the icon on the "
- "right to the GNOME panel or your "
- "desktop."), menu_description,
- dentry->name);
- } else {
- /* couldn't find an icon */
- label_text = g_strdup_printf (_("%sTo start %s, click "
- "the Launch button below."),
- menu_description, dentry->name);
- }
- g_free (menu_description);
- label = eel_label_new (label_text);
- gtk_widget_set_usize (label, 400, -1);
- eel_label_set_is_smooth (EEL_LABEL (label), FALSE);
- eel_label_set_wrap (EEL_LABEL (label), TRUE);
- eel_label_set_justify (EEL_LABEL (label), GTK_JUSTIFY_LEFT);
- eel_label_set_adjust_wrap_on_resize (EEL_LABEL (label), TRUE);
- gtk_misc_set_alignment (GTK_MISC (label), 0.0, 1.0);
- gtk_widget_show (label);
- g_free (label_text);
- gtk_table_attach (GTK_TABLE (table), label,
- 2, 3, i*3+2, i*3+3,
- (GtkAttachOptions) (GTK_FILL),
- (GtkAttachOptions) (GTK_FILL | GTK_FILL),
- 0, 0);
-
- /* set up the "launch" button */
- buttonbox = gtk_hbutton_box_new ();
- gtk_button_box_set_layout (GTK_BUTTON_BOX (buttonbox), GTK_BUTTONBOX_START);
- gtk_button_box_set_spacing (GTK_BUTTON_BOX (buttonbox), 3);
- button = gtk_button_new_with_label ("Launch");
- gtk_container_add (GTK_CONTAINER (buttonbox), button);
- gtk_signal_connect_full (GTK_OBJECT (button), "clicked",
- GTK_SIGNAL_FUNC (launcher_clicked_callback), NULL,
- dentry, (GtkDestroyNotify) gnome_desktop_entry_free,
- FALSE, FALSE);
- gtk_widget_show (button);
- gtk_widget_show (buttonbox);
- gtk_table_attach (GTK_TABLE (table), buttonbox,
- 2, 3, i*3+3, i*3+4,
- (GtkAttachOptions) (GTK_FILL),
- (GtkAttachOptions) (GTK_FILL | GTK_FILL),
- 0, 0);
- }
- gtk_widget_show (table);
-}
-
-/* signal callback -- ask the user for the root password (for installs) */
-static char *
-nautilus_service_need_password (GtkObject *object, const char *prompt, NautilusServiceInstallView *view)
-{
- char *message = NULL;
- GtkWidget *dialog;
- gboolean okay;
- char *out;
-
- if (view->details->remembered_password) {
- return g_strdup (view->details->remembered_password);
- }
-
- if (view->details->password_attempts > 0) {
- message = g_strdup_printf ("%s\n \n%s", PASSWORD_PROMPT, _("Incorrect password."));
- } else {
- message = g_strdup (PASSWORD_PROMPT);
- }
-
- dialog = eel_password_dialog_new (_("Authenticate as root"), message, prompt, "", TRUE);
- okay = eel_password_dialog_run_and_block (EEL_PASSWORD_DIALOG (dialog));
-
- if (! okay) {
- /* cancel */
- view->details->password_attempts = 0;
- view->details->cancelled = TRUE;
- out = g_strdup ("");
- } else {
- out = eel_password_dialog_get_password (EEL_PASSWORD_DIALOG (dialog));
- if (eel_password_dialog_get_remember (EEL_PASSWORD_DIALOG (dialog))) {
- view->details->remembered_password = g_strdup (out);
- }
- }
-
- gtk_widget_destroy (dialog);
-
- if (okay) {
- view->details->password_attempts++;
- }
-
- g_free (message);
-
- return out;
-}
-
-/* bad password -- let em try again? */
-static gboolean
-nautilus_service_try_again (GtkObject *object, NautilusServiceInstallView *view)
-{
- if (view->details->password_attempts == 0) {
- /* user hit "cancel" */
- return FALSE;
- }
-
- /* a wrong password shouldn't be remembered :) */
- g_free (view->details->remembered_password);
- view->details->remembered_password = NULL;
-
- if (view->details->password_attempts >= 3) {
- /* give up. */
- view->details->password_attempts = 0;
- return FALSE;
- }
- return TRUE;
-}
-
-static TrilobiteRootClient *
-set_root_client (BonoboObjectClient *service, NautilusServiceInstallView *view)
-{
- TrilobiteRootClient *root_client = NULL;
- CORBA_Environment ev;
-
- CORBA_exception_init (&ev);
-
- if (bonobo_object_client_has_interface (service, "IDL:Trilobite/PasswordQuery:1.0", &ev)) {
- root_client = trilobite_root_client_new ();
- if (! trilobite_root_client_attach (root_client, service)) {
- g_warning ("unable to attach root client to Trilobite/PasswordQuery!");
- }
-
- gtk_signal_connect (GTK_OBJECT (root_client), "need_password",
- GTK_SIGNAL_FUNC (nautilus_service_need_password),
- view);
- gtk_signal_connect (GTK_OBJECT (root_client), "try_again",
- GTK_SIGNAL_FUNC (nautilus_service_try_again),
- view);
- } else {
- g_warning ("Object does not support IDL:Trilobite/PasswordQuery:1.0");
- }
-
- CORBA_exception_free (&ev);
- return root_client;
-}
-
-static void
-nautilus_service_install_view_update_from_uri_finish (NautilusServiceInstallView *view, const char *uri)
-{
- PackageData *pack;
- CategoryData *category_data;
- char *host;
- int port;
- GNOME_Trilobite_Eazel_Install service;
- CORBA_Environment ev;
- char *out, *p;
- gboolean set_auth;
-
- /* get default host/port */
- host = g_strdup (trilobite_get_services_address ());
- p = strchr (host, ':');
- if (p != NULL) {
- *p = 0;
- port = atoi (p+1);
- } else {
- port = 80;
- }
-
- set_auth = !(nautilus_install_parse_uri (uri, view, &host, &port, &view->details->username));
-
- if (! view->details->categories) {
- return;
- }
-
- /* NOTE: This adds a libeazelinstall packagedata object to the view */
- pack = (PackageData*) gtk_object_get_data (GTK_OBJECT (view), "packagedata");
- if (pack != NULL) {
- /* Destroy the old */
- gtk_object_unref (GTK_OBJECT (pack));
- }
-
- /* find the package data for the package we're about to install */
- category_data = (CategoryData *) view->details->categories->data;
- pack = (PackageData *) category_data->packages->data;
-
- gtk_object_set_data (GTK_OBJECT (view), "packagedata", pack);
-
- if (g_list_length (category_data->packages) > 1) {
- out = g_strdup_printf (_("Installing packages"));
- } else if ((pack->eazel_id != NULL) || (pack->suite_id != NULL)) {
- out = g_strdup_printf (_("Installing remote package"));
- } else if (pack->name != NULL) {
- out = g_strdup_printf (_("Installing \"%s\""), pack->name);
- } else {
- out = g_strdup_printf (_("Installing some package"));
- }
- eel_label_set_text (EEL_LABEL (view->details->package_name), out);
- g_free (out);
-
- CORBA_exception_init (&ev);
- if (view->details->installer) {
- eazel_install_callback_unref (GTK_OBJECT (view->details->installer));
- }
- view->details->installer = eazel_install_callback_new ();
- if (view->details->installer == NULL) {
- GtkWidget *toplevel, *dialog;
- char *message;
-
- nautilus_view_report_load_complete (view->details->nautilus_view);
- gtk_widget_hide (view->details->form);
-
- message = g_strdup (_("The Eazel install service is missing:\nInstalls will not work."));
- toplevel = gtk_widget_get_toplevel (view->details->message_box);
- if (GTK_IS_WINDOW (toplevel)) {
- dialog = gnome_error_dialog_parented (message, GTK_WINDOW (toplevel));
- } else {
- dialog = gnome_error_dialog (message);
- }
- gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
- gnome_dialog_run_and_close (GNOME_DIALOG (dialog));
- return;
- }
-
- view->details->problem = eazel_install_problem_new ();
- view->details->root_client = set_root_client (eazel_install_callback_bonobo (view->details->installer), view);
- service = eazel_install_callback_corba_objref (view->details->installer);
- GNOME_Trilobite_Eazel_Install__set_protocol (service, GNOME_Trilobite_Eazel_PROTOCOL_HTTP, &ev);
- GNOME_Trilobite_Eazel_Install__set_server (service, host, &ev);
- GNOME_Trilobite_Eazel_Install__set_server_port (service, port, &ev);
- GNOME_Trilobite_Eazel_Install__set_auth (service, set_auth, &ev);
-
- if (view->details->username != NULL) {
- GNOME_Trilobite_Eazel_Install__set_username (service, view->details->username, &ev);
- }
- GNOME_Trilobite_Eazel_Install__set_test_mode (service, FALSE, &ev);
-
- gtk_signal_connect (GTK_OBJECT (view->details->installer), "dependency_check",
- nautilus_service_install_dependency_check, view);
- gtk_signal_connect (GTK_OBJECT (view->details->installer), "file_conflict_check",
- GTK_SIGNAL_FUNC (nautilus_service_install_conflict_check), view);
- gtk_signal_connect (GTK_OBJECT (view->details->installer), "preflight_check",
- GTK_SIGNAL_FUNC (nautilus_service_install_preflight_check), view);
- gtk_signal_connect (GTK_OBJECT (view->details->installer), "save_transaction",
- GTK_SIGNAL_FUNC (nautilus_service_install_save_transaction), view);
- gtk_signal_connect (GTK_OBJECT (view->details->installer), "download_progress",
- GTK_SIGNAL_FUNC (nautilus_service_install_download_progress), view);
- gtk_signal_connect (GTK_OBJECT (view->details->installer), "download_failed",
- GTK_SIGNAL_FUNC (nautilus_service_install_download_failed), view);
- gtk_signal_connect (GTK_OBJECT (view->details->installer), "install_progress",
- nautilus_service_install_progress, view);
- gtk_signal_connect (GTK_OBJECT (view->details->installer), "install_failed",
- nautilus_service_install_failed, view);
- gtk_signal_connect (GTK_OBJECT (view->details->installer), "done",
- nautilus_service_install_done, view);
- eazel_install_callback_install_packages (view->details->installer,
- view->details->categories,
- NULL, &ev);
-
- CORBA_exception_free (&ev);
-
- show_overall_feedback (view, _("Contacting the Eazel Software Catalog ..."));
-
- /* might take a while (leave the throbber on) */
-}
-
-static void /* AmmonitePromptLoginCb */
-user_login_callback (
- gpointer user_data,
- const EazelProxy_User *user,
- const EazelProxy_AuthnFailInfo *fail_info,
- AmmoniteDialogButton button_pressed)
-{
- NautilusServiceInstallView *view;
-
- view = NAUTILUS_SERVICE_INSTALL_VIEW (user_data);
-
- /* if the view has been destroyed while the callback was gone, just drop everything */
- if (!GTK_OBJECT_DESTROYED (GTK_OBJECT(view))) {
- if (fail_info == NULL) {
- /* login succeeded */
- nautilus_service_install_view_update_from_uri_finish (view, view->details->uri);
- } else {
- if (button_pressed == AMMONITE_BUTTON_REGISTER) {
- nautilus_view_open_location_in_this_window (
- view->details->nautilus_view,
- EAZEL_ACCOUNT_REGISTER_URI);
- } else if (button_pressed == AMMONITE_BUTTON_FORGOT) {
- nautilus_view_open_location_in_this_window (
- view->details->nautilus_view,
- EAZEL_ACCOUNT_FORGOTPW_URI);
- } else {
- nautilus_view_open_location_in_this_window (
- view->details->nautilus_view,
- NEXT_URL_ANONYMOUS);
- }
- }
- }
-
- gtk_object_unref (GTK_OBJECT(view));
-}
-
-static void
-nautilus_service_install_view_update_from_uri (NautilusServiceInstallView *view, const char *uri)
-{
- char *host;
- int port;
-
- host = NULL;
-
- nautilus_install_parse_uri (uri, view, &host, &port, &view->details->username);
-
- if (host == NULL) {
- /* Ensure that the user is logged in. Note that the "anonymous" user
- * will not be prompted
- */
-
- gtk_object_ref (GTK_OBJECT(view));
-
- show_overall_feedback (view, _("Checking for authorization..."));
-
- /* Cancel a pending login request, if there was one...*/
- ammonite_prompt_login_async_cancel (user_login_callback);
- ammonite_do_prompt_login_async (view->details->username, NULL, NULL, view->details->username == NULL ? TRUE: FALSE, view, user_login_callback);
- } else {
- nautilus_service_install_view_update_from_uri_finish (view, uri);
- }
-
- g_free (host);
- host = NULL;
-}
-
-void
-nautilus_service_install_view_load_uri (NautilusServiceInstallView *view,
- const char *uri)
-{
- /* dispose of any old uri and copy in the new one */
- g_free (view->details->uri);
- view->details->uri = g_strdup (uri);
-
- /* dispose of any old form that was installed */
- if (view->details->form != NULL) {
- gtk_widget_destroy (view->details->form);
- view->details->form = NULL;
- }
- if (view->details->message) {
- g_list_foreach (view->details->message, (GFunc)install_message_destroy, NULL);
- g_list_free (view->details->message);
- view->details->message = NULL;
- }
- if (view->details->desktop_files) {
- g_list_foreach (view->details->desktop_files, (GFunc)g_free, NULL);
- g_list_free (view->details->desktop_files);
- view->details->desktop_files = NULL;
- }
-
- /* clear some variables */
- view->details->already_installed = FALSE;
- view->details->cancelled = FALSE;
- view->details->failures = 0;
- view->details->downloaded_anything = FALSE;
-
- generate_install_form (view);
-
- nautilus_view_report_load_underway (NAUTILUS_VIEW (view->details->nautilus_view));
-
- nautilus_service_install_view_update_from_uri (view, uri);
-}
-
-static void
-service_install_load_location_callback (NautilusView *nautilus_view,
- const char *location,
- NautilusServiceInstallView *view)
-{
-
- g_assert (nautilus_view == view->details->nautilus_view);
-
- nautilus_view_report_load_underway (nautilus_view);
-
- nautilus_service_install_view_load_uri (view, location);
-}
-
-static void
-service_install_stop_loading_callback (NautilusView *nautilus_view, NautilusServiceInstallView *view)
-{
- GNOME_Trilobite_Eazel_Install service;
- CORBA_Environment ev;
- int i;
-
- view->details->cancelled = TRUE;
- view->details->preflight_status = PREFLIGHT_CANCEL;
- show_overall_feedback (view, _("Aborting package downloads (please wait) ..."));
- /* on a fast download, the GUI could get stuck here, constantly updating the download progress */
- for (i = 0; i < 10; i++) {
- if (gtk_events_pending ()) {
- gtk_main_iteration ();
- } else {
- i = 11;
- }
- }
- /* have to set these up here, because if they hit STOP before any downloads have started, the
- * call to _stop below will freeze until we get the preflight signal later.
- */
-
- g_assert (nautilus_view == view->details->nautilus_view);
-
- CORBA_exception_init (&ev);
- service = eazel_install_callback_corba_objref (view->details->installer);
- GNOME_Trilobite_Eazel_Install_stop (service, &ev);
- CORBA_exception_free (&ev);
-
- show_overall_feedback (view, _("Package download aborted."));
- current_progress_bar_complete (view, _("Aborted"));
-}
diff --git a/components/services/install-view/nautilus-service-install-view.h b/components/services/install-view/nautilus-service-install-view.h
deleted file mode 100644
index 70612c9fa..000000000
--- a/components/services/install-view/nautilus-service-install-view.h
+++ /dev/null
@@ -1,158 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: J Shane Culpepper
- */
-
-#ifndef NAUTILUS_SERVICE_INSTALL_VIEW_H
-#define NAUTILUS_SERVICE_INSTALL_VIEW_H
-
-#include <libnautilus/nautilus-view.h>
-#include <gtk/gtk.h>
-#include <eazel-package-system-types.h>
-#include <eazel-install-corba-types.h>
-#include <eazel-install-corba-callback.h>
-#include <eazel-install-problem.h>
-#include "libtrilobite/libtrilobite.h"
-
-typedef struct _NautilusServiceInstallView NautilusServiceInstallView;
-typedef struct _NautilusServiceInstallViewClass NautilusServiceInstallViewClass;
-
-#define NAUTILUS_TYPE_SERVICE_INSTALL_VIEW (nautilus_service_install_view_get_type ())
-#define NAUTILUS_SERVICE_INSTALL_VIEW(obj) (GTK_CHECK_CAST ((obj), NAUTILUS_TYPE_SERVICE_INSTALL_VIEW, NautilusServiceInstallView))
-#define NAUTILUS_SERVICE_INSTALL_VIEW_CLASS (klass) (GTK_CHECK_CLASS_CAST ((klass), NAUTILUS_TYPE_SERVICE_INSTALL_VIEW, NautilusServiceInstallViewClass))
-#define NAUTILUS_IS_SERVICE_INSTALL_VIEW(obj) (GTK_CHECK_TYPE ((obj), NAUTILUS_TYPE_SERVICE_INSTALL_VIEW))
-#define NAUTILUS_IS_SERVICE_INSTALL_VIEW_CLASS (klass) (GTK_CHECK_CLASS_TYPE ((klass), NAUTILUS_TYPE_SERVICE_INSTALL_VIEW))
-
-typedef struct _NautilusServiceInstallViewDetails NautilusServiceInstallViewDetails;
-
-struct _NautilusServiceInstallView {
- GtkEventBox parent;
- NautilusServiceInstallViewDetails *details;
-};
-
-struct _NautilusServiceInstallViewClass {
- GtkEventBoxClass parent_class;
-};
-
-typedef struct {
- char *package_name;
- GtkWidget *label;
- GtkWidget *progress_bar;
- GtkWidget *progress_label;
- GtkWidget *vbox; /* [ progress_bar, progress_label ] */
- GtkWidget *hbox; /* [ label, padding, vbox ] */
- GtkWidget *line;
-} InstallMessage;
-
-typedef enum {
- PREFLIGHT_UNKNOWN = 0,
- PREFLIGHT_CANCEL,
- PREFLIGHT_OK,
- PREFLIGHT_PANIC_BUTTON /* view is being destroyed */
-} InstallViewPreflightStatus;
-
-/* A NautilusContentView's private information. */
-struct _NautilusServiceInstallViewDetails {
- char *uri;
- NautilusView *nautilus_view;
- GtkWidget *form;
- GtkWidget *form_title;
- GtkWidget *package_name;
- GtkWidget *package_details;
- GtkWidget *package_summary;
- GtkWidget *package_version;
- GtkWidget *total_progress_bar;
- GtkWidget *overall_feedback_text;
- GtkWidget *message_box;
- GtkWidget *current_feedback_text;
- InstallMessage *current_im;
- GtkWidget *pane;
- GtkWidget *middle_title;
- GtkWidget *query_box;
- GtkWidget *query_pane;
- GtkWidget *spacing;
-
- char *current_rpm;
- int current_package;
- char *remembered_password;
- int password_attempts;
- guint cylon_timer;
- int using_local_file;
- gboolean cancelled;
- gboolean already_installed;
- gboolean downloaded_anything;
- int failures;
- int last_k; /* used to avoid flickering the KB count so much */
- gboolean cancelled_before_downloads;
- unsigned long download_bytes_total;
- unsigned long download_bytes_sofar;
- char *username;
-
- EazelInstallCallback *installer;
- EazelInstallProblem *problem;
- TrilobiteRootClient *root_client;
- GList *categories;
-
- gboolean core_package;
-
- GList *problem_cases;
- GList *desktop_files;
-
- GList *message; /* GList<InstallMessage *> */
- GHashTable *deps; /* package(char *) => package that needs it(char *) */
-
- InstallViewPreflightStatus preflight_status;
-};
-
-
-/* number of rows of (label, progressbar) to scroll at the bottom */
-#define STATUS_ROWS 2
-
-#define PROGRESS_BAR_HEIGHT 15
-#define MESSAGE_BOX_HEIGHT 110
-
-/* This ensures that if the arch is detected as i[3-9]86, the
- requested archtype will be set to i386 */
-#define ASSUME_ix86_IS_i386
-
-/* send the user here after a completed (success or failure) install */
-#define NEXT_URL_ANONYMOUS "eazel:"
-#define NEXT_URL "eazel-services:/catalog"
-
-
-/* GtkObject support */
-GtkType nautilus_service_install_view_get_type (void);
-
-/* Component embedding support */
-NautilusView *nautilus_service_install_view_get_nautilus_view (NautilusServiceInstallView *view);
-
-/* URI handling */
-void nautilus_service_install_view_load_uri (NautilusServiceInstallView *view,
- const char *uri);
-
-/* called during preflight to build up a list of .desktop files to scan later */
-void nautilus_service_install_check_for_desktop_files (NautilusServiceInstallView *view,
- EazelInstallCallback *cb,
- PackageData *package);
-
-/* add launchers for each menu to the congrats dialog */
-void nautilus_install_service_add_menu_launchers (NautilusServiceInstallView *view, GtkWidget *dialog);
-
-#endif /* NAUTILUS_SERVICE_INSTALL_VIEW_H */
diff --git a/components/services/install/.cvsignore b/components/services/install/.cvsignore
deleted file mode 100644
index 282522db0..000000000
--- a/components/services/install/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-Makefile
-Makefile.in
diff --git a/components/services/install/Makefile.am b/components/services/install/Makefile.am
deleted file mode 100644
index da1970b81..000000000
--- a/components/services/install/Makefile.am
+++ /dev/null
@@ -1 +0,0 @@
-SUBDIRS = idl lib server command-line
diff --git a/components/services/install/command-line/.cvsignore b/components/services/install/command-line/.cvsignore
deleted file mode 100644
index b0ea8c04e..000000000
--- a/components/services/install/command-line/.cvsignore
+++ /dev/null
@@ -1,11 +0,0 @@
-.deps
-.libs
-Makefile
-Makefile.in
-eazel-gen-xml
-eazel-install
-eazel-softcat
-eazel-test-packsys
-eazel-test-types
-eazel-test-inventory
-eazel-test-install-types
diff --git a/components/services/install/command-line/Makefile.am b/components/services/install/command-line/Makefile.am
deleted file mode 100644
index e4b92988e..000000000
--- a/components/services/install/command-line/Makefile.am
+++ /dev/null
@@ -1,92 +0,0 @@
-include $(top_srcdir)/Makefile.shared
-
-INCLUDES = \
- -DPREFIX=\"$(prefix)\" \
- -DG_LOG_DOMAIN=\"Nautilus-Services\" \
- -I$(top_srcdir) \
- -I$(top_builddir) \
- -I$(top_srcdir)/components/services/trilobite/libtrilobite \
- -I$(top_builddir)/components/services/trilobite/libtrilobite \
- -I$(top_srcdir)/components/services/trilobite \
- -I$(top_builddir)/components/services/trilobite \
- -I$(top_srcdir)/components/services/install/lib \
- -I$(top_builddir)/components/services/install/lib \
- -DGNOMELOCALEDIR=\""$(datadir)/locale"\" \
- $(EEL_INCLUDEDIR) \
- $(LIBRSVG_INCLUDEDIR) \
- $(GNOME_CFLAGS) \
- $(GCONF_CFLAGS) \
- $(VFS_CFLAGS) \
- $(XML_CFLAGS) \
- $(GHTTP_CFLAGS) \
- $(NULL)
-
-LDADD = \
- $(top_builddir)/components/services/trilobite/libtrilobite/libtrilobite.la \
- $(EEL_LIBS) \
- $(LIBRSVG_LIBS) \
- $(BONOBO_LIBS) \
- $(GNOME_LIBS) \
- $(GCONF_LIBS) \
- $(VFS_LIBS) \
- $(GHTTP_LIBS) \
- $(RPM_LIBS) \
- $(NULL)
-
-bin_PROGRAMS = eazel-install eazel-gen-xml eazel-test-packsys eazel-softcat eazel-test-install-types
-
-eazel_install_SOURCES = \
- eazel-alt-install-corba.c \
- $(NULL)
-
-eazel_install_LDADD = \
- $(LDADD) \
- $(top_builddir)/components/services/install/lib/libeazelinstall.la \
- $(top_builddir)/components/services/install/lib/libeazelpackagesystem.la \
- $(NULL)
-
-eazel_gen_xml_SOURCES = \
- eazel-gen-xml.c \
- $(NULL)
-
-eazel_gen_xml_LDADD = \
- $(LDADD) \
- $(top_builddir)/components/services/install/lib/libeazelinstall.la \
- $(top_builddir)/components/services/install/lib/libeazelpackagesystem.la \
- $(NULL)
-
-eazel_test_packsys_SOURCES = \
- eazel-test-packsys.c \
- $(NULL)
-
-eazel_test_packsys_LDADD = \
- $(LDADD) \
- $(top_builddir)/components/services/install/lib/libeazelpackagesystem.la \
- $(NULL)
-
-#eazel_test_inventory_SOURCES = \
-# eazel-test-inventory.c \
-# $(NULL)
-
-#eazel_test_inventory_LDADD = \
-# $(LDADD) \
-# $(top_builddir)/components/services/install/lib/libeazelpackagesystem.la \
-# $(NULL)
-
-eazel_test_install_types_SOURCES = \
- eazel-test-types.c \
- $(NULL)
-
-eazel_test_install_types_LDADD = \
- $(LDADD) \
- $(top_builddir)/components/services/install/lib/libeazelpackagesystem.la \
- $(NULL)
-
-eazel_softcat_SOURCES = \
- eazel-test-softcat.c \
- $(NULL)
-
-eazel_softcat_LDADD = \
- $(LDADD) \
- $(top_builddir)/components/services/install/lib/libeazelpackagesystem.la \
- $(NULL)
diff --git a/components/services/install/command-line/eazel-alt-install-corba.c b/components/services/install/command-line/eazel-alt-install-corba.c
deleted file mode 100644
index 0c5e7e53c..000000000
--- a/components/services/install/command-line/eazel-alt-install-corba.c
+++ /dev/null
@@ -1,1069 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: Eskil Heyn Olsen <eskil@eazel.com>
- *
- */
-
-/* Return values
- 0 = all ok
- !0 = failure
-
- 1 = downloads failed
- 2 = dep/install failed
- 3 = md5 failure (man-in-the-middle, softcat inconsistency or bad download)
-*/
-
-#include <config.h>
-#include <gnome.h>
-#include <liboaf/liboaf.h>
-#include <bonobo.h>
-#include <sys/utsname.h>
-
-#include <eazel-package-system-types.h>
-#include <eazel-install-corba-types.h>
-#include <eazel-install-corba-callback.h>
-#include <eazel-install-problem.h>
-
-#include <libtrilobite/libtrilobite.h>
-#include <trilobite-eazel-install.h>
-
-#include <unistd.h>
-
-#define PACKAGE_FILE_NAME "package-list.xml"
-
-#define DEFAULT_PROTOCOL PROTOCOL_HTTP
-#define DEFAULT_RPMRC "/usr/lib/rpm/rpmrc"
-#define DEFAULT_REMOTE_PACKAGE_LIST "/package-list.xml"
-#define DEFAULT_REMOTE_RPM_DIR "/RPMS"
-#define DEFAULT_LOG_FILE "/tmp/eazel-install/log"
-
-/* This ensure that if the arch is detected as i[3-9]86, the
- requested archtype will be set to i386 */
-#define ASSUME_ix86_IS_i386
-
-#define OAF_ID "OAFIID:trilobite_eazel_install_service:8ff6e815-1992-437c-9771-d932db3b4a17"
-
-/* Popt stuff */
-int arg_dry_run = 0,
- arg_http = 0,
- arg_ftp = 0,
- arg_local = 0,
- arg_debug = 0,
- arg_delay = 0,
- arg_file = 0,
- arg_force = 0,
- arg_upgrade = 0,
- arg_downgrade = 0,
- arg_erase = 0,
- arg_query = 0,
- arg_revert = 0,
- arg_ssl_rename = 0,
- arg_provides = 0,
- arg_verbose = 0,
- arg_id = 0,
- arg_suite = 0,
- arg_ei2 = 0,
- arg_no_pct = 0,
- arg_no_auth = 0,
- arg_silent = 0,
- arg_machine = 0;
-char *arg_server = NULL,
- *arg_cgi = NULL,
- *arg_config_file = NULL,
- *arg_package_list = NULL,
- *arg_username = NULL,
- *arg_root = NULL,
- *arg_batch = NULL,
- *arg_version = NULL;
-
-/* Yeahyeah, but this was initially a test tool,
- so stop whining... */
-CORBA_ORB orb;
-CORBA_Environment ev;
-int cli_result = 0;
-GList *cases = NULL;
-GList *categories;
-gboolean downloaded_files = FALSE;
-gboolean auto_cont = FALSE;
-
-static const struct poptOption options[] = {
- {"batch", '\0', POPT_ARG_STRING, &arg_batch, 0, N_("Set the default answer to continue, also default delete to Yes"), NULL},
- {"cgi-path", '\0', POPT_ARG_STRING, &arg_cgi, 0, N_("Specify search cgi"), NULL},
- {"debug", '\0', POPT_ARG_NONE, &arg_debug, 0 , N_("Show debug output"), NULL},
- {"delay", '\0', POPT_ARG_NONE, &arg_delay, 0 , N_("10 sec delay after starting service"), NULL},
- {"downgrade", 'd', POPT_ARG_NONE, &arg_downgrade, 0, N_("Allow downgrades"), NULL},
- {"erase", 'e', POPT_ARG_NONE, &arg_erase, 0, N_("Erase packages"), NULL},
- {"ei2", '\0', POPT_ARG_NONE, &arg_ei2, 0, N_("enable ei2"), NULL},
- {"file",'\0', POPT_ARG_NONE, &arg_file, 0, N_("RPM args are filename"), NULL},
- {"ftp", 'f', POPT_ARG_NONE, &arg_ftp, 0, N_("Use ftp"), NULL},
- {"local", 'l', POPT_ARG_NONE, &arg_local, 0, N_("Use local"), NULL},
- {"http", 'h', POPT_ARG_NONE, &arg_http, 0, N_("Use http"), NULL},
- {"id", 'i', POPT_ARG_NONE, &arg_id, 0, N_("RPM args are Eazel Ids"), NULL},
- {"machine", 'm', POPT_ARG_NONE, &arg_machine, 0, N_("machine readable output"), NULL},
- {"no-percent", '\0', POPT_ARG_NONE, &arg_no_pct, 0, N_("Don't print fancy percent output"), NULL},
- {"no-auth", '\0', POPT_ARG_NONE, &arg_no_auth, 0, N_("don't use eazel auth stuff"), NULL},
- {"packagefile", '\0', POPT_ARG_STRING, &arg_package_list, 0, N_("Specify package file"), NULL},
- {"provides", '\0', POPT_ARG_NONE, &arg_provides, 0, N_("RPM args are needed files"), NULL},
- {"query", 'q', POPT_ARG_NONE, &arg_query, 0, N_("Run Query"), NULL},
- {"revert", 'r', POPT_ARG_NONE, &arg_revert, 0, N_("Revert"), NULL},
- {"root", '\0', POPT_ARG_STRING, &arg_root, 0, N_("Set root"), NULL},
- {"server", '\0', POPT_ARG_STRING, &arg_server, 0, N_("Specify server"), NULL},
- {"silent", '\0', POPT_ARG_NONE, &arg_silent, 0, N_("Dont print too much, just problems and download"), NULL},
- {"ssl-rename", 's', POPT_ARG_NONE, &arg_ssl_rename, 0, N_("Perform ssl renaming"), NULL},
- {"suite", '\0', POPT_ARG_NONE, &arg_suite, 0, N_("argument is a suite id"), NULL},
- {"test", 't', POPT_ARG_NONE, &arg_dry_run, 0, N_("Test run"), NULL},
- {"username", '\0', POPT_ARG_STRING, &arg_username, 0, N_("Allow username"), NULL},
- {"upgrade", 'u', POPT_ARG_NONE, &arg_upgrade, 0, N_("Allow upgrades"), NULL},
- {"verbose", 'v', POPT_ARG_NONE, &arg_verbose, 0, N_("Verbose output"), NULL},
- {"package-version", 'V', POPT_ARG_STRING, &arg_version, 0, N_("Install a specific package version"), "version"},
- {NULL, '\0', 0, NULL, 0}
-};
-
-#define check_ev(s) \
-if (ev._major!=CORBA_NO_EXCEPTION) { \
- fprintf (stderr, "*** %s: Caught exception %s", \
- s, CORBA_exception_id (&ev)); \
-}
-
-static void
-set_parameters_from_command_line (GNOME_Trilobite_Eazel_Install service)
-{
- if (!arg_debug) {
- GNOME_Trilobite_Eazel_Install__set_log_file (service, DEFAULT_LOG_FILE, &ev);
- check_ev ("set_log_file");
- } else {
- GNOME_Trilobite_Eazel_Install__set_debug (service, TRUE, &ev);
- check_ev ("set_debug");
- }
-
- /* We only want 1 protocol type */
- if (arg_http + arg_ftp + arg_local > 1) {
- fprintf (stderr, _("*** You cannot specify more then one protocol type.\n"));
- exit (1);
- }
- if (arg_http) {
- GNOME_Trilobite_Eazel_Install__set_protocol (service, GNOME_Trilobite_Eazel_PROTOCOL_HTTP, &ev);
- check_ev ("set_protocol");
- } else if (arg_ftp) {
- GNOME_Trilobite_Eazel_Install__set_protocol (service, GNOME_Trilobite_Eazel_PROTOCOL_FTP, &ev);
- check_ev ("set_protocol");
- } else if (arg_local) {
- GNOME_Trilobite_Eazel_Install__set_protocol (service, GNOME_Trilobite_Eazel_PROTOCOL_LOCAL, &ev);
- check_ev ("set_protocol");
- } else {
- GNOME_Trilobite_Eazel_Install__set_protocol (service, GNOME_Trilobite_Eazel_PROTOCOL_HTTP, &ev);
- check_ev ("set_protocol");
- }
- if (arg_erase + arg_revert > 1) {
- fprintf (stderr, _("*** Erase and revert ? Somebody set up us the bomb!\n"));
- exit (1);
- }
- if (arg_upgrade) {
- GNOME_Trilobite_Eazel_Install__set_upgrade (service, TRUE, &ev);
- check_ev ("upgrade");
- }
- if (arg_downgrade) {
- GNOME_Trilobite_Eazel_Install__set_downgrade (service, TRUE, &ev);
- check_ev ("downgrade");
- }
- if (arg_server) {
- char *colon = strchr (arg_server, ':');
- if (colon) {
- char *host;
- int port;
-
- host = g_new0(char, (colon - arg_server) + 1);
- strncpy (host, arg_server, colon - arg_server);
- colon++;
- port = atoi (colon);
- GNOME_Trilobite_Eazel_Install__set_server (service, host, &ev);
- check_ev ("set_server");
- GNOME_Trilobite_Eazel_Install__set_server_port (service, port, &ev);
- check_ev ("set_port");
- g_free (host);
- } else {
- GNOME_Trilobite_Eazel_Install__set_server (service, arg_server, &ev);
- check_ev ("set_server");
- }
- GNOME_Trilobite_Eazel_Install__set_auth (service, FALSE, &ev);
- check_ev ("set_auth");
- } else if (arg_no_auth==0) {
- char *host, *p;
- int port;
-
- host = g_strdup (trilobite_get_services_address ());
- if ((p = strchr (host, ':')) != NULL) {
- *p = 0;
- port = atoi (p+1);
- } else {
- port = 80;
- }
- GNOME_Trilobite_Eazel_Install__set_auth (service, TRUE, &ev);
- check_ev ("set_auth");
- GNOME_Trilobite_Eazel_Install__set_server (service, host, &ev);
- check_ev ("set_server");
- GNOME_Trilobite_Eazel_Install__set_server_port (service, port, &ev);
- check_ev ("set_port");
- g_free (host);
- }
- if (arg_username) {
- GNOME_Trilobite_Eazel_Install__set_username (service, arg_username, &ev);
- check_ev ("set_username");
- }
- if (arg_cgi) {
- GNOME_Trilobite_Eazel_Install__set_cgi (service, arg_cgi, &ev);
- check_ev ("set_cgi");
- }
-
- if (arg_ssl_rename) {
- GNOME_Trilobite_Eazel_Install__set_ssl_rename (service, TRUE, &ev);
- check_ev ("set_ssl_rename");
- }
- if (arg_ei2) {
- GNOME_Trilobite_Eazel_Install__set_ei2 (service, TRUE, &ev);
- check_ev ("set_ei2");
- }
- if (arg_no_auth) {
- GNOME_Trilobite_Eazel_Install__set_auth (service, FALSE, &ev);
- check_ev ("set_auth");
- }
- if (arg_dry_run) {
- GNOME_Trilobite_Eazel_Install__set_test_mode (service, TRUE, &ev);
- }
- if (arg_force) {
- GNOME_Trilobite_Eazel_Install__set_force (service, TRUE, &ev);
- }
- if (arg_package_list) {
- GNOME_Trilobite_Eazel_Install__set_package_list (service, arg_package_list, &ev);
- check_ev ("packagelist");
- }
-
- if (arg_root) {
- if (arg_root[0]=='~') {
- char *tmp = g_strdup_printf ("%s/%s", g_get_home_dir (),
- arg_root+1);
- free (arg_root);
- arg_root = strdup (tmp);
- g_free (tmp);
- } else if (arg_root[0]!='/' || arg_root[0]=='.') {
- char *tmp = g_strdup_printf ("%s%s%s", g_get_current_dir (),
- arg_root[0]=='.' ? "" : "/",
- arg_root+1);
- free (arg_root);
- arg_root = strdup (tmp);
- g_free (tmp);
- }
- g_message ("DB root = %s", arg_root);
- }
-}
-
-static void
-eazel_file_conflict_check_signal (EazelInstallCallback *service,
- const PackageData *pack,
- gpointer unused)
-{
- if (!arg_silent) {
- if (!arg_machine) {
- printf (_("File conflict checking %s...\n"), pack->name);
- }
- } else {
- printf ("."); fflush (stdout);
- }
-}
-
-static void
-eazel_file_uniqueness_check_signal (EazelInstallCallback *service,
- const PackageData *pack,
- gpointer unused)
-{
- if (!arg_silent) {
- if (! arg_machine) {
- printf (_("File uniqueness checking %s...\n"), pack->name);
- }
- } else {
- printf ("."); fflush (stdout);
- }
-}
-
-static void
-eazel_feature_consistency_check_signal (EazelInstallCallback *service,
- const PackageData *pack,
- gpointer unused)
-{
- if (!arg_silent) {
- if (!arg_machine) {
- printf (_("Feature consistency checking %s...\n"), pack->name);
- }
- } else {
- printf ("."); fflush (stdout);
- }
-}
-
-static void
-eazel_download_progress_signal (EazelInstallCallback *service,
- const PackageData *pack,
- int amount,
- int total,
- gpointer unused)
-{
- static time_t t;
- static int pct;
- static int old_pct;
-
- time_t end;
- time_t diff;
- static float ks=0;
-
- g_assert (pack->name != NULL);
-
- downloaded_files = TRUE;
-
- if (arg_machine) {
- return;
- }
-
- if (amount==0) {
- fprintf (stdout, _("Downloading %s..."), pack->name);
- t = time (NULL);
- old_pct = pct = 0;
- } else if (amount != total ) {
- if (arg_no_pct==0) {
- pct = total != 0 ? (amount * 100) / total : 100;
- if (pct > 5) {
- if (old_pct != pct && pct%5==0) {
- end = time (NULL);
- diff = end - t;
- ks = ((float)amount/1024)/diff;
- old_pct = pct;
- }
- /* I18N note: %s is a package name, %d/%d is bytes/totalbytes,
- the next %d is a percentage completed, %1.f is a KB/s */
- fprintf (stdout, "\r");
- fprintf (stdout, _("Downloading %s... (%d/%d) = %d%% %.1f KB/s"),
- pack->name,
- amount, total, pct,
- ks);
- fprintf (stdout, " \r");
-
- } else {
- fprintf (stdout, "\r");
- fprintf (stdout, _("Downloading %s... (%d/%d) = %d%%"),
- pack->name,
- amount, total, pct);
- }
- }
- } else if (amount == total && total!=0) {
- if (arg_no_pct==0) {
- fprintf (stdout, "\r");
- fprintf (stdout, _("Downloading %s... (%d/%d) %.1f KB/s Done \n"),
- pack->name,
- amount, total,
- ks);
- } else {
- fprintf (stdout, _("Downloading %s... %3.1f KB/s Done\n"),
- pack->name, ks);
- }
- }
- fflush (stdout);
-}
-
-static void
-eazel_install_progress_signal (EazelInstallCallback *service,
- const PackageData *pack,
- int package_num, int num_packages,
- int amount, int total,
- int total_size_completed, int total_size,
- char *title)
-{
- char *packname;
-
- packname = packagedata_get_readable_name (pack);
-
- if (amount==0) {
- if (!arg_machine) {
- fprintf (stdout, "%s %s", title, packname);
- }
- } else if (amount != total ) {
- if (arg_no_pct==0) {
- if (!arg_machine) {
- if (strcasecmp (title, "Installing")==0) {
- fprintf (stdout, "\r");
- fprintf (stdout, _("Installing %s (%d/%d), (%d/%d)b - (%d/%d) = %d%%"),
- packname,
- package_num, num_packages,
- total_size_completed, total_size,
- amount, total,
- total != 0 ? (amount * 100) / total : 100);
- } else {
- fprintf (stdout, "\r");
- fprintf (stdout, _("Uninstalling %s (%d/%d), (%d/%d)b - (%d/%d) = %d%%"),
- packname,
- package_num, num_packages,
- total_size_completed, total_size,
- amount, total,
- total != 0 ? (amount * 100) / total : 100);
-
- }
- }
- }
- }
- if (amount == total && total!=0) {
- if (arg_machine) {
- if (title && strcasecmp (title, "Installing")==0) {
- fprintf (stdout, "INSTALLED %s\n", pack->name);
- } else {
- fprintf (stdout, "UNINSTALLED %s\n", pack->name);
- }
- } else {
- if (arg_no_pct==0) {
- if (strcasecmp (title, "Installing")==0) {
- fprintf (stdout, "\r");
- fprintf (stdout, _("Installing %s (%d/%d), (%d/%d)b - (%d/%d) = %d%% Done\n"),
- packname,
- package_num, num_packages,
- total_size_completed, total_size,
- amount, total, 100);
- } else {
- fprintf (stdout, "\r");
- fprintf (stdout, _("Uninstalling %s (%d/%d), (%d/%d)b - (%d/%d) = %d%% Done\n"),
- packname,
- package_num, num_packages,
- total_size_completed, total_size,
- amount, total, 100);
-
- }
- } else {
- fprintf (stdout, _("Done\n"));
- }
- }
-
- }
-
- fflush (stdout);
- g_free (packname);
-}
-
-static void
-download_failed (EazelInstallCallback *service,
- const PackageData *pack,
- gpointer unused)
-{
- g_assert (pack->name != NULL);
-
- cli_result = 1;
-
- if (!arg_machine) {
- fprintf (stdout, _("Download of %s FAILED\n"), pack->name);
- }
-}
-
-static void
-something_failed (EazelInstallCallback *service,
- PackageData *pd,
- EazelInstallProblem *problem,
- gboolean uninstall)
-{
- char *title;
- GList *stuff = NULL;
-
- gtk_object_ref (GTK_OBJECT (pd));
-
- auto_cont = FALSE;
-
- cli_result = 2;
-
- if (arg_machine) { return; };
- if (arg_silent) { printf ("\n"); }
- if (uninstall) {
- title = g_strdup_printf (_("Package %s failed to uninstall.\n"), pd->name);
- } else {
- title = g_strdup_printf (_("Package %s failed to install.\n"), pd->name);
- }
-
- fprintf (stdout, "%s\n", title);
- g_free (title);
-
- if (arg_debug) {
- GList *list = g_list_prepend (NULL, pd);
- char *out = packagedata_dump_tree (list, 2);
- fprintf (stdout, "%s\n", out);
- g_list_free (list);
- g_free (out);
- }
-
- if (problem) {
- stuff = eazel_install_problem_tree_to_string (problem, pd, uninstall);
- if (stuff) {
- GList *extra_cases = NULL;
- GList *it;
- for (it = stuff; it; it = g_list_next (it)) {
- /* I18N note: \xB7 is a dot */
- fprintf (stdout, _("\t\xB7 Problem : %s\n"), (char*)(it->data));
- }
- eazel_install_problem_tree_to_case (problem, pd, uninstall, &extra_cases);
- if (extra_cases) {
- stuff = eazel_install_problem_cases_to_string (problem, extra_cases);
- if (stuff) {
- GList *it;
- for (it = stuff; it; it = g_list_next (it)) {
- /* I18N note: \xB7 is a dot */
- fprintf (stdout, _("\t\xB7 Action : %s\n"), (char*)(it->data));
- }
- }
- }
- cases = g_list_concat (cases, extra_cases);
- }
- }
- gtk_object_unref (GTK_OBJECT (pd));
-}
-
-/*
- This dumps the entire tree for the failed package.
- */
-static void
-install_failed (EazelInstallCallback *service,
- PackageData *pd,
- EazelInstallProblem *problem)
-{
- something_failed (service, pd, problem, FALSE);
-}
-
-static void
-uninstall_failed (EazelInstallCallback *service,
- PackageData *pd,
- EazelInstallProblem *problem)
-{
- something_failed (service, pd, problem, TRUE);
-}
-
-static gboolean
-eazel_preflight_check_signal (EazelInstallCallback *service,
- EazelInstallCallbackOperation op,
- const GList *packages,
- int total_bytes,
- int total_packages,
- gpointer unused)
-{
- const GList *iterator;
-
- if (cases && (total_packages == 0)) {
- if (arg_machine) {
- return FALSE;
- }
- fprintf (stdout, _("Cancelling operation\n"));
- return FALSE;
- }
-
- if (arg_machine) {
- return TRUE;
- }
-
- if (arg_silent) { printf ("\n"); }
- switch (op) {
- case EazelInstallCallbackOperation_INSTALL:
- fprintf (stdout, _("About to install a total of %d packages, %dKB\n"),
- total_packages, total_bytes/1024);
- break;
- case EazelInstallCallbackOperation_UNINSTALL:
- fprintf (stdout, _("About to uninstall a total of %d packages, %dKB\n"),
- total_packages, total_bytes/1024);
- break;
- case EazelInstallCallbackOperation_REVERT:
- fprintf (stdout, _("About to revert a total of %d packages, %d KB\n"),
- total_packages, total_bytes/1024);
- break;
- }
-
- for (iterator = packages; iterator; iterator = iterator->next) {
- PackageData *pack = (PackageData*)iterator->data;
- if (arg_debug) {
- GList *list = g_list_prepend (NULL, pack);
- char *out = packagedata_dump_tree (list, 2);
- fprintf (stdout, "%s", out);
- g_list_free (list);
- g_free (out);
- } else {
- char *name = packagedata_get_readable_name (pack);
- if (pack->depends) {
- /* I18N note: %s is a package name, \xB7 is a dot */
- printf (_("\t\xB7 %s and it's dependencies\n"), name);
- } else {
- /* I18N note: %s is a package name, \xB7 is a dot */
- printf (_("\t\xB7 %s\n"), name);
- }
- g_free (name);
- }
- }
-
- return TRUE;
-}
-
-static gboolean
-eazel_save_transaction_signal (EazelInstallCallback *service,
- EazelInstallCallbackOperation op,
- const GList *packages,
- gpointer unused)
-{
- char answer[128];
- gboolean result = FALSE;
-
- /* Disabled for 1.0 */
- return result;
-
- if (arg_machine) { return TRUE; }
-
- /* I18N note: the (y/n) is translateable. There is later a 1 character
- string with the context "y" which is the "yes" indicator.
- If you eg. translate this to Danish : "Fortsæt (j/n) " and
- translated the "y" later to "j", da_DK users can respond with
- "j" "ja" "JA" etc. */
- printf (_("Save transaction report ? (y/n) "));
- fflush (stdout);
- if (arg_batch) {
- fprintf (stdout, "%s\n", arg_batch);
- strcpy (answer, arg_batch);
- } else {
- fgets (answer, 10, stdin);
- }
- /* I18N note: y is the letter for the word Yes. This is
- used in the response for a yes/no questions. Your translation
- must be 1 character only. */
- if (strncasecmp (answer, _("y"), 1)==0) {
- fflush (stdout);
- result = TRUE;
- }
-
- return result;
-}
-
-static void
-dep_check (EazelInstallCallback *service,
- const PackageData *package,
- const PackageData *needs_package,
- gpointer unused)
-{
- char *pack, *needs;
-
- if (arg_machine) { return; }
-
- pack = packagedata_get_readable_name (package);
- needs = packagedata_get_readable_name (needs_package);
- if (!arg_silent) {
- printf (_("Dependency : %s needs %s\n"), pack, needs);
- } else {
- printf ("."); fflush (stdout);
- }
- g_free (pack);
- g_free (needs);
-}
-
-static void
-md5_check_failed (EazelInstallCallback *service,
- const PackageData *package,
- const char *actual_md5,
- gpointer unused)
-{
- cli_result = 3;
- if (arg_machine) { return; }
- if (arg_silent) { printf ("\n"); }
- /* I18N note: %s is a package name */
- fprintf (stdout, _("Package %s failed md5 check!\n"), package->name);
- /* I18N note: %s is a 32 bytes hex numbers, \xB7 is a dot */
- fprintf (stdout, _("\t\xB7 server MD5 checksum is %s\n"), package->md5);
- /* I18N note: %s is a 32 bytes hex numbers, \xB7 is a dot */
- fprintf (stdout, _("\t\xB7 actual MD5 checksum is %s\n"), actual_md5);
-}
-
-static PackageData*
-create_package (char *name)
-{
- struct utsname buf;
- PackageData *pack;
-
- uname (&buf);
- pack = packagedata_new ();
- if (arg_file) {
- /* If file starts with /, use filename,
- if it starts with ~, insert g_get_home_dir,
- otherwise, insert g_get_current_dir */
- pack->filename =
- name[0]=='/' ?
- g_strdup (name) :
- name[0]=='~' ?
- g_strdup_printf ("%s/%s", g_get_home_dir (), name+1) :
- g_strdup_printf ("%s/%s", g_get_current_dir (), name);
- } else if (arg_provides) {
- pack->provides = g_list_prepend (pack->provides, g_strdup (name));
- } else if (arg_id) {
- pack->eazel_id = g_strdup (name);
- } else if (arg_suite) {
- pack->suite_id = g_strdup (name);
- } else {
- pack->name = g_strdup (name);
- }
- if (arg_version) {
- pack->version = g_strdup (arg_version);
- }
- pack->archtype = g_strdup (buf.machine);
-#ifdef ASSUME_ix86_IS_i386
- if (strlen (pack->archtype)==4 && pack->archtype[0]=='i' &&
- pack->archtype[1]>='3' && pack->archtype[1]<='9' &&
- pack->archtype[2]=='8' && pack->archtype[3]=='6') {
- g_free (pack->archtype);
- pack->archtype = g_strdup ("i386");
- }
-#endif
- pack->distribution = trilobite_get_distribution ();
- pack->toplevel = TRUE;
-
- return pack;
-}
-
-static gboolean
-delete_files (EazelInstallCallback *service, EazelInstallProblem *problem)
-{
- char answer[128];
- gboolean ask_delete = TRUE;
- gboolean result = TRUE;
-
- if (arg_machine) { return TRUE; }
-
- if ((auto_cont && cases) || cases ) {
- gboolean cont = FALSE;
-
- if (auto_cont == FALSE) {
- /* I18N note: the (y/n) is translateable. There is later a 1 character
- string with the context "y" which is the "yes" indicator.
- If you eg. translate this to Danish : "Fortsæt (j/n " and
- translated the "y" later to "j", da_DK users can respond with
- "j" "ja" "JA" etc. */
- printf (_("Continue? (y/n) "));
- fflush (stdout);
- if (arg_batch) {
- fprintf (stdout, "%s\n", arg_batch);
- strcpy (answer, arg_batch);
- } else {
- fgets (answer, 10, stdin);
- }
- /* I18N note: y is the letter for the word Yes. This is
- used in the response for a yes/no questions. Your translation
- must be 1 character only. */
- if (strncasecmp (answer, _("y"), 1)==0) {
- fflush (stdout);
- cont = TRUE;
- }
-
- } else {
- cont = TRUE;
- }
- if (cont) {
- auto_cont = TRUE;
- eazel_install_problem_handle_cases (problem,
- service,
- &cases,
- &categories,
- NULL,
- arg_root);
- ask_delete = FALSE;
- result = FALSE;
- } else {
- eazel_install_problem_case_list_destroy (cases);
- cases = NULL;
- }
- }
-
- if (downloaded_files && !arg_query && !arg_erase && !arg_file && ask_delete) {
- /* I18N note: the (y/n) is translateable. There is later a 1 character
- string with the context "y" which is the "yes" indicator.
- If you eg. translate this to Danish : "Fortsæt (j/n " and
- translated the "y" later to "j", da_DK users can respond with
- "j" "ja" "JA" etc. */
- printf (_("Should I delete the RPM files? (y/n) "));
- fflush (stdout);
- if (arg_batch) {
- fprintf (stdout, "yes\n");
- strcpy (answer, "yes");
- } else {
- fgets (answer, 10, stdin);
- }
-
- /* I18N note: y is the letter for the word Yes. This is
- used in the response for a yes/no questions. Your translation
- must be 1 character only. */
- if (strncasecmp (answer, _("y"), 1)==0) {
- fflush (stdout);
- eazel_install_callback_delete_files (service, &ev);
- }
- }
-
- return result;
-}
-
-static void
-done (EazelInstallCallback *service,
- gboolean result,
- EazelInstallProblem *problem)
-{
- if (cli_result == 0) {
- cli_result = result ? 0 : 1;
- }
-
- if (!arg_machine) {
- if (result) {
- fprintf (stderr, _("Operation ok\n"));
- } else {
- fprintf (stderr, _("Operation failed\n"));
- }
- }
-
- if (delete_files (service, problem)) {
- trilobite_main_quit ();
- }
-}
-
-static char *
-get_password_dude (TrilobiteRootClient *root_client, const char *prompt, void *user_data)
-{
- char * real_prompt;
- char * passwd;
-
- real_prompt = g_strdup_printf ("%s: ", prompt);
- passwd = getpass (real_prompt);
- g_free (real_prompt);
-
- return g_strdup (passwd);
-}
-
-static TrilobiteRootClient *
-set_root_client (BonoboObjectClient *service)
-{
- TrilobiteRootClient *root_client;
-
- if (bonobo_object_client_has_interface (service, "IDL:Trilobite/PasswordQuery:1.0", &ev)) {
- root_client = trilobite_root_client_new ();
- gtk_signal_connect (GTK_OBJECT (root_client), "need_password", GTK_SIGNAL_FUNC (get_password_dude),
- NULL);
-
- if (! trilobite_root_client_attach (root_client, service)) {
- fprintf (stderr, "*** unable to attach root client to Trilobite/PasswordQuery!");
- }
-
- return root_client;
- } else {
- fprintf (stderr, "*** Object does not support IDL:Trilobite/PasswordQuery:1.0");
- return NULL;
- }
-}
-
-int main(int argc, char *argv[]) {
- poptContext ctxt;
- GList *packages;
- char *str;
- GList *strs;
- EazelInstallCallback *cb;
- EazelInstallProblem *problem = NULL;
-
- CORBA_exception_init (&ev);
-
- strs = NULL;
-
- /* Seems that bonobo_main doens't like
- not having gnome_init called, dies in a
- X call, yech */
-
-#ifdef ENABLE_NLS /* sadly we need this ifdef because otherwise the following get empty statement warnings */
- bindtextdomain (PACKAGE, GNOMELOCALEDIR);
- textdomain (PACKAGE);
-#endif
-
-#if 0
- gnomelib_register_popt_table (oaf_popt_options, oaf_get_popt_table_name ());
- orb = oaf_init (argc, argv);
- gnome_init_with_popt_table ("Eazel Install", "1.0", argc, argv, options, 0, &ctxt);
- if (!bonobo_init (NULL, NULL, NULL)) {
- g_error ("Could not init bonobo");
- }
-#else
- trilobite_init ("Eazel Install", "1.0", NULL, options, argc, argv);
- ctxt = trilobite_get_popt_context ();
-#endif
-
- packages = NULL;
- categories = NULL;
- /* If there are more args, get them and parse them as packages */
- while ((str = poptGetArg (ctxt)) != NULL) {
- packages = g_list_prepend (packages, create_package (str));
- strs = g_list_prepend (strs, g_strdup (str));
- }
- if (packages) {
- CategoryData *category;
- category = categorydata_new ();
- category->name = g_strdup ("files from commandline");
- category->packages = packages;
- categories = g_list_prepend (NULL, category);
- }
-
- bonobo_activate ();
-
- cb = eazel_install_callback_new ();
- problem = eazel_install_problem_new ();
- gtk_object_ref (GTK_OBJECT (problem));
-
- if (arg_delay) {
- sleep (10);
- }
-
- set_parameters_from_command_line (eazel_install_callback_corba_objref (cb));
- set_root_client (eazel_install_callback_bonobo (cb));
-
- /* Set up signal connections */
- gtk_signal_connect (GTK_OBJECT (cb), "file_conflict_check",
- GTK_SIGNAL_FUNC (eazel_file_conflict_check_signal),
- NULL);
- gtk_signal_connect (GTK_OBJECT (cb), "file_uniqueness_check",
- GTK_SIGNAL_FUNC (eazel_file_uniqueness_check_signal),
- NULL);
- gtk_signal_connect (GTK_OBJECT (cb), "feature_consistency_check",
- GTK_SIGNAL_FUNC (eazel_feature_consistency_check_signal),
- NULL);
-
- gtk_signal_connect (GTK_OBJECT (cb), "download_progress",
- GTK_SIGNAL_FUNC (eazel_download_progress_signal),
- NULL);
- gtk_signal_connect (GTK_OBJECT (cb), "preflight_check",
- GTK_SIGNAL_FUNC (eazel_preflight_check_signal),
- NULL);
- gtk_signal_connect (GTK_OBJECT (cb), "save_transaction",
- GTK_SIGNAL_FUNC (eazel_save_transaction_signal),
- NULL);
- gtk_signal_connect (GTK_OBJECT (cb), "install_progress",
- GTK_SIGNAL_FUNC (eazel_install_progress_signal),
- _("Installing"));
- gtk_signal_connect (GTK_OBJECT (cb), "md5_check_failed",
- GTK_SIGNAL_FUNC (md5_check_failed),
- "");
- gtk_signal_connect (GTK_OBJECT (cb), "install_failed",
- GTK_SIGNAL_FUNC (install_failed),
- problem);
- gtk_signal_connect (GTK_OBJECT (cb), "uninstall_progress",
- GTK_SIGNAL_FUNC (eazel_install_progress_signal),
- _("Uninstalling"));
- gtk_signal_connect (GTK_OBJECT (cb), "uninstall_failed",
- GTK_SIGNAL_FUNC (uninstall_failed),
- problem);
- gtk_signal_connect (GTK_OBJECT (cb), "download_failed",
- GTK_SIGNAL_FUNC (download_failed),
- NULL);
- gtk_signal_connect (GTK_OBJECT (cb), "dependency_check",
- GTK_SIGNAL_FUNC (dep_check),
- NULL);
- gtk_signal_connect (GTK_OBJECT (cb), "done",
- GTK_SIGNAL_FUNC (done),
- problem);
-
- if (arg_erase + arg_query + arg_revert > 1) {
- g_error (_("Only one operation at a time please."));
- }
-
- if (arg_erase) {
- if (categories == NULL) {
- fprintf (stderr, _("%s: --help for usage\n"), argv[0]);
- cli_result = 1;
- } else {
- eazel_install_callback_uninstall_packages (cb, categories, arg_root, &ev);
- }
- } else if (arg_query) {
- GList *iterator;
- if (strs == NULL) {
- fprintf (stderr, _("%s: --help for usage\n"), argv[0]);
- cli_result = 1;
- } else for (iterator = strs; iterator; iterator = iterator->next) {
- GList *matched_packages;
- GList *match_it;
- matched_packages = eazel_install_callback_simple_query (cb,
- (char*)iterator->data,
- NULL,
- &ev);
- for (match_it = matched_packages; match_it; match_it = match_it->next) {
- PackageData *p;
- p = (PackageData*)match_it->data;
- if (arg_verbose) {
- char *tmp;
- GList *provide_iterator;
- tmp = trilobite_get_distribution_name (p->distribution, TRUE, FALSE);
- fprintf (stdout, _("Name : %s\n"), p->name?p->name:"?");
- fprintf (stdout, _("Version : %s\n"), p->version?p->version:"?");
- fprintf (stdout, _("Minor : %s\n"), p->minor?p->minor:"?");
-
- fprintf (stdout, _("Size : %d\n"), p->bytesize);
- fprintf (stdout, _("Arch : %s\n"), p->archtype?p->archtype:"?");
- fprintf (stdout, _("Distribution : %s\n"), tmp?tmp:"?");
- fprintf (stdout, _("Description : %s\n"),
- p->description?p->description:"?");
- fprintf (stdout, _("Install root : %s\n"),
- p->install_root?p->install_root:"?");
- if (p->provides) {
- fprintf (stdout, _("Provides : \n"));
- for (provide_iterator = p->provides; provide_iterator;
- provide_iterator = g_list_next (provide_iterator)) {
- fprintf (stdout, "\t%s\n",
- (char*)provide_iterator->data);
- }
- }
- } else {
- fprintf (stdout, "%s %s %50.50s\n", p->name, p->version, p->description);
- }
- }
- cli_result = 0;
- }
- } else if (arg_revert) {
- GList *iterator;
- if (strs == NULL) {
- fprintf (stderr, _("%s: --help for usage\n"), argv[0]);
- cli_result = 1;
- } else for (iterator = strs; iterator; iterator = iterator->next) {
- eazel_install_callback_revert_transaction (cb, (char*)iterator->data, arg_root, &ev);
- }
- } else {
- if (categories == NULL) {
- fprintf (stderr, _("%s: --help for usage\n"), argv[0]);
- cli_result = 1;
- } else {
- eazel_install_callback_install_packages (cb, categories, arg_root, &ev);
- }
- }
-
- if (!cli_result && !arg_query) {
- trilobite_main ();
- }
-
- categorydata_list_destroy (categories);
-
- eazel_install_callback_unref (GTK_OBJECT (cb));
- gtk_object_unref (GTK_OBJECT (problem));
- /* Corba cleanup */
- CORBA_exception_free (&ev);
-
- if (arg_debug) {
- printf (_("exit code %d\n"), cli_result);
- }
-
- return cli_result;
-};
diff --git a/components/services/install/command-line/eazel-gen-pre-xml.sh b/components/services/install/command-line/eazel-gen-pre-xml.sh
deleted file mode 100755
index 1f7aeb56c..000000000
--- a/components/services/install/command-line/eazel-gen-pre-xml.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-#! /bin/bash
-LIST=`ls $1/*rpm`
-for FILE in $LIST; do
- echo `rpm -qp --queryformat="$2:%{NAME}:%{VERSION}:%{RELEASE}:%{ARCH}:%{SIZE}:%{SUMMARY}" $FILE`
-done
diff --git a/components/services/install/command-line/eazel-gen-xml.c b/components/services/install/command-line/eazel-gen-xml.c
deleted file mode 100644
index 8dd1a9a96..000000000
--- a/components/services/install/command-line/eazel-gen-xml.c
+++ /dev/null
@@ -1,63 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: Eskil Heyn Olsen <eskil@eazel.com>
- *
- */
-
-#include <config.h>
-#include <gnome.h>
-#include <liboaf/liboaf.h>
-#include <bonobo.h>
-
-#include <eazel-install-xml-package-list.h>
-
-#define PACKAGE_FILE_NAME "package-list.xml"
-
-int arg_debug;
-char *arg_local_list,
- *arg_input_list;
-
-CORBA_ORB orb;
-CORBA_Environment ev;
-
-static const struct poptOption options[] = {
- {"in", '\0', POPT_ARG_STRING, &arg_input_list, 0, N_("Specify package list to use (/var/eazel/service/package-list.xml)"), NULL},
- {"out", '\0', POPT_ARG_STRING, &arg_local_list, 0, N_("Use specified file to generate a package list, requires --packagelist"), NULL},
- {"debug", '\0', POPT_ARG_NONE, &arg_debug, 0 , N_("Show debug output"), NULL},
- {NULL, '\0', 0, NULL, 0}
-};
-
-int main(int argc, char *argv[]) {
- gtk_type_init ();
- gnomelib_init ("Eazel Gen Xml", "1.0");
- gnomelib_register_popt_table (options, "Eazel Gen Xml");
- gnomelib_parse_args (argc, argv, 0);
-
- if (arg_input_list==NULL) {
- g_error ("Please specify an input file");
- }
- if (arg_local_list==NULL) {
- arg_local_list = g_strdup (PACKAGE_FILE_NAME);
- }
-
- generate_xml_package_list (arg_input_list, arg_local_list);
-
- return 0;
-};
diff --git a/components/services/install/command-line/eazel-test-inventory.c b/components/services/install/command-line/eazel-test-inventory.c
deleted file mode 100644
index 2d6f22ba3..000000000
--- a/components/services/install/command-line/eazel-test-inventory.c
+++ /dev/null
@@ -1,79 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: J Shane Culpepper <pepper@eazel.com>
- *
- */
-
-#include <config.h>
-
-#include <gnome.h>
-#include <popt-gnome.h>
-#include <eazel-package-system.h>
-#include <eazel-inventory-utils.h>
-#include <libtrilobite/trilobite-md5-tools.h>
-
-static const struct poptOption optionsTable[] = {
- {NULL, '\0', 0, NULL, 0}
-};
-
-int main (int argc, char *argv[])
-{
-
- poptContext pctx;
- gboolean return_val;
- unsigned char digest[16];
- char *inventory_file;
-
-
- pctx = poptGetContext("Eazel Test Inventory", argc, argv, optionsTable, 0);
-
- poptFreeContext (pctx);
-
- gtk_type_init();
-
- inventory_file = g_strdup_printf ("%s/.nautilus/configuration.xml", g_get_home_dir ());
-
- /* initialize the inventory so that the next update will return the same hash value */
- return_val = eazel_gather_inventory ();
- /* do nothing with the return_val for now */
-
- g_print ("Updating GConf value.\n");
- trilobite_md5_get_digest_from_file (inventory_file, digest);
- return_val = update_gconf_inventory_digest (digest);
- if (return_val == FALSE) {
- g_print ("test FAILED\n");
- exit (1);
- }
-
- /* Now gather inventory again and compare to GConf value.
- * eazel_gather_inventory will return FALSE if the md5 digests
- * match and TRUE if they are different. This can be used to
- * know when inventory needs to be synced.
- */
- return_val = eazel_gather_inventory ();
- if (return_val == FALSE) {
- g_print ("test PASSED\n");
- exit (1);
- } else {
- g_print ("test FAILED\n");
- }
-
- return 0;
-};
diff --git a/components/services/install/command-line/eazel-test-packsys.c b/components/services/install/command-line/eazel-test-packsys.c
deleted file mode 100644
index 9783e56e9..000000000
--- a/components/services/install/command-line/eazel-test-packsys.c
+++ /dev/null
@@ -1,624 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: Eskil Heyn Olsen <eskil@eazel.com>
- *
- */
-
-#include <config.h>
-#include <time.h>
-#include <gnome.h>
-#include <eazel-package-system.h>
-
-#include <libtrilobite/trilobite-root-helper.h>
-
-#define MATCHES_ONLY_ONE "glibc"
-#define PROVIDED_BY_ONLY_ONE "libc.so.6"
-#define OWNED_BY_ONLY_ONE "/bin/sh"
-#define NEEDED_BY_MANY "glibc"
-
-static void
-test_database_mtime (EazelPackageSystem *packsys)
-{
- time_t mtime = eazel_package_system_database_mtime (packsys);
- char *tmp;
-
- if (mtime == 0) {
- g_message ("Couldn't get package system database mtime.\n");
- } else {
- tmp = ctime (&mtime);
- g_message ("Package system database mtime: %s\n", tmp);
- }
-}
-
-static void
-test_is_installed (EazelPackageSystem *packsys)
-{
- GList *result;
-
- result = eazel_package_system_query (packsys,
- NULL,
- MATCHES_ONLY_ONE,
- EAZEL_PACKAGE_SYSTEM_QUERY_MATCHES,
- 0);
- if (g_list_length (result)==1) {
- PackageData *p;
- p = PACKAGEDATA (result->data);
- if (eazel_package_system_is_installed (packsys,
- NULL,
- p->name,
- p->version,
- p->minor,
- EAZEL_SOFTCAT_SENSE_EQ)) {
- g_message ("is_installed 1 ok");
- } else {
- g_message ("is_installed 1 FAILED");
- }
- if (eazel_package_system_is_installed (packsys,
- NULL,
- p->name,
- p->version,
- p->minor,
- EAZEL_SOFTCAT_SENSE_GE)) {
- g_message ("is_installed 2 ok");
- } else {
- g_message ("is_installed 2 FAILED");
- }
- if (eazel_package_system_is_installed (packsys,
- NULL,
- p->name,
- p->version,
- p->minor,
- EAZEL_SOFTCAT_SENSE_LT)) {
- g_message ("is_installed 3 FAILED");
- } else {
- g_message ("is_installed 3 ok");
- }
- if (eazel_package_system_is_installed (packsys,
- NULL,
- p->name,
- p->version,
- p->minor,
- EAZEL_SOFTCAT_SENSE_GT)) {
- g_message ("is_installed 4 FAILED");
- } else {
- g_message ("is_installed 4 ok");
- }
- if (eazel_package_system_is_installed (packsys,
- NULL,
- p->name,
- "0",
- NULL,
- EAZEL_SOFTCAT_SENSE_GE)) {
- g_message ("is_installed 5 ok");
- } else {
- g_message ("is_installed 5 FAILED");
- }
- if (eazel_package_system_is_installed (packsys,
- NULL,
- p->name,
- "1000",
- NULL,
- EAZEL_SOFTCAT_SENSE_GE)) {
- g_message ("is_installed 6 FAILED");
- } else {
- g_message ("is_installed 6 ok");
- }
- }
- g_list_foreach (result, (GFunc)gtk_object_unref, NULL);
- g_list_free (result);
-}
-
-static void
-test_version_compare (EazelPackageSystem *packsys)
-{
- g_message ("version compare M1 is %s",
- eazel_package_system_compare_version (packsys, "M18", "M17") > 0 ? "ok" : "FAILED");
- g_message ("version compare M2 is %s",
- eazel_package_system_compare_version (packsys, "M17", "M18") < 0 ? "ok" : "FAILED");
- g_message ("version compare M3 is %s",
- eazel_package_system_compare_version (packsys, "M18", "0.7") < 0 ? "ok" : "FAILED");
- g_message ("version compare M4 is %s",
- eazel_package_system_compare_version (packsys, "0.7", "M18") > 0 ? "ok" : "FAILED");
-
- g_message ("version compare 1 is %s",
- eazel_package_system_compare_version (packsys, "1.0", "1.1") < 0 ? "ok" : "FAILED");
- g_message ("version compare 2 is %s",
- eazel_package_system_compare_version (packsys, "1.0", "1.0") == 0 ? "ok" : "FAILED");
- g_message ("version compare 3 is %s",
- eazel_package_system_compare_version (packsys, "1.1", "1.0") > 0 ? "ok" : "FAILED");
-}
-
-static void
-test_package_load (EazelPackageSystem *packsys,
- const char *package_file_name)
-{
- PackageData *p;
- int flag;
- unsigned int provides_count = 0;
-
- flag = PACKAGE_FILL_EVERYTHING;
- p = eazel_package_system_load_package (packsys, NULL, package_file_name, flag);
- if (p->description && p->summary && p->provides && p->depends) {
- g_message ("load_package test 1 ok");
- provides_count = g_list_length (p->provides);
- } else {
- g_message ("load_package test 1 FAIL");
- }
- g_message (packagedata_dump (p, TRUE));
- gtk_object_unref (GTK_OBJECT (p));
-
- flag = PACKAGE_FILL_NO_PROVIDES;
- p = eazel_package_system_load_package (packsys, NULL, package_file_name, flag);
- if (p->description && p->summary && p->provides==NULL) {
- g_message ("load_package test 2 ok");
- } else {
- g_message ("load_package test 2 FAIL");
- }
- gtk_object_unref (GTK_OBJECT (p));
-
-
- flag = PACKAGE_FILL_NO_DIRS_IN_PROVIDES;
- p = eazel_package_system_load_package (packsys, NULL, package_file_name, flag);
- if (p->description && p->summary && p->provides) {
- if (provides_count > g_list_length (p->provides)) {
- g_message ("load_package test 3 ok");
- } else {
- g_message ("load_package test 3 FAIL (%d in provides, should have less then %d)",
- g_list_length (p->provides), provides_count);
- }
- } else {
- g_message ("load_package test 3 FAIL");
- }
- gtk_object_unref (GTK_OBJECT (p));
-}
-
-static char *
-get_password_dude (TrilobiteRootHelper *root_client,
- const char *prompt,
- void *user_data)
-{
- char * real_prompt;
- char * passwd;
-
- real_prompt = g_strdup_printf ("%s: ", prompt);
- passwd = getpass (real_prompt);
- g_free (real_prompt);
-
- return g_strdup (passwd);
-}
-
-static EazelPackageSystem*
-init_package_system (char *a_dbpath, char *a_root)
-{
- EazelPackageSystem *packsys;
- TrilobiteRootHelper *root_helper;
- GList *dbpaths = NULL;
-
- dbpaths = g_list_prepend (dbpaths, a_root);
- dbpaths = g_list_prepend (dbpaths, a_dbpath);
-
- root_helper = trilobite_root_helper_new ();
- gtk_signal_connect (GTK_OBJECT (root_helper), "need_password", GTK_SIGNAL_FUNC (get_password_dude),
- NULL);
- packsys = eazel_package_system_new (dbpaths);
- gtk_object_set_data (GTK_OBJECT (packsys), "trilobite-root-helper", root_helper);
-
- return packsys;
-}
-
-static void
-test_query (EazelPackageSystem *packsys)
-{
- GList *result;
-
- result = eazel_package_system_query (packsys,
- NULL,
- MATCHES_ONLY_ONE,
- EAZEL_PACKAGE_SYSTEM_QUERY_MATCHES,
- 0);
- if (g_list_length (result)==1) {
- g_message ("Query matches ok (1 hit on %s)", MATCHES_ONLY_ONE);
- } else {
- g_message ("Query matches fail (got %d, not 1 for %s)",
- g_list_length (result), MATCHES_ONLY_ONE);
- }
- g_list_foreach (result, (GFunc)gtk_object_unref, NULL);
- g_list_free (result);
-
- result = eazel_package_system_query (packsys,
- NULL,
- PROVIDED_BY_ONLY_ONE,
- EAZEL_PACKAGE_SYSTEM_QUERY_PROVIDES,
- 0);
- if (g_list_length (result)==1) {
- g_message ("Query provides ok (1 hit for %s)", PROVIDED_BY_ONLY_ONE);
- } else {
- g_message ("Query provides fail (got %d, not 1 for %s)",
- g_list_length (result), PROVIDED_BY_ONLY_ONE);
- }
- g_list_foreach (result, (GFunc)gtk_object_unref, NULL);
- g_list_free (result);
-
- result = eazel_package_system_query (packsys,
- NULL,
- OWNED_BY_ONLY_ONE,
- EAZEL_PACKAGE_SYSTEM_QUERY_OWNS,
- 0);
- if (g_list_length (result)==1) {
- g_message ("Query owned ok (1 hit for %s)", OWNED_BY_ONLY_ONE);
- } else {
- g_message ("Query owned fail (got %d, not 1 for %s)",
- g_list_length (result), OWNED_BY_ONLY_ONE);
- }
- g_list_foreach (result, (GFunc)gtk_object_unref, NULL);
- g_list_free (result);
-
- result = eazel_package_system_query (packsys,
- NULL,
- "",
- EAZEL_PACKAGE_SYSTEM_QUERY_SUBSTR,
- 0);
- if (g_list_length (result)>10) {
- g_message ("Query substr ok (%d hits for \"\")", g_list_length (result));
- } else {
- g_message ("Query substr fail (%d hits, too few (<10) for \"\")",
- g_list_length (result));
- }
- g_list_foreach (result, (GFunc)gtk_object_unref, NULL);
- g_list_free (result);
-
- {
- GList *glibc_result;
-
- glibc_result = eazel_package_system_query (packsys,
- NULL,
- NEEDED_BY_MANY,
- EAZEL_PACKAGE_SYSTEM_QUERY_MATCHES,
- 0);
-
- if (g_list_length (glibc_result) > 0) {
- PackageData *pack = (PackageData*)glibc_result->data;
-
- result = eazel_package_system_query (packsys,
- NULL,
- pack,
- EAZEL_PACKAGE_SYSTEM_QUERY_REQUIRES,
- 0);
- if (g_list_length (result)>50) {
- g_message ("Query requries ok (%d hits for %s)",
- g_list_length (result), NEEDED_BY_MANY);
- } else {
- g_message ("Query requires fail (%d hits, too few (<50) for %s)",
- g_list_length (result), NEEDED_BY_MANY);
- }
- g_list_foreach (result, (GFunc)gtk_object_unref, NULL);
- g_list_free (result);
- } else {
- g_message ("Can't test query requires, no hits for %s", NEEDED_BY_MANY);
- }
- g_list_foreach (glibc_result, (GFunc)gtk_object_unref, NULL);
- g_list_free (glibc_result);
-
- }
-}
-
-static void
-test_query_owns_mem (EazelPackageSystem *packsys)
-{
- GList *result;
- int i;
-
- g_message ("doing 1000 owns queries");
- for (i=1;i<=1000; i++) {
- result = eazel_package_system_query (packsys,
- NULL,
- OWNED_BY_ONLY_ONE,
- EAZEL_PACKAGE_SYSTEM_QUERY_OWNS,
- 0);
- if (i%50==0) {
- g_message ("%d queries done...", i);
- }
- g_list_foreach (result, (GFunc)gtk_object_unref, NULL);
- g_list_free (result);
- }
-}
-
-static GList*
-get_package_list (EazelPackageSystem *packsys,
- const char *package_file_name)
-{
- GList *packages = NULL;
- PackageData *package;
-
- package = eazel_package_system_load_package (packsys, NULL, package_file_name, 0);
-
- packages = g_list_prepend (packages, package);
- return packages;
-}
-
-static gboolean
-start_signal (EazelPackageSystem *system,
- EazelPackageSystemOperation op,
- const PackageData *pack,
- gboolean *signals)
-{
- if (signals[0] == FALSE) {
- signals[0] = TRUE;
- } else {
- signals[3] = TRUE;
- }
- return TRUE;
-}
-
-static gboolean
-end_signal (EazelPackageSystem *system,
- EazelPackageSystemOperation op,
- const PackageData *pack,
- gboolean *signals)
-{
- if (signals[2] == FALSE) {
- signals[2] = TRUE;
- } else {
- signals[3] = TRUE;
- }
- return TRUE;
-}
-
-static gboolean
-progress_signal (EazelPackageSystem *system,
- EazelPackageSystemOperation op,
- const PackageData *pack,
- unsigned long *info,
- gboolean *signals)
-{
- if (op==EAZEL_PACKAGE_SYSTEM_OPERATION_VERIFY) {
- /*
- g_message ("checking file \"%s\" (%ld/%ld %ld/%ld %ld/%ld)",
- (char*)((g_list_nth (pack->provides, info[0]-1))->data),
- info [0], info [1],
- info [2], info [3],
- info [4], info [5]);
- */
- }
- signals[1] = TRUE;
- return TRUE;
-}
-
-static gboolean
-failed_signal (EazelPackageSystem *system,
- EazelPackageSystemOperation op,
- const PackageData *package,
- gpointer unused)
-{
- return TRUE;
-
-}
-
-static gboolean
-is_installed (EazelPackageSystem *packsys,
- char *dbpath,
- const char *package_file_name)
-{
- GList *query;
- PackageData *package = eazel_package_system_load_package (packsys,
- NULL,
- package_file_name,
- 0);
- gboolean result = FALSE;
-
- query = eazel_package_system_query (packsys,
- dbpath,
- package->name,
- EAZEL_PACKAGE_SYSTEM_QUERY_MATCHES,
- 0);
- gtk_object_unref (GTK_OBJECT (package));
- if (g_list_length (query) > 0) {
- result = TRUE;
- }
- return result;
-}
-
-static void
-test_install (EazelPackageSystem *packsys,
- char *dbpath,
- const char *package_file_name)
-{
- GList *packages = get_package_list (packsys, package_file_name);
- gboolean *signals;
- guint h1, h2, h3;
-
- signals = g_new0 (gboolean, 4);
-
- h1 = gtk_signal_connect (GTK_OBJECT (packsys),
- "start",
- (GtkSignalFunc)start_signal,
- signals);
- h2 = gtk_signal_connect (GTK_OBJECT (packsys),
- "end",
- (GtkSignalFunc)end_signal,
- signals);
- h3 = gtk_signal_connect (GTK_OBJECT (packsys),
- "progress",
- (GtkSignalFunc)progress_signal,
- signals);
-
- eazel_package_system_install (packsys,
- dbpath,
- packages,
- EAZEL_PACKAGE_SYSTEM_OPERATION_UPGRADE|
- EAZEL_PACKAGE_SYSTEM_OPERATION_DOWNGRADE|
- EAZEL_PACKAGE_SYSTEM_OPERATION_FORCE);
-
- if (signals[3]) {
- g_message ("install FAIL (inconsistent)");
- } else if (signals[0] && signals[1] && signals[2]) {
- if (is_installed (packsys, dbpath, package_file_name)) {
- g_message ("install ok");
- } else {
- g_message ("install FAIL (package not installed)");
- }
- } else {
- g_message ("install FAIL");
- }
- g_list_foreach (packages, (GFunc)gtk_object_unref, NULL);
-
- gtk_signal_disconnect (GTK_OBJECT (packsys), h1);
- gtk_signal_disconnect (GTK_OBJECT (packsys), h2);
- gtk_signal_disconnect (GTK_OBJECT (packsys), h3);
- g_free (signals);
-}
-
-static void
-test_uninstall (EazelPackageSystem *packsys,
- char *dbpath,
- const char *package_file_name)
-{
- GList *packages = get_package_list (packsys, package_file_name);
- gboolean *signals;
- guint h1, h2, h3;
-
- signals = g_new0 (gboolean, 4);
-
- h1 = gtk_signal_connect (GTK_OBJECT (packsys),
- "start",
- (GtkSignalFunc)start_signal,
- signals);
- h2 = gtk_signal_connect (GTK_OBJECT (packsys),
- "end",
- (GtkSignalFunc)end_signal,
- signals);
- h3 = gtk_signal_connect (GTK_OBJECT (packsys),
- "progress",
- (GtkSignalFunc)progress_signal,
- signals);
-
- eazel_package_system_uninstall (packsys,
- dbpath,
- packages,
- EAZEL_PACKAGE_SYSTEM_OPERATION_UPGRADE|
- EAZEL_PACKAGE_SYSTEM_OPERATION_UPGRADE|
- EAZEL_PACKAGE_SYSTEM_OPERATION_FORCE);
-
- if (signals[3]) {
- g_message ("uninstall FAIL (inconsistent)");
- } else if (signals[0] && signals[2]) {
- if (is_installed (packsys, dbpath, package_file_name)) {
- g_message ("uninstall FAIL (package still installed)");
- } else {
- g_message ("uninstall ok");
- }
- } else {
- g_message ("uninstall FAIL");
- }
- g_list_foreach (packages, (GFunc)gtk_object_unref, NULL);
-
- gtk_signal_disconnect (GTK_OBJECT (packsys), h1);
- gtk_signal_disconnect (GTK_OBJECT (packsys), h2);
- gtk_signal_disconnect (GTK_OBJECT (packsys), h3);
- g_free (signals);
-}
-
-static void
-test_verify (EazelPackageSystem *packsys,
- char *dbpath,
- const char *package_file_name)
-{
- GList *packages = get_package_list (packsys, package_file_name);
- gboolean *signals;
- guint h1, h2, h3, h4;
-
- signals = g_new0 (gboolean, 4);
-
- h1 = gtk_signal_connect (GTK_OBJECT (packsys),
- "start",
- (GtkSignalFunc)start_signal,
- signals);
- h2 = gtk_signal_connect (GTK_OBJECT (packsys),
- "end",
- (GtkSignalFunc)end_signal,
- signals);
- h3 = gtk_signal_connect (GTK_OBJECT (packsys),
- "progress",
- (GtkSignalFunc)progress_signal,
- signals);
- h4 = gtk_signal_connect (GTK_OBJECT (packsys),
- "failed",
- (GtkSignalFunc)failed_signal,
- signals);
-
- eazel_package_system_verify (packsys,
- dbpath,
- packages);
-
- if (signals[3]) {
- g_message ("verified more then 1 file");
- } else if (signals[0] && signals[1] && signals[2]) {
- g_message ("verify ok");
- } else {
- g_message ("verify didn't emit enough signals");
- }
- g_list_foreach (packages, (GFunc)gtk_object_unref, NULL);
-
- gtk_signal_disconnect (GTK_OBJECT (packsys), h1);
- gtk_signal_disconnect (GTK_OBJECT (packsys), h2);
- gtk_signal_disconnect (GTK_OBJECT (packsys), h3);
- gtk_signal_disconnect (GTK_OBJECT (packsys), h4);
- g_free (signals);
-}
-
-/*******************************************************************************************/
-int arg_debug;
-
-static const struct poptOption options[] = {
- {"debug", '\0', POPT_ARG_INT, &arg_debug, 0 , N_("Show debug output"), NULL},
- {NULL, '\0', 0, NULL, 0}
-};
-
-
-int main(int argc, char *argv[]) {
- EazelPackageSystem *packsys;
- char *home_dbpath;
- char *filename;
- poptContext ctxt;
-
- gnome_init_with_popt_table ("Eazel Test Packsys", "1.0", argc, argv, options, 0, &ctxt);
- home_dbpath = g_strdup_printf ("/tmp/packagedb");
- packsys = init_package_system (home_dbpath, g_strdup (g_get_home_dir ()));
-
- filename= poptGetArg (ctxt);
- if (filename==NULL) {
- g_error ("usage : %s [options (-h for help)] filename", argv[1]);
- }
-
- eazel_package_system_set_debug (packsys, arg_debug);
-
- test_package_load (packsys, filename);
- test_database_mtime (packsys);
- test_is_installed (packsys);
- test_version_compare (packsys);
- test_query (packsys);
- test_query_owns_mem (packsys);
-
- test_install (packsys, home_dbpath, filename);
- test_verify (packsys, home_dbpath, filename);
- test_uninstall (packsys, home_dbpath, filename);
-
- return 0;
-};
diff --git a/components/services/install/command-line/eazel-test-softcat.c b/components/services/install/command-line/eazel-test-softcat.c
deleted file mode 100644
index 018d415a7..000000000
--- a/components/services/install/command-line/eazel-test-softcat.c
+++ /dev/null
@@ -1,202 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: Robey Pointer <robey@eazel.com>
- *
- */
-
-/*
- Test command of the day :
-
-eazel-softcat --debug --server=services.eazel.com:80 --funk=100 \
-id:3434 id:8934 id:8833 id:4544 id:3443 id:8452 id:6983 id:4599 id:9828 id:5456 id:9828 \
-feat:libc.so.6 feat:libm.so.6 feat:libroev.so.69 \
-nautilus xmms xfig transfig bladeenc lame grip ammonite gnumeric libghttp libtiff emacs glib
-
- */
-
-#include <config.h>
-#include <gnome.h>
-#include <libtrilobite/libtrilobite.h>
-#include <eazel-softcat.h>
-
-char *arg_server = NULL;
-char *arg_cgi_path = NULL;
-char *arg_username = NULL;
-char *arg_version = NULL;
-int arg_debug = 0;
-int arg_by_id = 0;
-int arg_by_features = 0;
-int arg_retries = 0;
-int arg_delay = 0;
-int arg_verbose = 0;
-int arg_version_ge = 0;
-int arg_check = 0;
-int arg_funk = 0;
-
-static const struct poptOption options[] = {
- {"server", 's', POPT_ARG_STRING, &arg_server, 0, N_("Softcat server to connect to"), "server[:port]"},
- {"cgi-path", '\0', POPT_ARG_STRING, &arg_cgi_path, 0, N_("Use alternate CGI path"), "path"},
- {"debug", '\0', POPT_ARG_NONE, &arg_debug, 0, N_("Show debug output"), NULL},
- {"user", 'u', POPT_ARG_STRING, &arg_username, 0, N_("Connect as a softcat user through ammonite"), "username"},
- {"retry", 'r', POPT_ARG_INT, &arg_retries, 0, N_("Number of times to try the request"), "times"},
- {"delay", 'd', POPT_ARG_INT, &arg_delay, 0, N_("Delay between request retries, in usec"), "delay"},
- {"by-id", 'i', POPT_ARG_NONE, &arg_by_id, 0, N_("Lookup by Eazel package id"), NULL},
- {"by-features", 'p', POPT_ARG_NONE, &arg_by_features, 0, N_("Lookup package that features a feature/file"), NULL},
- {"version", 'V', POPT_ARG_STRING, &arg_version, 0, N_("Lookup package with a specific version"), "version"},
- {"ge", '\0', POPT_ARG_NONE, &arg_version_ge, 0, N_("(with --version) Use >= comparison"), NULL},
- {"check", 'C', POPT_ARG_NONE, &arg_check, 0, N_("use check function (for debugging)"), NULL},
- {"verbose", 'v', POPT_ARG_NONE, &arg_verbose, 0, N_("Show detailed sub-package info"), NULL},
- {"funk", '\0', POPT_ARG_INT, &arg_funk, 0, N_("enable funk parser"), NULL},
- {NULL, '\0', 0, NULL, 0}
-};
-
-
-
-int
-main (int argc, char **argv)
-{
- poptContext popt;
- EazelSoftCat *softcat;
- const char *username;
- PackageData *package = NULL, *newpack = NULL;
- char *name;
- char *info;
- GList *package_list;
- EazelSoftCatError err;
- int sense_flags = 0;
-
- gnome_init_with_popt_table ("eazel-test-softcat", "1.0", argc, argv, options, 0, &popt);
- trilobite_set_log_handler (stdout, G_LOG_DOMAIN);
- trilobite_set_debug_mode (arg_debug ? TRUE : FALSE);
-
- package_list = NULL;
- while ((name = poptGetArg (popt)) != NULL) {
- package = packagedata_new ();
-
- if (arg_funk) {
- char *ptr = name;
- if (strncmp (ptr, "id:", 3)==0) {
- package->eazel_id = g_strdup (strchr (name, ':')+1);
- } else if (strncmp (ptr, "feat:", 5)==0) {
- package->features = g_list_prepend (package->features, g_strdup (strchr (name, ':')+1));
- } else {
- package->name = g_strdup (name);
- }
- } else {
- if (arg_by_id) {
- package->eazel_id = g_strdup (name);
- } else if (arg_by_features) {
- package->features = g_list_prepend (package->features, g_strdup (name));
- } else {
- package->name = g_strdup (name);
- }
-
- if (arg_version != NULL) {
- package->version = g_strdup (arg_version);
- sense_flags = (arg_version_ge ? EAZEL_SOFTCAT_SENSE_GE : EAZEL_SOFTCAT_SENSE_EQ);
- }
- }
-
- package_list = g_list_prepend (package_list, package);
- }
- package_list = g_list_reverse (package_list);
-
- if (package_list == NULL) {
- printf ("No packages requested.\n");
- exit (1);
- }
-
- softcat = eazel_softcat_new ();
- if (arg_server != NULL) {
- eazel_softcat_set_server (softcat, arg_server);
- }
- if (arg_cgi_path != NULL) {
- eazel_softcat_set_cgi_path (softcat, arg_cgi_path);
- }
- if (arg_username != NULL) {
- eazel_softcat_set_authn (softcat, TRUE, arg_username);
- }
- eazel_softcat_set_retry (softcat, arg_retries, arg_delay);
-
- if (arg_funk) {
- GList *iterator;
- GList *out=NULL, *err=NULL;
- printf ("Contacting softcat server at %s using funk technology ", eazel_softcat_get_server (softcat));
- if (eazel_softcat_get_authn (softcat, &username)) {
- printf ("(user: %s) ", username);
- }
- printf ("...\n");
- eazel_softcat_set_packages_per_query (softcat, arg_funk);
- eazel_softcat_get_info_plural (softcat, package_list,
- &out, &err,
- sense_flags, PACKAGE_FILL_EVERYTHING);
-
-
- for (iterator = err; iterator; iterator = g_list_next (iterator)) {
- PackageData *p = PACKAGEDATA (iterator->data);
- printf ("\n");
- info = packagedata_get_readable_name (p);
- printf ("Failed : %s\n", info);
- g_free (info);
- }
- for (iterator = out; iterator; iterator = g_list_next (iterator)) {
- PackageData *p = PACKAGEDATA (iterator->data);
- printf ("\n");
- info = packagedata_dump (p, arg_verbose ? TRUE : FALSE);
- printf ("%s\n", info);
- g_free (info);
- }
- return 0;
- } else while (package_list != NULL) {
- printf ("Contacting softcat server at %s ", eazel_softcat_get_server (softcat));
- if (eazel_softcat_get_authn (softcat, &username)) {
- printf ("(user: %s) ", username);
- }
- printf ("...\n");
-
- package = (PackageData *)(package_list->data);
- if (arg_check) {
- if (eazel_softcat_available_update (softcat, package, &newpack, PACKAGE_FILL_EVERYTHING)) {
- printf ("New package available!\n");
- info = packagedata_dump (newpack, arg_verbose ? TRUE : FALSE);
- printf ("%s\n", info);
- g_free (info);
- gtk_object_unref (GTK_OBJECT (newpack));
- } else {
- printf ("No new package available.\n");
- }
- } else {
- err = eazel_softcat_get_info (softcat, package, sense_flags, PACKAGE_FILL_EVERYTHING);
- if (err != EAZEL_SOFTCAT_SUCCESS) {
- printf ("FAILED: %s\n\n", eazel_softcat_error_string (err));
- } else {
- printf ("\n");
- info = packagedata_dump (package, arg_verbose ? TRUE : FALSE);
- printf ("%s\n", info);
- g_free (info);
- }
- }
-
- package_list = g_list_remove (package_list, package);
- gtk_object_unref (GTK_OBJECT (package));
- }
-
- return 0;
-}
diff --git a/components/services/install/command-line/eazel-test-types.c b/components/services/install/command-line/eazel-test-types.c
deleted file mode 100644
index c93d96391..000000000
--- a/components/services/install/command-line/eazel-test-types.c
+++ /dev/null
@@ -1,184 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: Eskil Heyn Olsen <eskil@eazel.com>
- *
- */
-
-#include <config.h>
-#include <gnome.h>
-#include <eazel-package-system.h>
-
-#include <libtrilobite/trilobite-root-helper.h>
-
-static PackageData*
-make_package (char *name, char *version, char *minor)
-{
- PackageData *p;
-
- p = packagedata_new ();
- p->name = name ? g_strdup (name) : NULL;
- p->version = version ? g_strdup (version) : NULL;
- p->minor = minor ? g_strdup (minor) : NULL;
-
- return p;
-}
-
-static void
-test_packagelist_prune (void)
-{
- PackageData *p, *q;
- GList *in = NULL, *rm = NULL;
-
- p = make_package ("hest", "1.0", "1");
- q = make_package ("hest", "1.1", "1");
- in = g_list_prepend (in, p);
- rm = g_list_prepend (rm, q);
-
- p = make_package ("fisk", "1.0", "1");
- q = make_package ("fisk", "1.0", "2");
- in = g_list_prepend (in, p);
- rm = g_list_prepend (rm, q);
-
- p = make_package ("gris", "1.0", "1");
- q = make_package ("gris", "1.0", "1");
- in = g_list_prepend (in, p);
- rm = g_list_prepend (rm, q);
-
- p = make_package ("odder", "1.0", "1");
- in = g_list_prepend (in, p);
- p = make_package ("bæver", "1.0", "1");
- in = g_list_prepend (in, p);
- p = make_package ("kanin", "1.0", "1");
- in = g_list_prepend (in, p);
- p = make_package ("osteklokke", "1.0", "1");
- in = g_list_prepend (in, p);
-
- packagedata_list_prune (&in, rm, TRUE, TRUE);
- if (g_list_length (in) == 4) {
- g_message ("packagedata_list_prune ok");
- } else {
- g_message ("packagedata_list_prune FAIL");
- }
-}
-
-#define EQ_TEST(b,a,order) do { \
-int res = eazel_install_package_matches_versioning (b, a->version, a->minor, EAZEL_SOFTCAT_SENSE_EQ); \
-if (res) { \
- g_message ("matches_versioning (%s == %s) = %d %s", \
- packagedata_get_name (b), packagedata_get_name (a), res, \
- order ? "ok" : "fail"); \
-} else { \
- g_message ("matches_versioning (%s == %s) = %d %s", \
- packagedata_get_name (b), packagedata_get_name (a), res, \
- !order ? "ok" : "fail"); \
-} } while (0)
-
-#define GE_TEST(b,a,order) do { \
-int res = eazel_install_package_matches_versioning (b, a->version, a->minor, EAZEL_SOFTCAT_SENSE_GE); \
-if (res) { \
- g_message ("matches_versioning (%s >= %s) = %d %s", \
- packagedata_get_name (b), packagedata_get_name (a), res, \
- order ? "ok" : "fail"); \
-} else { \
- g_message ("matches_versioning (%s >= %s) = %d %s", \
- packagedata_get_name (b), packagedata_get_name (a), \
- res, !order ? "ok" : "fail"); \
-} } while (0)
-
-static void
-test_eazel_install_package_matches_versioning (void)
-{
- PackageData *a, *b;
-
- a = make_package ("odder", NULL, NULL);
- b = make_package ("odder", "1.0", "1");
- EQ_TEST(b, a, 1);
-
- a = make_package ("odder", "1.0", NULL);
- b = make_package ("odder", "1.0", "1");
- EQ_TEST(b, a, 1);
-
- a = make_package ("odder", "1.0", "1");
- b = make_package ("odder", "1.0", "1");
- EQ_TEST(b, a, 1);
-
- a = make_package ("odder", "1.1", NULL);
- b = make_package ("odder", "1.0", "1");
- EQ_TEST(b, a, 0);
-
- a = make_package ("odder", "1.1", "2");
- b = make_package ("odder", "1.0", "1");
- EQ_TEST(b, a, 0);
-
- a = make_package ("odder", "1.0", "2");
- b = make_package ("odder", "1.0", "1");
- EQ_TEST(b, a, 0);
-
- a = make_package ("odder", "1.1", "1");
- b = make_package ("odder", "1.0", "1");
- EQ_TEST(b,a, 0);
-
- /* EQ | GT */
-
- a = make_package ("odder", NULL, NULL);
- b = make_package ("odder", "1.0", "1");
- GE_TEST(b,a, 1);
-
- a = make_package ("odder", "1.0", NULL);
- b = make_package ("odder", "1.0", "1");
- GE_TEST(b,a, 1);
-
- a = make_package ("odder", "1.0", "1");
- b = make_package ("odder", "1.0", "1");
- GE_TEST(b,a, 1);
-
- a = make_package ("odder", "1.0", NULL);
- b = make_package ("odder", "1.1", "1");
- GE_TEST(b,a, 1);
-
- a = make_package ("odder", "1.0", "2");
- b = make_package ("odder", "1.1", "1");
- GE_TEST(b,a, 1);
-
- a = make_package ("odder", "1.0", "1");
- b = make_package ("odder", "1.0", "2");
- GE_TEST(b,a, 1);
-
- a = make_package ("odder", "1.1", "1");
- b = make_package ("odder", "1.0", "1");
- GE_TEST(b,a, 0);
-
- a = make_package ("odder", "1.1", "2");
- b = make_package ("odder", "1.0", "1");
- GE_TEST(b,a, 0);
-
- a = make_package ("odder", "1.1", "1");
- b = make_package ("odder", "1.0", "2");
- GE_TEST(b,a, 0);
-}
-
-int main(int argc, char *argv[]) {
- gnome_init ("Eazel Test Packsys", "1.0", argc, argv);
-
- test_packagelist_prune ();
- test_eazel_install_package_matches_versioning ();
-
- return 0;
-};
diff --git a/components/services/install/command-line/genpkg_list.example b/components/services/install/command-line/genpkg_list.example
deleted file mode 100644
index b6e9f4f89..000000000
--- a/components/services/install/command-line/genpkg_list.example
+++ /dev/null
@@ -1,39 +0,0 @@
-roev
-:GConf:0.5.EazelSourceSnapshot:1:i386::
-Nautilus:GConf-devel:0.5.EazelSourceSnapshot::i386::
-Nautilus:ORBit:0.5.2.EazelSourceSnapshot::i386::
-Nautilus:ORBit-devel:0.5.2.EazelSourceSnapshot::i386::
-Nautilus:bonobo:0.15.EazelSourceSnapshot:prw:i386::
-Nautilus:bonobo-devel:0.15.EazelSourceSnapshot:prw:i386::
-Nautilus:control-center:1.2.0.EazelSourceSnapshot::i386::
-Nautilus:control-center-devel:1.2.0.EazelSourceSnapshot::i386::
-Nautilus:eog:0.3.EazelSourceSnapshot::i386::
-Nautilus:gdk-pixbuf:0.8.0.EazelSourceSnapshot::i386::
-Nautilus:gdk-pixbuf-devel:0.8.0.EazelSourceSnapshot::i386::
-Nautilus:gnome-print:0.20.EazelSourceSnapshot::i386::
-Nautilus:gnome-print-devel:0.20.EazelSourceSnapshot::i386::
-Nautilus:gnome-vfs:0.1.EazelSourceSnapshot::i386::
-Nautilus:gnome-vfs-devel:0.1.EazelSourceSnapshot::i386::
-Nautilus:gtkhtml:0.4.EazelSourceSnapshot::i386::
-Nautilus:gtkhtml-devel:0.4.EazelSourceSnapshot::i386::
-Nautilus:libghttp:1.0.7.EazelSourceSnapshot::i386::
-Nautilus:libghttp-devel:1.0.7.EazelSourceSnapshot::i386::
-Nautilus:medusa:0.1.0.EazelSourceSnapshot::i386::
-Nautilus:medusa-devel:0.1.0.EazelSourceSnapshot::i386::
-Nautilus:nautilus:0.1.0:prw:i386::
-Nautilus:nautilus-devel:0.1.0:prw:i386::
-Nautilus:oaf:0.4.0.EazelSourceSnapshot::i386::
-Nautilus:oaf-devel:0.4.0.EazelSourceSnapshot::i386::
-Nautilus:gnome-libs:1.2.3::i386::
-Nautilus:gtk+:1.2.8::i386::
-Nautilus:glib:1.2.8::i386::
-Nautilus:imlib:1.9.8.1::i386::
-Nautilus:imlib-configurator::i386::
-Nautilus:libxml:1.8.7::i386::
-Nautilus:gnome-libs-devel:1.2.3::i386::
-Nautilus:gtk+-devel:1.2.8::i386::
-Nautilus:glib-devel:1.2.8::i386::
-Nautilus:imlib-devel:1.9.8.1::i386::
-Nautilus:libxml-devel:1.8.7::i386::
-Nautilus:imlib-cfgeditor:1.9.8.1::i386::
-Nautilus:mozilla:5.0::i386::
diff --git a/components/services/install/idl/.cvsignore b/components/services/install/idl/.cvsignore
deleted file mode 100644
index 282522db0..000000000
--- a/components/services/install/idl/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-Makefile
-Makefile.in
diff --git a/components/services/install/idl/Makefile.am b/components/services/install/idl/Makefile.am
deleted file mode 100644
index 4dffb8ca3..000000000
--- a/components/services/install/idl/Makefile.am
+++ /dev/null
@@ -1,5 +0,0 @@
-idldir = ${prefix}/idl
-idl_DATA = trilobite-eazel-install.idl
-
-EXTRA_DIST=\
- $(idl_DATA)
diff --git a/components/services/install/idl/trilobite-eazel-install.idl b/components/services/install/idl/trilobite-eazel-install.idl
deleted file mode 100644
index 7147e3d14..000000000
--- a/components/services/install/idl/trilobite-eazel-install.idl
+++ /dev/null
@@ -1,308 +0,0 @@
-/* -*- Mode: IDL; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
-
-#include <Bonobo.idl>
-
-module GNOME {
-module Trilobite {
- module Eazel {
-
- /* NOTE: adding enums here requires adding them in
- eazel-install-corba-types.c
- - corba_packagedatastruct_from_packagedata
- - packagedata_from_corba_packagedatastruct
- eazel-install-types.c
- - packagedata_status_enum_to_str
- - packagedata_status_str_to_enum
- */
-
- enum PackageStatusEnum {
- UNKNOWN_STATUS,
- CANCELLED, /* medium: Package cancelled, eg wrong password or such */
- SOURCE_NOT_SUPPORTED, /* bad: we don't install source packages */
- DEPENDENCY_FAIL, /* bad: a dependency failed in next level */
- FILE_CONFLICT, /* bad: this file owns a file that the
- package we're installing also wants to install */
- BREAKS_DEPENDENCY, /* bad: installing this breaks something, see PackageDataStruct.breaks */
- INVALID, /* bad: this is not a rpm, go away */
- CANNOT_OPEN, /* bad: cannot open/fetch/imagine this file */
- PARTLY_RESOLVED, /* perhaps: the immediate deps where ok, check all in PackageDataStruct.soft/hard_depends */
- RESOLVED, /* good: all deps ok */
- ALREADY_INSTALLED, /* medium: you don't get to install it, but then again... */
- CIRCULAR_DEPENDENCY, /* bad: two packages are fighting it out */
- PACKSYS_FAILURE /* bad: can't lock rpmdb (usually) */
- };
-
- enum PackageModificationStatus {
- UNTOUCHED,
- INSTALLED,
- UNINSTALLED,
- UPGRADED,
- DOWNGRADED
- };
-
- enum Operation {
- OPERATION_INSTALL,
- OPERATION_UNINSTALL,
- OPERATION_REVERT
- };
-
- enum ProtocolEnum {
- PROTOCOL_HTTP,
- PROTOCOL_FTP,
- PROTOCOL_LOCAL
- };
-
- struct DistributionStruct {
- string name;
- long major;
- long minor;
- };
-
- exception NoAccess {}; /* Raised if access to the package system wasn't allowed */
- exception PackagesFailed {}; /* Raised if some packages failed (un)install */
-
- /* ORBit is unable to cope with recursive struct definitions, so we refer to other
- * packages using a "soft pointer" (their MD5). it sucks, but it works.
- */
-
- struct PackageDependencyStruct {
- string sense;
- string version;
- string package_md5;
- };
-
- enum PackageBreaksEnum {
- PACKAGE_FILE_CONFLICT,
- PACKAGE_FEATURE_MISSING
- };
- union PackageBreaksUnion switch (PackageBreaksEnum) {
- case PACKAGE_FILE_CONFLICT:
- sequence <string> files;
- case PACKAGE_FEATURE_MISSING:
- sequence <string> features;
- };
-
- struct PackageBreaksStruct {
- string package_md5;
- PackageBreaksUnion u;
- };
-
- struct PackageDataStruct {
- /*
- These fields should be set when passed to
- Eazel:Install::install ()
- */
- string name;
- string version;
- /* or set this you want to install a local file and
- still use eg. protocol HTTP to do dep stuff */
- string filename;
- /*
- Or this if you want to use an Eazel package id */
- string eazel_id;
- /*
- Or this if you want to use an Eazel suite id */
- string suite_id;
-
- /*
- Eazel:Install::install ()
- will set these if not set.
- */
- string archtype;
- DistributionStruct distribution;
-
- /*
- Not needed for
- Eazel:Install::install (), but will
- (if available) be set when callbacks are called.
- */
- string release;
- string summary;
- string description;
- long bytesize;
- long filesize;
- boolean toplevel;
- boolean anchor; /* internal use only */
-
- /* The location the rpm is installed (if installed) */
- string install_root;
-
- /* The md5 checksum of the rpmfile */
- string md5;
-
- /* When Eazel::IntallCallback::install_failed is
- called, this is set. The toplevel will have
- PARTLY_RESOLVED and in depends,
- packages will have typically eiter
- RESOLVED for the good deps,
- bad deps will have one of the
- bad: deps.
- */
- PackageStatusEnum status;
-
- PackageModificationStatus modify_status;
-
- sequence <PackageDependencyStruct> depends;
- sequence <PackageBreaksStruct> breaks;
- sequence <string> modifies; /* MD5 identifiers */
- sequence <string> provides; /* file list */
- sequence <string> features; /* feature list */
- };
- typedef sequence <PackageDataStruct> PackageDataStructList;
-
- struct CategoryStruct {
- string name;
- PackageDataStructList packages;
- };
- typedef sequence <CategoryStruct> CategoryStructList;
-
- /*
- When adding a signal :
- - add signal to EazelInstallCallback in eazel-install-corba-callback.c
- - add signal to EazelInstall in eazel-install-public.h and eazel-install-object.c
- - add emitters to EazelInstall in eazel-install-public.h and eazel-install-object.c
- - call them...
-
- When modifying a signal :
- - change interface in EazelInstallCallback in eazel-install-corba-callback.c
- - change interface in EazelInstall in eazel-install-public.h and eazel-install-object.c
- - change interface in EazelInstall in eazel-install-public.h and eazel-install-object.c
- - find and change all calls
-
- Getting the klass functions and the gtk_signal_new into both eazel-install-object.c
- and eazel-install-corba-callback.c can be optimized by using Cut'n'Paste<tm> Technology
- */
-
- interface InstallCallback : Bonobo::Unknown {
- /* Called during download of a file */
- /* make it 2-way so that it will process incoming corba calls */
- void download_progress (in PackageDataStruct package, in long amount, in long total);
-
- /* Called when dependency check is being handled */
- oneway void dependency_check (in PackageDataStruct package, in PackageDataStruct needs);
-
- /* Called when a package is being file/feature/unique checked */
- oneway void file_conflict_check (in PackageDataStruct package);
- oneway void file_uniqueness_check (in PackageDataStruct package);
- oneway void feature_consistency_check (in PackageDataStruct package);
-
- /* Called after download is complete, and before the (un)install begins.
- Typically while heating up RPM */
- boolean preflight_check (in Operation op,
- in PackageDataStructList package_tree,
- in long total_size,
- in long num_packages);
-
- /* On a successfull operation, this is called and should
- return TRUE if a transaction log should be kept */
- boolean save_transaction (in Operation op,
- in PackageDataStructList package_tree);
-
- /* Called during (un)installation of a package */
- oneway void install_progress (in PackageDataStruct package,
- in long package_num,
- in long num_packages,
- in long package_size_completed,
- in long package_size_total,
- in long total_size_completed,
- in long total_size);
- oneway void uninstall_progress (in PackageDataStruct package,
- in long package_num,
- in long num_packages,
- in long package_size_completed,
- in long package_size_total,
- in long total_size_completed,
- in long total_size);
-
- /* Called whenever a package (un)install fails
- */
- void download_failed (in PackageDataStruct package);
- void install_failed (in PackageDataStructList package_tree);
- void uninstall_failed (in PackageDataStructList package_tree);
-
- /* Emitted when a package fails the md5 check.
- The package structure contains the md5 it should have,
- and actual_md5 contains the md5 checksum of the rpmfile */
- void md5_check_failed (in PackageDataStruct package, in string actual_md5);
-
- /* Called when the operation is finished */
- void done (in boolean result);
- };
-
- interface Install : Bonobo::Unknown {
- attribute boolean debug;
- attribute boolean verbose; /* Mucho log output */
- attribute boolean silent; /* Minimal log output */
- attribute boolean test_mode; /* dry run, do not install, but act as if... */
- attribute boolean force; /* force install specified package (DANGER WILL ROBINSON) */
- attribute boolean upgrade; /* enable upgrade (default is FALSE) */
- attribute boolean downgrade; /* enable downgrade (default is FALSE) */
- attribute string package_list; /* Local package list to use, rather then download
- from server */
-
- attribute string server; /* server to use for both file and package list download */
- attribute string username;
- attribute string cgi;
- attribute boolean auth;
- attribute long server_port; /* */
-
- attribute string log_file; /* where to put the logfile (otherwise it blurps to stdout) */
- attribute string tmp_dir; /* directory to store tmp files in (/tmp/eazel-install) */
-
- attribute ProtocolEnum protocol; /* */
-
- attribute boolean ssl_rename; /* Do the renaming trick, where all hostnames in
- all urls are renamed to localhost. This makes
- ssl tunneling work */
- attribute boolean ignore_file_conflicts; /* instruct the installer to not
- do file conflict checking */
-
- attribute boolean ei2;
-
- /* Install/uninstall using the packagelist from the server */
- oneway void install (in string packagelist, in InstallCallback cb);
- oneway void uninstall (in string packagelist, in InstallCallback cb);
-
- /* These are for installing/uninstalling specific packages */
- oneway void install_packages (in CategoryStructList categories,
- in string root,
- in InstallCallback cb);
- oneway void uninstall_packages (in CategoryStructList categories,
- in string root,
- in InstallCallback cb);
-
- /* These are for installing/uninstalling specific packages */
-/*
- This is for bug 5267
- oneway void prepare_operation (in PackageDataStructList packages,
- in string root,
- in Operation op,
- in InstallCallback cb);
-
- oneway void perform_operation (in PackageDataStructList packages,
- in string root,
- in Operation op,
- in InstallCallback cb);
-*/
-
- boolean query_server (in PackageDataStruct q,
- out PackageDataStruct result);
-
- /* Run a query to the package sys */
- PackageDataStructList simple_query (in string query,
- in string root);
-
- /* Revert a operation */
- oneway void revert_transaction (in string xml,
- in string root,
- in InstallCallback cb);
-
- /* Cancel an ongoing download. */
- void stop ();
-
- /* Delete the temp dir and its contents, after an operation. */
- oneway void delete_files ();
- };
- };
-};
-};
diff --git a/components/services/install/lib/.cvsignore b/components/services/install/lib/.cvsignore
deleted file mode 100644
index 2f77d4c88..000000000
--- a/components/services/install/lib/.cvsignore
+++ /dev/null
@@ -1,13 +0,0 @@
-*.la
-*.lo
-.deps
-.libs
-Makefile
-Makefile.in
-eazel-install-query-lex.c
-idl_stamp
-makefile.staticlib
-trilobite-eazel-install-common.c
-trilobite-eazel-install-skels.c
-trilobite-eazel-install-stubs.c
-trilobite-eazel-install.h
diff --git a/components/services/install/lib/Makefile.am b/components/services/install/lib/Makefile.am
deleted file mode 100644
index e186bdf41..000000000
--- a/components/services/install/lib/Makefile.am
+++ /dev/null
@@ -1,155 +0,0 @@
-NULL =
-
-INCLUDES = \
- -DPREFIX=\"$(prefix)\" \
- -DG_LOG_DOMAIN=\"trilobite-eazel-install-service\" \
- -DGNOMELOCALEDIR=\""$(datadir)/locale"\" \
- -I$(top_srcdir) \
- -I$(top_builddir) \
- -I/usr/include/rpm \
- -I$(top_srcdir)/components/services/trilobite \
- -I$(top_builddir)/components/services/trilobite \
- -I$(top_srcdir)/components/services/trilobite/libtrilobite\
- -I$(top_builddir)/components/services/trilobite/libtrilobite\
- -I$(top_srcdir)/components/services/trilobite/lib \
- -I$(top_builddir)/components/services/trilobite/lib \
- $(GNOME_CFLAGS) \
- $(GCONF_CFLAGS) \
- $(XML_CFLAGS) \
- $(GHTTP_CFLAGS) \
- $(NULL)
-
-lib_LTLIBRARIES = \
- libeazelinstall.la \
- libeazelpackagesystem.la \
- libeazelpackagesystem-rpm3.la \
- libeazelpackagesystem-rpm4.la \
- libeazelpackagesystem-skeleton.la \
- libeazelpackagesystem-dpkg.la \
- $(NULL)
-
-
-# libeazelinstall
-
-libeazelinstallincludedir=$(includedir)/libtrilobite/eazel/install
-
-libeazelinstallinclude_HEADERS = \
- eazel-install-public.h \
- trilobite-eazel-install.h \
- libeazelinstall.h \
- eazel-install-corba-types.h \
- eazel-install-metadata.h \
- eazel-install-protocols.h \
- eazel-install-rpm-signature.h \
- eazel-install-query.h \
- eazel-install-tests.h \
- eazel-install-private.h \
- eazel-install-corba-callback.h \
- eazel-install-problem.h \
- eazel-install-logic2.h \
- $(NULL)
-
-libeazelinstall_la_SOURCES = \
- $(CORBA_GENERATED) \
- eazel-install-corba.c \
- eazel-install-corba-types.c \
- eazel-install-corba-callback.c \
- eazel-install-metadata.c \
- eazel-install-protocols.c \
- eazel-install-logic2.c \
- eazel-install-rpm-signature.c \
- eazel-install-tests.c \
- eazel-install-object.c \
- eazel-install-problem.c \
- eazel-package-system-rpm3.c \
- $(NULL)
-
-libeazelinstall_la_LDFLAGS = \
- $(GHTTP_LIBS)
-
-# libeazelpackagesystem
-
-libeazelpackagesystemincludedir=$(includedir)/libtrilobite/eazel/package-system/
-
-libeazelpackagesysteminclude_HEADERS = \
- eazel-package-system.h \
- eazel-package-system-private.h \
- eazel-package-system-types.h \
- eazel-install-xml-package-list.h \
- eazel-softcat.h \
- eazel-softcat-private.h \
- $(NULL)
-
-libeazelpackagesystem_la_SOURCES = \
- eazel-package-system-types.c \
- eazel-package-system.c \
- eazel-softcat.c \
- eazel-install-xml-package-list.c \
- $(NULL)
-
-# libeazelpackagesystem-skeleton
-
-libeazelpackagesystem_skeleton_la_SOURCES = \
- eazel-package-system-skeleton.h \
- eazel-package-system-skeleton.c \
- $(NULL)
-
-
-# libeazelpackagesystem-dpkg
-
-libeazelpackagesystem_dpkg_la_SOURCES = \
- eazel-package-system-dpkg.h \
- eazel-package-system-dpkg.c \
- $(NULL)
-
-
-# libeazelpackagesystem-rpm3
-libeazelpackagesystem_rpm3_la_SOURCES = \
- eazel-package-system-rpm3.h \
- eazel-package-system-rpm3-private.h \
- eazel-package-system-rpm3.c \
- $(NULL)
-
-# libeazelpackagesystem-rpm4
-libeazelpackagesystem_rpm4_la_SOURCES = \
- eazel-package-system-rpm3.h \
- eazel-package-system-rpm3.c \
- eazel-package-system-rpm4.h \
- eazel-package-system-rpm4.c \
- $(NULL)
-
-# stuff
-
-EXTRA_DIST = \
- eazel-install-query-lex.l \
- eazel-package-system-rpm3-private.h \
- $(NULL)
-
-eazel-install-query-lex.c: $(srcdir)/eazel-install-query-lex.l eazel-install-query-parse.h
- @rm -f $@
- $(LEX) -t $(srcdir)/eazel-install-query-lex.l >$@
-
-
-## CORBA magic
-
-CORBA_GENERATED = \
- trilobite-eazel-install-common.c \
- trilobite-eazel-install-skels.c \
- trilobite-eazel-install-stubs.c \
- trilobite-eazel-install.h \
- $(NULL)
-
-IDLDIR = $(top_srcdir)/components/services/install/idl
-IDL = $(IDLDIR)/trilobite-eazel-install.idl
-
-$(CORBA_GENERATED): idl_stamp
-idl_stamp: $(IDL)
- $(ORBIT_IDL) $(IDL_CFLAGS) -I$(IDLDIR) $(IDL)
- touch idl_stamp
-
-CLEANFILES+=$(CORBA_GENERATED) idl_stamp
-
-BUILT_SOURCES = \
- $(CORBA_GENERATED)
-##
-
diff --git a/components/services/install/lib/eazel-install-corba-callback.c b/components/services/install/lib/eazel-install-corba-callback.c
deleted file mode 100644
index e49255409..000000000
--- a/components/services/install/lib/eazel-install-corba-callback.c
+++ /dev/null
@@ -1,707 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: Eskil Heyn Olsen <eskil@eazel.com>
- *
- */
-
-#include <config.h>
-#include <gnome-xml/parser.h>
-#include "eazel-install-corba-callback.h"
-#include "eazel-install-corba-types.h"
-#include "eazel-install-xml-package-list.h"
-/*
-#include <gnome.h>
-#include <liboaf/liboaf.h>
-#include <bonobo.h>
-#include <libtrilobite/libtrilobite.h>
-#include "trilobite-eazel-install.h"
-*/
-
-#define OAF_ID "OAFIID:trilobite_eazel_install_service:8ff6e815-1992-437c-9771-d932db3b4a17"
-
-enum {
- FILE_CONFLICT_CHECK,
- FILE_UNIQUENESS_CHECK,
- FEATURE_CONSISTENCY_CHECK,
-
- DOWNLOAD_PROGRESS,
- PREFLIGHT_CHECK,
- SAVE_TRANSACTION,
- INSTALL_PROGRESS,
- UNINSTALL_PROGRESS,
-
- DOWNLOAD_FAILED,
- MD5_CHECK_FAILED,
- INSTALL_FAILED,
- UNINSTALL_FAILED,
-
- DEPENDENCY_CHECK,
- DELETE_FILES,
-
- DONE,
-
- LAST_SIGNAL
-};
-
-/* The signal array, used for building the signal bindings */
-
-static guint signals[LAST_SIGNAL] = { 0 };
-
-static BonoboObjectClass *eazel_install_callback_parent_class;
-
-static PortableServer_ServantBase__epv base_epv = { NULL, NULL, NULL };
-
-typedef struct {
- POA_GNOME_Trilobite_Eazel_InstallCallback poa;
- EazelInstallCallback *object;
-} impl_POA_GNOME_Trilobite_Eazel_InstallCallback;
-
-static void
-impl_file_conflict_check (impl_POA_GNOME_Trilobite_Eazel_InstallCallback *servant,
- const GNOME_Trilobite_Eazel_PackageDataStruct *corbapack,
- CORBA_Environment * ev)
-{
- PackageData *pack;
- pack = packagedata_from_corba_packagedatastruct (corbapack);
- gtk_signal_emit (GTK_OBJECT (servant->object), signals[FILE_CONFLICT_CHECK], pack);
- gtk_object_unref (GTK_OBJECT (pack));
-}
-
-static void
-impl_file_uniqueness_check (impl_POA_GNOME_Trilobite_Eazel_InstallCallback *servant,
- const GNOME_Trilobite_Eazel_PackageDataStruct *corbapack,
- CORBA_Environment * ev)
-{
- PackageData *pack;
- pack = packagedata_from_corba_packagedatastruct (corbapack);
- gtk_signal_emit (GTK_OBJECT (servant->object), signals[FILE_UNIQUENESS_CHECK], pack);
- gtk_object_unref (GTK_OBJECT (pack));
-}
-
-static void
-impl_feature_consistency_check (impl_POA_GNOME_Trilobite_Eazel_InstallCallback *servant,
- const GNOME_Trilobite_Eazel_PackageDataStruct *corbapack,
- CORBA_Environment * ev)
-{
- PackageData *pack;
- pack = packagedata_from_corba_packagedatastruct (corbapack);
- gtk_signal_emit (GTK_OBJECT (servant->object), signals[FEATURE_CONSISTENCY_CHECK], pack);
- gtk_object_unref (GTK_OBJECT (pack));
-}
-
-static void
-impl_download_progress (impl_POA_GNOME_Trilobite_Eazel_InstallCallback *servant,
- const GNOME_Trilobite_Eazel_PackageDataStruct *corbapack,
- const CORBA_long amount,
- const CORBA_long total,
- CORBA_Environment * ev)
-{
- PackageData *pack;
-
- pack = packagedata_from_corba_packagedatastruct (corbapack);
- gtk_signal_emit (GTK_OBJECT (servant->object), signals[DOWNLOAD_PROGRESS], pack, amount, total);
- gtk_object_unref (GTK_OBJECT (pack));
-}
-
-static CORBA_boolean
-impl_preflight_check (impl_POA_GNOME_Trilobite_Eazel_InstallCallback *servant,
- const GNOME_Trilobite_Eazel_Operation corba_op,
- const GNOME_Trilobite_Eazel_PackageDataStructList *package_tree,
- const CORBA_long total_bytes,
- const CORBA_long total_packages,
- CORBA_Environment * ev)
-{
- GList *packages;
- gboolean result;
- EazelInstallCallbackOperation op = EazelInstallCallbackOperation_INSTALL;
-
- switch (corba_op) {
- case GNOME_Trilobite_Eazel_OPERATION_INSTALL:
- op = EazelInstallCallbackOperation_INSTALL;
- break;
- case GNOME_Trilobite_Eazel_OPERATION_UNINSTALL:
- op = EazelInstallCallbackOperation_UNINSTALL;
- break;
- case GNOME_Trilobite_Eazel_OPERATION_REVERT:
- op = EazelInstallCallbackOperation_REVERT;
- break;
- }
-
- packages = packagedata_tree_from_corba_packagedatastructlist (package_tree);
- if (packages == NULL) {
- g_warning ("preflight called with error in package tree!");
- } else {
- gtk_signal_emit (GTK_OBJECT (servant->object), signals[PREFLIGHT_CHECK],
- op,
- packages,
- total_bytes,
- total_packages,
- &result);
- }
- g_list_foreach (packages, (GFunc)gtk_object_unref, NULL);
- g_list_free (packages);
-
- return result ? CORBA_TRUE : CORBA_FALSE;
-}
-
-static CORBA_boolean
-impl_save_transaction (impl_POA_GNOME_Trilobite_Eazel_InstallCallback *servant,
- const GNOME_Trilobite_Eazel_Operation corba_op,
- const GNOME_Trilobite_Eazel_PackageDataStructList *package_tree,
- CORBA_Environment * ev)
-{
- GList *packages;
- gboolean result;
- EazelInstallCallbackOperation op = EazelInstallCallbackOperation_INSTALL;
-
- switch (corba_op) {
- case GNOME_Trilobite_Eazel_OPERATION_INSTALL:
- op = EazelInstallCallbackOperation_INSTALL;
- break;
- case GNOME_Trilobite_Eazel_OPERATION_UNINSTALL:
- op = EazelInstallCallbackOperation_UNINSTALL;
- break;
- case GNOME_Trilobite_Eazel_OPERATION_REVERT:
- op = EazelInstallCallbackOperation_REVERT;
- break;
- }
-
- packages = packagedata_tree_from_corba_packagedatastructlist (package_tree);
- if (packages == NULL) {
- g_warning ("save transaction called with error in package tree!");
- } else {
- gtk_signal_emit (GTK_OBJECT (servant->object), signals[SAVE_TRANSACTION],
- op,
- packages,
- &result);
- }
- g_list_foreach (packages, (GFunc)gtk_object_unref, NULL);
- g_list_free (packages);
-
- return result ? CORBA_TRUE : CORBA_FALSE;
-}
-
-static void
-impl_download_failed (impl_POA_GNOME_Trilobite_Eazel_InstallCallback *servant,
- const GNOME_Trilobite_Eazel_PackageDataStruct *corbapack,
- CORBA_Environment * ev)
-{
- PackageData *pack;
-
- pack = packagedata_from_corba_packagedatastruct (corbapack);
- gtk_signal_emit (GTK_OBJECT (servant->object), signals[DOWNLOAD_FAILED], pack);
- gtk_object_unref (GTK_OBJECT (pack));
-}
-
-static void
-impl_dep_check (impl_POA_GNOME_Trilobite_Eazel_InstallCallback *servant,
- const GNOME_Trilobite_Eazel_PackageDataStruct *corbapack,
- const GNOME_Trilobite_Eazel_PackageDataStruct *corbaneeds,
- CORBA_Environment * ev)
-{
- PackageData *pack, *needs;
- pack = packagedata_from_corba_packagedatastruct (corbapack);
- needs = packagedata_from_corba_packagedatastruct (corbaneeds);
- gtk_signal_emit (GTK_OBJECT (servant->object), signals[DEPENDENCY_CHECK], pack, needs);
- gtk_object_unref (GTK_OBJECT (pack));
- gtk_object_unref (GTK_OBJECT (needs));
-}
-
-static void
-impl_install_progress (impl_POA_GNOME_Trilobite_Eazel_InstallCallback *servant,
- const GNOME_Trilobite_Eazel_PackageDataStruct *corbapack,
- const CORBA_long package_num, const CORBA_long num_packages,
- const CORBA_long package_size_completed, const CORBA_long package_size_total,
- const CORBA_long total_size_completed, const CORBA_long total_size,
- CORBA_Environment * ev)
-{
- PackageData *pack;
- pack = packagedata_from_corba_packagedatastruct (corbapack);
- gtk_signal_emit (GTK_OBJECT (servant->object), signals[INSTALL_PROGRESS],
- pack,
- package_num, num_packages,
- package_size_completed, package_size_total,
- total_size_completed, total_size);
- gtk_object_unref (GTK_OBJECT (pack));
-}
-
-static void
-impl_uninstall_progress (impl_POA_GNOME_Trilobite_Eazel_InstallCallback *servant,
- const GNOME_Trilobite_Eazel_PackageDataStruct *corbapack,
- const CORBA_long package_num, const CORBA_long num_packages,
- const CORBA_long package_size_completed, const CORBA_long package_size_total,
- const CORBA_long total_size_completed, const CORBA_long total_size,
- CORBA_Environment * ev)
-{
- PackageData *pack;
- pack = packagedata_from_corba_packagedatastruct (corbapack);
- gtk_signal_emit (GTK_OBJECT (servant->object), signals[UNINSTALL_PROGRESS],
- pack,
- package_num, num_packages,
- package_size_completed, package_size_total,
- total_size_completed, total_size);
- gtk_object_unref (GTK_OBJECT (pack));
-}
-
-static void
-impl_md5_check_failed (impl_POA_GNOME_Trilobite_Eazel_InstallCallback *servant,
- const GNOME_Trilobite_Eazel_PackageDataStruct *corbapack,
- const CORBA_char *actual_md5,
- CORBA_Environment * ev)
-{
- PackageData *pack;
- pack = packagedata_from_corba_packagedatastruct (corbapack);
- gtk_signal_emit (GTK_OBJECT (servant->object), signals[MD5_CHECK_FAILED], pack, actual_md5);
- gtk_object_unref (GTK_OBJECT (pack));
-}
-
-static void
-impl_install_failed (impl_POA_GNOME_Trilobite_Eazel_InstallCallback *servant,
- const GNOME_Trilobite_Eazel_PackageDataStructList *package_tree,
- CORBA_Environment * ev)
-{
- GList *packages;
-
- packages = packagedata_tree_from_corba_packagedatastructlist (package_tree);
- if (packages == NULL) {
- g_warning ("install_failed called with error in package tree!");
- } else {
- /* always called with only one package at the root of the tree */
- gtk_signal_emit (GTK_OBJECT (servant->object), signals[INSTALL_FAILED], PACKAGEDATA (packages->data));
- }
- g_list_foreach (packages, (GFunc)gtk_object_unref, NULL);
- g_list_free (packages);
-}
-
-static void
-impl_uninstall_failed (impl_POA_GNOME_Trilobite_Eazel_InstallCallback *servant,
- const GNOME_Trilobite_Eazel_PackageDataStructList *package_tree,
- CORBA_Environment * ev)
-{
- GList *packages;
-
- packages = packagedata_tree_from_corba_packagedatastructlist (package_tree);
- if (packages == NULL) {
- g_warning ("uninstall_failed called with error in package tree!");
- } else {
- /* always called with only one package at the root of the tree */
- gtk_signal_emit (GTK_OBJECT (servant->object), signals[UNINSTALL_FAILED], PACKAGEDATA (packages->data));
- }
- g_list_foreach (packages, (GFunc)gtk_object_unref, NULL);
- g_list_free (packages);
-}
-
-static void
-impl_done (impl_POA_GNOME_Trilobite_Eazel_InstallCallback *servant,
- CORBA_boolean result,
- CORBA_Environment * ev)
-{
- gtk_signal_emit (GTK_OBJECT (servant->object), signals[DONE], result);
-}
-
-POA_GNOME_Trilobite_Eazel_InstallCallback__epv*
-eazel_install_callback_get_epv ()
-{
- POA_GNOME_Trilobite_Eazel_InstallCallback__epv *epv;
-
- epv = g_new0 (POA_GNOME_Trilobite_Eazel_InstallCallback__epv, 1);
-
- epv->file_conflict_check = (gpointer)&impl_file_conflict_check;
- epv->file_uniqueness_check = (gpointer)&impl_file_uniqueness_check;
- epv->feature_consistency_check = (gpointer)&impl_feature_consistency_check;
-
- epv->download_progress = (gpointer)&impl_download_progress;
- epv->preflight_check = (gpointer)&impl_preflight_check;
- epv->save_transaction = (gpointer)&impl_save_transaction;
- epv->dependency_check = (gpointer)&impl_dep_check;
- epv->install_progress = (gpointer)&impl_install_progress;
- epv->uninstall_progress = (gpointer)&impl_uninstall_progress;
- epv->md5_check_failed = (gpointer)&impl_md5_check_failed;
- epv->install_failed = (gpointer)&impl_install_failed;
- epv->download_failed = (gpointer)&impl_download_failed;
- epv->uninstall_failed = (gpointer)&impl_uninstall_failed;
- epv->done = (gpointer)&impl_done;
-
- return epv;
-};
-
-GNOME_Trilobite_Eazel_InstallCallback
-eazel_install_callback_create_corba_object (BonoboObject *service) {
- impl_POA_GNOME_Trilobite_Eazel_InstallCallback *servant;
- CORBA_Environment ev;
-
- g_assert (service != NULL);
- g_assert (EAZEL_IS_INSTALL_CALLBACK (service));
-
- CORBA_exception_init (&ev);
-
- servant = g_new0 (impl_POA_GNOME_Trilobite_Eazel_InstallCallback,1);
- servant->object = EAZEL_INSTALL_CALLBACK (service);
-
- ((POA_GNOME_Trilobite_Eazel_InstallCallback*) servant)->vepv =
- EAZEL_INSTALL_CALLBACK_CLASS ( GTK_OBJECT (service)->klass)->servant_vepv;
- POA_GNOME_Trilobite_Eazel_InstallCallback__init (servant, &ev);
- ORBIT_OBJECT_KEY (((POA_GNOME_Trilobite_Eazel_InstallCallback*)servant)->_private)->object = NULL;
-
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_warning ("Cannot instantiate Eazel_InstallCallback corba object");
- g_free (servant);
- CORBA_exception_free (&ev);
- return CORBA_OBJECT_NIL;
- }
-
- CORBA_exception_free (&ev);
-
- /* Return the bonobo activation of the servant */
- return (GNOME_Trilobite_Eazel_InstallCallback) bonobo_object_activate_servant (service, servant);
-}
-
-
-/*****************************************
- GTK+ object stuff
-*****************************************/
-
-void
-eazel_install_callback_unref (GtkObject *object)
-{
- g_return_if_fail (object != NULL);
- g_return_if_fail (EAZEL_INSTALL_CALLBACK (object));
-
- bonobo_object_unref (BONOBO_OBJECT (object));
-}
-
-static void
-eazel_install_callback_finalize (GtkObject *object)
-{
- EazelInstallCallback *service;
-
- g_return_if_fail (object != NULL);
- g_return_if_fail (EAZEL_INSTALL_CALLBACK (object));
-
- service = EAZEL_INSTALL_CALLBACK (object);
-
- if (service->installservice_corba != CORBA_OBJECT_NIL) {
- CORBA_Environment ev;
- CORBA_exception_init (&ev);
-
- bonobo_object_unref (BONOBO_OBJECT (service->installservice_bonobo));
- Bonobo_Unknown_unref (service->installservice_corba, &ev);
- CORBA_Object_release (service->installservice_corba, &ev);
-
- CORBA_Object_release (service->cb, &ev);
- CORBA_exception_free (&ev);
- }
-
- if (GTK_OBJECT_CLASS (eazel_install_callback_parent_class)->destroy) {
- GTK_OBJECT_CLASS (eazel_install_callback_parent_class)->destroy (object);
- }
-}
-
-static void
-eazel_install_callback_class_initialize (EazelInstallCallbackClass *klass)
-{
- GtkObjectClass *object_class;
-
- object_class = (GtkObjectClass*)klass;
- object_class->finalize = eazel_install_callback_finalize;
-
- eazel_install_callback_parent_class = gtk_type_class (bonobo_object_get_type ());
- klass->servant_vepv = g_new0 (POA_GNOME_Trilobite_Eazel_InstallCallback__vepv,1);
- ((POA_GNOME_Trilobite_Eazel_InstallCallback__vepv*)klass->servant_vepv)->_base_epv = &base_epv;
- ((POA_GNOME_Trilobite_Eazel_InstallCallback__vepv*)klass->servant_vepv)->Bonobo_Unknown_epv = bonobo_object_get_epv ();
- ((POA_GNOME_Trilobite_Eazel_InstallCallback__vepv*)klass->servant_vepv)->GNOME_Trilobite_Eazel_InstallCallback_epv =
- eazel_install_callback_get_epv ();
-
- signals[FILE_CONFLICT_CHECK] =
- gtk_signal_new ("file_conflict_check",
- GTK_RUN_LAST,
- object_class->type,
- GTK_SIGNAL_OFFSET (EazelInstallCallbackClass, file_conflict_check),
- gtk_marshal_NONE__POINTER,
- GTK_TYPE_NONE, 1, GTK_TYPE_POINTER);
- signals[FILE_UNIQUENESS_CHECK] =
- gtk_signal_new ("file_uniqueness_check",
- GTK_RUN_LAST,
- object_class->type,
- GTK_SIGNAL_OFFSET (EazelInstallCallbackClass, file_uniqueness_check),
- gtk_marshal_NONE__POINTER,
- GTK_TYPE_NONE, 1, GTK_TYPE_POINTER);
- signals[FEATURE_CONSISTENCY_CHECK] =
- gtk_signal_new ("feature_consistency_check",
- GTK_RUN_LAST,
- object_class->type,
- GTK_SIGNAL_OFFSET (EazelInstallCallbackClass, feature_consistency_check),
- gtk_marshal_NONE__POINTER,
- GTK_TYPE_NONE, 1, GTK_TYPE_POINTER);
-
- signals[DOWNLOAD_PROGRESS] =
- gtk_signal_new ("download_progress",
- GTK_RUN_LAST,
- object_class->type,
- GTK_SIGNAL_OFFSET (EazelInstallCallbackClass, download_progress),
- gtk_marshal_NONE__POINTER_INT_INT,
- GTK_TYPE_NONE, 3, GTK_TYPE_POINTER, GTK_TYPE_INT, GTK_TYPE_INT);
- signals[PREFLIGHT_CHECK] =
- gtk_signal_new ("preflight_check",
- GTK_RUN_LAST,
- object_class->type,
- GTK_SIGNAL_OFFSET (EazelInstallCallbackClass, preflight_check),
- eazel_install_gtk_marshal_BOOL__ENUM_POINTER_INT_INT,
- GTK_TYPE_BOOL, 4, GTK_TYPE_ENUM, GTK_TYPE_POINTER, GTK_TYPE_INT, GTK_TYPE_INT);
- signals[SAVE_TRANSACTION] =
- gtk_signal_new ("save_transaction",
- GTK_RUN_LAST,
- object_class->type,
- GTK_SIGNAL_OFFSET (EazelInstallCallbackClass, save_transaction),
- eazel_install_gtk_marshal_BOOL__ENUM_POINTER,
- GTK_TYPE_BOOL, 2, GTK_TYPE_ENUM, GTK_TYPE_POINTER);
- signals[INSTALL_PROGRESS] =
- gtk_signal_new ("install_progress",
- GTK_RUN_LAST,
- object_class->type,
- GTK_SIGNAL_OFFSET (EazelInstallCallbackClass, install_progress),
- eazel_install_gtk_marshal_NONE__POINTER_INT_INT_INT_INT_INT_INT,
- GTK_TYPE_NONE, 7,
- GTK_TYPE_POINTER, GTK_TYPE_INT, GTK_TYPE_INT,
- GTK_TYPE_INT, GTK_TYPE_INT, GTK_TYPE_INT, GTK_TYPE_INT);
- signals[UNINSTALL_PROGRESS] =
- gtk_signal_new ("uninstall_progress",
- GTK_RUN_LAST,
- object_class->type,
- GTK_SIGNAL_OFFSET (EazelInstallCallbackClass, uninstall_progress),
- eazel_install_gtk_marshal_NONE__POINTER_INT_INT_INT_INT_INT_INT,
- GTK_TYPE_NONE, 7,
- GTK_TYPE_POINTER, GTK_TYPE_INT, GTK_TYPE_INT,
- GTK_TYPE_INT, GTK_TYPE_INT, GTK_TYPE_INT, GTK_TYPE_INT);
- signals[DOWNLOAD_FAILED] =
- gtk_signal_new ("download_failed",
- GTK_RUN_LAST,
- object_class->type,
- GTK_SIGNAL_OFFSET (EazelInstallCallbackClass, download_failed),
- gtk_marshal_NONE__POINTER,
- GTK_TYPE_NONE, 1, GTK_TYPE_POINTER);
- signals[MD5_CHECK_FAILED] =
- gtk_signal_new ("md5_check_failed",
- GTK_RUN_LAST,
- object_class->type,
- GTK_SIGNAL_OFFSET (EazelInstallCallbackClass, md5_check_failed),
- gtk_marshal_NONE__POINTER_POINTER,
- GTK_TYPE_NONE, 2, GTK_TYPE_POINTER, GTK_TYPE_POINTER);
- signals[INSTALL_FAILED] =
- gtk_signal_new ("install_failed",
- GTK_RUN_LAST,
- object_class->type,
- GTK_SIGNAL_OFFSET (EazelInstallCallbackClass, install_failed),
- gtk_marshal_NONE__POINTER,
- GTK_TYPE_NONE, 1, GTK_TYPE_POINTER);
- signals[UNINSTALL_FAILED] =
- gtk_signal_new ("uninstall_failed",
- GTK_RUN_LAST,
- object_class->type,
- GTK_SIGNAL_OFFSET (EazelInstallCallbackClass, uninstall_failed),
- gtk_marshal_NONE__POINTER,
- GTK_TYPE_NONE, 1, GTK_TYPE_POINTER);
- signals[DEPENDENCY_CHECK] =
- gtk_signal_new ("dependency_check",
- GTK_RUN_LAST,
- object_class->type,
- GTK_SIGNAL_OFFSET (EazelInstallCallbackClass, dependency_check),
- gtk_marshal_NONE__POINTER_POINTER,
- GTK_TYPE_NONE, 2, GTK_TYPE_POINTER, GTK_TYPE_POINTER);
- signals[DELETE_FILES] =
- gtk_signal_new ("delete_files",
- GTK_RUN_LAST,
- object_class->type,
- GTK_SIGNAL_OFFSET (EazelInstallCallbackClass, delete_files),
- gtk_marshal_BOOL__NONE,
- GTK_TYPE_BOOL, 0);
- signals[DONE] =
- gtk_signal_new ("done",
- GTK_RUN_LAST,
- object_class->type,
- GTK_SIGNAL_OFFSET (EazelInstallCallbackClass, done),
- gtk_marshal_NONE__BOOL,
- GTK_TYPE_NONE, 1, GTK_TYPE_BOOL);
- gtk_object_class_add_signals (object_class, signals, LAST_SIGNAL);
-}
-
-static void
-eazel_install_callback_initialize (EazelInstallCallback *service) {
- CORBA_Environment ev;
-
- g_assert (service != NULL);
- g_assert (EAZEL_IS_INSTALL_CALLBACK (service));
-
- CORBA_exception_init (&ev);
- service->cb = eazel_install_callback_create_corba_object (BONOBO_OBJECT (service));
-
- service->installservice_bonobo = bonobo_object_activate (OAF_ID, 0);
- if ( !service->installservice_bonobo) {
- g_warning ("Cannot activate %s\n", OAF_ID);
- } else {
- if (! bonobo_object_client_has_interface (service->installservice_bonobo, "IDL:Trilobite/Service:1.0", &ev)) {
- g_warning ("Object does not support IDL:Trilobite/Service:1.0");
- }
- if (! bonobo_object_client_has_interface (service->installservice_bonobo, "IDL:GNOME/Trilobite/Eazel/Install:1.0", &ev)) {
- g_warning ("Object does not support IDL:GNOME/Trilobite/Eazel/Install:1.0");
- }
- service->installservice_corba = bonobo_object_query_interface (BONOBO_OBJECT (service->installservice_bonobo),
- "IDL:GNOME/Trilobite/Eazel/Install:1.0");
- }
-
- /* This sets the bonobo structures in service using the corba object */
- if (!bonobo_object_construct (BONOBO_OBJECT (service), service->cb)) {
- g_warning ("bonobo_object_construct failed");
- }
-
- CORBA_exception_free (&ev);
-}
-
-GtkType
-eazel_install_callback_get_type (void)
-{
- static GtkType service_type = 0;
-
- /* First time it's called ? */
- if (!service_type)
- {
- static const GtkTypeInfo service_info =
- {
- "EazelInstallCallback",
- sizeof (EazelInstallCallback),
- sizeof (EazelInstallCallbackClass),
- (GtkClassInitFunc) eazel_install_callback_class_initialize,
- (GtkObjectInitFunc) eazel_install_callback_initialize,
- /* reserved_1 */ NULL,
- /* reserved_2 */ NULL,
- (GtkClassInitFunc) NULL,
- };
-
- service_type = gtk_type_unique (bonobo_object_get_type (), &service_info);
- }
-
- return service_type;
-}
-
-EazelInstallCallback *
-eazel_install_callback_new (void)
-{
- EazelInstallCallback *service;
-
- service = EAZEL_INSTALL_CALLBACK (gtk_object_new (TYPE_EAZEL_INSTALL_CALLBACK, NULL));
- if (! service->installservice_bonobo || ! service->installservice_corba) {
- bonobo_object_unref (BONOBO_OBJECT (service));
- service = NULL;
- }
-
- return service;
-}
-
-GNOME_Trilobite_Eazel_Install
-eazel_install_callback_corba_objref (EazelInstallCallback *service)
-{
- return service->installservice_corba;
-}
-
-BonoboObjectClient*
-eazel_install_callback_bonobo (EazelInstallCallback *service)
-{
- return service->installservice_bonobo;
-}
-
-void
-eazel_install_callback_install_packages (EazelInstallCallback *service,
- GList *categories,
- const char *root,
- CORBA_Environment *ev)
-{
- GNOME_Trilobite_Eazel_CategoryStructList *corbacats;
- corbacats = corba_category_list_from_categorydata_list (categories);
- GNOME_Trilobite_Eazel_Install_install_packages (service->installservice_corba,
- corbacats,
- root ? root : "",
- service->cb,
- ev);
-}
-
-void
-eazel_install_callback_uninstall_packages (EazelInstallCallback *service,
- GList *categories,
- const char *root,
- CORBA_Environment *ev)
-{
- GNOME_Trilobite_Eazel_CategoryStructList *corbacats;
- corbacats = corba_category_list_from_categorydata_list (categories);
- GNOME_Trilobite_Eazel_Install_uninstall_packages (service->installservice_corba,
- corbacats,
- root ? root : "",
- service->cb,
- ev);
-}
-
-GList*
-eazel_install_callback_simple_query (EazelInstallCallback *service,
- const char *query,
- const char *root,
- CORBA_Environment *ev)
-{
- GList *result;
- GNOME_Trilobite_Eazel_PackageDataStructList *corbares;
-
- corbares = GNOME_Trilobite_Eazel_Install_simple_query (service->installservice_corba,
- query,
- root ? root : "",
- ev);
- result = packagedata_list_from_corba_packagedatastructlist (corbares);
- CORBA_free (corbares);
-
- return result;
-}
-
-void
-eazel_install_callback_revert_transaction (EazelInstallCallback *service,
- const char *xmlfile,
- const char *root,
- CORBA_Environment *ev)
-{
- xmlDocPtr doc;
- xmlChar *mem;
- int size;
- CORBA_char *arg;
-
- doc = xmlParseFile (xmlfile);
- xmlDocDumpMemory (doc, &mem, &size);
- arg = CORBA_string_dup (mem);
- GNOME_Trilobite_Eazel_Install_revert_transaction (service->installservice_corba,
- arg,
- root ? root : "",
- service->cb,
- ev);
- CORBA_free (arg);
- g_free (mem);
- xmlFreeDoc (doc);
-}
-
-void
-eazel_install_callback_delete_files (EazelInstallCallback *service,
- CORBA_Environment *ev)
-{
- GNOME_Trilobite_Eazel_Install_delete_files (service->installservice_corba, ev);
-}
diff --git a/components/services/install/lib/eazel-install-corba-callback.h b/components/services/install/lib/eazel-install-corba-callback.h
deleted file mode 100644
index 67e00e2a0..000000000
--- a/components/services/install/lib/eazel-install-corba-callback.h
+++ /dev/null
@@ -1,171 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: Eskil Heyn Olsen <eskil@eazel.com>
- *
- */
-
-#ifndef EAZEL_INSTALL_CORBA_CALLBACK_H
-#define EAZEL_INSTALL_CORBA_CALLBACK_H
-
-#include <libgnome/gnome-defs.h>
-#include "bonobo.h"
-#include "trilobite-eazel-install.h"
-
-#include "eazel-package-system-types.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-#define TYPE_EAZEL_INSTALL_CALLBACK (eazel_install_callback_get_type ())
-#define EAZEL_INSTALL_CALLBACK(obj) (GTK_CHECK_CAST ((obj), TYPE_EAZEL_INSTALL_CALLBACK, EazelInstallCallback))
-#define EAZEL_INSTALL_CALLBACK_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), TYPE_EAZEL_INSTALL_CALLBACK, EazelInstallCallbackClass))
-#define EAZEL_IS_INSTALL_CALLBACK(obj) (GTK_CHECK_TYPE ((obj), TYPE_EAZEL_INSTALL_CALLBACK))
-#define EAZEL_IS_INSTALL_CALLBACK_CLASS(klass)(GTK_CHECK_CLASS_TYPE ((klass), TYPE_EAZEL_INSTALL_CALLBACK))
-
-typedef struct _EazelInstallCallback EazelInstallCallback;
-typedef struct _EazelInstallCallbackClass EazelInstallCallbackClass;
-
-typedef enum EazelInstallCallbackOperation {
- EazelInstallCallbackOperation_INSTALL,
- EazelInstallCallbackOperation_UNINSTALL,
- EazelInstallCallbackOperation_REVERT
-} EazelInstallCallbackOperation;
-
-struct _EazelInstallCallbackClass
-{
- BonoboObjectClass parent_class;
-
- /* Called during the download of a file */
- void (*download_progress) (EazelInstallCallback *service, const char *name, int amount, int total);
-
- /* Called after download and before (un)install_progress */
- gboolean (*preflight_check) (EazelInstallCallback *service,
- EazelInstallCallbackOperation op,
- const GList *packages,
- int total_size,
- int num_packages);
-
- /* Called after (un)install progress and done, only if
- result is good */
- gboolean (*save_transaction) (EazelInstallCallback *service,
- EazelInstallCallbackOperation op,
- const GList *packages);
-
- /* Called during install of a package */
- void (*install_progress) (EazelInstallCallback *service,
- const PackageData *pack,
- int package_num, int num_packages,
- int package_size_completed, int package_size_total,
- int total_size_completed, int total_size);
- /* Called during uninstall of a package */
- void (*uninstall_progress) (EazelInstallCallback *service,
- const PackageData *pack,
- int package_num, int num_packages,
- int package_size_completed, int package_size_total,
- int total_size_completed, int total_size);
-
- /* Called when a package is undergoing the different checks */
- void (*file_conflict_check)(EazelInstallCallback *service, const PackageData *package);
- void (*file_uniqueness_check)(EazelInstallCallback *service, const PackageData *package);
- void (*feature_consistency_check)(EazelInstallCallback *service, const PackageData *package);
-
- /* Called when a dependency check is being resolved */
- void (*dependency_check) (EazelInstallCallback *service, const PackageData *package, const PackageData *needed );
-
- /* Called when a file could not be downloaded */
- void (*download_failed) (EazelInstallCallback *service, char *name);
- /* Called when a package install request fails, eg. for dependency reasons.
- pd->soft_depends and pd->breaks can be traversed to see why the package
- failed */
- void (*install_failed) (EazelInstallCallback *service, PackageData *pd);
- /* Same as install_failed... */
- void (*uninstall_failed) (EazelInstallCallback *service, PackageData *pd);
-
- /* Emitted when the md5 checksum fails for a package file.
- pd contains the md5 that the package file should have,
- and actual_md5 contains the actual md5 of the package file */
- void (*md5_check_failed) (EazelInstallCallback *service,
- const PackageData *pd,
- const char *actual_md5);
-
- /* Called after installation to determine if the RPM files should be deleted */
- gboolean (*delete_files) (EazelInstallCallback *service);
-
- /* Called when the operation is complete */
- void (*done) (gboolean result);
-
- gpointer servant_vepv;
-};
-
-struct _EazelInstallCallback
-{
- BonoboObject parent;
- GNOME_Trilobite_Eazel_InstallCallback cb;
-
- BonoboObjectClient *installservice_bonobo;
- GNOME_Trilobite_Eazel_Install installservice_corba;
-};
-
-/* Create a new eazel-install-callback object */
-EazelInstallCallback *eazel_install_callback_new (void);
-/* Destroy the eazel-install-callback object */
-void eazel_install_callback_unref (GtkObject *object);
-
-/* Request the installation of a set of packages in categories.
- If categories = NULL, the service tries to fetch the packagelist
- from the server. See the trilobite-eazel-install.idl file for
- the function to specify packagelist name */
-void eazel_install_callback_install_packages (EazelInstallCallback *service,
- GList *categories,
- const char *root,
- CORBA_Environment *ev);
-
-/* Request the uninstallation of a set of packages */
-void eazel_install_callback_uninstall_packages (EazelInstallCallback *service,
- GList *categories,
- const char *root,
- CORBA_Environment *ev);
-
-GList* eazel_install_callback_simple_query (EazelInstallCallback *service,
- const char* query,
- const char *root,
- CORBA_Environment *ev);
-
-void eazel_install_callback_revert_transaction (EazelInstallCallback *service,
- const char *xmlfile,
- const char *root,
- CORBA_Environment *ev);
-
-void eazel_install_callback_delete_files (EazelInstallCallback *service,
- CORBA_Environment *ev);
-
-/* Stuff */
-GtkType eazel_install_callback_get_type (void);
-POA_GNOME_Trilobite_Eazel_InstallCallback__epv *eazel_install_callback_get_epv (void);
-GNOME_Trilobite_Eazel_InstallCallback eazel_install_callback_create_corba_object (BonoboObject *service);
-GNOME_Trilobite_Eazel_Install eazel_install_callback_corba_objref (EazelInstallCallback *service);
-BonoboObjectClient *eazel_install_callback_bonobo (EazelInstallCallback *service);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* EAZEL_INSTALL_CORBA_CALLBACK_H */
diff --git a/components/services/install/lib/eazel-install-corba-types.c b/components/services/install/lib/eazel-install-corba-types.c
deleted file mode 100644
index adfe8dab6..000000000
--- a/components/services/install/lib/eazel-install-corba-types.c
+++ /dev/null
@@ -1,650 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Copyright (C) 2000 Eazel, Inc
- * Copyright (C) 2000 Helix Code, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: Eskil Heyn Olsen <eskil@eazel.com>
- * Robey Pointer <robey@eazel.com>
- */
-
-#include "eazel-install-corba-types.h"
-#include "eazel-softcat.h"
-#include <libtrilobite/trilobite-core-utils.h>
-#include <libtrilobite/trilobite-core-distribution.h>
-
-static GList*
-corba_string_sequence_to_glist (const CORBA_sequence_CORBA_string *string_list)
-{
- GList *result = NULL;
- guint iterator;
-
- for (iterator = 0; iterator < string_list->_length; iterator++) {
- result = g_list_prepend (result, g_strdup (string_list->_buffer[iterator]));
- }
- return result;
-}
-
-static void
-g_list_to_corba_string_sequence (CORBA_sequence_CORBA_string *sequence, GList *string_list)
-{
- GList *iterator;
- int i = 0;
-
- sequence->_length = g_list_length (string_list);
- sequence->_buffer = CORBA_sequence_CORBA_string_allocbuf (sequence->_length);
- for (iterator = string_list; iterator; iterator = g_list_next (iterator)) {
- sequence->_buffer[i] = CORBA_string_dup ((char*)iterator->data);
- i++;
- }
-}
-
-static void
-corba_packagedatastruct_fill_from_packagedata (GNOME_Trilobite_Eazel_PackageDataStruct *corbapack,
- const PackageData *pack)
-{
- corbapack->name = pack->name ? CORBA_string_dup (pack->name) : CORBA_string_dup ("");
- corbapack->eazel_id = pack->eazel_id ? CORBA_string_dup (pack->eazel_id) : CORBA_string_dup ("");
- corbapack->suite_id = pack->suite_id ? CORBA_string_dup (pack->suite_id) : CORBA_string_dup ("");
- corbapack->version = pack->version ? CORBA_string_dup (pack->version) : CORBA_string_dup ("");
- corbapack->archtype = pack->archtype ? CORBA_string_dup (pack->archtype) : CORBA_string_dup ("");
- corbapack->filename = pack->filename ? CORBA_string_dup (pack->filename) : CORBA_string_dup ("");
-
- corbapack->install_root = pack->install_root ? CORBA_string_dup (pack->install_root) : CORBA_string_dup ("");
- corbapack->md5 = pack->md5 ? CORBA_string_dup (pack->md5) : CORBA_string_dup ("");
-
- if (pack->distribution.name == DISTRO_UNKNOWN) {
- TrilobiteDistributionInfo dist;
- dist = trilobite_get_distribution ();
- corbapack->distribution.name =
- CORBA_string_dup (trilobite_get_distribution_name (dist, FALSE, FALSE));
- corbapack->distribution.major = dist.version_major;
- corbapack->distribution.minor = dist.version_minor;
- } else {
- corbapack->distribution.name =
- CORBA_string_dup (trilobite_get_distribution_name (pack->distribution, FALSE, FALSE));
- corbapack->distribution.major = pack->distribution.version_major;
- corbapack->distribution.minor = pack->distribution.version_minor;
- }
- corbapack->release = pack->minor ? CORBA_string_dup (pack->minor) : CORBA_string_dup ("");
- corbapack->summary = pack->summary ? CORBA_string_dup (pack->summary) : CORBA_string_dup ("");
- corbapack->description = pack->description ? CORBA_string_dup (pack->description) : CORBA_string_dup ("");
- corbapack->bytesize = pack->bytesize;
- corbapack->filesize = pack->filesize;
- corbapack->toplevel = pack->toplevel;
- corbapack->anchor = FALSE;
-
- switch (pack->status) {
- case PACKAGE_UNKNOWN_STATUS:
- corbapack->status = GNOME_Trilobite_Eazel_UNKNOWN_STATUS;
- break;
- case PACKAGE_SOURCE_NOT_SUPPORTED:
- corbapack->status = GNOME_Trilobite_Eazel_SOURCE_NOT_SUPPORTED;
- break;
- case PACKAGE_DEPENDENCY_FAIL:
- corbapack->status = GNOME_Trilobite_Eazel_DEPENDENCY_FAIL;
- break;
- case PACKAGE_FILE_CONFLICT:
- corbapack->status = GNOME_Trilobite_Eazel_FILE_CONFLICT;
- break;
- case PACKAGE_BREAKS_DEPENDENCY:
- corbapack->status = GNOME_Trilobite_Eazel_BREAKS_DEPENDENCY;
- break;
- case PACKAGE_INVALID:
- corbapack->status = GNOME_Trilobite_Eazel_INVALID;
- break;
- case PACKAGE_CANNOT_OPEN:
- corbapack->status = GNOME_Trilobite_Eazel_CANNOT_OPEN;
- break;
- case PACKAGE_PARTLY_RESOLVED:
- corbapack->status = GNOME_Trilobite_Eazel_PARTLY_RESOLVED;
- break;
- case PACKAGE_RESOLVED:
- corbapack->status = GNOME_Trilobite_Eazel_RESOLVED;
- break;
- case PACKAGE_ALREADY_INSTALLED:
- corbapack->status = GNOME_Trilobite_Eazel_ALREADY_INSTALLED;
- break;
- case PACKAGE_CANCELLED:
- corbapack->status = GNOME_Trilobite_Eazel_CANCELLED;
- break;
- case PACKAGE_CIRCULAR_DEPENDENCY:
- corbapack->status = GNOME_Trilobite_Eazel_CIRCULAR_DEPENDENCY;
- break;
- case PACKAGE_PACKSYS_FAILURE:
- corbapack->status = GNOME_Trilobite_Eazel_PACKSYS_FAILURE;
- }
-
- switch (pack->modify_status) {
- case PACKAGE_MOD_UNTOUCHED:
- corbapack->modify_status = GNOME_Trilobite_Eazel_UNTOUCHED;
- break;
- case PACKAGE_MOD_UPGRADED:
- corbapack->modify_status = GNOME_Trilobite_Eazel_UPGRADED;
- break;
- case PACKAGE_MOD_DOWNGRADED:
- corbapack->modify_status = GNOME_Trilobite_Eazel_DOWNGRADED;
- break;
- case PACKAGE_MOD_INSTALLED:
- corbapack->modify_status = GNOME_Trilobite_Eazel_INSTALLED;
- break;
- case PACKAGE_MOD_UNINSTALLED:
- corbapack->modify_status = GNOME_Trilobite_Eazel_UNINSTALLED;
- break;
- }
-
-
- /* depends will be filled in later on, if they're required --
- * many times, this function is called to create a single corba package with no other package pointers */
- corbapack->depends._length = 0;
- corbapack->depends._buffer = NULL;
- corbapack->breaks._length = 0;
- corbapack->breaks._buffer = NULL;
- corbapack->modifies._length = 0;
- corbapack->modifies._buffer = NULL;
- corbapack->provides._length = 0;
- corbapack->provides._buffer = NULL;
- corbapack->features._length = 0;
- corbapack->features._buffer = NULL;
-}
-
-GNOME_Trilobite_Eazel_PackageDataStruct *
-corba_packagedatastruct_from_packagedata (const PackageData *pack)
-{
- GNOME_Trilobite_Eazel_PackageDataStruct *corbapack;
-
- corbapack = GNOME_Trilobite_Eazel_PackageDataStruct__alloc ();
- corba_packagedatastruct_fill_from_packagedata (corbapack, pack);
-
- return corbapack;
-}
-
-static void
-corba_packagedatastructlist_fill_from_packagedata_list (GNOME_Trilobite_Eazel_PackageDataStructList *packagelist,
- GList *packages)
-{
- guint i;
-
- packagelist->_length = g_list_length (packages);
- packagelist->_buffer = CORBA_sequence_GNOME_Trilobite_Eazel_PackageDataStruct_allocbuf (packagelist->_length);
- for (i = 0; i < packagelist->_length; i++) {
- PackageData *pack;
- pack = PACKAGEDATA (g_list_nth (packages, i)->data);
- corba_packagedatastruct_fill_from_packagedata (&(packagelist->_buffer[i]), pack);
- }
-}
-
-GNOME_Trilobite_Eazel_PackageDataStructList *
-corba_packagedatastructlist_from_packagedata_list (GList *packages)
-{
- GNOME_Trilobite_Eazel_PackageDataStructList *packagelist;
-
- packagelist = GNOME_Trilobite_Eazel_PackageDataStructList__alloc ();
- corba_packagedatastructlist_fill_from_packagedata_list (packagelist, packages);
- return packagelist;
-}
-
-static char *
-new_fake_md5 (void)
-{
- static unsigned long counter = 23;
-
- return g_strdup_printf ("FAKE-MD5-#%lu", counter++);
-}
-
-/* burrow through a package tree and stick them all into an MD5 hashtable */
-static void
-traverse_packagetree_md5 (const PackageData *pack, GHashTable *md5_table)
-{
- PackageDependency *dep;
- PackageData *subpack;
- PackageBreaks *pbreak;
- GList *iter;
-
- if (pack->md5 == NULL) {
- PACKAGEDATA (pack)->md5 = new_fake_md5 ();
- }
-
- if (g_hash_table_lookup (md5_table, pack->md5) != NULL) {
- /* already touched this package */
- return;
- }
-
- g_hash_table_insert (md5_table, pack->md5, (void *)pack);
- for (iter = g_list_first (pack->depends); iter != NULL; iter = g_list_next (iter)) {
- dep = (PackageDependency *)(iter->data);
- g_assert (dep);
- traverse_packagetree_md5 (dep->package, md5_table);
- }
- for (iter = g_list_first (pack->breaks); iter != NULL; iter = g_list_next (iter)) {
- pbreak = PACKAGEBREAKS (iter->data);
- traverse_packagetree_md5 (packagebreaks_get_package (pbreak), md5_table);
- }
- for (iter = g_list_first (pack->modifies); iter != NULL; iter = g_list_next (iter)) {
- subpack = PACKAGEDATA (iter->data);
- traverse_packagetree_md5 (subpack, md5_table);
- }
-}
-
-/* given a filled-in corba package, fill in the deps/breaks/modifies fields.
- * we replace the pointers with MD5 strings, which we previously guaranteed were present (and ought to be unique).
- */
-static void
-corba_packagedatastruct_fill_deps (GNOME_Trilobite_Eazel_PackageDataStruct *corbapack,
- const PackageData *pack,
- GHashTable *md5_table)
-{
- GNOME_Trilobite_Eazel_PackageDependencyStruct *corbadep;
- PackageDependency *dep;
- PackageBreaks *pbreak;
- PackageFileConflict *pbreakfile;
- PackageFeatureMissing *pbreakfeature;
- PackageData *subpack;
- GList *iter;
- char *sense_str;
- int i;
-
- if (pack->depends != NULL) {
- corbapack->depends._length = g_list_length (pack->depends);
- corbapack->depends._buffer = CORBA_sequence_GNOME_Trilobite_Eazel_PackageDependencyStruct_allocbuf (corbapack->depends._length);
-
- for (iter = g_list_first (pack->depends), i = 0;
- iter != NULL;
- iter = g_list_next (iter), i++) {
- dep = (PackageDependency *)(iter->data);
-
- /* set up a PackageDependencyStruct for it */
- g_assert (dep);
- corbadep = &(corbapack->depends._buffer[i]);
- sense_str = eazel_softcat_sense_flags_to_string (dep->sense);
- corbadep->sense = CORBA_string_dup (sense_str);
- corbadep->version = CORBA_string_dup ((dep->version != NULL) ? dep->version : "");
- corbadep->package_md5 = CORBA_string_dup (dep->package->md5);
- g_free (sense_str);
- }
- g_assert (i!=0);
- }
-
- if (pack->breaks != NULL) {
- corbapack->breaks._length = g_list_length (pack->breaks);
- corbapack->breaks._buffer = CORBA_sequence_GNOME_Trilobite_Eazel_PackageBreaksStruct_allocbuf (corbapack->breaks._length);
- for (iter = g_list_first (pack->breaks), i = 0;
- iter != NULL;
- iter = g_list_next (iter), i++) {
- pbreak = PACKAGEBREAKS (iter->data);
- g_assert (IS_VALID_PACKAGEBREAKS (pbreak));
- corbapack->breaks._buffer[i].package_md5 = CORBA_string_dup (packagebreaks_get_package (pbreak)->md5);
- /* dealing with unions in corba is a pure delight. */
- if (IS_PACKAGEFILECONFLICT (pbreak)) {
- pbreakfile = PACKAGEFILECONFLICT (pbreak);
- corbapack->breaks._buffer[i].u._d = GNOME_Trilobite_Eazel_PACKAGE_FILE_CONFLICT;
- g_list_to_corba_string_sequence (&(corbapack->breaks._buffer[i].u._u.files), pbreakfile->files);
- } else if (IS_PACKAGEFEATUREMISSING (pbreak)) {
- pbreakfeature = PACKAGEFEATUREMISSING (pbreak);
- corbapack->breaks._buffer[i].u._d = GNOME_Trilobite_Eazel_PACKAGE_FEATURE_MISSING;
- g_list_to_corba_string_sequence (&(corbapack->breaks._buffer[i].u._u.features), pbreakfeature->features);
- } else {
- g_assert_not_reached ();
- }
- }
- }
-
- if (pack->modifies != NULL) {
- corbapack->modifies._length = g_list_length (pack->modifies);
- corbapack->modifies._buffer = CORBA_sequence_CORBA_string_allocbuf (corbapack->modifies._length);
- for (iter = g_list_first (pack->modifies), i = 0;
- iter != NULL;
- iter = g_list_next (iter), i++) {
- subpack = PACKAGEDATA (iter->data);
- corbapack->modifies._buffer[i] = CORBA_string_dup (subpack->md5);
- }
- }
-
- if (pack->provides != NULL) {
- g_list_to_corba_string_sequence (&(corbapack->provides), pack->provides);
- }
- if (pack->features != NULL) {
- g_list_to_corba_string_sequence (&(corbapack->features), pack->features);
- }
-}
-
-static void
-corba_packagedatastructlist_foreach (const char *key, const PackageData *package, GList **list)
-{
- *list = g_list_prepend (*list, (void *)package);
-}
-
-/* flatten a package tree (really a directed graph) into a list of packages,
- * changing all the depends/breaks/modifies pointers into lists of MD5's
- */
-GNOME_Trilobite_Eazel_PackageDataStructList *
-corba_packagedatastructlist_from_packagedata_tree (GList *packlist)
-{
- GNOME_Trilobite_Eazel_PackageDataStructList *corbalist;
- GHashTable *md5_table; /* GHashTable<char* md5, PackageData *> */
- GList *list, *iter;
- PackageData *package;
- int i;
-
- md5_table = g_hash_table_new (g_str_hash, g_str_equal);
- for (iter = g_list_first (packlist); iter != NULL; iter = g_list_next (iter)) {
- package = PACKAGEDATA (iter->data);
- traverse_packagetree_md5 (package, md5_table);
- }
-
- /* convert hashtable of MD5=>PackageData into GList<PackageData *> */
- list = NULL;
- g_hash_table_foreach (md5_table, (GHFunc)corba_packagedatastructlist_foreach, &list);
-
- /* build up actual corba list from the flattened tree */
- corbalist = GNOME_Trilobite_Eazel_PackageDataStructList__alloc ();
- corbalist->_length = g_list_length (list);
- corbalist->_buffer = CORBA_sequence_GNOME_Trilobite_Eazel_PackageDataStruct_allocbuf (corbalist->_length);
- for (iter = g_list_first (list), i = 0; iter != NULL; iter = g_list_next (iter), i++) {
- package = PACKAGEDATA (iter->data);
- corba_packagedatastruct_fill_from_packagedata (&(corbalist->_buffer[i]), package);
- corba_packagedatastruct_fill_deps (&(corbalist->_buffer[i]), package, md5_table);
- if (g_list_find (packlist, package) != NULL) {
- /* one of the anchor packages */
- corbalist->_buffer[i].anchor = TRUE;
- }
- }
-
- g_hash_table_destroy (md5_table);
- g_list_free (list);
-
- return corbalist;
-}
-
-PackageData*
-packagedata_from_corba_packagedatastruct (const GNOME_Trilobite_Eazel_PackageDataStruct *corbapack)
-{
- PackageData *pack;
-
- pack = packagedata_new();
- pack->name = strlen (corbapack->name) ? g_strdup (corbapack->name) : NULL;
- pack->eazel_id = strlen (corbapack->eazel_id) ? g_strdup (corbapack->eazel_id) : NULL;
- pack->suite_id = strlen (corbapack->suite_id) ? g_strdup (corbapack->suite_id) : NULL;
- pack->version = strlen (corbapack->version) ? g_strdup (corbapack->version) : NULL;
- pack->minor = strlen (corbapack->release) ? g_strdup (corbapack->release) : NULL;
- pack->archtype = strlen (corbapack->archtype) ? g_strdup (corbapack->archtype) : NULL;
- pack->filename = strlen (corbapack->filename) ? g_strdup (corbapack->filename) : NULL;
- pack->summary = strlen (corbapack->summary) ? g_strdup (corbapack->summary) : NULL;
- pack->description = strlen (corbapack->description) ? g_strdup (corbapack->description) : NULL;
- pack->toplevel = corbapack->toplevel;
- pack->bytesize = corbapack->bytesize;
- pack->filesize = corbapack->filesize;
-
- pack->install_root = strlen (corbapack->install_root) ? g_strdup (corbapack->install_root) : NULL;
- pack->md5 = strlen (corbapack->md5) ? g_strdup (corbapack->md5) : NULL;
-
- pack->distribution.name = trilobite_get_distribution_enum (corbapack->distribution.name, FALSE);
- pack->distribution.version_major = corbapack->distribution.major;
- pack->distribution.version_minor = corbapack->distribution.minor;
-
- switch (corbapack->status) {
- case GNOME_Trilobite_Eazel_UNKNOWN_STATUS:
- pack->status = PACKAGE_UNKNOWN_STATUS;
- break;
- case GNOME_Trilobite_Eazel_SOURCE_NOT_SUPPORTED:
- pack->status = PACKAGE_SOURCE_NOT_SUPPORTED;
- break;
- case GNOME_Trilobite_Eazel_DEPENDENCY_FAIL:
- pack->status = PACKAGE_DEPENDENCY_FAIL;
- break;
- case GNOME_Trilobite_Eazel_FILE_CONFLICT:
- pack->status = PACKAGE_FILE_CONFLICT;
- break;
- case GNOME_Trilobite_Eazel_BREAKS_DEPENDENCY:
- pack->status = PACKAGE_BREAKS_DEPENDENCY;
- break;
- case GNOME_Trilobite_Eazel_INVALID:
- pack->status = PACKAGE_INVALID;
- break;
- case GNOME_Trilobite_Eazel_CANNOT_OPEN:
- pack->status = PACKAGE_CANNOT_OPEN;
- break;
- case GNOME_Trilobite_Eazel_PARTLY_RESOLVED:
- pack->status = PACKAGE_PARTLY_RESOLVED;
- break;
- case GNOME_Trilobite_Eazel_ALREADY_INSTALLED:
- pack->status = PACKAGE_ALREADY_INSTALLED;
- break;
- case GNOME_Trilobite_Eazel_CANCELLED:
- pack->status = PACKAGE_CANCELLED;
- break;
- case GNOME_Trilobite_Eazel_CIRCULAR_DEPENDENCY:
- pack->status = PACKAGE_CIRCULAR_DEPENDENCY;
- break;
- case GNOME_Trilobite_Eazel_RESOLVED:
- pack->status = PACKAGE_RESOLVED;
- break;
- case GNOME_Trilobite_Eazel_PACKSYS_FAILURE:
- pack->status = PACKAGE_PACKSYS_FAILURE;
- break;
- }
-
- switch (corbapack->modify_status) {
- case GNOME_Trilobite_Eazel_UNTOUCHED:
- pack->modify_status = PACKAGE_MOD_UNTOUCHED;
- break;
- case GNOME_Trilobite_Eazel_UPGRADED:
- pack->modify_status = PACKAGE_MOD_UPGRADED;
- break;
- case GNOME_Trilobite_Eazel_DOWNGRADED:
- pack->modify_status = PACKAGE_MOD_DOWNGRADED;
- break;
- case GNOME_Trilobite_Eazel_INSTALLED:
- pack->modify_status = PACKAGE_MOD_INSTALLED;
- break;
- case GNOME_Trilobite_Eazel_UNINSTALLED:
- pack->modify_status = PACKAGE_MOD_UNINSTALLED;
- break;
- }
-
- return pack;
-}
-
-GList*
-packagedata_list_from_corba_packagedatastructlist (const GNOME_Trilobite_Eazel_PackageDataStructList *corbapack)
-{
- PackageData *pack;
- GList *result;
- guint i;
-
- result = NULL;
-
- for (i = 0; i < corbapack->_length; i++) {
- pack = packagedata_from_corba_packagedatastruct (&(corbapack->_buffer[i]));
- result = g_list_prepend (result, pack);
- }
- result = g_list_reverse (result);
-
- return result;
-}
-
-static gboolean
-empty_hash_table (char *key,
- PackageData *pack,
- gpointer unused)
-{
- gtk_object_unref (GTK_OBJECT (pack));
- return TRUE;
-}
-
-/* inflate a corba package list into a full-blown package tree (really a
- * directed graph), by converting the soft MD5 pointers into physical ones.
- */
-GList *
-packagedata_tree_from_corba_packagedatastructlist (const GNOME_Trilobite_Eazel_PackageDataStructList *corbalist)
-{
- GList *packlist, *outlist, *iter;
- PackageData *pack, *subpack;
- PackageDependency *dep;
- PackageFileConflict *pbreakfile;
- PackageFeatureMissing *pbreakfeature;
- GNOME_Trilobite_Eazel_PackageDataStruct *corbapack;
- GNOME_Trilobite_Eazel_PackageDependencyStruct *corbadep;
- GHashTable *md5_table;
- guint i, j;
-
- packlist = packagedata_list_from_corba_packagedatastructlist (corbalist);
- md5_table = g_hash_table_new (g_str_hash, g_str_equal);
-
- /* first, populate the MD5 hashtable */
- for (iter = g_list_first (packlist); iter != NULL; iter = g_list_next (iter)) {
- pack = PACKAGEDATA (iter->data);
- if (pack->md5 == NULL) {
- pack->md5 = new_fake_md5 ();
- }
- g_hash_table_insert (md5_table, pack->md5, pack);
- }
-
- /* now, resolve MD5 "soft" references between packages */
- for (i = 0; i < corbalist->_length; i++) {
- pack = PACKAGEDATA (g_hash_table_lookup (md5_table, corbalist->_buffer[i].md5));
- g_assert (pack != NULL);
- corbapack = &(corbalist->_buffer[i]);
-
- for (j = 0; j < corbapack->depends._length; j++) {
- corbadep = &(corbapack->depends._buffer[j]);
- dep = packagedependency_new ();
- dep->sense = eazel_softcat_string_to_sense_flags (corbadep->sense);
- dep->version = g_strdup (corbadep->version);
- dep->package = PACKAGEDATA (g_hash_table_lookup (md5_table, corbadep->package_md5));
- gtk_object_ref (GTK_OBJECT (dep->package));
- if (dep->package == NULL) {
- g_warning ("corba unpack: can't follow md5 soft pointer '%s'", corbadep->package_md5);
- g_free (dep);
- } else {
- dep->package->toplevel = FALSE;
- pack->depends = g_list_prepend (pack->depends, dep);
- }
- }
-
- pack->depends = g_list_reverse (pack->depends);
-
- for (j = 0; j < corbapack->breaks._length; j++) {
- subpack = g_hash_table_lookup (md5_table, corbapack->breaks._buffer[j].package_md5);
- if (subpack == NULL) {
- g_warning ("corba unpack: can't follow md5 soft pointer '%s'", corbapack->breaks._buffer[j].package_md5);
- } else {
- subpack->toplevel = FALSE;
- switch (corbapack->breaks._buffer[j].u._d) {
- case GNOME_Trilobite_Eazel_PACKAGE_FILE_CONFLICT:
- pbreakfile = packagefileconflict_new ();
- packagebreaks_set_package (PACKAGEBREAKS (pbreakfile), subpack);
- pbreakfile->files = corba_string_sequence_to_glist (&(corbapack->breaks._buffer[j].u._u.files));
- packagedata_add_to_breaks (pack, PACKAGEBREAKS (pbreakfile));
- gtk_object_unref (GTK_OBJECT (pbreakfile));
- break;
- case GNOME_Trilobite_Eazel_PACKAGE_FEATURE_MISSING:
- pbreakfeature = packagefeaturemissing_new ();
- packagebreaks_set_package (PACKAGEBREAKS (pbreakfeature), subpack);
- pbreakfeature->features = corba_string_sequence_to_glist (&(corbapack->breaks._buffer[j].u._u.features));
- packagedata_add_to_breaks (pack, PACKAGEBREAKS (pbreakfeature));
- gtk_object_unref (GTK_OBJECT (pbreakfeature));
- break;
- default:
- g_assert_not_reached ();
- }
- }
- }
- pack->breaks = g_list_reverse (pack->breaks);
-
- for (j = 0; j < corbapack->modifies._length; j++) {
- subpack = g_hash_table_lookup (md5_table, corbapack->modifies._buffer[j]);
- if (subpack == NULL) {
- g_warning ("corba unpack: can't follow md5 soft pointer '%s'", corbapack->modifies._buffer[j]);
- } else {
- subpack->toplevel = FALSE;
- pack->modifies = g_list_prepend (pack->modifies, subpack);
- gtk_object_ref (GTK_OBJECT (subpack));
- }
- }
- pack->modifies = g_list_reverse (pack->modifies);
-
- pack->provides = corba_string_sequence_to_glist (&(corbapack->provides));
- pack->features = corba_string_sequence_to_glist (&(corbapack->features));
- }
-
- /* now make a list of JUST the toplevel packages */
- outlist = NULL;
- for (i = 0; i < corbalist->_length; i++) {
- if (corbalist->_buffer[i].anchor) {
- pack = g_hash_table_lookup (md5_table, corbalist->_buffer[i].md5);
- gtk_object_ref (GTK_OBJECT (pack));
- outlist = g_list_prepend (outlist, pack);
- }
- }
- g_list_free (packlist);
-
- g_hash_table_foreach_remove (md5_table, (GHRFunc)empty_hash_table, NULL);
- g_hash_table_destroy (md5_table);
-
- return outlist;
-}
-
-GNOME_Trilobite_Eazel_CategoryStructList*
-corba_category_list_from_categorydata_list (GList *categories)
-{
- GNOME_Trilobite_Eazel_CategoryStructList *corbacats;
- GList *iterator;
- int i;
-
- corbacats = GNOME_Trilobite_Eazel_CategoryStructList__alloc ();
- corbacats->_length = g_list_length (categories);
- corbacats->_buffer = CORBA_sequence_GNOME_Trilobite_Eazel_CategoryStruct_allocbuf (corbacats->_length);
-
- i = 0;
- for (iterator = categories; iterator; iterator = iterator->next) {
- CategoryData *cat;
-
- cat = (CategoryData *)iterator->data;
- corbacats->_buffer[i].name = CORBA_string_dup ((cat->name != NULL) ? cat->name : "");
- corba_packagedatastructlist_fill_from_packagedata_list (&(corbacats->_buffer[i].packages), cat->packages);
- i++;
- }
- return corbacats;
-}
-
-GList*
-categorydata_list_from_corba_categorystructlist (const GNOME_Trilobite_Eazel_CategoryStructList *corbacategories)
-{
- GList *categories;
- guint i;
-
- categories = NULL;
-
- for (i = 0; i < corbacategories->_length; i++) {
- CategoryData *category;
- GList *packages;
- GNOME_Trilobite_Eazel_CategoryStruct *corbacategory;
- GNOME_Trilobite_Eazel_PackageDataStructList *packagelist;
-
- packages = NULL;
- corbacategory = &(corbacategories->_buffer[i]);
- packagelist = &(corbacategory->packages);
-
- category = categorydata_new ();
- category->name = (strlen (corbacategory->name) > 0) ? g_strdup (corbacategory->name) : NULL;
- category->packages = packagedata_list_from_corba_packagedatastructlist (packagelist);
- categories = g_list_prepend (categories, category);
- }
-
- return categories;
-}
diff --git a/components/services/install/lib/eazel-install-corba-types.h b/components/services/install/lib/eazel-install-corba-types.h
deleted file mode 100644
index ae727e81e..000000000
--- a/components/services/install/lib/eazel-install-corba-types.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Copyright (C) 2000 Eazel, Inc
- * Copyright (C) 2000 Helix Code, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: Eskil Heyn Olsen <eskil@eazel.com>
- */
-
-#ifndef EAZEL_INSTALL_SERVICES_CORBA_TYPES_H
-#define EAZEL_INSTALL_SERVICES_CORBA_TYPES_H
-
-#include <eazel-package-system-types.h>
-#include <trilobite-eazel-install.h>
-#include <glib.h>
-
-GNOME_Trilobite_Eazel_PackageDataStruct* corba_packagedatastruct_from_packagedata (const PackageData *pack);
-
-GNOME_Trilobite_Eazel_PackageDataStructList* corba_packagedatastructlist_from_packagedata_list (GList *packages);
-
-GNOME_Trilobite_Eazel_PackageDataStructList* corba_packagedatastructlist_from_packagedata_tree (GList *packlist);
-
-GNOME_Trilobite_Eazel_CategoryStructList* corba_category_list_from_categorydata_list (GList *categories);
-
-PackageData* packagedata_from_corba_packagedatastruct (const GNOME_Trilobite_Eazel_PackageDataStruct *corbapack);
-
-GList* packagedata_list_from_corba_packagedatastructlist (const GNOME_Trilobite_Eazel_PackageDataStructList *corbapack);
-
-GList* packagedata_tree_from_corba_packagedatastructlist (const GNOME_Trilobite_Eazel_PackageDataStructList *corbalist);
-
-GList* categorydata_list_from_corba_categorystructlist (const GNOME_Trilobite_Eazel_CategoryStructList *corbacategories);
-
-#endif /* EAZEL_INSTALL_SERVICES_TYPES_H */
diff --git a/components/services/install/lib/eazel-install-corba.c b/components/services/install/lib/eazel-install-corba.c
deleted file mode 100644
index b0d110210..000000000
--- a/components/services/install/lib/eazel-install-corba.c
+++ /dev/null
@@ -1,604 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: Eskil Heyn Olsen <eskil@eazel.com>
- *
- */
-
-#include <config.h>
-#include <gnome.h>
-
-#ifndef EAZEL_INSTALL_NO_CORBA
-#include <liboaf/liboaf.h>
-#include <bonobo.h>
-#include <libtrilobite/libtrilobite.h>
-
-#include "trilobite-eazel-install.h"
-#include "eazel-install-public.h"
-#include "eazel-install-private.h"
-#include "eazel-install-corba-types.h"
-#include "eazel-install-query.h"
-
-#define RELEASE_CB if (servant->object->callback != CORBA_OBJECT_NIL) { \
- CORBA_Object_release (servant->object->callback, ev); \
-}
-#define SET_CB(cb) servant->object->callback = CORBA_Object_duplicate(cb, ev)
-
-/*****************************************
- Corba stuff
-*****************************************/
-
-typedef struct {
- POA_GNOME_Trilobite_Eazel_Install poa;
- EazelInstall *object;
-} impl_POA_GNOME_Trilobite_Eazel_Install;
-
-static void
-impl_Eazel_Install_install(impl_POA_GNOME_Trilobite_Eazel_Install *servant,
- const CORBA_char *package_list,
- const GNOME_Trilobite_Eazel_InstallCallback cb,
- CORBA_Environment * ev)
-{
- RELEASE_CB;
- SET_CB (cb);
-}
-
-static void
-impl_Eazel_Install_uninstall(impl_POA_GNOME_Trilobite_Eazel_Install *servant,
- const CORBA_char *package_list,
- const GNOME_Trilobite_Eazel_InstallCallback cb,
- CORBA_Environment * ev)
-{
- RELEASE_CB;
- SET_CB (cb);
-
- return;
-}
-
-static void
-impl_Eazel_Install_install_packages(impl_POA_GNOME_Trilobite_Eazel_Install *servant,
- const GNOME_Trilobite_Eazel_CategoryStructList *corbacategories,
- const CORBA_char *root,
- const GNOME_Trilobite_Eazel_InstallCallback cb,
- CORBA_Environment * ev)
-{
- GList *categories;
-
- RELEASE_CB;
- SET_CB (cb);
-
- categories = NULL;
- categories = categorydata_list_from_corba_categorystructlist (corbacategories);
- eazel_install_install_packages (servant->object,
- categories,
- !root || strcmp (root, "")==0 ? NULL : root);
-
- g_list_foreach (categories, (GFunc)categorydata_destroy_foreach, NULL);
- g_list_free (categories);
-
- return;
-}
-
-static void
-impl_Eazel_Install_uninstall_packages(impl_POA_GNOME_Trilobite_Eazel_Install *servant,
- const GNOME_Trilobite_Eazel_CategoryStructList *corbacategories,
- const CORBA_char *root,
- const GNOME_Trilobite_Eazel_InstallCallback cb,
- CORBA_Environment * ev)
-{
- GList *categories;
-
- RELEASE_CB;
- SET_CB (cb);
-
- categories = NULL;
- categories = categorydata_list_from_corba_categorystructlist (corbacategories);
- eazel_install_uninstall_packages (servant->object,
- categories,
- !root || strcmp (root, "")==0 ? NULL : root);
-
- g_list_foreach (categories, (GFunc)categorydata_destroy_foreach, NULL);
- g_list_free (categories);
-
- return;
-}
-
-static void
-impl_Eazel_Install_stop (impl_POA_GNOME_Trilobite_Eazel_Install *servant,
- CORBA_Environment * ev)
-{
- trilobite_debug (">>> STOP <<<");
- servant->object->private->cancel_download = TRUE;
-}
-
-static void
-impl_Eazel_Install_delete_files (impl_POA_GNOME_Trilobite_Eazel_Install *servant,
- CORBA_Environment * ev)
-{
- eazel_install_delete_downloads (servant->object);
-}
-
-static void
-impl_Eazel_Install_revert_transaction (impl_POA_GNOME_Trilobite_Eazel_Install *servant,
- const CORBA_char *xml,
- const CORBA_char *root,
- const GNOME_Trilobite_Eazel_InstallCallback cb,
- CORBA_Environment * ev)
-{
- RELEASE_CB;
- SET_CB (cb);
-
- eazel_install_revert_transaction_from_xmlstring (servant->object,
- xml,
- strlen (xml),
- !root || strcmp (root, "")==0 ? NULL : root);
-
- return;
-}
-
-static void
-impl_Eazel_Install__set_verbose (impl_POA_GNOME_Trilobite_Eazel_Install *servant,
- const CORBA_boolean value,
- CORBA_Environment *ev)
-{
- eazel_install_set_verbose (servant->object, value);
-}
-
-static CORBA_boolean
-impl_Eazel_Install__get_verbose (impl_POA_GNOME_Trilobite_Eazel_Install *servant,
- CORBA_Environment *ev)
-{
- return eazel_install_get_verbose (servant->object);
-}
-
-static void
-impl_Eazel_Install__set_debug (impl_POA_GNOME_Trilobite_Eazel_Install *servant,
- const CORBA_boolean value,
- CORBA_Environment *ev)
-{
- eazel_install_set_debug (servant->object, value);
-}
-
-static CORBA_boolean
-impl_Eazel_Install__get_debug (impl_POA_GNOME_Trilobite_Eazel_Install *servant,
- CORBA_Environment *ev)
-{
- return eazel_install_get_debug (servant->object);
-}
-
-static void
-impl_Eazel_Install__set_silent (impl_POA_GNOME_Trilobite_Eazel_Install *servant,
- const CORBA_boolean value,
- CORBA_Environment *ev)
-{
- eazel_install_set_silent (servant->object, value);
-}
-
-static CORBA_boolean
-impl_Eazel_Install__get_silent (impl_POA_GNOME_Trilobite_Eazel_Install *servant,
- CORBA_Environment *ev)
-{
- return eazel_install_get_silent (servant->object);
-}
-
-static void
-impl_Eazel_Install__set_test_mode (impl_POA_GNOME_Trilobite_Eazel_Install *servant,
- const CORBA_boolean value,
- CORBA_Environment *ev)
-{
- eazel_install_set_test (servant->object, value);
-}
-
-static CORBA_boolean
-impl_Eazel_Install__get_test_mode (impl_POA_GNOME_Trilobite_Eazel_Install *servant,
- CORBA_Environment *ev)
-{
- return eazel_install_get_test (servant->object);
-}
-
-
-static void
-impl_Eazel_Install__set_force (impl_POA_GNOME_Trilobite_Eazel_Install *servant,
- const CORBA_boolean value,
- CORBA_Environment *ev)
-{
- eazel_install_set_force (servant->object, value);
-}
-
-static CORBA_boolean
-impl_Eazel_Install__get_force (impl_POA_GNOME_Trilobite_Eazel_Install *servant,
- CORBA_Environment *ev)
-{
- return eazel_install_get_force (servant->object);
-}
-
-static void
-impl_Eazel_Install__set_ei2 (impl_POA_GNOME_Trilobite_Eazel_Install *servant,
- const CORBA_boolean value,
- CORBA_Environment *ev)
-{
- eazel_install_set_ei2 (servant->object, value);
-}
-
-static CORBA_boolean
-impl_Eazel_Install__get_ei2 (impl_POA_GNOME_Trilobite_Eazel_Install *servant,
- CORBA_Environment *ev)
-{
- return eazel_install_get_ei2 (servant->object);
-}
-
-static void
-impl_Eazel_Install__set_auth (impl_POA_GNOME_Trilobite_Eazel_Install *servant,
- const CORBA_boolean value,
- CORBA_Environment *ev)
-{
- eazel_install_set_eazel_auth (servant->object, value);
-}
-
-static CORBA_boolean
-impl_Eazel_Install__get_auth (impl_POA_GNOME_Trilobite_Eazel_Install *servant,
- CORBA_Environment *ev)
-{
- return eazel_install_get_eazel_auth (servant->object);
-}
-
-static void
-impl_Eazel_Install__set_upgrade (impl_POA_GNOME_Trilobite_Eazel_Install *servant,
- const CORBA_boolean value,
- CORBA_Environment *ev)
-{
- eazel_install_set_upgrade (servant->object, value);
-}
-
-static CORBA_boolean
-impl_Eazel_Install__get_upgrade (impl_POA_GNOME_Trilobite_Eazel_Install *servant,
- CORBA_Environment *ev)
-{
- return eazel_install_get_upgrade (servant->object);
-}
-
-static void
-impl_Eazel_Install__set_downgrade (impl_POA_GNOME_Trilobite_Eazel_Install *servant,
- const CORBA_boolean value,
- CORBA_Environment *ev)
-{
- eazel_install_set_downgrade (servant->object, value);
-}
-
-static CORBA_boolean
-impl_Eazel_Install__get_downgrade (impl_POA_GNOME_Trilobite_Eazel_Install *servant,
- CORBA_Environment *ev)
-{
- return eazel_install_get_downgrade (servant->object);
-}
-
-static void
-impl_Eazel_Install__set_tmp_dir (impl_POA_GNOME_Trilobite_Eazel_Install *servant,
- const CORBA_char *value,
- CORBA_Environment *ev)
-{
- eazel_install_set_tmp_dir (servant->object, value);
-}
-
-
-static CORBA_char*
-impl_Eazel_Install__get_tmp_dir (impl_POA_GNOME_Trilobite_Eazel_Install *servant,
- CORBA_Environment *ev)
-{
- return eazel_install_get_tmp_dir (servant->object);
-}
-
-static void
-impl_Eazel_Install__set_ssl_rename (impl_POA_GNOME_Trilobite_Eazel_Install *servant,
- const CORBA_boolean value,
- CORBA_Environment *ev)
-{
- eazel_install_set_ssl_rename (servant->object, value);
-}
-
-
-static CORBA_boolean
-impl_Eazel_Install__get_ssl_rename (impl_POA_GNOME_Trilobite_Eazel_Install *servant,
- CORBA_Environment *ev)
-{
- return eazel_install_get_ssl_rename (servant->object);
-}
-
-static void
-impl_Eazel_Install__set_ignore_file_conflicts (impl_POA_GNOME_Trilobite_Eazel_Install *servant,
- const CORBA_boolean value,
- CORBA_Environment *ev)
-{
- eazel_install_set_ignore_file_conflicts (servant->object, value);
-}
-
-
-static CORBA_boolean
-impl_Eazel_Install__get_ignore_file_conflicts (impl_POA_GNOME_Trilobite_Eazel_Install *servant,
- CORBA_Environment *ev)
-{
- return eazel_install_get_ignore_file_conflicts (servant->object);
-}
-
-static void
-impl_Eazel_Install__set_server (impl_POA_GNOME_Trilobite_Eazel_Install *servant,
- const CORBA_char *value,
- CORBA_Environment *ev)
-{
- eazel_install_set_server (servant->object, value);
-}
-
-
-static CORBA_char*
-impl_Eazel_Install__get_server (impl_POA_GNOME_Trilobite_Eazel_Install *servant,
- CORBA_Environment *ev)
-{
- return eazel_install_get_server (servant->object);
-}
-
-static void
-impl_Eazel_Install__set_cgi (impl_POA_GNOME_Trilobite_Eazel_Install *servant,
- const CORBA_char *value,
- CORBA_Environment *ev)
-{
- eazel_install_set_cgi_path (servant->object, value);
-}
-
-
-static CORBA_char*
-impl_Eazel_Install__get_cgi (impl_POA_GNOME_Trilobite_Eazel_Install *servant,
- CORBA_Environment *ev)
-{
- return eazel_install_get_cgi_path (servant->object);
-}
-
-static void
-impl_Eazel_Install__set_username (impl_POA_GNOME_Trilobite_Eazel_Install *servant,
- const CORBA_char *value,
- CORBA_Environment *ev)
-{
- eazel_install_set_username (servant->object, value);
-}
-
-
-static CORBA_char*
-impl_Eazel_Install__get_username (impl_POA_GNOME_Trilobite_Eazel_Install *servant,
- CORBA_Environment *ev)
-{
- return eazel_install_get_username (servant->object);
-}
-
-static void
-impl_Eazel_Install__set_server_port (impl_POA_GNOME_Trilobite_Eazel_Install *servant,
- const CORBA_long value,
- CORBA_Environment *ev)
-{
- eazel_install_set_server_port (servant->object, value);
-}
-
-
-static CORBA_long
-impl_Eazel_Install__get_server_port (impl_POA_GNOME_Trilobite_Eazel_Install *servant,
- CORBA_Environment *ev)
-{
- return eazel_install_get_server_port (servant->object);
-}
-
-static void
-impl_Eazel_Install__set_log_file (impl_POA_GNOME_Trilobite_Eazel_Install *servant,
- const CORBA_char *value,
- CORBA_Environment *ev)
-{
- eazel_install_open_log (servant->object, value);
-}
-
-
-static CORBA_char*
-impl_Eazel_Install__get_log_file (impl_POA_GNOME_Trilobite_Eazel_Install *servant,
- CORBA_Environment *ev)
-{
- return servant->object->private->logfilename;
-}
-
-static void
-impl_Eazel_Install__set_package_list (impl_POA_GNOME_Trilobite_Eazel_Install *servant,
- const CORBA_char *value,
- CORBA_Environment *ev)
-{
- eazel_install_set_package_list (servant->object, value);
-}
-
-
-static CORBA_char*
-impl_Eazel_Install__get_package_list (impl_POA_GNOME_Trilobite_Eazel_Install *servant,
- CORBA_Environment *ev)
-{
- return eazel_install_get_package_list (servant->object);
-}
-
-static void
-impl_Eazel_Install__set_protocol (impl_POA_GNOME_Trilobite_Eazel_Install *servant,
- const GNOME_Trilobite_Eazel_ProtocolEnum value,
- CORBA_Environment *ev)
-{
- switch (value) {
- case GNOME_Trilobite_Eazel_PROTOCOL_HTTP:
- eazel_install_set_protocol (servant->object, PROTOCOL_HTTP);
- break;
- case GNOME_Trilobite_Eazel_PROTOCOL_FTP:
- eazel_install_set_protocol (servant->object, PROTOCOL_FTP);
- break;
- case GNOME_Trilobite_Eazel_PROTOCOL_LOCAL:
- eazel_install_set_protocol (servant->object, PROTOCOL_LOCAL);
- break;
- }
-}
-
-
-static GNOME_Trilobite_Eazel_ProtocolEnum
-impl_Eazel_Install__get_protocol (impl_POA_GNOME_Trilobite_Eazel_Install *servant,
- CORBA_Environment *ev)
-{
- switch (eazel_install_get_protocol (servant->object)) {
- default:
- case PROTOCOL_HTTP:
- return GNOME_Trilobite_Eazel_PROTOCOL_HTTP;
- break;
- case PROTOCOL_FTP:
- return GNOME_Trilobite_Eazel_PROTOCOL_FTP;
- break;
- case PROTOCOL_LOCAL:
- return GNOME_Trilobite_Eazel_PROTOCOL_LOCAL;
- break;
- }
-}
-
-static GNOME_Trilobite_Eazel_PackageDataStructList*
-impl_Eazel_Install_simple_query (impl_POA_GNOME_Trilobite_Eazel_Install *servant,
- const CORBA_char *query,
- const CORBA_char *root,
- CORBA_Environment *ev)
-{
- GNOME_Trilobite_Eazel_PackageDataStructList *result;
- GList *tmp_result;
-
- g_free (servant->object->private->cur_root);
- if (!root || strcmp (root, "")==0) {
- servant->object->private->cur_root = NULL;
- } else {
- servant->object->private->cur_root = g_strdup (root);
- }
-
- tmp_result = eazel_install_query_package_system (servant->object,
- query,
- EI_SIMPLE_QUERY_MATCHES,
- servant->object->private->cur_root);
- result = corba_packagedatastructlist_from_packagedata_list (tmp_result);
-
- g_list_foreach (tmp_result, (GFunc)gtk_object_unref, NULL);
-
- return result;
-}
-
-POA_GNOME_Trilobite_Eazel_Install__epv*
-eazel_install_get_epv ()
-{
- POA_GNOME_Trilobite_Eazel_Install__epv *epv;
-
- epv = g_new0 (POA_GNOME_Trilobite_Eazel_Install__epv, 1);
- epv->install = (gpointer)&impl_Eazel_Install_install;
- epv->uninstall = (gpointer)&impl_Eazel_Install_uninstall;
- epv->stop = (gpointer)&impl_Eazel_Install_stop;
- epv->delete_files = (gpointer)&impl_Eazel_Install_delete_files;
- epv->install_packages = (gpointer)&impl_Eazel_Install_install_packages;
- epv->uninstall_packages = (gpointer)&impl_Eazel_Install_uninstall_packages;
- epv->revert_transaction = (gpointer)&impl_Eazel_Install_revert_transaction;
-
- epv->_set_verbose = (gpointer)&impl_Eazel_Install__set_verbose;
- epv->_get_verbose = (gpointer)&impl_Eazel_Install__get_verbose;
-
- epv->_set_debug = (gpointer)&impl_Eazel_Install__set_debug;
- epv->_get_debug = (gpointer)&impl_Eazel_Install__get_debug;
-
- epv->_set_silent = (gpointer)&impl_Eazel_Install__set_silent;
- epv->_get_silent = (gpointer)&impl_Eazel_Install__get_silent;
-
- epv->_set_test_mode = (gpointer)&impl_Eazel_Install__set_test_mode;
- epv->_get_test_mode = (gpointer)&impl_Eazel_Install__get_test_mode;
-
- epv->_set_force = (gpointer)&impl_Eazel_Install__set_force;
- epv->_get_force = (gpointer)&impl_Eazel_Install__get_force;
-
- epv->_set_ei2 = (gpointer)&impl_Eazel_Install__set_ei2;
- epv->_get_ei2 = (gpointer)&impl_Eazel_Install__get_ei2;
-
- epv->_set_auth = (gpointer)&impl_Eazel_Install__set_auth;
- epv->_get_auth = (gpointer)&impl_Eazel_Install__get_auth;
-
- epv->_set_upgrade = (gpointer)&impl_Eazel_Install__set_upgrade;
- epv->_get_upgrade = (gpointer)&impl_Eazel_Install__get_upgrade;
-
- epv->_set_downgrade = (gpointer)&impl_Eazel_Install__set_downgrade;
- epv->_get_downgrade = (gpointer)&impl_Eazel_Install__get_downgrade;
-
- epv->_set_protocol = (gpointer)&impl_Eazel_Install__set_protocol;
- epv->_get_protocol = (gpointer)&impl_Eazel_Install__get_protocol;
-
- epv->_set_server = (gpointer)&impl_Eazel_Install__set_server;
- epv->_get_server = (gpointer)&impl_Eazel_Install__get_server;
-
- epv->_set_cgi = (gpointer)&impl_Eazel_Install__set_cgi;
- epv->_get_cgi = (gpointer)&impl_Eazel_Install__get_cgi;
-
- epv->_set_username = (gpointer)&impl_Eazel_Install__set_username;
- epv->_get_username = (gpointer)&impl_Eazel_Install__get_username;
-
- epv->_set_server_port = (gpointer)&impl_Eazel_Install__set_server_port;
- epv->_get_server_port = (gpointer)&impl_Eazel_Install__get_server_port;
-
- epv->_set_log_file = (gpointer)&impl_Eazel_Install__set_log_file;
- epv->_get_log_file = (gpointer)&impl_Eazel_Install__get_log_file;
-
- epv->_set_package_list = (gpointer)&impl_Eazel_Install__set_package_list;
- epv->_get_package_list = (gpointer)&impl_Eazel_Install__get_package_list;
-
- epv->_set_tmp_dir = (gpointer)&impl_Eazel_Install__set_tmp_dir;
- epv->_get_tmp_dir = (gpointer)&impl_Eazel_Install__get_tmp_dir;
-
- epv->_set_ignore_file_conflicts = (gpointer)&impl_Eazel_Install__set_ignore_file_conflicts;
- epv->_get_ignore_file_conflicts = (gpointer)&impl_Eazel_Install__get_ignore_file_conflicts;
-
- epv->_set_ssl_rename = (gpointer)&impl_Eazel_Install__set_ssl_rename;
- epv->_get_ssl_rename = (gpointer)&impl_Eazel_Install__get_ssl_rename;
-
- epv->simple_query = (gpointer)&impl_Eazel_Install_simple_query;
-
- return epv;
-};
-
-GNOME_Trilobite_Eazel_Install
-eazel_install_create_corba_object (BonoboObject *service) {
- impl_POA_GNOME_Trilobite_Eazel_Install *servant;
- CORBA_Environment ev;
-
- g_assert (service != NULL);
- g_assert (EAZEL_IS_INSTALL (service));
-
- CORBA_exception_init (&ev);
-
- servant = g_new0 (impl_POA_GNOME_Trilobite_Eazel_Install,1);
- servant->object = EAZEL_INSTALL (service);
-
- ((POA_GNOME_Trilobite_Eazel_Install*) servant)->vepv = EAZEL_INSTALL_CLASS ( GTK_OBJECT (service)->klass)->servant_vepv;
- POA_GNOME_Trilobite_Eazel_Install__init (servant, &ev);
- ORBIT_OBJECT_KEY (((POA_GNOME_Trilobite_Eazel_Install*)servant)->_private)->object = NULL;
-
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_warning ("Cannot instantiate Eazel_Install corba object");
- g_free (servant);
- CORBA_exception_free (&ev);
- return CORBA_OBJECT_NIL;
- }
-
- CORBA_exception_free (&ev);
-
- /* Return the bonobo activation of the servant */
- return (GNOME_Trilobite_Eazel_Install) bonobo_object_activate_servant (service, servant);
-}
-#endif /* EAZEL_INSTALL_NO_CORBA */
diff --git a/components/services/install/lib/eazel-install-logic2.c b/components/services/install/lib/eazel-install-logic2.c
deleted file mode 100644
index 18d792c76..000000000
--- a/components/services/install/lib/eazel-install-logic2.c
+++ /dev/null
@@ -1,3435 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: Eskil Heyn Olsen <eskil@eazel.com>
- * Robey Pointer <robey@eazel.com>
- */
-
-#include "eazel-install-logic2.h"
-#include "eazel-install-public.h"
-#include "eazel-install-private.h"
-
-#include <libtrilobite/trilobite-core-utils.h>
-#include <libtrilobite/trilobite-md5-tools.h>
-
-#include <eel/eel-debug.h>
-
-#ifndef EAZEL_INSTALL_NO_CORBA
-#include <libtrilobite/libtrilobite.h>
-#else
-#include <libtrilobite/trilobite-root-helper.h>
-#include <libtrilobite/trilobite-i18n.h>
-#endif
-
-#include <glib.h>
-#include <string.h>
-
-/*
- 0x1 enables post check_dependencies treedumps
- 0x2 enables post dedupe tree dumps
- 0x4 enables random spewing
- 0x8 enables dumping the final tree
- */
-#define EI2_DEBUG 0xFF
-
-#define PATCH_FOR_SOFTCAT_BUG 1
-#define MUST_HAVE PACKAGE_FILL_NO_DIRS_IN_PROVIDES
-#define UPDATE_MUST_HAVE PACKAGE_FILL_NO_DEPENDENCIES|PACKAGE_FILL_NO_TEXT|PACKAGE_FILL_NO_DIRS_IN_PROVIDES
-#define OWNS_MUST_HAVE PACKAGE_FILL_NO_DEPENDENCIES|PACKAGE_FILL_NO_TEXT|PACKAGE_FILL_NO_DIRS_IN_PROVIDES
-#define MODIFY_MUST_HAVE PACKAGE_FILL_NO_DEPENDENCIES|PACKAGE_FILL_NO_TEXT|PACKAGE_FILL_NO_DIRS_IN_PROVIDES
-
-enum {
- DEPENDENCY_OK = 1,
- DEPENDENCY_NOT_OK = 2
-};
-
-/***********************************************************************************/
-/*
- this is a debug thing that'll dump the memory addresses of all packages
- in trees, and thereby let you manually check whether the dedupe worked or not.
-*/
-#if EI2_DEBUG & 0x10
-static void
-dump_tree (GList *packages)
-{
- char *out;
- char **lines;
- int i;
- GList *packs = NULL;
- GList *iterator;
-
- for (iterator = packages; iterator; iterator = g_list_next (iterator)) {
- PackageData *pack = NULL;
- if (IS_PACKAGEDATA (iterator->data)) {
- pack = PACKAGEDATA (iterator->data);
- } else if (IS_PACKAGEDEPENDENCY (iterator->data)) {
- pack = PACKAGEDEPENDENCY (iterator->data)->package;
- } else {
- g_assert_not_reached ();
- }
- packs = g_list_prepend (packs, pack);
- }
-
- out = packagedata_dump_tree (packs, 2);
- lines = g_strsplit (out, "\n", 0);
- for (i = 0; lines[i] != NULL; i++) {
- trilobite_debug ("%s", lines[i]);
- }
- g_strfreev (lines);
- g_free (out);
- g_list_free (packs);
-}
-#endif
-
-
-/***********************************************************************************/
-
-/* This is code to check the md5 of downloaded packages */
-
-
-gboolean
-check_md5_on_files (EazelInstall *service,
- GList *packages)
-{
- gboolean result = TRUE;
- GList *iterator;
- GList *flat_packages;
-
- result = eazel_install_lock_tmp_dir (service);
-
- if (!result) {
- g_warning (_("Failed to lock the downloaded file"));
- return FALSE;
- }
-
- flat_packages = flatten_packagedata_dependency_tree (packages);
-
- for (iterator = flat_packages; iterator; iterator = g_list_next (iterator)) {
- PackageData *pack = (PackageData*)iterator->data;
-
- if (pack->md5) {
- char pmd5[16];
- char md5[16];
-
- trilobite_md5_get_digest_from_file (pack->filename, md5);
- trilobite_md5_get_digest_from_md5_string (pack->md5, pmd5);
-
- if (memcmp (pmd5, md5, 16) != 0) {
- g_warning (_("MD5 mismatch, package %s may be compromised"), pack->name);
-#if EI2_DEBUG & 0x4
- /* get_readable_name is leaked */
- trilobite_debug ("read md5 from file %s", pack->filename);
- trilobite_debug ("for package %s", packagedata_get_readable_name (pack));
-#endif
- eazel_install_emit_md5_check_failed (service,
- pack,
- trilobite_md5_get_string_from_md5_digest (md5));
- result = FALSE;
- } else {
-#if EI2_DEBUG & 0x4
- trilobite_debug ("md5 match on %s", pack->name);
-#endif
- }
- } else {
- g_message (_("No MD5 available for %s"), pack->name);
- }
- }
-
- g_list_free (flat_packages);
- eazel_install_unlock_tmp_dir (service);
-
- return result;
-}
-
-/***********************************************************************************/
-
-/* This is code to removed failed trees from the tree */
-
-void prune_failed_packages (EazelInstall *service, GList **packages);
-void prune_failed_packages_helper (EazelInstall *service, PackageData *root,
- PackageData *pack, GList *packages, GList **path, GList **result);
-
-typedef enum {
- PRUNE_ACTION_NORMAL,
- PRUNE_ACTION_ALLOW
-} PruneAction;
-
-void
-prune_failed_packages_helper (EazelInstall *service,
- PackageData *root,
- PackageData *pack,
- GList *packages,
- GList **path,
- GList **result)
-{
- GList *iterator;
- PruneAction action = PRUNE_ACTION_NORMAL;
- char *pack_name = packagedata_get_readable_name (pack);
-
-#if EI2_DEBUG & 0x4
- trilobite_debug ("entering subpruner %p %s %s",
- pack, pack_name,
- packagedata_status_enum_to_str (pack->status));
-#endif
- /* If package is already installed, check if the service
- settings requires us to fail it */
- if (pack->status == PACKAGE_ALREADY_INSTALLED) {
- gboolean cancel_package;
- cancel_package = GPOINTER_TO_INT (gtk_object_get_data (GTK_OBJECT (pack), "cancelled"));
-#if EI2_DEBUG & 0x4
- trilobite_debug ("Package cancel status == %d", cancel_package);
-#endif
- if (cancel_package == 0) {
- action = PRUNE_ACTION_ALLOW;
- }
- }
-
- /* If it's a suite and no dependencies, cancel it */
- if (packagedata_is_suite (pack) &&
- g_list_length (pack->depends)==0 &&
- pack->status == PACKAGE_PARTLY_RESOLVED) {
- pack->status = PACKAGE_ALREADY_INSTALLED;
- }
-
- /* Recursion check */
- if (g_list_find (*path, pack)) {
-#if EI2_DEBUG & 0x4
- trilobite_debug ("... %p %s recurses ...", pack, pack_name);
-#endif
- g_free (pack_name);
- return;
- }
-
- if (action == PRUNE_ACTION_NORMAL && pack->status == PACKAGE_PARTLY_RESOLVED) {
- action = PRUNE_ACTION_ALLOW;
- }
-
- if (action != PRUNE_ACTION_ALLOW) {
- char *root_name = packagedata_get_readable_name (root);
-#if EI2_DEBUG & 0x4
- trilobite_debug ("subpruner kill root %p %s because of %p %s",
- root, root_name, pack, pack_name);
-#endif
- if (g_list_find (*result, root)==NULL) {
- (*result) = g_list_prepend (*result, root);
- }
- g_free (pack_name);
- g_free (root_name);
- } else {
- g_free (pack_name);
- for (iterator = pack->depends; iterator; iterator = g_list_next (iterator)) {
- PackageDependency *dep = PACKAGEDEPENDENCY (iterator->data);
- (*path) = g_list_prepend (*path, pack);
- prune_failed_packages_helper (service, root, dep->package, packages, path, result);
- (*path) = g_list_remove (*path, pack);
- }
- }
-}
-
-/* If the calls to prune_failed_packages are removed, no
- install_failed signals are emitted, and the client gets the entire
- tree list. This is for bug 5267 */
-
-void
-prune_failed_packages (EazelInstall *service,
- GList **packages)
-{
- GList *iterator;
- GList *result = NULL;
-
- for (iterator = *packages; iterator; iterator = g_list_next (iterator)) {
- PackageData *pack = PACKAGEDATA (iterator->data);
- GList *path = NULL;
- prune_failed_packages_helper (service, pack, pack, *packages, &path, &result);
- }
-
- for (iterator = result; iterator; iterator = g_list_next (iterator)) {
- PackageData *pack = PACKAGEDATA (iterator->data);
-
-#if EI2_DEBUG & 0x4
- trilobite_debug ("removing %p %s", pack, pack->name);
-#endif
- (*packages) = g_list_remove (*packages, pack);
- eazel_install_emit_install_failed (service, pack);
- gtk_object_unref (GTK_OBJECT (pack));
- /* FIXME: bugzilla.eazel.com 7654
- If object ref reaches zero, it should be removed from the
- dedupe hash */
- }
- if (g_list_length (*packages) == 0) {
-#if EI2_DEBUG & 0x4
- trilobite_debug ("packages is empty after prune");
-#endif
- g_list_free (*packages);
- (*packages) = NULL;
- }
- g_list_free (result);
-
-#if EI2_DEBUG & 0x2
- dump_tree (*packages);
-#endif
-}
-
-
-/***********************************************************************************/
-
-/* Code to check already installed packages */
-
-EazelInstallStatus
-eazel_install_check_existing_packages (EazelInstall *service,
- PackageData *pack)
-{
- GList *existing_packages;
- GList *borked_packages = NULL;
- EazelInstallStatus result;
-
-#if EI2_DEBUG & 0x4
- trilobite_debug ("check_existing %p %s", pack, pack->name);
-#endif
- result = EAZEL_INSTALL_STATUS_NEW_PACKAGE;
- /* query for existing package of same name */
- existing_packages = eazel_package_system_query (service->private->package_system,
- service->private->cur_root,
- pack->name,
- EAZEL_PACKAGE_SYSTEM_QUERY_MATCHES,
- MODIFY_MUST_HAVE);
-
- /* If error, handle it */
- if (service->private->package_system->err) {
-#if EI2_DEBUG & 0x4
- switch (service->private->package_system->err->e) {
- case EazelPackageSystemError_DB_ACCESS:
- if (strcmp (service->private->package_system->err->u.db_access.path,
- service->private->cur_root)==0) {
- trilobite_debug ("some package dbs is locked by another process",
- service->private->package_system->err->u.db_access.pid);
- pack->status = PACKAGE_PACKSYS_FAILURE;
- g_free (service->private->package_system->err);
- return EAZEL_INSTALL_STATUS_QUO;
- break;
- }
- }
-#endif
- }
- if (existing_packages) {
- /* Get the existing package, set it's modify flag and add it */
- GList *iterator;
- PackageData *survivor = NULL;
- gboolean abort = FALSE;
- int res;
-
- if (g_list_length (existing_packages)>1) {
-#if EI2_DEBUG & 0x4
- trilobite_debug ("there are %d existing packages called %s",
- g_list_length (existing_packages),
- pack->name);
-#endif
- /* Verify them all, to find one that is not damaged. Mark the rest
- as invalid so the client can suggest the user should delete them */
- for (iterator = existing_packages; iterator; iterator = g_list_next (iterator)) {
- PackageData *existing_package = PACKAGEDATA (iterator->data);
- char *name = packagedata_get_readable_name (existing_package);
- GList *foo = NULL;
-
- foo = g_list_prepend (foo, existing_package);
- if (eazel_package_system_verify (service->private->package_system,
- service->private->cur_root,
- foo)) {
- /* I18N note: "%is is ok" in the sense that %s=package name and the
- package is intact */
- g_message (_("%s is ok"), name);
- if (survivor == NULL) {
- survivor = existing_package;
- } else {
- abort = TRUE;
- }
- } else {
- /* I18N note: "%is is not ok" in the sense that %s=package name and the
- package is not intact */
- g_message ("%s is not ok", name);
- existing_package->status = PACKAGE_INVALID;
- /* I add the borked packages later, so they'll show up
- earlier in the tree */
- borked_packages = g_list_prepend (borked_packages, existing_package);
- }
- g_list_free (foo);
- g_free (name);
- }
- } else {
- survivor = PACKAGEDATA (g_list_first (existing_packages)->data);
- }
-
- if (abort) {
- trilobite_debug ("*********************************************************");
- trilobite_debug ("This is a bad bad case, see bug 3511");
- trilobite_debug ("To circumvent this problem, as root, execute this command");
- trilobite_debug ("(which is dangerous by the way....)");
- trilobite_debug ("rpm -e --nodeps `rpm -q %s`", pack->name);
-
- g_list_free (borked_packages);
-
- /* Cancel the package, mark all the existing as invalid */
- pack->status = PACKAGE_CANCELLED;
- for (iterator = existing_packages; iterator; iterator = g_list_next (iterator)) {
- PackageData *existing_package = PACKAGEDATA (iterator->data);
- existing_package->status = PACKAGE_INVALID;
- packagedata_add_pack_to_modifies (pack, existing_package);
- gtk_object_unref (GTK_OBJECT (existing_package));
- }
- }
-
- if (abort==FALSE && survivor) {
- g_assert (pack->version);
- g_assert (survivor->version);
-
- res = eazel_package_system_compare_version (service->private->package_system,
- pack->version,
- survivor->version);
-
- if (survivor->epoch > 0) {
- g_warning ("modified package has epoch %d, new package has %d",
- survivor->epoch,
- pack->epoch);
- gtk_object_set_data (GTK_OBJECT (service->private->package_system),
- "ignore-epochs", GINT_TO_POINTER (1));
- }
-
- /* check against minor version */
- if (res==0) {
-#if EI2_DEBUG & 0x4
- trilobite_debug ("versions are equal (%s), comparing minors", pack->version);
-#endif
- if (pack->minor && survivor->minor) {
-#if EI2_DEBUG & 0x4
- trilobite_debug ("minors are %s for new and %s for installed)",
- pack->minor, survivor->minor);
-#endif
- res = eazel_package_system_compare_version (service->private->package_system,
- pack->minor, survivor->minor);
- } else if (!pack->minor && survivor->minor) {
- /* If the given packages does not have a minor,
- but the installed has, assume we're fine */
- /* FIXME: bugzilla.eazel.com
- This is a patch, it should be res=1, revert when
- softcat is updated to have revisions for all packages
- (post PR3) */
- res = 1;
- } else {
- /* Eh, do nothing just to be safe */
- res = 0;
- }
- }
-
- /* Set the modify_status flag */
- if (res == 0) {
- survivor->modify_status = PACKAGE_MOD_UNTOUCHED;
- } else if (res > 0) {
- survivor->modify_status = PACKAGE_MOD_UPGRADED;
- } else {
- survivor->modify_status = PACKAGE_MOD_DOWNGRADED;
- }
-
- /* Calc the result */
- if (res == 0) {
- result = EAZEL_INSTALL_STATUS_QUO;
- } else if (res > 0) {
- result = EAZEL_INSTALL_STATUS_UPGRADES;
- } else {
- result = EAZEL_INSTALL_STATUS_DOWNGRADES;
- }
-
-#if EI2_DEBUG & 0x4
- /* Debug output */
- switch (result) {
- case EAZEL_INSTALL_STATUS_QUO: {
- if (pack->minor && survivor->minor) {
- trilobite_debug (_("%s-%s version %s-%s already installed"),
- pack->name, pack->minor,
- survivor->version, survivor->minor);
- } else {
- trilobite_debug (_("%s version %s already installed"),
- pack->name,
- survivor->version);
- }
- }
- break;
- case EAZEL_INSTALL_STATUS_UPGRADES: {
- /* This is certainly ugly as helll */
- if (pack->minor && survivor->minor) {
- trilobite_debug (_("%s upgrades from version %s-%s to %s-%s"),
- pack->name,
- survivor->version, survivor->minor,
- pack->version, pack->minor);
- } else {
- trilobite_debug (_("%s upgrades from version %s-%s to %s-%s"),
- pack->name,
- survivor->version, survivor->minor,
- pack->version, pack->minor);
- }
- }
- break;
- case EAZEL_INSTALL_STATUS_DOWNGRADES: {
- if (pack->minor && survivor->minor) {
- trilobite_debug (_("%s downgrades from version %s-%s to %s-%s"),
- pack->name,
- survivor->version, survivor->minor,
- pack->version, pack->minor);
- } else {
- trilobite_debug (_("%s downgrades from version %s to %s"),
- pack->name,
- survivor->version,
- pack->version);
- }
- }
- break;
- default:
- break;
- }
-#endif
-/*
- if (g_list_find_custom (pack->modifies,
- survivor->name,
- (GCompareFunc)eazel_install_package_name_compare)) {
-#if EI2_DEBUG & 0x4
- trilobite_debug ("%s already marked as modified", survivor->name);
-#endif
- gtk_object_unref (GTK_OBJECT (survivor));
- survivor = NULL;
- continue;
- }
-*/
-
- /* Set modifies list */
- if (result != EAZEL_INSTALL_STATUS_QUO) {
-#if EI2_DEBUG & 0x4
- trilobite_debug ("%p %s modifies %p %s",
- pack, pack->name,
- survivor, survivor->name);
-#endif
-
- packagedata_add_pack_to_modifies (pack, survivor);
- survivor->status = PACKAGE_RESOLVED;
- }
- pack->status = PACKAGE_ALREADY_INSTALLED;
- gtk_object_unref (GTK_OBJECT (survivor));
- }
-
- /* Now add the borked packages */
- for (iterator = borked_packages; iterator; iterator = g_list_next (iterator)) {
- PackageData *existing_package = PACKAGEDATA (iterator->data);
- packagedata_add_pack_to_modifies (pack, existing_package);
- gtk_object_unref (GTK_OBJECT (existing_package));
-
- }
- g_list_free (borked_packages);
-
- /* Free the list structure from _simple_query */
- g_list_free (existing_packages);
- } else {
-#if EI2_DEBUG & 0x4
- if (pack->minor) {
- trilobite_debug (_("%s installs version %s-%s"),
- pack->name,
- pack->version,
- pack->minor);
- } else {
- trilobite_debug (_("%s installs version %s"),
- pack->name,
- pack->version);
- }
-
-#endif
- }
-
- return result;
-}
-
-/***********************************************************************************/
-
-/* Info collector */
-
-typedef enum {
- NO_SOFTCAT_HIT = 0,
- SOFTCAT_HIT_OK = 1,
- PACKAGE_SKIPPED = 2
-} GetSoftCatResult;
-
-void get_package_info (EazelInstall *service, GList *packages);
-GetSoftCatResult get_softcat_info (EazelInstall *service, gpointer *ptr);
-
-static void
-add_to_dedupe_hash (EazelInstall *service,
- PackageData *package)
-{
- if (g_hash_table_lookup (service->private->dedupe_hash,
- package->md5) != NULL) {
- return;
- }
-#if EI2_DEBUG & 0x4
- trilobite_debug ("(adding %p %s %s to dedupe)",
- package, package->name, package->md5);
-#endif
- gtk_object_ref (GTK_OBJECT (package));
- /* FIXME: bugzilla.eazel.com 7654 */
- g_hash_table_insert (service->private->dedupe_hash,
- g_strdup (package->md5),
- package);
-}
-
-static void
-fail_modified_packages (EazelInstall *service,
- PackageData *package)
-{
- GList *iterator;
-
- for (iterator = package->modifies; iterator; iterator = g_list_next (iterator)) {
- PackageData *pack = PACKAGEDATA (iterator->data);
- if (pack->status == PACKAGE_RESOLVED) {
- pack->status = PACKAGE_CANCELLED;
- }
- }
-}
-
-#if 0
-static GetSoftCatResult
-post_get_softcat_info (EazelInstall *service,
- PackageData **package,
- GetSoftCatResult result)
-{
- PackageData *p1 = NULL;
-
-#if EI2_DEBUG & 0x4
- trilobite_debug ("-> post_get_softcat_info %p %s",
- (*package), (*package)->name);
-#endif
-
- g_assert ((*package)->md5);
- p1 = g_hash_table_lookup (service->private->dedupe_hash, (*package)->md5);
-
- if (p1 != NULL) {
- /* Don't dedupe yourself */
- if (p1 != (*package)) {
-#if EI2_DEBUG & 0x4
- trilobite_debug ("\tdeduping(a) %p %s is already at %p %s", *package, (*package)->name, p1, p1->name);
-#endif
-
- gtk_object_ref (GTK_OBJECT (p1));
- gtk_object_unref (GTK_OBJECT (*package));
- (*package) = p1;
- } else {
-#if EI2_DEBUG & 0x4
- trilobite_debug ("\tnot deduping(a) myself %p %s", *package, (*package)->name, p1);
-#endif
- }
- }
-
- if (GPOINTER_TO_INT (gtk_object_get_data (GTK_OBJECT ((*package)), "have-checked-existing")) == 0) {
- EazelInstallStatus status;
-
- status = eazel_install_check_existing_packages (service, *package);
- gtk_object_set_data (GTK_OBJECT ((*package)), "have-checked-existing", GINT_TO_POINTER (1));
-
-#if 0
- /* HACK to always fail gnome-libs for fun... */
- if (strcmp ((*package)->name, "gnome-libs")==0) {
- trilobite_debug ("\t%s:%d MATCHED gnome-libs", __FILE__, __LINE__);
- status = EAZEL_INSTALL_STATUS_DOWNGRADES;
- }
-#endif
-
- switch (status) {
- case EAZEL_INSTALL_STATUS_NEW_PACKAGE:
- add_to_dedupe_hash (service, *package);
- break;
- case EAZEL_INSTALL_STATUS_UPGRADES:
- if (eazel_install_get_upgrade (service)) {
- add_to_dedupe_hash (service, *package);
- } else {
- fail_modified_packages (service, *package);
- gtk_object_set_data (GTK_OBJECT (*package),
- "cancelled",
- GINT_TO_POINTER (1));
- }
- break;
- case EAZEL_INSTALL_STATUS_DOWNGRADES:
- if (eazel_install_get_downgrade (service)) {
- add_to_dedupe_hash (service, *package);
- } else {
- fail_modified_packages (service, *package);
- gtk_object_set_data (GTK_OBJECT (*package),
- "cancelled",
- GINT_TO_POINTER (1));
- }
- break;
- case EAZEL_INSTALL_STATUS_QUO:
- fail_modified_packages (service, *package);
- gtk_object_set_data (GTK_OBJECT (*package),
- "cancelled",
- GINT_TO_POINTER (1));
- result = PACKAGE_SKIPPED;
- break;
- }
- }
-
-#if EI2_DEBUG & 0x4
- trilobite_debug ("<- post_get_softcat_info %p %s",
- (*package), (*package)->name);
-#endif
-
- return result;
-}
-
-GetSoftCatResult
-get_softcat_info (EazelInstall *service,
- gpointer *ptr)
-{
- GetSoftCatResult result = NO_SOFTCAT_HIT;
- PackageDependency *dep = NULL;
- PackageData **package = NULL;
-
- g_assert (ptr);
- g_assert (*ptr);
- g_assert (service);
- g_assert (EAZEL_IS_INSTALL (service));
-
- if (IS_PACKAGEDATA (*ptr)) {
- package = (PackageData**) (ptr);
- } else if (IS_PACKAGEDEPENDENCY (*ptr)) {
- dep = PACKAGEDEPENDENCY (*ptr);
- package = &(dep->package);
- } else {
- g_assert_not_reached ();
- }
-
- if ((*package)->fillflag == MUST_HAVE) {
- /* Package is already filled, set result to OK and toggle packages status */
- result = SOFTCAT_HIT_OK;
- (*package)->status = PACKAGE_PARTLY_RESOLVED;
- } else {
- if ((*package)->filename) {
- /* Package already has a filename, load info from disk */
- if (access ((*package)->filename, F_OK) == 0&&
- access ((*package)->filename, R_OK) == 0) {
- PackageData *loaded_package;
-#if EI2_DEBUG & 0x4
- trilobite_debug ("%p %s load from disk", (*package), (*package)->name);
-#else
- g_message (_("Loading package info from file %s"), (*package)->filename);
-#endif
- loaded_package = eazel_package_system_load_package (service->private->package_system,
- (*package),
- (*package)->filename,
- MUST_HAVE);
- if (loaded_package==NULL) {
- (*package)->status = PACKAGE_CANNOT_OPEN;
- } else {
- (*package)->status = PACKAGE_PARTLY_RESOLVED;
- }
- result = SOFTCAT_HIT_OK;
- }
- } else {
- /* Otherwise get info from SoftCat */
- EazelSoftCatError err;
-
- /* if package->version is set, we want get_info to get the exact
- version */
- if (dep) {
- g_free ((*package)->version);
- (*package)->version = g_strdup (dep->version);
- err = eazel_softcat_get_info (service->private->softcat,
- (*package),
- dep->sense,
- MUST_HAVE);
- } else {
- err = eazel_softcat_get_info (service->private->softcat,
- (*package),
- EAZEL_SOFTCAT_SENSE_EQ,
- MUST_HAVE);
- }
-
- /* if ((err==EAZEL_SOFTCAT_SUCCESS) && ((*package)->fillflag & MUST_HAVE)) { */
- if (err==EAZEL_SOFTCAT_SUCCESS) {
- result = SOFTCAT_HIT_OK;
- (*package)->status = PACKAGE_PARTLY_RESOLVED;
- } else {
- result = NO_SOFTCAT_HIT;
- (*package)->status = PACKAGE_CANNOT_OPEN;
- }
- }
- }
- if ((result != NO_SOFTCAT_HIT) && !packagedata_is_suite ((*package))) {
- post_get_softcat_info (service, package, result);
- }
- return result;
-}
-
-static GetSoftCatResult
-get_package_info_foreach (EazelInstall *service,
- gpointer *ptr)
-{
- GetSoftCatResult result;
-
- g_assert (service);
- g_assert (EAZEL_IS_INSTALL (service));
- g_assert (ptr);
-
- result = get_softcat_info (service, ptr);
-
- switch (result) {
- case NO_SOFTCAT_HIT:
- g_message ("Could not get info from SoftwareCatalog ");
- break;
- case PACKAGE_SKIPPED:
-#if EI2_DEBUG & 0x4
- trilobite_debug ("Package skipped");
-#endif
- break;
- default:
-#if EI2_DEBUG & 0x4
- trilobite_debug ("Softcat check ok");
-#endif
- break;
- }
- return result;
-}
-#endif
-
-static GetSoftCatResult
-post_check (EazelInstall *service,
- PackageData **package,
- GetSoftCatResult result)
-{
- PackageData *p1 = NULL;
-
- (*package)->status = PACKAGE_PARTLY_RESOLVED;
-
- if ((*package)->md5==NULL && packagedata_is_suite ((*package))) {
- return result;
- }
-
- p1 = g_hash_table_lookup (service->private->dedupe_hash, (*package)->md5);
-
- if (p1) {
-#if EI2_DEBUG & 0x4
- trilobite_debug ("deduping %p %s to %p", (*package), (*package)->name, p1);
-#endif
-
- gtk_object_ref (GTK_OBJECT (p1));
- gtk_object_unref (GTK_OBJECT ((*package)));
- (*package) = p1;
- } else {
- EazelInstallStatus status;
-
- status = eazel_install_check_existing_packages (service, (*package));
-#if 0
- /* HACK to always fail gnome-libs for fun... */
- if (strcmp ((*package)->name, "gnome-libs")==0) {
- trilobite_debug ("%s:%d MATCHED gnome-libs", __FILE__, __LINE__);
- status = EAZEL_INSTALL_STATUS_DOWNGRADES;
- }
-#endif
-
- switch (status) {
- case EAZEL_INSTALL_STATUS_NEW_PACKAGE:
- add_to_dedupe_hash (service, (*package));
- break;
- case EAZEL_INSTALL_STATUS_UPGRADES:
- if (eazel_install_get_upgrade (service)) {
- add_to_dedupe_hash (service, (*package));
- } else {
- fail_modified_packages (service, (*package));
- gtk_object_set_data (GTK_OBJECT ((*package)),
- "cancelled",
- GINT_TO_POINTER (1));
- }
- break;
- case EAZEL_INSTALL_STATUS_DOWNGRADES:
- if (eazel_install_get_downgrade (service)) {
- add_to_dedupe_hash (service, (*package));
- } else {
- fail_modified_packages (service, (*package));
- gtk_object_set_data (GTK_OBJECT ((*package)),
- "cancelled",
- GINT_TO_POINTER (1));
- }
- break;
- case EAZEL_INSTALL_STATUS_QUO:
- fail_modified_packages (service, (*package));
- gtk_object_set_data (GTK_OBJECT ((*package)),
- "cancelled",
- GINT_TO_POINTER (1));
- result = PACKAGE_SKIPPED;
- break;
- }
- }
- return result;
-}
-
-void
-get_package_info (EazelInstall *service,
- GList *packages)
-{
- GList *iterator;
- GList *packages_by_softcat = NULL;
- GList *out = NULL, *error = NULL;
-
- g_assert (service);
- g_assert (EAZEL_IS_INSTALL (service));
-
- for (iterator = packages; iterator; iterator = g_list_next (iterator)) {
- PackageData **pack = NULL;
- gpointer ptr = iterator->data;
-
- if (IS_PACKAGEDATA (ptr)) {
- pack = (PackageData**)&ptr;
- } else if (IS_PACKAGEDEPENDENCY (ptr)) {
- pack = &(PACKAGEDEPENDENCY (ptr)->package);
- } else {
- g_assert_not_reached ();
- }
-
- if ((*pack)->filename) {
- /* Package already has a filename, load info from disk */
- if (access ((*pack)->filename, F_OK)==0 &&
- access ((*pack)->filename, R_OK)==0) {
- PackageData *loaded_package;
-#if EI2_DEBUG & 0x4
- trilobite_debug ("%p %s load from disk", (*pack), (*pack)->name);
-#else
- g_message (_("Loading package info from file %s"), (*pack)->filename);
-#endif
- loaded_package = eazel_package_system_load_package (service->private->package_system,
- (*pack),
- (*pack)->filename,
- MUST_HAVE);
- if (loaded_package==NULL) {
- (*pack)->status = PACKAGE_CANNOT_OPEN;
- } else {
- (*pack)->status = PACKAGE_PARTLY_RESOLVED;
- post_check (service, pack, SOFTCAT_HIT_OK);
- }
- }
- } else {
- packages_by_softcat = g_list_prepend (packages_by_softcat, (*pack));
- }
- }
-
- if (packages_by_softcat) {
- eazel_softcat_get_info_plural (service->private->softcat,
- packages_by_softcat,
- &out, &error,
- EAZEL_SOFTCAT_SENSE_EQ,
- MUST_HAVE);
-
- g_list_free (packages_by_softcat);
- }
-
- for (iterator = out; iterator; iterator = g_list_next (iterator)) {
- PackageData *p = PACKAGEDATA (iterator->data);
- post_check (service, &p, SOFTCAT_HIT_OK);
- }
-
- for (iterator = error; iterator; iterator = g_list_next (iterator)) {
- PackageData *p = PACKAGEDATA (iterator->data);
- p->status = PACKAGE_CANNOT_OPEN;
- }
-
- g_list_free (out);
- g_list_free (error);
-}
-
-/***********************************************************************************/
-
-/* This is the dedupe magic, which given a tree, links dupes (same eazel-id) to
- point to the same PackageData* object and unrefs the dupes */
-
-void dedupe_foreach (gpointer ptr, EazelInstall *service);
-void dedupe_foreach_depends (PackageDependency *d, EazelInstall *service);
-void dedupe (EazelInstall *service, GList *packages);
-
-void
-dedupe_foreach_depends (PackageDependency *d,
- EazelInstall *service)
-{
- PackageData *p1;
- PackageData *p11;
-
- g_assert (d);
- g_assert (IS_PACKAGEDEPENDENCY (d));
- g_assert (service);
- g_assert (EAZEL_IS_INSTALL (service));
-
- p1 = d->package;
-
- if (p1->md5 == NULL) {
- /* Package info not received from SoftCat */
- return;
- }
-
- p11 = g_hash_table_lookup (service->private->dedupe_hash, p1->md5);
-
- if (p11) {
- if (p11 != p1) {
-#if EI2_DEBUG & 0x4
- trilobite_debug ("\tdeduping(b) %p %s is already read at %p %s", p1, p1->name, p11, p11->name);
-#endif
- gtk_object_ref (GTK_OBJECT (p11));
- gtk_object_unref (GTK_OBJECT (p1));
- d->package = p11;
- } else {
-#if EI2_DEBUG & 0x4
- trilobite_debug ("\tnot deduping(b) myself %p %s", p11, p11->name, p1);
-#endif
- }
- } else {
- add_to_dedupe_hash (service, p1);
- dedupe_foreach ((gpointer)p1, service);
- }
-}
-
-void
-dedupe_foreach (gpointer ptr,
- EazelInstall *service)
-{
- PackageData *package = NULL;
-
- g_assert (ptr);
- g_assert (service);
- g_assert (EAZEL_IS_INSTALL (service));
-
- if (IS_PACKAGEDATA (ptr)) {
- package = PACKAGEDATA (ptr);
- } else if (IS_PACKAGEDEPENDENCY (ptr)) {
- package = PACKAGEDEPENDENCY (ptr)->package;
- } else {
- g_assert_not_reached ();
- }
-
- g_list_foreach (package->depends, (GFunc)dedupe_foreach_depends, service);
-}
-
-void
-dedupe (EazelInstall *service,
- GList *packages)
-{
- g_assert (service);
- g_assert (EAZEL_IS_INSTALL (service));
-
- g_list_foreach (packages, (GFunc)dedupe_foreach, service);
-#if EI2_DEBUG & 0x2
- dump_tree (packages);
-#endif
-}
-
-/***********************************************************************************/
-
-/* This is the code to remove already satisfied dependencies */
-
-void check_dependencies (EazelInstall *service, GList *packages);
-void check_dependencies_foreach (EazelInstall *service, GList *packages, PackageData *package);
-gboolean is_satisfied (EazelInstall *service, GList *packages, PackageDependency *dep);
-gboolean is_satisfied_features (EazelInstall *service, GList *packages, PackageData *package);
-gboolean is_satisfied_from_package_list (EazelInstall *service, GList *packages, PackageDependency *dep);
-
-/*
- FIXME: bugzilla.eazel.com 6809
- is_satisfied_from_package_list is flawed since it 1) looks also at unresolved deps,
- should only look at partly_resolved 2) is only looks at the current workset, and not the complete
- (ie. everything at the current level, but now upwards */
-
-gboolean
-is_satisfied (EazelInstall *service,
- GList *packages,
- PackageDependency *dep)
-{
- char *key;
- int previous_check_state = 0;
- char *sense_str;
- gboolean result = FALSE;
-
- g_assert (dep);
- g_assert (IS_PACKAGEDEPENDENCY (dep));
- g_assert (service);
- g_assert (EAZEL_IS_INSTALL (service));
-
- /* FIXME:
- this checks that the package isn't already filled, but what if
- it is, but later fails, will we loose a dependency ? */
- /* First check if we've already downloaded the package */
- if (dep->package->fillflag == MUST_HAVE) {
-#if EI2_DEBUG & 0x4
- trilobite_debug ("is_satisfied? %p %s",
- dep->package, dep->package->name);
- trilobite_debug ("\t -> already filled, must be ok");
-#else
- g_message ("\tcached : %s",
- dep->package->name);
-#endif
-
- return FALSE;
- }
-
- /* If the dependency has a version, but no sense, something is terribly
- wrong with the xml */
-#if EI2_DEBUG & 0x4
- if (dep->version && dep->sense == 0) {
- trilobite_debug ("I'm going to die now, because softcat is making no sense");
- trilobite_debug ("Or rather, the xml returned a invalid dependency sense");
- }
-#endif
- if (dep->version) { g_assert (dep->sense!=0); }
-
- sense_str = eazel_softcat_sense_flags_to_string (dep->sense);
-#if EI2_DEBUG & 0x4
- trilobite_debug ("is_satisfied? %p %s %s %s",
- dep->package, dep->package->name, sense_str,
- (dep->version != NULL ? dep->version : ""));
-#endif
- key = g_strdup_printf ("%s/%s/%s", dep->package->name, sense_str,
- (dep->version != NULL ? dep->version : ""));
-
- if (key != NULL && strcmp (key, "(null)//")!=0) {
- previous_check_state = GPOINTER_TO_INT (g_hash_table_lookup (service->private->dep_ok_hash, key));
- }
-#if EI2_DEBUG & 0x4
- trilobite_debug ("\t--> key is %s", key);
-#endif
- switch (previous_check_state) {
- case DEPENDENCY_OK: {
-#if EI2_DEBUG & 0x4
- trilobite_debug ("\t--> dep hash ok");
-#endif
- result = TRUE;
- break;
- }
- case DEPENDENCY_NOT_OK: {
-#if EI2_DEBUG & 0x4
- trilobite_debug ("\t--> dep hash failed");
-#endif
- result = FALSE;
- break;
- }
- default: {
- /* If dependency has name and version, first check workset, then packages on system,
- and use the dependency's version/sense */
- if (dep->package->name && dep->version) {
- if (is_satisfied_from_package_list (service, packages, dep)) {
-#if EI2_DEBUG & 0x4
- trilobite_debug ("\t--> present with version in workset");
-#endif
- result = TRUE;
- } else if (eazel_package_system_is_installed (service->private->package_system,
- service->private->cur_root,
- dep->package->name,
- dep->version,
- NULL,
- dep->sense)) {
-#if EI2_DEBUG & 0x4
- trilobite_debug ("\t--> installed with version");
-#endif
- result = TRUE;
- }
- } else if (dep->package->features && is_satisfied_features (service, packages, dep->package)) {
- /* If package dependency didn't have a name/sense/version, but
- has features, check if features are installed */
-#if EI2_DEBUG & 0x4
- trilobite_debug ("\t--> features of package are satisfied");
-#endif
- result = TRUE;
- } else if (dep->package->name) {
- /* Else check for name in workset and then amongst installed packages,
- using sense ANY */
- if (is_satisfied_from_package_list (service, packages, dep)) {
-#if EI2_DEBUG & 0x4
- trilobite_debug ("\t--> present in workset");
-#endif
- result = TRUE;
- } else if (eazel_package_system_is_installed (service->private->package_system,
- service->private->cur_root,
- dep->package->name,
- NULL,
- NULL,
- EAZEL_SOFTCAT_SENSE_ANY)) {
-#if EI2_DEBUG & 0x4
- trilobite_debug ("\t--> installed");
-#endif
- result = TRUE;
- }
- }
-
- if (result) {
-#if EI2_DEBUG & 0x4
- trilobite_debug ("\t--> feature is satisfied");
-#endif
- g_hash_table_insert (service->private->dep_ok_hash,
- key,
- GINT_TO_POINTER (DEPENDENCY_OK));
- } else {
-#if EI2_DEBUG & 0x4
- trilobite_debug ("\t--> feature not satisfied");
-#endif
- g_hash_table_insert (service->private->dep_ok_hash,
- key,
- GINT_TO_POINTER (DEPENDENCY_NOT_OK));
- }
- }
- }
-
-#if ~EI2_DEBUG & 0x4
- g_message ("\t%8.8s : %s %s %s",
- /* I18N note: ok is for "package dependencies are ok", "not ok".. well guess... */
- result ? _("ok") : _("not ok"),
- dep->package->name, sense_str,
- (dep->version != NULL ? dep->version : ""));
-#endif
- g_free (sense_str);
- return result;
-}
-
-gboolean
-is_satisfied_from_package_list (EazelInstall *service,
- GList *packages,
- PackageDependency *dep)
-{
- GList *iterator;
- GList *flat_packages;
- gboolean result = FALSE;
-
-#if EI2_DEBUG & 0x4
- trilobite_debug ("\t--> is_satisfied_from_packages %s from %d packages",
- dep->package->name, g_list_length (packages));
-#endif
- flat_packages = flatten_packagedata_dependency_tree (packages);
-
- for (iterator = flat_packages; iterator; iterator = g_list_next (iterator)) {
- PackageData *p = PACKAGEDATA (iterator->data);
- /*
- trilobite_debug ("\t\t --> checking %s %s %s",
- p->name,
- packagedata_status_enum_to_str (p->status),
- p->fillflag == MUST_HAVE ? "filled" : "not filled");
- */
- if (p->status == PACKAGE_PARTLY_RESOLVED &&
- (p->fillflag == MUST_HAVE) &&
- p->name &&
- (strcmp (p->name, dep->package->name)==0)) {
- trilobite_debug ("\t\t --> foo");
- if (dep->version) {
- int res;
- res = eazel_package_system_compare_version (service->private->package_system,
- dep->version,p->version);
- if (res==0 && dep->sense & EAZEL_SOFTCAT_SENSE_EQ) {
- result = TRUE;
- break;
- } else if (res < 0 && dep->sense & EAZEL_SOFTCAT_SENSE_LT) {
- result = TRUE;
- break;
- } else if (res > 0 && dep->sense & EAZEL_SOFTCAT_SENSE_GT) {
- result = TRUE;
- break;
- }
- } else {
- result = TRUE;
- break;
- }
- }
- }
-
- g_list_free (flat_packages);
- return result;
-}
-
-gboolean
-is_satisfied_features (EazelInstall *service,
- GList *packages,
- PackageData *package)
-{
- gboolean result = TRUE;
- GList *iterator;
- GList *features;
-
- g_assert (service);
- g_assert (EAZEL_IS_INSTALL (service));
- g_assert (package);
- g_assert (IS_PACKAGEDATA (package));
-
- features = package->features;
-
-#if EI2_DEBUG & 0x4
- trilobite_debug ("\t -> is_satisfied_features %d features", g_list_length (features));
-#endif
-
- for (iterator = features; iterator && result; iterator = g_list_next (iterator)) {
- GList *query_result;
- char *f = (char*)iterator->data;
-
-#if EI2_DEBUG & 0x4
- trilobite_debug ("\t -> %s", f);
-#endif
- query_result = eazel_package_system_query (service->private->package_system,
- service->private->cur_root,
- f,
- EAZEL_PACKAGE_SYSTEM_QUERY_PROVIDES,
- PACKAGE_FILL_MINIMAL);
- if (g_list_length (query_result) == 0) {
- query_result = eazel_package_system_query (service->private->package_system,
- service->private->cur_root,
- f,
- EAZEL_PACKAGE_SYSTEM_QUERY_OWNS,
- PACKAGE_FILL_MINIMAL);
- if (g_list_length (query_result) == 0) {
-#if EI2_DEBUG & 0x4
- trilobite_debug ("\t -> noone owns or provides %s", f);
-#endif
- result = FALSE;
-
-/* This is a workaround for a softcat bug "speciality, where packagedependencies
- with no sense are reported as a <FEATURE>foo</FEATURE>. When bug 1129
- is closed, remove this evilness */
-#if PATCH_FOR_SOFTCAT_BUG
- if (eazel_package_system_is_installed (service->private->package_system,
- service->private->cur_root,
- f, NULL, NULL,
- EAZEL_SOFTCAT_SENSE_ANY)) {
-#if EI2_DEBUG & 0x4
- trilobite_debug ("\t -> but a package called %s exists", f);
-#endif
- result = TRUE;
- }
-#endif
- }
- }
- g_list_foreach (query_result, (GFunc)gtk_object_unref, NULL);
- g_list_free (query_result);
- }
-
- return result;
-}
-
-void
-check_dependencies_foreach (EazelInstall *service,
- GList *packages,
- PackageData *package)
-{
- GList *remove = NULL;
- GList *iterator;
-
- g_assert (service);
- g_assert (EAZEL_IS_INSTALL (service));
- g_assert (package);
- g_assert (IS_PACKAGEDATA (package));
-
- /* If the package was cancelled, don't process it's dependencies */
- if (package->status == PACKAGE_CANCELLED ||
- (package->status == PACKAGE_ALREADY_INSTALLED && package->modifies==NULL)) {
- g_list_foreach (package->depends, (GFunc)gtk_object_unref, NULL);
- g_list_free (package->depends);
- package->depends = NULL;
- return;
- }
-
- if (packagedata_is_suite (package)) {
- for (iterator = package->depends; iterator; iterator = g_list_next (iterator)) {
- PackageDependency *dep = PACKAGEDEPENDENCY (iterator->data);
- dep->package->fillflag = PACKAGE_FILL_INVALID;
- g_list_foreach (dep->package->depends, (GFunc)gtk_object_unref, NULL);
- dep->package->depends = NULL;
- }
-#if EI2_DEBUG & 0x4
- trilobite_debug ("skipping suite %p %s", package, package->suite_id);
-#endif
- }
-
-
-#if EI2_DEBUG & 0x4
- trilobite_debug ("check deps for %p %s", package, package->name);
-#else
- g_message (_("Checking dependencies for %s"), package->name);
-#endif
-
- for (iterator = package->depends; iterator; iterator = g_list_next (iterator)) {
- PackageDependency *dep = PACKAGEDEPENDENCY (iterator->data);
-
- if (dep->package->name && package->name && strcmp (dep->package->name, package->name)==0) {
- char *name_a, *name_b;
-
- name_a = packagedata_get_readable_name (package);
- name_b = packagedata_get_readable_name (dep->package);
-
- g_warning ("Inconsistency!");
- g_warning ("%s depends on %s", name_a, name_b);
-
- g_free (name_a);
- g_free (name_b);
-
- package->status = PACKAGE_CIRCULAR_DEPENDENCY;
- } else {
- if (is_satisfied (service, packages, dep)) {
- remove = g_list_prepend (remove, dep);
- } else {
- eazel_install_emit_dependency_check (service, package, dep);
- }
- }
- }
-
- for (iterator = remove; iterator; iterator = g_list_next (iterator)) {
- PackageDependency *dep = PACKAGEDEPENDENCY (iterator->data);
- package->depends = g_list_remove (package->depends, dep);
-#if EI2_DEBUG & 0x4
- trilobite_debug ("removing %p %s from %p %s",
- dep->package, dep->package->name,
- package, package->name);
-#endif
- gtk_object_unref (GTK_OBJECT (dep));
- }
- g_list_free (remove);
-}
-
-void
-check_dependencies (EazelInstall *service,
- GList *packages)
-{
- GList *iterator;
-
- g_assert (service);
- g_assert (EAZEL_INSTALL (service));
-
- for (iterator = packages; iterator; iterator = g_list_next (iterator)) {
- PackageData *package = NULL;
- gpointer ptr = iterator->data;
-
- if (IS_PACKAGEDATA (ptr)) {
- package = PACKAGEDATA (ptr);
- } else if (IS_PACKAGEDEPENDENCY (ptr)) {
- package = PACKAGEDEPENDENCY (ptr)->package;
- } else {
- g_assert_not_reached ();
- }
-
- check_dependencies_foreach (service, packages, package);
- }
-
-#if EI2_DEBUG & 0x1
- trilobite_debug ("post dep_check tree");
- dump_tree (packages);
-#endif
-}
-
-/***********************************************************************************/
-
-/* This is the main dependency check function */
-
-void do_dep_check_internal (EazelInstall *service, GList *packages);
-void do_dep_check (EazelInstall *service, GList **packages);
-void do_requirement_consistency_check (EazelInstall *service, GList *packages);
-void do_requirement_consistency_check_internal (EazelInstall *service, GList *packages);
-
-void
-do_dep_check_internal (EazelInstall *service,
- GList *packages)
-{
- GList *iterator;
- GList *K = NULL;
-
- g_assert (service);
- g_assert (EAZEL_IS_INSTALL (service));
-
- if (packages==NULL) {
- return;
- }
-
-#if EI2_DEBUG & 0x1
- trilobite_debug ("do_dep_check tree");
- dump_tree (packages);
-#endif
-
- get_package_info (service, packages);
- dedupe (service, packages);
- check_dependencies (service, packages);
-
- /* we might have received a "stop" callback recently */
- if (service->private->cancel_download) {
- return;
- }
-
- /* Build the K list, consisting of packages without must_have set... */
- for (iterator = packages; iterator; iterator = g_list_next (iterator)) {
- GList *diterator;
- PackageData *pack = NULL;
-
- if (IS_PACKAGEDATA (iterator->data)) {
- pack = PACKAGEDATA (iterator->data);
- } else if (IS_PACKAGEDEPENDENCY (iterator->data)) {
- pack = PACKAGEDEPENDENCY (iterator->data)->package;
- }
-
- for (diterator = pack->depends; diterator; diterator = g_list_next (diterator)) {
- PackageDependency *dep = PACKAGEDEPENDENCY (diterator->data);
- if (((~dep->package->fillflag & MUST_HAVE) ||
- packagedata_is_suite (pack)) &&
- (g_list_find (K, dep->package)==NULL)) {
- K = g_list_prepend (K, dep);
- }
- }
- }
-
- /* ... and process them */
- if (K) {
- do_dep_check_internal (service, K);
- }
-}
-
-void
-do_dep_check (EazelInstall *service,
- GList **packages)
-{
- /* Shift to the internal. We want to do a prune_failed_packages
- after completion, but since the do_dep_check algorithm is
- recursive, we call an internal function here. */
- do_dep_check_internal (service, *packages);
- prune_failed_packages (service, packages);
-}
-
-/* This function is used by do_requirement_consistency_check_package.
- "pack" is a package which modified "updated", and "dep" is a
- dependency that someone else has on updated.
-
- To accept :
- calculate version compare value x for cmp (dep->version, pack->version)
- if upgrading the package and sense is any, accept
- if upgrading the package and sense has >, accept
- if upgrading the package and sense has <, accept if x > 0
- if upgrading the package and sense has =, accept if x = 0
- vice versa for downgrade (flipping the ><'s)
-
- This will not be called with dep->sense = ANY, since these are always ok.
-*/
-static gboolean
-check_if_modification_is_ok (EazelInstall *service,
- PackageData *pack,
- PackageData *updated,
- PackageDependency *dep)
-{
- gboolean accept = FALSE;
- int x;
-
- /* But just in case.... */
- if (dep->sense == EAZEL_SOFTCAT_SENSE_ANY) {
- return TRUE;
- }
-
- x = eazel_package_system_compare_version (service->private->package_system,
- dep->version,
- pack->version);
-
- switch (updated->modify_status) {
- case PACKAGE_MOD_UPGRADED:
-#if EI2_DEBUG & 0x4
- trilobite_debug ("\t\t\t\t -> checking if upgrade is ok");
-#endif
- if (dep->sense & EAZEL_SOFTCAT_SENSE_GT) {
- /* is sense it has > in it, upgrading is safe */
- accept = TRUE;
- } else if (dep->sense & EAZEL_SOFTCAT_SENSE_LT) {
- /* if sense it has < in it, upgrade is
- safe if dep->version is > pack->version*/
- if (x > 0) {
- accept = TRUE;
- }
- } else if (dep->sense & EAZEL_SOFTCAT_SENSE_EQ) {
- /* if sense is =, upgrade is safe if
- x == 0 */
- if (x == 0) {
- accept = TRUE;
- }
- }
- break;
- case PACKAGE_MOD_DOWNGRADED:
-#if EI2_DEBUG & 0x4
- trilobite_debug ("\t\t\t\t -> checking if downgrade is ok");
-#endif
- if (dep->sense & EAZEL_SOFTCAT_SENSE_LT) {
- /* is sense it has < in it,
- downgrading is safe */
- accept = TRUE;
- } else if (dep->sense & EAZEL_SOFTCAT_SENSE_GT) {
- /* if sense it has > in it, upgrade is
- safe if pack->version is > dep->version */
- if (x < 0) {
- accept = TRUE;
- }
- } else if (dep->sense & EAZEL_SOFTCAT_SENSE_EQ) {
- /* if sense is =, upgrade is safe if
- x == 0 */
- if (x == 0) {
- accept = TRUE;
- }
- }
- break;
- default:
- break;
- }
-
-#if EI2_DEBUG & 0x4
- trilobite_debug ("\t\t\t\t -> %s", accept ? "yarh" : "argh");
-#endif
-
- return accept;
-}
-
-static int
-find_break_by_package_name (PackageBreaks *breaks, PackageData *pack)
-{
- return eazel_install_package_compare (packagebreaks_get_package (breaks),
- pack);
-}
-
-/*
- Traverse the packages modifies and query for packages R that require them
- foreach r in R
- foreach d in R->depends
- if d->version && d->package is set (and sense isn'any)
- if modification not ok, add breaks structure
- */
-static void
-do_requirement_consistency_check_package (EazelInstall *service,
- GList *packages,
- PackageData *pack)
-{
- GList *iterator;
-
-#if EI2_DEBUG & 0x4
- trilobite_debug ("\t -> do_requirement_consistency_check_package (%p %s)", pack, pack->name);
-#endif
-
- if (GPOINTER_TO_INT (gtk_object_get_data (GTK_OBJECT (pack), "do_requirement_consistency_check"))!=0) {
- return;
- }
- gtk_object_set_data (GTK_OBJECT (pack), "do_requirement_consistency_check", GINT_TO_POINTER (1));
-
- /* Check all the modifies of the package */
- for (iterator = pack->modifies; iterator; iterator = g_list_next (iterator)) {
- PackageData *updated = PACKAGEDATA (iterator->data);
- GList *requiredby_list = NULL;
- GList *requiredby_it;
-
- GList *feature_cache;
- GList *provide_cache;
-
-#if EI2_DEBUG & 0x4
- trilobite_debug ("\t -> querying for who requires %s", updated->name);
-#endif
- /* I temporarily omit the provides, since we later do a provide consistency check */
- feature_cache = updated->features;
- updated->features = NULL;
- provide_cache = updated->provides;
- updated->provides = NULL;
-
- /* Get the packages that require the modified package */
- requiredby_list = eazel_package_system_query (service->private->package_system,
- service->private->cur_root,
- updated,
- EAZEL_PACKAGE_SYSTEM_QUERY_REQUIRES,
- PACKAGE_FILL_NO_PROVIDES);
- updated->features = feature_cache;
- updated->provides = provide_cache;
-
- /* Now check all the dependencies of the packages that requires the modified package */
- for (requiredby_it = requiredby_list; requiredby_it; requiredby_it = g_list_next (requiredby_it)) {
- PackageData *requiredby = PACKAGEDATA (requiredby_it->data);
- GList *dep_it;
-
-#if EI2_DEBUG & 0x4
- trilobite_debug ("\t\t -> scanning deps for %s", requiredby->name);
-#endif
- /* If the package that requries something from the modified package is
- in the current workset, assume the other parts of the dependency voodoo
- works and we can there just continue... */
-
- if (g_list_find_custom (packages,
- requiredby->name,
- (GCompareFunc)eazel_install_package_name_compare)) {
-#if EI2_DEBUG & 0x4
- trilobite_debug ("\t\t -> since it's in packages, it's fine...");
-#endif
- } else for (dep_it = requiredby->depends; dep_it; dep_it = g_list_next (dep_it)) {
- PackageDependency *dep = PACKAGEDEPENDENCY (dep_it->data);
- if (dep->package && dep->version) {
- /* if this is a dep for the updated package, and sense
- isn't ANY, check if modification is safe.
- Note, sense will never be ANY (since you can't have ANY sense
- and a version, but just for purity, I check for it */
- if (dep->package->name &&
- strcmp (dep->package->name, updated->name)==0 &&
- dep->sense != EAZEL_SOFTCAT_SENSE_ANY) {
-#if EI2_DEBUG & 0x4
- trilobite_debug ("\t\t\t -> %p %s requires %s %s %s",
- requiredby, requiredby->name,
- dep->package->name,
- eazel_softcat_sense_flags_to_string (dep->sense),
- dep->version);
-#endif
- if (check_if_modification_is_ok (service,
- pack,
- updated,
- dep)
- == FALSE) {
- /* If we fail, mark pack as breaking requiredby */
- if (g_list_find_custom (pack->breaks,
- updated,
- (GCompareFunc)find_break_by_package_name)==NULL) {
- PackageFeatureMissing *breakage =
- packagefeaturemissing_new ();
- PackageDependency *req_dep = packagedependency_new();
-
- /* Ref mojo */
- gtk_object_ref (GTK_OBJECT (updated));
- gtk_object_ref (GTK_OBJECT (requiredby));
- req_dep->package = updated;
- req_dep->sense = dep->sense;
- req_dep->version = g_strdup (dep->version);
- packagedata_add_pack_to_depends (requiredby, req_dep);
- pack->status = PACKAGE_BREAKS_DEPENDENCY;
- packagebreaks_set_package (PACKAGEBREAKS (breakage),
- requiredby);
- packagedata_add_to_breaks (pack, PACKAGEBREAKS (breakage));
- }
- }
- }
- }
- }
- }
- g_list_foreach (requiredby_list, (GFunc)gtk_object_unref, NULL);
- g_list_free (requiredby_list);
- }
-}
-
-void
-do_requirement_consistency_check_internal (EazelInstall *service,
- GList *packages)
-{
- GList *iterator;
-
-#if EI2_DEBUG & 0x4
- trilobite_debug ("--> do_requirement_consistency_check_internal");
-#endif
-
- for (iterator = packages; iterator; iterator = g_list_next (iterator)) {
- PackageData *pack = PACKAGEDATA (iterator->data);
- if (pack->modifies) {
-#if EI2_DEBUG & 0x4
- trilobite_debug ("\t -> checking %p %s", pack, pack->name);
-#endif
- do_requirement_consistency_check_package (service, packages, pack);
-
- }
- }
-
-#if EI2_DEBUG & 0x4
- trilobite_debug ("<-- do_requirement_consistency_check_internal");
-#endif
-}
-
-void
-do_requirement_consistency_check (EazelInstall *service,
- GList *packages)
-{
- GList *flat_packages;
-
- flat_packages = flatten_packagedata_dependency_tree (packages);
- do_requirement_consistency_check_internal (service, flat_packages);
- g_list_free (flat_packages);
-}
-
-/***********************************************************************************/
-
-/* This is the main file conflicts check hell */
-
-void do_file_conflict_check (EazelInstall *service, GList **packages, GList **extra_packages);
-void check_no_two_packages_has_same_file (EazelInstall *service, GList *packages);
-void check_feature_consistency (EazelInstall *service, GList *packages);
-void check_conflicts_against_already_installed_packages (EazelInstall *service, GList *packages);
-void check_tree_for_conflicts (EazelInstall *service, GList **packages, GList **extra_packages);
-gboolean check_if_modified_related_package (EazelInstall *service, PackageData *package, PackageData *dep);
-gboolean check_if_related_package (EazelInstall *service, PackageData *package, PackageData *dep);
-
-/*
- This function tests whether "package" and "dep"
- seems to be related in some way.
- This is done by checking the package->modifies list for
- elements that have same version as dep->version.
- I then compare these elements against dep->name,
- and if one matches the x-y-z vs dep->name=x-y scheme,
- I declare that "package" and "dep" are related
-*/
-gboolean
-check_if_related_package (EazelInstall *service,
- PackageData *package,
- PackageData *dep)
-{
- /* Pessimisn mode = HIGH */
- gboolean result = FALSE;
- char **dep_name_elements;
- char **mod_name_elements;
- char *dep_name_iterator;
- char *mod_name_iterator;
- int cnt = 0;
-
-#if EI2_DEBUG & 0x4
- trilobite_debug ("check_if_related_package (%p %s-%s, %p %s-%s)",
- package, package->name, package->version,
- dep, dep->name, dep->version);
-#endif
-
- /* If the two packages don't have the same version, they're not related.
- While this may seem to be too restrictive, it's how it has to
- be done in the context where this call is used */
- if (eazel_package_system_compare_version (service->private->package_system,
- package->version,
- dep->version) != 0) {
-#if EI2_DEBUG & 0x4
- trilobite_debug ("versions do not match, not related");
-#endif
- return FALSE;
- }
-
- dep_name_elements = g_strsplit (dep->name, "-", 80);
- mod_name_elements = g_strsplit (package->name, "-", 80);
-
- for (cnt=0; TRUE;cnt++) {
- dep_name_iterator = dep_name_elements[cnt];
- mod_name_iterator = mod_name_elements[cnt];
-#if 0
- trilobite_debug ("dep name iterator = \"%s\"", dep_name_iterator);
- trilobite_debug ("mod name iterator = \"%s\"", mod_name_iterator);
-#endif
- if ((dep_name_iterator==NULL) ||
- (mod_name_iterator==NULL)) {
- break;
- }
- if ((strlen (dep_name_iterator) == strlen (mod_name_iterator)) &&
- (strcmp (dep_name_iterator, mod_name_iterator)==0)) {
- continue;
- }
- break;
- }
- if (cnt >= 1) {
- if (!result) {
- result = TRUE;
- } else {
- trilobite_debug ("but what blows is, the previous also did!!");
- package->status = PACKAGE_CANCELLED;
- result = FALSE;
- }
- } else {
-#if EI2_DEBUG & 0x4
- trilobite_debug ("%s-%s is not related to %s-%s",
- dep->name, dep->version,
- package->name, package->version);
-#endif
- }
-
- g_strfreev (mod_name_elements);
- g_strfreev (dep_name_elements);
- return result;
-}
-
-/*
- This function tests whether "package" has modifieds that are related to "dep" in any way.
-*/
-gboolean
-check_if_modified_related_package (EazelInstall *service,
- PackageData *package,
- PackageData *dep)
-{
- /* Pessimisn mode = HIGH */
- gboolean result = FALSE;
- GList *potiental_mates;
-
- potiental_mates = package->modifies;
-
- while ((result == FALSE) &&
- (potiental_mates =
- g_list_find_custom (potiental_mates,
- dep->version,
- (GCompareFunc)eazel_install_package_version_compare))!=NULL) {
- PackageData *modpack = PACKAGEDATA (potiental_mates->data);
-#if EI2_DEBUG & 0x4
- trilobite_debug ("checking against %p %s-%s %p %s-%s %p %s-%s",
- package,
- package->name, package->version,
- modpack,
- modpack->name,
- modpack->version,
- dep, dep->name, dep->version);
-#endif
- if (check_if_related_package (service,
- modpack,
- dep) == TRUE) {
-#if EI2_DEBUG & 0x4
- trilobite_debug ("%s-%s seems to be a related package of %s-%s, which %s-%s modifies",
- dep->name, dep->version,
- modpack->name, modpack->version,
- package->name, package->version);
-#endif
- result = TRUE;
- }
- /* Skip one ahead */
- potiental_mates = g_list_next (potiental_mates);
- }
-
- return result;
-}
-
-static gboolean
-check_update_for_no_more_file_conflicts (PackageFileConflict *conflict,
- PackageData *pack_update)
-{
- GList *iterator;
-
- g_assert (IS_PACKAGEFILECONFLICT (conflict));
- g_assert (conflict->files);
- g_assert (g_list_length (conflict->files));
-
- trilobite_debug ("-> check_update_for_no_more_file_conflicts");
-
- for (iterator = conflict->files; iterator; iterator = g_list_next (iterator)) {
- char *filename = (char*)iterator->data;
- trilobite_debug ("\t checking %s", filename);
- if (g_list_find_custom (pack_update->provides,
- filename,
- (GCompareFunc)strcmp)) {
-
- trilobite_debug ("<- check_update_for_no_more_file_conflicts FALSE");
- return FALSE;
- }
- }
- trilobite_debug ("<- check_update_for_no_more_file_conflicts TRUE");
- return TRUE;
-}
-
-static gboolean
-check_for_no_more_missing_features (PackageFeatureMissing *missing,
- PackageData *pack_update)
-{
- /* FIXME: bugzilla.eazel.com 6811 */
- /*
- tjek that the update no longer requires
- missing->features;
- for each F in missing->features {
- for each D in pack_update->depends {
- if F occurs in D->features pack_update still needs feature F
- }
- }
-
- */
- GList *iterator;
-
- for (iterator = missing->features; iterator; iterator = g_list_next (iterator)) {
- char *feature = (char*)iterator->data;
- GList *dep_iterator;
-
- for (dep_iterator = pack_update->depends; dep_iterator; dep_iterator = g_list_next (dep_iterator)) {
- PackageDependency *dep = PACKAGEDEPENDENCY (dep_iterator->data);
- PackageData *pack = dep->package;
-
- if (pack==NULL) { continue; }
- if (g_list_find (pack->features, feature)) {
- return FALSE;
- }
- }
- }
-
- return TRUE;
-}
-
-
-static void
-check_tree_helper (EazelInstall *service,
- PackageData *pack,
- GList **extra_packages,
- GList **path)
-{
- GList *iterator;
- GList *remove = NULL;
-
- if (g_list_find (*path, pack)) {
-#if EI2_DEBUG & 0x4
- trilobite_debug ("... %p %s recurses ..", pack, pack->name);
-#endif
- return;
- }
-
- if (pack->status == PACKAGE_FILE_CONFLICT ||
- pack->status == PACKAGE_BREAKS_DEPENDENCY) {
- if (eazel_install_get_upgrade (service)==FALSE) {
-#if EI2_DEBUG & 0x4
- trilobite_debug ("cannot revive %s, update not allowed", pack->name);
-#endif
- }
-#if EI2_DEBUG & 0x4
- trilobite_debug ("trying to revive %p %s", pack, pack->name);
-#else
- g_message ("trying to revive %s", pack->name);
-#endif
- /* Iterate over all the breakages registered so far */
- for (iterator = pack->breaks; iterator; iterator = g_list_next (iterator)) {
- PackageBreaks *breakage = PACKAGEBREAKS (iterator->data);
-
- PackageData *pack_broken = packagebreaks_get_package (breakage);
- PackageData *pack_update = NULL;
- gboolean update_available = FALSE;
- gboolean related = FALSE;
-
- related = check_if_modified_related_package (service,
- pack,
- pack_broken);
- /* If the package we're operating on modifies somehthing that is related,
- get an exact (matching) version instead of just checking for an
- update. This is typicall for recovering from breaking a -devel package */
-
- if (related) {
- char *a, *b;
- a = packagedata_get_readable_name (pack);
- b = packagedata_get_readable_name (pack_broken);
- /* I18N note: both %s' are package names.
- related is in the sense that the two packages apparently
- are connected somehow, eg. foo and foo-devel */
- g_message (_("%s is related to %s"),
- a, b);
-
- /* Create the pack_update */
- pack_update = packagedata_new ();
- pack_update->name = g_strdup (pack_broken->name);
- pack_update->version = g_strdup (pack->version);
- pack_update->distribution = pack_broken->distribution;
- pack_update->archtype = g_strdup (pack_broken->archtype);
-
- /* Try and get the info */
- if (eazel_softcat_get_info (service->private->softcat,
- pack_update,
- EAZEL_SOFTCAT_SENSE_EQ,
- MUST_HAVE)
- != EAZEL_SOFTCAT_SUCCESS) {
- update_available = FALSE;
- /* if we failed, delete the package object */
- gtk_object_unref (GTK_OBJECT (pack_update));
- } else {
- update_available = TRUE;
- }
-
- g_free (a);
- g_free (b);
- } else {
- update_available =
- eazel_softcat_available_update (service->private->softcat,
- pack_broken,
- &pack_update,
- MUST_HAVE);
- }
-
- /* If we got the update, do the post_check check,
- which sets the modifies list and checks for dupes in the
- dedupe hash, also checks to see if a possible upgrade/downgrade
- is allowed */
- if (update_available) {
- if (post_check (service, &pack_update, SOFTCAT_HIT_OK) !=
- SOFTCAT_HIT_OK) {
- update_available = FALSE;
- }
- }
-
- /* So far so good... */
- if (update_available) {
- gboolean proceed = TRUE;
-
- /* Now we need to see if the proposed package
- resolves the current problem */
- if (IS_PACKAGEFILECONFLICT (breakage)) {
- PackageFileConflict *conflict = PACKAGEFILECONFLICT (breakage);
-
- /* If they're not related, check that the proposed update no
- longer has the offending file(s).
- If they're related, it will typically be foo and foo-devel with
- same version number, and the double ownership of the file
- will be ok */
- if (related==FALSE && check_update_for_no_more_file_conflicts (conflict, pack_update)==FALSE) {
- proceed = FALSE;
- }
- } else if (IS_PACKAGEFEATUREMISSING (breakage)) {
- PackageFeatureMissing *missing = PACKAGEFEATUREMISSING (breakage);
-
- /* Check that the package we're proposing to update to does not
- require the feature that would be lost */
- if (check_for_no_more_missing_features (missing, pack_update)==FALSE) {
- proceed = FALSE;
- }
- }
- if (proceed) {
- /* The proposed package did indeed resolve this problem... */
-#if EI2_DEBUG & 0x4
- trilobite_debug ("adding %s to packages to be installed, conflicts resolved",
- pack_update->name);
-#else
- g_message (_("updating %s to version %s-%s solves conflict"),
- pack_update->name, pack_update->version,
- pack_update->minor);
-#endif
- /* If not already in extra_packages, add it.
- Since post_softcat_get_info dedupes, even multiple
- resolves to the same package will at this point be
- the same package */
- if (g_list_find ((*extra_packages), pack_update)==NULL) {
- /* ref the package and add it to the extra_packages list */
- gtk_object_ref (GTK_OBJECT (pack_update));
- (*extra_packages) = g_list_prepend (*extra_packages,
- pack_update);
- pack_update->status = PACKAGE_PARTLY_RESOLVED;
- }
-
- remove = g_list_prepend (remove, breakage);
- pack_update->toplevel = TRUE;
- } else {
- /* Nope, proposed package did not help... */
-#if EI2_DEBUG & 0x4
- trilobite_debug ("%s still has conflict", pack_update->name);
-#else
- g_message (_("available update to %s (%s-%s) does not solves conflict"),
- pack_update->name,
- pack_update->version, pack_update->minor);
-#endif
- /* If a previous resolve added it to the list, remove it again */
- if (g_list_find ((*extra_packages), pack_update)!=NULL) {
- (*extra_packages) = g_list_remove ((*extra_packages), pack_update);
- }
- /* And remove it from the dedupe hash */
- g_hash_table_remove (service->private->dedupe_hash,
- pack_update->md5);
- /* and blast it away */
- gtk_object_unref (GTK_OBJECT (pack_update));
- }
- } else {
- g_message (_("could not revive %s"), pack->name);
- }
- }
-
- /* Now nuke the successfully revived PackageBreaks */
- for (iterator = remove; iterator; iterator = g_list_next (iterator)) {
- PackageBreaks *breakage = PACKAGEBREAKS (iterator->data);
- gtk_object_unref (GTK_OBJECT (breakage));
- pack->breaks = g_list_remove (pack->breaks, breakage);
- }
- g_list_free (remove);
-
- /* if no breaks were unrevived, null out the list */
- if (g_list_length (pack->breaks)==0) {
- /* reset the broken to some sane values if it has no more issues */
- pack->status = PACKAGE_PARTLY_RESOLVED;
- g_list_free (pack->breaks);
- pack->breaks = NULL;
- }
- }
-
- for (iterator = pack->depends; iterator; iterator = g_list_next (iterator)) {
- PackageDependency *dep = PACKAGEDEPENDENCY (iterator->data);
- (*path) = g_list_prepend (*path, pack);
- check_tree_helper (service, dep->package, extra_packages, path);
- (*path) = g_list_remove (*path, pack);
- }
-}
-
-/*
- Scan the tree for file conflicts. Add the broken packages to extra_packages
- and reset the status flag on the offending package. Since the prune_failed_packages
- is called at every step, we won't risk resetting a borked package to ok.
- */
-void
-check_tree_for_conflicts (EazelInstall *service,
- GList **packages,
- GList **extra_packages)
-{
- GList *iterator;
-#if EI2_DEBUG & 0x4
- trilobite_debug ("-> check_tree_for_conflicts");
-#endif
- for (iterator = g_list_first (*packages); iterator != NULL; iterator = g_list_next (iterator)) {
- PackageData *pack = PACKAGEDATA (iterator->data);
- GList *path = NULL;
- check_tree_helper (service, pack, extra_packages, &path);
- }
-#if EI2_DEBUG & 0x4
- trilobite_debug ("<- check_tree_for_conflicts");
-#endif
-}
-
-static gboolean
-add_file_conflict (EazelInstall *service,
- PackageData *pack,
- PackageData *broken,
- char *filename)
-{
- GList *prev;
-
- if (check_if_related_package (service, pack, broken) == TRUE) {
-#if EI2_DEBUG & 0x4
- trilobite_debug ("\%p %s %p %s are related, ignoring conflict",
- pack, pack->name,
- broken, broken->name);
-#endif
- return FALSE;
- }
-
-#if EI2_DEBUG & 0x4
- trilobite_debug ("\tadding file conflict between %p %s %p %s",
- pack, pack->name,
- broken, broken->name);
-#endif
-
- prev = g_list_find_custom (pack->breaks,
- broken,
- (GCompareFunc)find_break_by_package_name);
- pack->status = PACKAGE_FILE_CONFLICT;
-
- if (prev) {
- PackageFileConflict *conflict = PACKAGEFILECONFLICT (prev->data);
- conflict->files = g_list_prepend (conflict->files, g_strdup (filename));
- } else {
- PackageFileConflict *conflict = packagefileconflict_new ();
-
- pack->status = PACKAGE_FILE_CONFLICT;
- broken->status = PACKAGE_FILE_CONFLICT;
-
- packagebreaks_set_package (PACKAGEBREAKS (conflict), broken);
- conflict->files = g_list_prepend (conflict->files, g_strdup (filename));
- packagedata_add_to_breaks (pack, PACKAGEBREAKS (conflict));
- gtk_object_unref (GTK_OBJECT (conflict));
- }
-
- return TRUE;
-}
-
-/* make sure none of the packages we're installing will share files
-
- add code to check that no two packages provides the same file
-
- hash<char*, PackageData> Hfile;
-
- for each p in packages {
- for each f in p->provides {
- if p'=Hfile[f] {
- # f is provided by p'
- whine (about p' conflicting with p over file f)
- set: p breaks p'
- } else {
- Hfile[f] = p;
- }
- }
- }
-
- (rough draft by robey:)
-*/
-void
-check_no_two_packages_has_same_file (EazelInstall *service,
- GList *packages)
-{
- GHashTable *file_table; /* filename(char *) -> package(PackageData *) */
- GList *iter, *iter_file;
- PackageData *pack, *pack_other;
- char *filename;
- GList *flat_packages;
-
- flat_packages = flatten_packagedata_dependency_tree (packages);
-
- if (eazel_install_get_ignore_file_conflicts (service) ||
- (g_list_length (flat_packages) == 1)) {
-#if EI2_DEBUG & 0x4
- trilobite_debug ("(not performing duplicate file check)");
-#endif
- g_list_free (flat_packages);
- return;
- }
-
- file_table = g_hash_table_new (g_str_hash, g_str_equal);
-
-#if EI2_DEBUG & 0x4
- trilobite_debug ("-> no-two-packages conflict check begins (%d unique packages)", g_list_length (flat_packages));
-#endif
-
- for (iter = g_list_first (flat_packages); iter != NULL; iter = g_list_next (iter)) {
- gboolean reported_yet = FALSE;
- int other_conflicts = 0;
-
- pack = PACKAGEDATA (iter->data);
-
- if (packagedata_is_suite (pack)) {
- continue;
- }
-
- g_message (_("file uniqueness checking %s"), pack->name);
- eazel_install_emit_file_uniqueness_check (service, pack);
-
- for (iter_file = g_list_first (pack->provides); iter_file != NULL; iter_file = g_list_next (iter_file)) {
- filename = (char *)(iter_file->data);
-
- pack_other = g_hash_table_lookup (file_table, filename);
- if (pack_other != NULL) {
- /* Dang, this file is provided by both 'pack' and 'pack_other' */
- /* Only report it once in the debug log or we'll spam to eternity on some
- * large broken packages... */
- if (! reported_yet) {
-#if EI2_DEBUG & 0x4
- trilobite_debug ("Duplicate file : %s occurs in %p %s and %p %s",
- filename, pack, pack->name,
- pack_other, pack_other->name);
-#else
- {
- char *a, *b;
- a = packagedata_get_readable_name (pack);
- b = packagedata_get_readable_name (pack_other);
- g_message (_("Duplicate file : %s occurs in %s and %s"),
- filename, a, b);
- g_free (a);
- g_free (b);
- }
-#endif
- reported_yet = TRUE;
- } else {
- other_conflicts++;
- }
- if (add_file_conflict (service, pack, pack_other, filename) == FALSE) {
- g_message (_("... but it's ok, the packages are related"));
- }
- } else {
- /* file is okay */
- g_hash_table_insert (file_table, filename, pack);
- }
- }
- if (other_conflicts) {
- g_message (_("(there were %d other conflicts)"), other_conflicts);
- }
- }
-
- /* let's free all this crap, unlike last time (cough cough) :) */
- /* elements in flat_packages are not to be unreffed */
- g_list_free (flat_packages);
- /* the hashentries point to strings inside the packagedata objects */
- g_hash_table_destroy (file_table);
-
-#if EI2_DEBUG & 0x4
- trilobite_debug ("<- no_two_packages conflict");
-#endif
-}
-
-/* determine if package 'pack' is being upgraded in the 'packages' list,
- * and that upgrade no longer needs 'filename'
- */
-static gboolean
-package_is_upgrading_and_doesnt_need_file (PackageData *pack, GList *packages, const char *filename)
-{
- PackageData *pack_upgrade;
- GList *item, *item2;
-
- /* Hmmm, would eazel_install_package_compare be better ? */
- item = g_list_find_custom (packages, pack->name,
- (GCompareFunc)eazel_install_package_name_compare);
- if (item != NULL) {
- pack_upgrade = PACKAGEDATA (item->data);
- item2 = g_list_find_custom (pack_upgrade->provides, (char *)filename, (GCompareFunc)strcmp);
- if (item2 == NULL) {
- /* package IS in the package list, and does NOT provide this file anymore */
- return TRUE;
- }
- }
- return FALSE;
-}
-
-/* check if any of our packages contain files that would conflict with packages already installed.
-
- Add code to do conflict checking against already installed packages.
-
- for each p in packages {
- for each f in p->provides {
- L = query (PROVIDES, f)
- L -= p->modifies # dont care about packages we're modifying
- if L.size > 0 {
- # someone else might own f
- foreach p' in L {
- next if p'->name == p->name
- if p' in packages (name compare && p->provides[f]==null) {
- # we're upgrading p' to p'' which doesn't have f,
- # so all is well
- } else {
- whine (p might break p' since they share f);
- }
- }
- } else {
- # f is fine, noone else owns it
- }
- }
- }
-
- (rough draft by robey:)
-*/
-void
-check_conflicts_against_already_installed_packages (EazelInstall *service,
- GList *packages)
-{
- GList *owners;
- GList *iter, *iter_file, *iter_pack;
- PackageData *pack, *pack_owner;
- char *filename;
- GList *flat_packages;
-
- if (eazel_install_get_ignore_file_conflicts (service)) {
-#if EI2_DEBUG & 0x4
- trilobite_debug ("(not performing file conflict check)");
-#endif
- return;
- }
-
- flat_packages = flatten_packagedata_dependency_tree (packages);
-
-#if EI2_DEBUG & 0x4
- trilobite_debug ("-> file conflict check begins (%d unique packages)", g_list_length (flat_packages));
-#endif
-
- for (iter = g_list_first (flat_packages); iter != NULL; iter = g_list_next (iter)) {
- pack = PACKAGEDATA (iter->data);
-
- if (pack->conflicts_checked || packagedata_is_suite (pack)) {
- continue;
- }
-
- g_message (_("file conflict checking %s"), pack->name);
- eazel_install_emit_file_conflict_check (service, pack);
-
- pack->conflicts_checked = TRUE;
- for (iter_file = g_list_first (pack->provides); iter_file != NULL; iter_file = g_list_next (iter_file)) {
- filename = (char *)(iter_file->data);
-
- /* If the file isn't on the system, no need to check for conflicts */
- if (access (filename, F_OK) != 0) {
- continue;
- }
-
- owners = eazel_package_system_query (service->private->package_system,
- service->private->cur_root,
- filename,
- EAZEL_PACKAGE_SYSTEM_QUERY_OWNS,
- OWNS_MUST_HAVE);
- /* No need to check packages that we modify */
- packagedata_list_prune (&owners, pack->modifies, TRUE, TRUE);
-
- for (iter_pack = g_list_first (owners); iter_pack != NULL; iter_pack = g_list_next (iter_pack)) {
- pack_owner = (PackageData *)(iter_pack->data);
-
- if (strcmp (pack_owner->name, pack->name) == 0) {
- /* can't conflict with self */
- gtk_object_unref (GTK_OBJECT (pack_owner));
- continue;
- }
-
-#if EI2_DEBUG & 0x4
- trilobite_debug ("file conflict : package %p %s already provides %s also provided by %p %s",
- pack_owner, pack_owner->name, filename, pack, pack->name);
-#else
- {
- char *a, *b;
- a = packagedata_get_readable_name (pack_owner);
- b = packagedata_get_readable_name (pack);
- g_message (_("file conflict : package %s already provides file %s also provided by %s"),
- a, filename, b);
- g_free (a);
- g_free (b);
- }
-#endif
- if (package_is_upgrading_and_doesnt_need_file (pack_owner,
- flat_packages, filename)) {
- /* the owner of this file is a package that we're upgrading, and the
- * new version no longer has this file, so everything's okay. */
- g_message (_("...but it is okay, we're upgrading %s and it ditched that file"),
- pack_owner->name);
- } else {
- if (add_file_conflict (service, pack, pack_owner, filename) == FALSE) {
- g_message (_("... but it's ok, the packages are related"));
- }
- }
- gtk_object_unref (GTK_OBJECT (pack_owner));
- }
- g_list_free (owners);
- }
- }
-
-#if EI2_DEBUG & 0x4
- trilobite_debug ("<- file conflict check ends");
-#endif
- g_list_free (flat_packages);
-}
-
-/*
- hash<char*, PackageData> Hfeat;
-
- for each p in packages {
- for each f in p->features {
- Hfeat[f] = p;
- }
- }
-
- for each p in packages {
- for each p' in p->modifies {
- for each f in p'->features {
- if Hfeat[f] {
- # all is well, feature is still on system
- } else {
- # feature is lost
- L = query (REQUIRES, f);
- if l.size > 0 {
- # and someone requires this feature
- whine (p updates p' which breaks packages in L);
- }
- }
- }
- }
- }
-*/
-void
-check_feature_consistency (EazelInstall *service,
- GList *packages)
-{
- GHashTable *feature_hash;
- GList *iterator;
- GList *flat_packages;
-
- flat_packages = flatten_packagedata_dependency_tree (packages);
-#if EI2_DEBUG & 0x4
- trilobite_debug ("-> check_feature_consistency begins, %d packages", g_list_length (flat_packages));
-#endif
- feature_hash = g_hash_table_new ((GHashFunc)g_str_hash,
- (GCompareFunc)g_str_equal);
-
- for (iterator = flat_packages; iterator; iterator = g_list_next (iterator)) {
- PackageData *pack = PACKAGEDATA (iterator->data);
- GList *feature_it;
-
- if (GPOINTER_TO_INT (gtk_object_get_data (GTK_OBJECT (pack), "do_feature_consistency_check"))!=0) {
- continue;
- }
-
-#if EI2_DEBUG & 0x4
- trilobite_debug ("%s provides %d features", pack->name, g_list_length (pack->features));
-#endif
- for (feature_it = pack->features; feature_it; feature_it = g_list_next (feature_it)) {
- char *feature = (char*)feature_it->data;
- g_hash_table_insert (feature_hash, feature, pack);
-#if EI2_DEBUG & 0x4
- trilobite_debug ("%s provides feature %s", pack->name, feature);
-#endif
- }
- }
-
- for (iterator = flat_packages; iterator; iterator = g_list_next (iterator)) {
- PackageData *pack = PACKAGEDATA (iterator->data);
- GList *modify_it;
-
- if (GPOINTER_TO_INT (gtk_object_get_data (GTK_OBJECT (pack), "do_feature_consistency_check"))!=0) {
- continue;
- }
- gtk_object_set_data (GTK_OBJECT (pack), "do_feature_consistency_check", GINT_TO_POINTER (1));
-
-#if EI2_DEBUG & 0x4
- trilobite_debug ("checking %s", pack->name);
-#else
- g_message (_("checking feature consistency of %s"), pack->name);
-#endif
- eazel_install_emit_feature_consistency_check (service, pack);
-
- for (modify_it = pack->modifies; modify_it; modify_it = g_list_next (modify_it)) {
- PackageData *pack_modified = PACKAGEDATA (modify_it->data);
- GList *feature_it;
-#if EI2_DEBUG & 0x4
- trilobite_debug ("%s modifies %s", pack->name, pack_modified->name);
-#endif
-
- for (feature_it = pack_modified->features; feature_it; feature_it = g_list_next (feature_it)) {
- char *feature = (char*)feature_it->data;
-
- if (g_hash_table_lookup (feature_hash, feature)) {
- /* Since feature was in hash, it is still provided by someone */
-#if EI2_DEBUG & 0x4
- trilobite_debug ("feature %s is ok", feature);
-#endif
- } else {
- GList *required_by;
- GList *break_it;
- /* Feature is lost */
-#if EI2_DEBUG & 0x4
- trilobite_debug ("feature %s is lost", feature);
-#endif
- required_by = eazel_package_system_query (service->private->package_system,
- service->private->cur_root,
- feature,
- EAZEL_PACKAGE_SYSTEM_QUERY_REQUIRES_FEATURE,
- PACKAGE_FILL_NO_DIRS_IN_PROVIDES);
-
-#if EI2_DEBUG & 0x4
- if (g_list_length (required_by)==0) {
- trilobite_debug ("but noone uses it...");
- }
-#endif
- for (break_it = required_by; break_it; break_it = g_list_next (break_it)) {
- PackageFeatureMissing *feature_missing = packagefeaturemissing_new ();
- PackageData *pack_broken = PACKAGEDATA (break_it->data);
-
- if (eazel_install_package_compare (pack_broken, pack_modified)==0) {
-#if EI2_DEBUG & 0x4
- trilobite_debug ("%p %s, it's my child",
- pack_broken, pack_broken->name);
-#endif
- continue;
-
- }
-
- if (g_list_find_custom (pack->breaks, pack_broken,
- (GCompareFunc)find_break_by_package_name)) {
-#if EI2_DEBUG & 0x4
- trilobite_debug ("%p %s, already marked as borked",
- pack_broken, pack_broken->name);
-#endif
- continue;
-
- }
-
- feature_missing = packagefeaturemissing_new ();
-
-#if EI2_DEBUG & 0x4
- trilobite_debug ("%p %s is broken by %p %s modifying %p %s",
- pack_broken, pack_broken->name,
- pack, pack->name,
- pack_modified, pack_modified->name);
-#else
- g_message (_("feature missing : %s breaks if %s is installed (feature %s would be lost"),
- pack_broken->name,
- pack->name,
- feature);
-#endif
- pack_broken->status = PACKAGE_DEPENDENCY_FAIL;
- pack->status = PACKAGE_BREAKS_DEPENDENCY;
- packagebreaks_set_package (PACKAGEBREAKS (feature_missing), pack_broken);
- feature_missing->features = g_list_prepend (feature_missing->features, g_strdup (feature));
- packagedata_add_to_breaks (pack, PACKAGEBREAKS (feature_missing));
- gtk_object_unref (GTK_OBJECT (pack_broken));
- }
- g_list_free (required_by);
- }
- }
- }
- }
-
- g_list_free (flat_packages);
- g_hash_table_destroy (feature_hash);
-
-#if EI2_DEBUG & 0x4
- trilobite_debug ("<- check_feature_consistency");
- trilobite_debug ("POST-FEATURE-CHECK PACKAGE TREE");
- dump_tree (packages);
-#endif
-}
-
-
-/* Main conflict entry point */
-void
-do_file_conflict_check (EazelInstall *service,
- GList **packages,
- GList **extra_packages)
-{
- g_assert (extra_packages);
-
- /* Check that no two packages in the work set provides the
- same files */
- check_no_two_packages_has_same_file (service, *packages);
- /* If so, prune them no, no point in trying to update */
- prune_failed_packages (service, packages);
-
- /* Check for file conflicts against already installed packages,
- if conflicts, try and revive */
- check_conflicts_against_already_installed_packages (service, *packages);
- do_requirement_consistency_check (service, *packages);
- check_tree_for_conflicts (service, packages, extra_packages);
- prune_failed_packages (service, packages);
-
- /* If packages were revived (added to extra_packages,
- exit and we'll be recursed, otherwise check
- feature consistency */
- if (*extra_packages==NULL) {
- check_feature_consistency (service, *packages);
- check_tree_for_conflicts (service, packages, extra_packages);
- prune_failed_packages (service, packages);
- } else {
-#if EI2_DEBUG & 0x4
- trilobite_debug ("extra_packages set, no doing feature consistency check");
-#endif
- }
-}
-
-/***********************************************************************************/
-
-/* This is the download stuff */
-
-gboolean download_packages (EazelInstall *service, GList *packages);
-
-gboolean
-download_packages (EazelInstall *service,
- GList *packages)
-{
- GList *flat_packages;
- GList *iterator;
- gboolean result = TRUE;
-
- flat_packages = flatten_packagedata_dependency_tree (packages);
- g_message (_("downloading %d packages"), g_list_length (flat_packages));
-
- service->private->cancel_download = FALSE;
- for (iterator = flat_packages; iterator; iterator = g_list_next (iterator)) {
- PackageData *pack = PACKAGEDATA (iterator->data);
- if (pack->filename == NULL) {
- if (eazel_install_fetch_package (service, pack) == FALSE) {
- result = FALSE;
- break;
- }
- if (service->private->cancel_download) {
- result = FALSE;
- break;
- }
- }
- }
-
- g_list_free (flat_packages);
-
- return result;
-}
-
-/***********************************************************************************/
-
-static gboolean
-clean_up_dedupe_hash (char *md5, PackageData *pack)
-{
- g_free (md5);
- if (IS_PACKAGEDATA (pack)) {
- gtk_object_unref (GTK_OBJECT (pack));
- } else if (IS_PACKAGEDEPENDENCY (pack)) {
- gtk_object_unref (GTK_OBJECT (pack));
- } else {
- g_assert_not_reached ();
- }
- return TRUE;
-}
-
-static gboolean
-clean_up_dep_ok_hash (char *key, gpointer unused)
-{
- g_free (key);
- return TRUE;
-}
-
-unsigned long
-eazel_install_get_total_size_of_packages (EazelInstall *service,
- const GList *packages)
-{
- const GList *iterator;
- unsigned long result = 0;
- for (iterator = packages; iterator; glist_step (iterator)) {
- PackageData *pack;
-
- pack = (PackageData*)iterator->data;
- result += pack->bytesize;
- }
- return result;
-}
-
-static gboolean
-execute (EazelInstall *service,
- GList *packages,
- EazelPackageSystemOperation op,
- int flags)
-{
- TrilobiteRootHelper *root_helper;
- GList *flat_packages;
- gboolean result = FALSE;
-
- flat_packages = flatten_packagedata_dependency_tree (packages);
-
- root_helper = gtk_object_get_data (GTK_OBJECT (service), "trilobite-root-helper");
- gtk_object_set_data (GTK_OBJECT (service->private->package_system),
- "trilobite-root-helper", root_helper);
-
- if (eazel_install_get_test (service)) {
- flags |= EAZEL_PACKAGE_SYSTEM_OPERATION_TEST;
- }
-
- if (eazel_install_get_force (service)) {
- flags |= EAZEL_PACKAGE_SYSTEM_OPERATION_FORCE;
- }
-
- if (eazel_install_get_downgrade (service)) {
- flags |= EAZEL_PACKAGE_SYSTEM_OPERATION_DOWNGRADE;
- }
-
- if (eazel_install_get_upgrade (service)) {
- flags |= EAZEL_PACKAGE_SYSTEM_OPERATION_UPGRADE;
- }
-
- eazel_install_init_transaction (service);
-
- /* Init the hack var to emit the old style progress signals */
- service->private->infoblock [0] = 0; /* bytes of package completed */
- service->private->infoblock [1] = 0; /* total size of package */
- service->private->infoblock [2] = 0; /* number of packages */
- service->private->infoblock [3] = g_list_length (flat_packages);
- service->private->infoblock [4] = 0; /* total size completed */
- service->private->infoblock [5] = eazel_install_get_total_size_of_packages (service, flat_packages);
-
- switch (op) {
- case EAZEL_PACKAGE_SYSTEM_OPERATION_INSTALL:
- eazel_package_system_install (service->private->package_system,
- service->private->cur_root,
- flat_packages,
- flags);
- break;
- case EAZEL_PACKAGE_SYSTEM_OPERATION_UNINSTALL:
- eazel_package_system_uninstall (service->private->package_system,
- service->private->cur_root,
- flat_packages,
- flags);
- break;
- case EAZEL_PACKAGE_SYSTEM_OPERATION_VERIFY:
- eazel_package_system_verify (service->private->package_system,
- service->private->cur_root,
- flat_packages);
- g_assert (0);
- break;
- }
-
- if (service->private->failed_packages == NULL) {
- result = TRUE;
- if (eazel_install_emit_save_transaction (service, packages) == TRUE) {
- eazel_install_save_transaction_report (service);
- }
- }
-
- eazel_install_init_transaction (service);
-
- g_list_free (flat_packages);
-
- return result;
-}
-
-static void
-install_packages_helper (EazelInstall *service,
- GList **packages,
- GList **extra_packages)
-{
- g_assert (extra_packages);
-
-#if EI2_DEBUG & 0x4
- trilobite_debug ("-> install_packages_helper");
-#endif
- do_dep_check (service, packages);
- if (service->private->cancel_download) {
- return;
- }
- do_file_conflict_check (service, packages, extra_packages);
-
-#if EI2_DEBUG & 0x8
- trilobite_debug ("FINAL TREE BEGIN");
- dump_tree (*packages);
- if (*extra_packages) {
- trilobite_debug ("EXTRA PACKAGES BEGIN");
- dump_tree (*extra_packages);
- }
- trilobite_debug ("FINAL TREE END");
-#endif
-#if EI2_DEBUG & 0x4
- trilobite_debug ("<- install_packages_helper");
-#endif
- return;
-}
-
-static void
-set_toplevel (PackageData *package,
- EazelInstall *service)
-{
- package->toplevel = TRUE;
-}
-
-/***********************************************************************************/
-/* This is the revert majick */
-
-static GList *
-get_packages_with_mod_flag (GList *packages,
- PackageModification mod)
-{
- GList *it;
- GList *res;
-
- res = NULL;
- for (it = packages; it; it = g_list_next (it)) {
- PackageData *pack = NULL;
- if (IS_PACKAGEDATA (it->data)) {
- pack = PACKAGEDATA (it->data);
- } else if (IS_PACKAGEDEPENDENCY (it->data)) {
- pack = PACKAGEDEPENDENCY (it->data)->package;
- } else {
- g_assert_not_reached ();
- }
-
- if (pack->modify_status == mod) {
- res = g_list_prepend (res, pack);
- }
- if (pack->depends) {
- res = g_list_concat (res,
- get_packages_with_mod_flag (pack->depends, mod));
- }
- if (pack->modifies) {
- res = g_list_concat (res,
- get_packages_with_mod_flag (pack->modifies, mod));
- }
-
- pack->modify_status = PACKAGE_MOD_UNTOUCHED;
- }
- return res;
-}
-
-/* Function to prune the uninstall list for elements marked as downgrade */
-static void
-check_uninst_vs_downgrade (GList **inst,
- GList **down)
-{
- GList *it;
- GList *remove;
-
- remove = NULL;
- for (it = *inst; it; it = g_list_next (it)) {
- GList *entry;
- PackageData *pack;
-
- pack = (PackageData*)it->data;
- entry = g_list_find_custom (*down, pack->name, (GCompareFunc)eazel_install_package_name_compare);
- if (entry != NULL) {
- remove = g_list_prepend (remove, it->data);
- }
- }
-
- for (it = remove; it; it = g_list_next (it)) {
- (*inst) = g_list_remove (*inst, it->data);
- }
-}
-
-static void
-debug_revert (PackageData *pack, gpointer modr)
-{
- PackageModification mod = GPOINTER_TO_INT (modr);
- char *name = packagedata_get_readable_name (pack);
-
- switch (mod) {
- case PACKAGE_MOD_UPGRADED:
- g_message (_("will upgrade %s"), name);
- break;
- case PACKAGE_MOD_DOWNGRADED:
- g_message (_("will downgrade %s"), name);
- break;
- case PACKAGE_MOD_INSTALLED:
- g_message (_("will install %s"), name);
- break;
- case PACKAGE_MOD_UNINSTALLED:
- g_message (_("will uninstall %s"), name);
- break;
- default: break;
-
- };
-
- g_free (name);
-}
-
-/***********************************************************************************/
-/* This is the uninstall dep check majick */
-
-/*
-static int
-compare_break_to_package_by_name (PackageBreaks *breakage, PackageData *pack)
-{
- PackageData *broken_package = packagebreaks_get_package (breakage);
-
- return eazel_install_package_compare (broken_package, pack);
-}
-*/
-
-/* This traverses upwards in the deptree from the initial list, and adds
- all packages that will break to "breaks" */
-static void
-eazel_uninstall_upward_traverse (EazelInstall *service,
- GList **packages,
- GList **failed,
- GList **breaks)
-{
- GList *iterator;
- /*
- Create set
- add all packs from packages to set
- dep check
- for all break, add to packages and recurse
- */
-#if EI2_DEBUG & 0x4
- trilobite_debug ("--> eazel_uninstall_upward_traverse %d packages", g_list_length (*packages));
-#endif
-
- g_assert (packages!=NULL);
- g_assert (*packages!=NULL);
- g_assert (breaks!=NULL);
- g_assert (*breaks==NULL);
- g_assert (failed!=NULL);
-
- /* Open the package system */
-
- /* Add all packages to the set */
-
- for (iterator = *packages; iterator; iterator = g_list_next (iterator)) {
- PackageData *pack = (PackageData*)iterator->data;
- GList *matches = NULL;
- GList *match_iterator;
- GList *tmp_breaks = NULL;
- GList *b_iterator = NULL;
-
- /* Get the packages required by pack */
-#if EI2_DEBUG & 0x4
- trilobite_debug ("\t checking requirements by %p %s", pack, rpmname_from_packagedata (pack));
-#endif
- matches = eazel_package_system_query (service->private->package_system,
- service->private->cur_root,
- pack,
- EAZEL_PACKAGE_SYSTEM_QUERY_REQUIRES,
- PACKAGE_FILL_NO_TEXT |
- PACKAGE_FILL_NO_DIRS_IN_PROVIDES |
- PACKAGE_FILL_NO_DEPENDENCIES);
-
- /* For all of them, mark as a break conflict */
- for (match_iterator = matches; match_iterator; match_iterator = g_list_next (match_iterator)) {
- PackageData *requiredby = (PackageData*)match_iterator->data;;
-
- requiredby->status = PACKAGE_DEPENDENCY_FAIL;
- pack->status = PACKAGE_BREAKS_DEPENDENCY;
-#if EI2_DEBUG & 0x4
- trilobite_debug ("\t %p %s requires %p %s",
- requiredby, requiredby->name,
- pack, pack->name);
-#else
- {
- char *a, *b;
- a = packagedata_get_readable_name (requiredby);
- b = packagedata_get_readable_name (pack);
- g_message (_("%s requires %s"), a, b);
- g_free (a);
- g_free (b);
- }
-#endif
-
- /* If the broken package is in packages, just continue */
- if (g_list_find_custom (*packages, requiredby->name,
- (GCompareFunc)eazel_install_package_name_compare)) {
-#if EI2_DEBUG & 0x4
- trilobite_debug ("\t skip %p %s", requiredby, requiredby->name);
-#endif
- continue;
- }
-
- /* only add to breaks if it's a new breakage */
- if (g_list_find_custom (*breaks,
- (gpointer)requiredby,
- (GCompareFunc)eazel_install_package_compare) == NULL) {
- PackageFeatureMissing *breakage = packagefeaturemissing_new ();
-#if EI2_DEBUG & 0x4
- trilobite_debug ("\t Adding %p %s to breaks", requiredby, requiredby->name);
-#endif
- (*breaks) = g_list_prepend ((*breaks), requiredby);
- packagebreaks_set_package (PACKAGEBREAKS (breakage), requiredby);
- packagedata_add_to_breaks (pack, PACKAGEBREAKS (breakage));
- gtk_object_unref (GTK_OBJECT (breakage));
- }
-
- /* If the pac has not been failed yet (and is a toplevel),
- fail it */
- if (!g_list_find_custom (*failed, (gpointer)pack->name,
- (GCompareFunc)eazel_install_package_name_compare) &&
- pack->toplevel) {
- (*failed) = g_list_prepend (*failed, pack);
- }
- }
- g_list_foreach (matches, (GFunc)gtk_object_unref, NULL);
- g_list_free (matches);
-
- /* Now check the packages that broke, this is where eg. uninstalling
- glib begins to take forever */
- if (*breaks) {
- eazel_uninstall_upward_traverse (service, breaks, failed, &tmp_breaks);
- }
-
- /* Add the result from the recursion */
- for (b_iterator = tmp_breaks; b_iterator; b_iterator = g_list_next (b_iterator)) {
- (*breaks) = g_list_prepend ((*breaks), b_iterator->data);
- }
- }
-
- /* Remove the failed packages */
- for (iterator = *failed; iterator; iterator = g_list_next (iterator)) {
- (*packages) = g_list_remove (*packages, iterator->data);
- }
-
-#if EI2_DEBUG & 0x1
- trilobite_debug ("post uninstall upward tree");
- dump_tree (*packages);
-#endif
-#if EI2_DEBUG & 0x4
- trilobite_debug ("<-- eazel_uninstall_upward_traverse");
-#endif
-}
-
-static void
-eazel_uninstall_check_for_install (EazelInstall *service,
- GList **packages,
- GList **failed)
-{
- GList *iterator;
- GList *remove = NULL;
- GList *result = NULL;
-
-#if EI2_DEBUG & 0x4
- trilobite_debug ("--> eazel_uninstall_check_for_install");
-#endif
- g_assert (packages);
-
- for (iterator = *packages; iterator; iterator = g_list_next (iterator)) {
- PackageData *pack = (PackageData*)iterator->data;
-
- if (eazel_package_system_is_installed (service->private->package_system,
- service->private->cur_root,
- pack->name,
- pack->version,
- pack->minor,
- EAZEL_SOFTCAT_SENSE_EQ)) {
- GList *qresult;
- GList *qresult_it;
-
- qresult = eazel_package_system_query (service->private->package_system,
- service->private->cur_root,
- pack->name,
- EAZEL_PACKAGE_SYSTEM_QUERY_MATCHES,
- PACKAGE_FILL_NO_DEPENDENCIES |
- PACKAGE_FILL_NO_TEXT);
- for (qresult_it = qresult; qresult_it; qresult_it = g_list_next (qresult_it)) {
- PackageData *match = PACKAGEDATA (qresult_it->data);
- gboolean proceed = FALSE;
- if (pack->version == NULL) {
- proceed = TRUE;
- }
- if (proceed == FALSE &&
- eazel_package_system_compare_version (service->private->package_system,
- pack->version,
- match->version) == 0) {
- proceed = TRUE;
- }
- if (proceed) {
- pack->toplevel = TRUE;
- packagedata_fill_in_missing (pack, match,
- PACKAGE_FILL_NO_DEPENDENCIES |
- PACKAGE_FILL_NO_TEXT);
- result = g_list_prepend (result, pack);
- break;
- }
- }
- g_list_foreach (qresult, (GFunc)gtk_object_unref, NULL);
- g_list_free (qresult);
- } else {
-#if EI2_DEBUG & 0x4
- trilobite_debug ("\t %p %s is not installed", pack, pack->name);
-#endif
- pack->status = PACKAGE_CANNOT_OPEN;
- remove = g_list_prepend (remove, pack);
- }
- }
-
- for (iterator = remove; iterator; iterator=g_list_next (iterator)) {
- (*packages) = g_list_remove (*packages, iterator->data);
- (*failed) = g_list_prepend (*failed, iterator->data);
- }
- g_list_free (remove);
- remove = NULL;
-
- g_list_free (*packages);
- (*packages) = result;
-
-#if EI2_DEBUG & 0x4
- trilobite_debug ("<-- eazel_uninstall_check_for_install");
-#endif
-}
-
-/* Calls the upward and downward traversal */
-static void
-eazel_uninstall_globber (EazelInstall *service,
- GList **packages,
- GList **failed)
-{
- GList *iterator;
- GList *tmp;
-
- /*
- call upward with packages
- call downward with packages and &tmp
- add all from &tmp to packages
- */
-
-#if EI2_DEBUG & 0x4
- trilobite_debug ("--> eazel_uninstall_globber %d packages", g_list_length (*packages));
-#endif
-
- tmp = NULL;
-
- eazel_uninstall_check_for_install (service, packages, failed);
- for (iterator = *failed; iterator; iterator = g_list_next (iterator)) {
- eazel_install_emit_uninstall_failed (service, (PackageData*)iterator->data);
- }
- g_list_foreach (*failed, (GFunc)gtk_object_unref, NULL);
- g_list_free (*failed);
- (*failed)=NULL;
-
- /* If there are still packages and we're not forcing,
- do upwards traversel */
- if (*packages && !eazel_install_get_force (service)) {
- eazel_uninstall_upward_traverse (service, packages, failed, &tmp);
-
-#if EI2_DEBUG & 0x4
- if (g_list_length (*failed)) {
- trilobite_debug ("FAILED");
- dump_tree (*failed);
- }
-#endif
- for (iterator = *failed; iterator; iterator = g_list_next (iterator)) {
- PackageData *pack = (PackageData*)iterator->data;
-#if EI2_DEBUG & 0x4
- trilobite_debug ("failed %p %s", pack, pack->name);
-#else
- {
- char *a;
- a = packagedata_get_readable_name (pack);
- g_message (_("failed %s"), a);
- g_free (a);
- }
-#endif
- eazel_install_emit_uninstall_failed (service, pack);
- }
- g_list_foreach (*failed, (GFunc)gtk_object_unref, NULL);
- g_list_free (*failed);
- g_list_free (tmp);
- }
-
-#if EI2_DEBUG & 0x4
- trilobite_debug ("<-- eazel_uninstall_glob");
-#endif
-}
-
-
-/***********************************************************************************/
-
-/* These are the methods exposed to the the rest of the service object */
-
-EazelInstallOperationStatus
-install_packages (EazelInstall *service, GList *categories)
-{
- EazelInstallOperationStatus result = EAZEL_INSTALL_NOTHING;
- GList *packages;
- GList *extra_packages = NULL;
-
- eazel_softcat_reset_server_update_flag (service->private->softcat);
-
- packages = packagedata_list_copy (categorylist_flatten_to_packagelist (categories), TRUE);
-
- g_list_foreach (packages, (GFunc)set_toplevel, service);
- do {
- extra_packages = NULL;
- install_packages_helper (service, &packages, &extra_packages);
- if (extra_packages) {
- GList *iterator;
- /* add the contents of extra_packages, but avoid inserting
- dupes */
- for (iterator = extra_packages; iterator; iterator = g_list_next (iterator)) {
- PackageData *p = PACKAGEDATA (iterator->data);
- if (g_list_find_custom (packages, p,
- (GCompareFunc)eazel_install_package_compare)==NULL) {
- packages = g_list_prepend (packages, p);
- }
- }
-
- }
- } while (extra_packages != NULL);
-
-#if EI2_DEBUG & 0x4
- trilobite_debug ("%d packages survived", g_list_length (packages));
-#endif
-
- if (packages) {
- if (eazel_install_emit_preflight_check (service, packages)) {
- int flags = 0;
- gboolean go_ahead = TRUE;
-
-#if EI2_DEBUG & 0x4
- trilobite_debug ("emit_preflight returned true");
-#endif
- if (download_packages (service, packages)) {
- if (eazel_install_get_force (service) == FALSE) {
- if (!check_md5_on_files (service, packages)) {
- go_ahead = FALSE;
- }
- }
- if (go_ahead) {
- /* Execute the operation */
- if (execute (service, packages, EAZEL_PACKAGE_SYSTEM_OPERATION_INSTALL, flags)) {
- result = EAZEL_INSTALL_INSTALL_OK;
- }
- }
- } else {
- /* FIXME: bugzilla.eazel.com 5722
- download could fail, do the download func needs to
- be able to fail the operation... */
- }
- }
- }
-
- g_hash_table_foreach_remove (service->private->dedupe_hash,
- (GHRFunc)clean_up_dedupe_hash,
- service);
- g_hash_table_foreach_remove (service->private->dep_ok_hash,
- (GHRFunc)clean_up_dep_ok_hash,
- service);
- g_list_foreach (packages, (GFunc)gtk_object_unref, NULL);
-
- return result;
-}
-
-EazelInstallOperationStatus
-uninstall_packages (EazelInstall *service, GList *categories)
-{
- EazelInstallStatus result = EAZEL_INSTALL_NOTHING;
- GList *packages = NULL;
- GList *failed = NULL;
-
- eazel_softcat_reset_server_update_flag (service->private->softcat);
-
-#if EI2_DEBUG & 0x4
- trilobite_debug ("--> uninstall_packages");
-#endif
- packages = packagedata_list_copy (categorylist_flatten_to_packagelist (categories), TRUE);
- eazel_uninstall_globber (service, &packages, &failed);
-
- if (packages) {
- if (eazel_install_emit_preflight_check (service, packages)) {
- int flags = 0;
- if (execute (service, packages, EAZEL_PACKAGE_SYSTEM_OPERATION_UNINSTALL, flags)) {
- result = EAZEL_INSTALL_UNINSTALL_OK;
- }
- }
- }
-
- g_list_foreach (packages, (GFunc)gtk_object_unref, NULL);
- g_list_free (packages);
-
-#if EI2_DEBUG & 0x4
- trilobite_debug ("\tuninstall returns returning %s",
- result == EAZEL_INSTALL_UNINSTALL_OK ? "OK" : "FAILED");
- trilobite_debug ("<-- uninstall_all_packages");
-#endif
- return result;
-}
-
-EazelInstallStatus
-revert_transaction (EazelInstall *service,
- GList *packages)
-{
- GList *uninst, *inst, *upgrade, *downgrade;
- CategoryData *cat;
- GList *categories;
- EazelInstallStatus result = EAZEL_INSTALL_NOTHING;
-
- uninst = get_packages_with_mod_flag (packages, PACKAGE_MOD_INSTALLED);
- inst = get_packages_with_mod_flag (packages, PACKAGE_MOD_UNINSTALLED);
- upgrade = get_packages_with_mod_flag (packages, PACKAGE_MOD_DOWNGRADED);
- downgrade = get_packages_with_mod_flag (packages, PACKAGE_MOD_UPGRADED);
-
- check_uninst_vs_downgrade (&uninst, &downgrade);
-
- g_list_foreach (uninst, (GFunc)debug_revert, GINT_TO_POINTER (PACKAGE_MOD_UNINSTALLED));
- g_list_foreach (inst, (GFunc)debug_revert, GINT_TO_POINTER (PACKAGE_MOD_INSTALLED));
- g_list_foreach (downgrade, (GFunc)debug_revert, GINT_TO_POINTER (PACKAGE_MOD_DOWNGRADED));
- g_list_foreach (upgrade, (GFunc)debug_revert, GINT_TO_POINTER (PACKAGE_MOD_UPGRADED));
-
- cat = categorydata_new ();
- categories = g_list_prepend (NULL, cat);
-
- if (uninst) {
- eazel_install_set_uninstall (service, TRUE);
- eazel_install_set_downgrade (service, FALSE);
- eazel_install_set_upgrade (service, FALSE);
- cat->packages = uninst;
- if (uninstall_packages (service, categories) == EAZEL_INSTALL_UNINSTALL_OK) {
- result = EAZEL_INSTALL_REVERSION_OK;
- }
- }
- if (inst) {
- eazel_install_set_uninstall (service, FALSE);
- eazel_install_set_downgrade (service, FALSE);
- eazel_install_set_upgrade (service, FALSE);
- cat->packages = inst;
- if (install_packages (service, categories) == EAZEL_INSTALL_UNINSTALL_OK) {
- result = EAZEL_INSTALL_REVERSION_OK;
- }
- }
- if (downgrade) {
- eazel_install_set_uninstall (service, FALSE);
- eazel_install_set_downgrade (service, TRUE);
- eazel_install_set_upgrade (service, FALSE);
- cat->packages = downgrade;
- if (install_packages (service, categories) == EAZEL_INSTALL_UNINSTALL_OK) {
- result = EAZEL_INSTALL_REVERSION_OK;
- }
- }
- if (upgrade) {
- eazel_install_set_uninstall (service, FALSE);
- eazel_install_set_downgrade (service, TRUE);
- eazel_install_set_upgrade (service, TRUE);
- cat->packages = upgrade;
- if (install_packages (service, categories) == EAZEL_INSTALL_UNINSTALL_OK) {
- result = EAZEL_INSTALL_REVERSION_OK;
- }
- }
-
-
- categorydata_destroy (cat);
- g_list_free (categories);
-
- return result;
-}
-
-
diff --git a/components/services/install/lib/eazel-install-logic2.h b/components/services/install/lib/eazel-install-logic2.h
deleted file mode 100644
index 2021b162b..000000000
--- a/components/services/install/lib/eazel-install-logic2.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: Eskil Heyn Olsen <eskil@eazel.com>
- */
-
-#ifndef EAZEL_INSTALL_LOGIC2_H
-#define EAZEL_INSTALL_LOGIC2_H
-
-#include "eazel-package-system-types.h"
-#include "eazel-install-protocols.h"
-#include "eazel-install-public.h"
-#include <eazel-package-system.h>
-
-/* FIXME: these should not be exported once eazel-install-logic is being
- phased out */
-gboolean check_md5_on_files (EazelInstall *service, GList *packages);
-EazelInstallStatus eazel_install_check_existing_packages (EazelInstall *service,
- PackageData *pack);
-unsigned long eazel_install_get_total_size_of_packages (EazelInstall *service,
- const GList *packages);
-
-EazelInstallOperationStatus install_packages (EazelInstall *service, GList *categories);
-EazelInstallOperationStatus uninstall_packages (EazelInstall *service, GList *categories);
-EazelInstallOperationStatus revert_transaction (EazelInstall *service, GList *packages);
-
-#endif /* EAZEL_INSTALL_LOGIC_H */
diff --git a/components/services/install/lib/eazel-install-metadata.c b/components/services/install/lib/eazel-install-metadata.c
deleted file mode 100644
index 7f5087ac1..000000000
--- a/components/services/install/lib/eazel-install-metadata.c
+++ /dev/null
@@ -1,298 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: J Shane Culpepper <pepper@eazel.com>
- * Eskil Heyn Olsen <eskil@eazel.com>
- * Robey Pointer <robey@eazel.com>
- */
-
-/* eazel-install - services command line install/update/uninstall
- * component. This program will parse the eazel-services-config.xml
- * file and install a services generated package-list.xml.
- */
-
-#include <config.h>
-#include "eazel-install-metadata.h"
-
-#include "trilobite-i18n.h"
-
-#ifndef EAZEL_INSTALL_SLIM
-#include <gconf/gconf.h>
-#include <gconf/gconf-engine.h>
-static GConfEngine *conf_engine = NULL;
-#endif /* EAZEL_INSTALL_SLIM */
-
-#include <string.h>
-
-#define INSTALL_GCONF_PATH "/apps/eazel-trilobite/install"
-
-#define DEFAULT_SERVER "services.eazel.com"
-#define DEFAULT_PORT 80
-#define DEFAULT_CGI_PATH "/catalog/find"
-
-
-#ifndef EAZEL_INSTALL_SLIM
-/* called by atexit so we can close the gconf connection */
-static void
-done_with_gconf (void)
-{
- gconf_engine_unref (conf_engine);
-}
-#endif /* EAZEL_INSTALL_SLIM */
-
-static void
-check_gconf_init (void)
-{
-#ifndef EAZEL_INSTALL_SLIM
- GError *error = NULL;
-
- if (! gconf_is_initialized ()) {
- char *argv[] = { "trilobite", NULL };
-
- if (! gconf_init (1, argv, &error)) {
- g_assert (error != NULL);
- g_warning ("gconf init error: %s", error->message);
- g_error_free (error);
- }
- }
-
- if (conf_engine == NULL) {
- conf_engine = gconf_engine_get_default ();
- g_atexit (done_with_gconf);
- }
-#endif /* EAZEL_INSTALL_SLIM */
-}
-
-static char *
-get_conf_string (const char *key, const char *default_value)
-{
-#ifndef EAZEL_INSTALL_SLIM
- char *full_key;
- char *value;
-
- full_key = g_strdup_printf ("%s/%s", INSTALL_GCONF_PATH, key);
- value = gconf_engine_get_string (conf_engine, full_key, NULL);
- if ((value == NULL) && (default_value != NULL)) {
- value = g_strdup (default_value);
- /* write default value to gconf */
- gconf_engine_set_string (conf_engine, full_key, default_value, NULL);
- }
- g_free (full_key);
- return value;
-#else /* EAZEL_INSTALL_SLIM */
- return g_strdup (default_value);
-#endif /* EAZEL_INSTALL_SLIM */
-}
-
-static int
-get_conf_int (const char *key, int default_value)
-{
-#ifndef EAZEL_INSTALL_SLIM
- char *full_key;
- GConfValue *value;
- int out;
-
- full_key = g_strdup_printf ("%s/%s", INSTALL_GCONF_PATH, key);
- value = gconf_engine_get (conf_engine, full_key, NULL);
- if (value && (value->type == GCONF_VALUE_INT)) {
- out = gconf_value_get_int (value);
- gconf_value_free (value);
- } else {
- if (value) {
- gconf_value_free (value);
- }
- out = default_value;
- /* write default value to gconf */
- gconf_engine_set_int (conf_engine, full_key, default_value, NULL);
- }
-
- g_free (full_key);
- return out;
-#else /* EAZEL_INSTALL_SLIM */
- return default_value;
-#endif /* EAZEL_INSTALL_SLIM */
-}
-
-static gboolean
-get_conf_boolean (const char *key, gboolean default_value)
-{
-#ifndef EAZEL_INSTALL_SLIM
- char *full_key;
- GConfValue *value;
- gboolean out;
-
- full_key = g_strdup_printf ("%s/%s", INSTALL_GCONF_PATH, key);
- /* gconf API is so crappy that we can't use gconf_get_bool or anything nice */
- value = gconf_engine_get (conf_engine, full_key, NULL);
- if (value && (value->type == GCONF_VALUE_BOOL)) {
- out = gconf_value_get_bool (value);
- gconf_value_free (value);
- } else {
- if (value) {
- gconf_value_free (value);
- }
- out = default_value;
- /* write default value to gconf */
- gconf_engine_set_bool (conf_engine, full_key, default_value, NULL);
- }
-
- g_free (full_key);
- return out;
-#else /* EAZEL_INSTALL_SLIM */
- return default_value;
-#endif /* EAZEL_INSTALL_SLIM */
-}
-
-static URLType
-get_urltype_from_string (char* tmpbuf)
-{
- URLType rv;
-
- if (tmpbuf[0] == 'l' || tmpbuf[0] == 'L') {
- rv = PROTOCOL_LOCAL;
- } else if (tmpbuf[0] == 'f' || tmpbuf[0] == 'F') {
- rv = PROTOCOL_FTP;
- } else if (tmpbuf[0] == 'h' || tmpbuf[0] == 'H') {
- rv = PROTOCOL_HTTP;
- } else {
- g_warning (_("Could not set URLType from config file!"));
- rv = PROTOCOL_HTTP;
- }
- return rv;
-}
-
-InstallOptions *
-init_default_install_configuration (void)
-{
- InstallOptions *rv;
- char *temp;
-
- check_gconf_init ();
- rv = g_new0 (InstallOptions, 1);
-
- temp = get_conf_string ("protocol", "http");
- rv->protocol = get_urltype_from_string (temp);
- g_free (temp);
-
- rv->pkg_list = get_conf_string ("package-list", NULL);
- rv->transaction_dir = get_conf_string ("transaction-dir", NULL);
- if (rv->transaction_dir == NULL) {
- rv->transaction_dir = g_strdup_printf ("%s/.nautilus/transactions", g_get_home_dir ());
- }
-
- rv->mode_verbose = get_conf_boolean ("verbose", TRUE);
- rv->mode_silent = get_conf_boolean ("silent", FALSE);
- rv->mode_debug = get_conf_boolean ("debug", FALSE);
- rv->mode_test = get_conf_boolean ("dry-run", FALSE);
- rv->mode_force = get_conf_boolean ("force", FALSE);
- rv->mode_depend = get_conf_boolean ("depend", FALSE);
- rv->mode_update = get_conf_boolean ("allow-update", TRUE);
- rv->mode_downgrade = get_conf_boolean ("allow-downgrade", FALSE);
-
- return rv;
-}
-
-TransferOptions *
-init_default_transfer_configuration (void)
-{
- TransferOptions *rv;
-
- check_gconf_init ();
- rv = g_new0 (TransferOptions, 1);
-
- rv->tmp_dir = get_conf_string ("server/temp-dir", NULL);
- rv->rpmrc_file = get_conf_string ("server/rpmrc", "/usr/lib/rpm/rpmrc");
-
- return rv;
-}
-
-void
-eazel_install_configure_softcat (EazelSoftCat *softcat)
-{
- char *p;
- char *hostname, *cgi_path;
- int port;
-
- check_gconf_init ();
- port = get_conf_int ("server/port", DEFAULT_PORT);
- hostname = get_conf_string ("server/hostname", DEFAULT_SERVER);
- if ((p = strchr (hostname, ':')) != NULL) {
- /* make "server/port" optional -- could just be in "server/hostname" */
- *p = 0;
- port = atoi (p+1);
- }
- eazel_softcat_set_server_host (softcat, hostname);
- eazel_softcat_set_server_port (softcat, port);
- g_free (hostname);
-
- cgi_path = get_conf_string ("server/cgi-path", DEFAULT_CGI_PATH);
- eazel_softcat_set_cgi_path (softcat, cgi_path);
- g_free (cgi_path);
-
- eazel_softcat_set_authn (softcat, get_conf_boolean ("server/eazel-auth", TRUE), NULL);
-}
-
-gboolean
-eazel_install_configure_check_jump_after_install (char **url)
-{
- char *new_url;
-
- check_gconf_init ();
- if (! get_conf_boolean ("jump-after-install", TRUE)) {
- return FALSE;
- }
-
- new_url = get_conf_string ("jump-url", NULL);
- if (new_url != NULL) {
- g_free (*url);
- *url = new_url;
- }
- return TRUE;
-}
-
-gboolean
-eazel_install_configure_use_local_db (void)
-{
- check_gconf_init ();
- return get_conf_boolean ("use-local-db", TRUE);
-}
-
-void
-transferoptions_destroy (TransferOptions *topts)
-{
- g_return_if_fail (topts!=NULL);
-
- g_free (topts->pkg_list_storage_path);
- topts->pkg_list_storage_path = NULL;
- g_free (topts->tmp_dir);
- topts->tmp_dir = NULL;
- g_free (topts->rpmrc_file);
- topts->rpmrc_file = NULL;
-}
-
-void
-installoptions_destroy (InstallOptions *iopts)
-{
- g_return_if_fail (iopts!=NULL);
-
- g_free (iopts->pkg_list);
- g_free (iopts->transaction_dir);
- iopts->pkg_list = NULL;
- iopts->transaction_dir = NULL;
-}
diff --git a/components/services/install/lib/eazel-install-metadata.h b/components/services/install/lib/eazel-install-metadata.h
deleted file mode 100644
index 7273c117a..000000000
--- a/components/services/install/lib/eazel-install-metadata.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: J Shane Culpepper <pepper@eazel.com>
- */
-
-/* eazel-install - services command line install/update/uninstall
- * component. This program will parse the eazel-services-config.xml
- * file and install a services generated package-list.xml.
- */
-
-#ifndef EAZEL_INSTALL_METADATA_H
-#define EAZEL_INSTALL_METADATA_H
-
-#include "eazel-package-system-types.h"
-#include "eazel-softcat.h"
-
-InstallOptions *init_default_install_configuration (void);
-TransferOptions *init_default_transfer_configuration (void);
-void transferoptions_destroy (TransferOptions *topts);
-void installoptions_destroy (InstallOptions *iopts);
-void eazel_install_configure_softcat (EazelSoftCat *softcat);
-gboolean eazel_install_configure_check_jump_after_install (char **url);
-gboolean eazel_install_configure_use_local_db (void);
-
-#endif /* EAZEL_INSTALL_METADATA_H */
diff --git a/components/services/install/lib/eazel-install-object.c b/components/services/install/lib/eazel-install-object.c
deleted file mode 100644
index 2b823c38f..000000000
--- a/components/services/install/lib/eazel-install-object.c
+++ /dev/null
@@ -1,2230 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: Eskil Heyn Olsen <eskil@eazel.com>
- *
- */
-
-#include <config.h>
-#include <errno.h>
-#include <gnome-xml/parser.h>
-
-#include <gtk/gtksignal.h>
-
-#include "eazel-install-public.h"
-#include "eazel-install-private.h"
-#include "eazel-install-query.h"
-#include "eazel-install-xml-package-list.h"
-
-#ifndef EAZEL_INSTALL_SLIM
-#include <rpm/rpmmacro.h>
-#endif
-
-#ifndef EAZEL_INSTALL_NO_CORBA
-#include <liboaf/liboaf.h>
-#include <bonobo.h>
-#include <libtrilobite/libtrilobite.h>
-#include "trilobite-eazel-install.h"
-#include "eazel-install-corba-types.h"
-#else
-#include <libtrilobite/trilobite-core-utils.h>
-#include <libtrilobite/trilobite-i18n.h>
-#endif /* EAZEL_INSTALL_NO_CORBA */
-
-#include "eazel-install-metadata.h"
-#include "eazel-install-protocols.h"
-#include "eazel-install-logic2.h"
-#include "eazel-package-system-types.h"
-
-#include <sys/stat.h>
-#include <unistd.h>
-#include <pwd.h>
-#include <dirent.h>
-#include <string.h>
-#include <time.h>
-
-enum {
- FILE_CONFLICT_CHECK,
- FILE_UNIQUENESS_CHECK,
- FEATURE_CONSISTENCY_CHECK,
-
- DOWNLOAD_PROGRESS,
- PREFLIGHT_CHECK,
- SAVE_TRANSACTION,
- INSTALL_PROGRESS,
- UNINSTALL_PROGRESS,
- DOWNLOAD_FAILED,
- MD5_CHECK_FAILED,
- INSTALL_FAILED,
- UNINSTALL_FAILED,
- DEPENDENCY_CHECK,
- DONE,
- LAST_SIGNAL
-};
-
-enum {
- ARG_0,
- ARG_VERBOSE,
- ARG_SILENT,
- ARG_DEBUG,
- ARG_TEST,
- ARG_FORCE,
- ARG_DEPEND,
- ARG_UPGRADE,
- ARG_UNINSTALL,
- ARG_DOWNGRADE,
- ARG_PROTOCOL,
- ARG_TMP_DIR,
- ARG_RPMRC_FILE,
- ARG_SERVER,
- ARG_PACKAGE_LIST_STORAGE_PATH,
- ARG_PACKAGE_LIST,
- ARG_ROOT_DIRS,
- ARG_SERVER_PORT,
- ARG_TRANSACTION_DIR,
- ARG_CGI_PATH,
- ARG_SSL_RENAME,
- ARG_IGNORE_FILE_CONFLICTS,
- ARG_EAZEL_AUTH,
- ARG_EI2
-};
-
-/* The signal array, used for building the signal bindings */
-
-static guint signals[LAST_SIGNAL] = { 0 };
-
-/* This is the parent class pointer */
-
-#ifdef EAZEL_INSTALL_NO_CORBA
-static GtkObjectClass *eazel_install_parent_class;
-#else
-static BonoboObjectClass *eazel_install_parent_class;
-#endif /* EAZEL_INSTALL_NO_CORBA */
-
-
-/* prototypes */
-void eazel_install_emit_file_conflict_check_default (EazelInstall *service,
- const PackageData *package);
-void eazel_install_emit_file_uniqueness_check_default (EazelInstall *service,
- const PackageData *package);
-void eazel_install_emit_feature_consistency_check_default (EazelInstall *service,
- const PackageData *package);
-void eazel_install_emit_install_progress_default (EazelInstall *service,
- const PackageData *pack,
- int, int, int, int, int, int);
-void eazel_install_emit_uninstall_progress_default (EazelInstall *service,
- const PackageData *pack,
- int, int, int, int, int, int);
-void eazel_install_emit_download_progress_default (EazelInstall *service,
- const PackageData *package,
- int amount,
- int total);
-gboolean eazel_install_emit_preflight_check_default (EazelInstall *service,
- GList *packages,
- int total_bytes,
- int total_packages);
-gboolean eazel_install_emit_save_transaction_default (EazelInstall *service,
- GList *packages);
-void eazel_install_emit_download_failed_default (EazelInstall *service,
- const PackageData *package);
-void eazel_install_emit_md5_check_failed_default (EazelInstall *service,
- const PackageData *pack,
- const char *actual_md5);
-void eazel_install_emit_install_failed_default (EazelInstall *service,
- const PackageData *pack);
-void eazel_install_emit_uninstall_failed_default (EazelInstall *service,
- const PackageData *pack);
-void eazel_install_emit_dependency_check_default (EazelInstall *service,
- const PackageData *pack,
- const PackageData *needs);
-void eazel_install_emit_done_default (EazelInstall *service,
- gboolean result);
-
-#ifdef EAZEL_INSTALL_NO_CORBA
-static void eazel_install_log (const char *domain,
- GLogLevelFlags flags,
- const char *message,
- EazelInstall *service);
-#endif
-
-#ifndef EAZEL_INSTALL_NO_CORBA
-
-/*****************************************
- Corba stuff
-*****************************************/
-
-static PortableServer_ServantBase__epv base_epv = { NULL, NULL, NULL };
-
-#endif /* EAZEL_INSTALL_NO_CORBA */
-
-/*****************************************
- GTK+ object stuff
-*****************************************/
-
-static void
-eazel_install_finalize (GtkObject *object)
-{
- EazelInstall *service;
-
- g_return_if_fail (object != NULL);
- g_return_if_fail (EAZEL_IS_INSTALL (object));
-
- service = EAZEL_INSTALL (object);
-
-#ifndef EAZEL_INSTALL_NO_CORBA
- {
- CORBA_Environment ev;
- CORBA_exception_init (&ev);
- if (service->callback != CORBA_OBJECT_NIL) {
- CORBA_Object_release (service->callback, &ev);
- }
- CORBA_exception_free (&ev);
- }
-#endif
-
- trilobite_debug ("into eazel_install_finalize");
-
- g_hash_table_destroy (service->private->name_to_package_hash);
- g_free (service->private->logfilename);
-
- g_list_foreach (service->private->downloaded_files, (GFunc)g_free, NULL);
- g_list_free (service->private->downloaded_files);
-
- g_list_foreach (service->private->root_dirs, (GFunc)g_free, NULL);
- g_list_free (service->private->root_dirs);
-
- g_list_free (service->private->transaction);
- g_list_free (service->private->failed_packages);
-
- g_free (service->private->transaction_dir);
- g_free (service->private->cur_root);
-
- transferoptions_destroy (service->private->topts);
- installoptions_destroy (service->private->iopts);
- eazel_softcat_unref (GTK_OBJECT (service->private->softcat));
-
- if (GTK_OBJECT_CLASS (eazel_install_parent_class)->finalize) {
- GTK_OBJECT_CLASS (eazel_install_parent_class)->finalize (object);
- }
- trilobite_debug ("out eazel_install_finalize");
-}
-
-void
-eazel_install_unref (GtkObject *object)
-{
- g_return_if_fail (object != NULL);
- g_return_if_fail (EAZEL_IS_INSTALL (object));
-#ifndef EAZEL_INSTALL_SLIM
- bonobo_object_unref (BONOBO_OBJECT (object));
-#else
- gtk_object_unref (object);
-#endif
-}
-
-static gboolean
-eazel_install_start_signal (EazelPackageSystem *system,
- EazelPackageSystemOperation op,
- const PackageData *pack,
- EazelInstall *service)
-{
- service->private->infoblock[2]++;
- switch (op) {
- case EAZEL_PACKAGE_SYSTEM_OPERATION_INSTALL:
- eazel_install_emit_install_progress (service,
- pack,
- service->private->infoblock[2], service->private->infoblock[3],
- 0, pack->bytesize,
- service->private->infoblock[4], service->private->infoblock[5]);
- break;
- case EAZEL_PACKAGE_SYSTEM_OPERATION_UNINSTALL:
- eazel_install_emit_uninstall_progress (service,
- pack,
- service->private->infoblock[2], service->private->infoblock[3],
- 0, pack->bytesize,
- service->private->infoblock[4], service->private->infoblock[5]);
- break;
- default:
- break;
- }
- return TRUE;
-}
-
-static gboolean
-eazel_install_end_signal (EazelPackageSystem *system,
- EazelPackageSystemOperation op,
- const PackageData *pack,
- EazelInstall *service)
-{
- switch (op) {
- case EAZEL_PACKAGE_SYSTEM_OPERATION_INSTALL:
- eazel_install_emit_install_progress (service,
- pack,
- service->private->infoblock[2], service->private->infoblock[3],
- pack->bytesize, pack->bytesize,
- service->private->infoblock[4], service->private->infoblock[5]);
- break;
- case EAZEL_PACKAGE_SYSTEM_OPERATION_UNINSTALL:
- eazel_install_emit_uninstall_progress (service,
- pack,
- service->private->infoblock[2], service->private->infoblock[3],
- pack->bytesize, pack->bytesize,
- service->private->infoblock[4], service->private->infoblock[5]);
- break;
- default:
- break;
- }
- if (pack->toplevel) {
- if (g_list_find (service->private->failed_packages, (PackageData*)pack) == NULL) {
- g_message ("Adding %s to transaction", pack->name);
- service->private->transaction = g_list_prepend (service->private->transaction,
- (PackageData*)pack);
- }
- }
- return TRUE;
-}
-
-static gboolean
-eazel_install_progress_signal (EazelPackageSystem *system,
- EazelPackageSystemOperation op,
- const PackageData *pack,
- unsigned long *info,
- EazelInstall *service)
-{
- service->private->infoblock[4] = info[4];
- if ((info[0] != 0) && (info[0] != info[1])) {
- switch (op) {
- case EAZEL_PACKAGE_SYSTEM_OPERATION_INSTALL:
- eazel_install_emit_install_progress (service,
- pack,
- service->private->infoblock[2], service->private->infoblock[3],
- info[0], pack->bytesize,
- info[4], info[5]);
- break;
- case EAZEL_PACKAGE_SYSTEM_OPERATION_UNINSTALL:
- eazel_install_emit_uninstall_progress (service,
- pack,
- service->private->infoblock[2], service->private->infoblock[3],
- 1, pack->bytesize,
- info[4], info[5]);
- break;
- default:
- break;
- }
- }
- return TRUE;
-}
-
-static gboolean
-eazel_install_failed_signal (EazelPackageSystem *system,
- EazelPackageSystemOperation op,
- const PackageData *pack,
- EazelInstall *service)
-{
- trilobite_debug ("*** %s failed", pack->name);
-
- service->private->failed_packages = g_list_prepend (service->private->failed_packages,
- (PackageData*)pack);
-
- if (pack->toplevel) {
- trilobite_debug ("emiting failed for %s", pack->name);
- if (op==EAZEL_PACKAGE_SYSTEM_OPERATION_INSTALL) {
- eazel_install_emit_install_failed (service, pack);
- } else if (op==EAZEL_PACKAGE_SYSTEM_OPERATION_UNINSTALL) {
- eazel_install_emit_uninstall_failed (service, pack);
- }
- }
- return TRUE;
-}
-
-static void
-eazel_install_set_arg (GtkObject *object,
- GtkArg *arg,
- guint arg_id)
-{
- EazelInstall *service;
-
- g_assert (object != NULL);
- g_assert (EAZEL_IS_INSTALL (object));
-
- service = EAZEL_INSTALL (object);
-
- switch (arg_id) {
- case ARG_EI2:
- eazel_install_set_ei2 (service, GTK_VALUE_BOOL(*arg));
- break;
- case ARG_VERBOSE:
- eazel_install_set_verbose (service, GTK_VALUE_BOOL(*arg));
- break;
- case ARG_IGNORE_FILE_CONFLICTS:
- eazel_install_set_ignore_file_conflicts (service, GTK_VALUE_BOOL(*arg));
- break;
- case ARG_SSL_RENAME:
- eazel_install_set_ssl_rename (service, GTK_VALUE_BOOL(*arg));
- break;
- case ARG_SILENT:
- eazel_install_set_silent (service, GTK_VALUE_BOOL(*arg));
- break;
- case ARG_DEBUG:
- eazel_install_set_debug (service, GTK_VALUE_BOOL (*arg));
- break;
- case ARG_TEST:
- eazel_install_set_test (service, GTK_VALUE_BOOL(*arg));
- break;
- case ARG_FORCE:
- eazel_install_set_force (service, GTK_VALUE_BOOL(*arg));
- break;
- case ARG_DEPEND:
- eazel_install_set_depend (service, GTK_VALUE_BOOL(*arg));
- break;
- case ARG_UPGRADE:
- eazel_install_set_upgrade (service, GTK_VALUE_BOOL(*arg));
- break;
- case ARG_UNINSTALL:
- eazel_install_set_uninstall (service, GTK_VALUE_BOOL(*arg));
- break;
- case ARG_DOWNGRADE:
- eazel_install_set_downgrade (service, GTK_VALUE_BOOL(*arg));
- break;
- case ARG_PROTOCOL:
- eazel_install_set_protocol (service, GTK_VALUE_ENUM(*arg));
- break;
- case ARG_TMP_DIR:
- eazel_install_set_tmp_dir (service, (char*)GTK_VALUE_POINTER(*arg));
- break;
- case ARG_RPMRC_FILE:
- eazel_install_set_rpmrc_file (service, (char*)GTK_VALUE_POINTER(*arg));
- break;
- case ARG_SERVER:
- eazel_install_set_server (service, (char*)GTK_VALUE_POINTER(*arg));
- break;
- case ARG_PACKAGE_LIST_STORAGE_PATH:
- eazel_install_set_package_list_storage_path (service, (char*)GTK_VALUE_POINTER(*arg));
- break;
- case ARG_PACKAGE_LIST:
- eazel_install_set_package_list (service, (char*)GTK_VALUE_POINTER(*arg));
- break;
- case ARG_SERVER_PORT:
- eazel_install_set_server_port (service, GTK_VALUE_UINT(*arg));
- break;
- case ARG_ROOT_DIRS:
- eazel_install_set_root_dirs (service, (GList*)GTK_VALUE_POINTER(*arg));
- break;
- case ARG_TRANSACTION_DIR:
- eazel_install_set_transaction_dir (service, (char*)GTK_VALUE_POINTER(*arg));
- break;
- case ARG_CGI_PATH:
- eazel_install_set_cgi_path (service, (char*)GTK_VALUE_POINTER(*arg));
- break;
- case ARG_EAZEL_AUTH:
- eazel_install_set_eazel_auth (service, GTK_VALUE_BOOL (*arg));
- break;
- }
-}
-
-static void
-eazel_install_class_initialize (EazelInstallClass *klass)
-{
- GtkObjectClass *object_class;
-
- object_class = (GtkObjectClass*)klass;
- object_class->finalize = eazel_install_finalize;
- object_class->set_arg = eazel_install_set_arg;
-
-#ifdef EAZEL_INSTALL_NO_CORBA
- eazel_install_parent_class = gtk_type_class (gtk_object_get_type ());
-#else
- eazel_install_parent_class = gtk_type_class (bonobo_object_get_type ());
- klass->servant_vepv = g_new0 (POA_GNOME_Trilobite_Eazel_Install__vepv,1);
- ((POA_GNOME_Trilobite_Eazel_Install__vepv*)klass->servant_vepv)->_base_epv = &base_epv;
- ((POA_GNOME_Trilobite_Eazel_Install__vepv*)klass->servant_vepv)->Bonobo_Unknown_epv = bonobo_object_get_epv ();
- ((POA_GNOME_Trilobite_Eazel_Install__vepv*)klass->servant_vepv)->GNOME_Trilobite_Eazel_Install_epv = eazel_install_get_epv ();
-#endif /* EAZEL_INSTALL_NO_CORBA */
-
- signals[FILE_CONFLICT_CHECK] =
- gtk_signal_new ("file_conflict_check",
- GTK_RUN_LAST,
- object_class->type,
- GTK_SIGNAL_OFFSET (EazelInstallClass, file_conflict_check),
- gtk_marshal_NONE__POINTER,
- GTK_TYPE_NONE, 1, GTK_TYPE_POINTER);
- signals[FILE_UNIQUENESS_CHECK] =
- gtk_signal_new ("file_uniqueness_check",
- GTK_RUN_LAST,
- object_class->type,
- GTK_SIGNAL_OFFSET (EazelInstallClass, file_uniqueness_check),
- gtk_marshal_NONE__POINTER,
- GTK_TYPE_NONE, 1, GTK_TYPE_POINTER);
- signals[FEATURE_CONSISTENCY_CHECK] =
- gtk_signal_new ("feature_consistency_check",
- GTK_RUN_LAST,
- object_class->type,
- GTK_SIGNAL_OFFSET (EazelInstallClass, feature_consistency_check),
- gtk_marshal_NONE__POINTER,
- GTK_TYPE_NONE, 1, GTK_TYPE_POINTER);
-
- signals[DOWNLOAD_PROGRESS] =
- gtk_signal_new ("download_progress",
- GTK_RUN_LAST,
- object_class->type,
- GTK_SIGNAL_OFFSET (EazelInstallClass, download_progress),
- gtk_marshal_NONE__POINTER_INT_INT,
- GTK_TYPE_NONE, 3, GTK_TYPE_POINTER, GTK_TYPE_INT, GTK_TYPE_INT);
- signals[PREFLIGHT_CHECK] =
- gtk_signal_new ("preflight_check",
- GTK_RUN_LAST,
- object_class->type,
- GTK_SIGNAL_OFFSET (EazelInstallClass, preflight_check),
- gtk_marshal_BOOL__POINTER_INT_INT,
- GTK_TYPE_BOOL, 3, GTK_TYPE_POINTER, GTK_TYPE_INT, GTK_TYPE_INT);
- signals[SAVE_TRANSACTION] =
- gtk_signal_new ("save_transaction",
- GTK_RUN_LAST,
- object_class->type,
- GTK_SIGNAL_OFFSET (EazelInstallClass, save_transaction),
- gtk_marshal_BOOL__POINTER,
- GTK_TYPE_BOOL, 1, GTK_TYPE_POINTER);
- signals[INSTALL_PROGRESS] =
- gtk_signal_new ("install_progress",
- GTK_RUN_LAST,
- object_class->type,
- GTK_SIGNAL_OFFSET (EazelInstallClass, install_progress),
- eazel_install_gtk_marshal_NONE__POINTER_INT_INT_INT_INT_INT_INT,
- GTK_TYPE_NONE, 7, GTK_TYPE_POINTER,
- GTK_TYPE_INT, GTK_TYPE_INT, GTK_TYPE_INT,
- GTK_TYPE_INT, GTK_TYPE_INT, GTK_TYPE_INT);
- signals[UNINSTALL_PROGRESS] =
- gtk_signal_new ("uninstall_progress",
- GTK_RUN_LAST,
- object_class->type,
- GTK_SIGNAL_OFFSET (EazelInstallClass, uninstall_progress),
- eazel_install_gtk_marshal_NONE__POINTER_INT_INT_INT_INT_INT_INT,
- GTK_TYPE_NONE, 7, GTK_TYPE_POINTER,
- GTK_TYPE_INT, GTK_TYPE_INT, GTK_TYPE_INT,
- GTK_TYPE_INT, GTK_TYPE_INT, GTK_TYPE_INT);
- signals[DOWNLOAD_FAILED] =
- gtk_signal_new ("download_failed",
- GTK_RUN_LAST,
- object_class->type,
- GTK_SIGNAL_OFFSET (EazelInstallClass, download_failed),
- gtk_marshal_NONE__POINTER,
- GTK_TYPE_NONE, 1, GTK_TYPE_POINTER);
- signals[MD5_CHECK_FAILED] =
- gtk_signal_new ("md5_check_failed",
- GTK_RUN_LAST,
- object_class->type,
- GTK_SIGNAL_OFFSET (EazelInstallClass, md5_check_failed),
- gtk_marshal_NONE__POINTER_POINTER,
- GTK_TYPE_NONE, 2, GTK_TYPE_POINTER, GTK_TYPE_POINTER);
- signals[INSTALL_FAILED] =
- gtk_signal_new ("install_failed",
- GTK_RUN_LAST,
- object_class->type,
- GTK_SIGNAL_OFFSET (EazelInstallClass, install_failed),
- gtk_marshal_NONE__POINTER,
- GTK_TYPE_NONE, 1, GTK_TYPE_POINTER);
- signals[UNINSTALL_FAILED] =
- gtk_signal_new ("uninstall_failed",
- GTK_RUN_LAST,
- object_class->type,
- GTK_SIGNAL_OFFSET (EazelInstallClass, uninstall_failed),
- gtk_marshal_NONE__POINTER,
- GTK_TYPE_NONE, 1, GTK_TYPE_POINTER);
- signals[DEPENDENCY_CHECK] =
- gtk_signal_new ("dependency_check",
- GTK_RUN_LAST,
- object_class->type,
- GTK_SIGNAL_OFFSET (EazelInstallClass, dependency_check),
- gtk_marshal_NONE__POINTER_POINTER,
- GTK_TYPE_NONE, 2, GTK_TYPE_POINTER, GTK_TYPE_POINTER);
- signals[DONE] =
- gtk_signal_new ("done",
- GTK_RUN_LAST,
- object_class->type,
- GTK_SIGNAL_OFFSET (EazelInstallClass, done),
- gtk_marshal_NONE__BOOL,
- GTK_TYPE_NONE, 1, GTK_TYPE_BOOL);
- gtk_object_class_add_signals (object_class, signals, LAST_SIGNAL);
-
-#ifdef EAZEL_INSTALL_NO_CORBA
- klass->file_conflict_check = NULL;
- klass->file_uniqueness_check = NULL;
- klass->feature_consistency_check = NULL;
- klass->install_progress = NULL;
- klass->uninstall_progress = NULL;
- klass->download_progress = NULL;
- klass->download_failed = NULL;
- klass->md5_check_failed = NULL;
- klass->install_failed = NULL;
- klass->uninstall_failed = NULL;
- klass->dependency_check = NULL;
- klass->preflight_check = NULL;
- klass->save_transaction = NULL;
-#else
- klass->file_conflict_check = eazel_install_emit_file_conflict_check_default;
- klass->file_uniqueness_check = eazel_install_emit_file_uniqueness_check_default;
- klass->feature_consistency_check = eazel_install_emit_feature_consistency_check_default;
- klass->install_progress = eazel_install_emit_install_progress_default;
- klass->uninstall_progress = eazel_install_emit_uninstall_progress_default;
- klass->download_progress = eazel_install_emit_download_progress_default;
- klass->download_failed = eazel_install_emit_download_failed_default;
- klass->md5_check_failed = eazel_install_emit_md5_check_failed_default;
- klass->install_failed = eazel_install_emit_install_failed_default;
- klass->uninstall_failed = eazel_install_emit_uninstall_failed_default;
- klass->dependency_check = eazel_install_emit_dependency_check_default;
- klass->preflight_check = eazel_install_emit_preflight_check_default;
- klass->save_transaction = eazel_install_emit_save_transaction_default;
-#endif
- klass->done = eazel_install_emit_done_default;
-
- gtk_object_add_arg_type ("EazelInstall::ei2",
- GTK_TYPE_BOOL,
- GTK_ARG_READWRITE,
- ARG_VERBOSE);
- gtk_object_add_arg_type ("EazelInstall::verbose",
- GTK_TYPE_BOOL,
- GTK_ARG_READWRITE,
- ARG_VERBOSE);
- gtk_object_add_arg_type ("EazelInstall::ignore_file_conflicts",
- GTK_TYPE_BOOL,
- GTK_ARG_READWRITE,
- ARG_IGNORE_FILE_CONFLICTS);
- gtk_object_add_arg_type ("EazelInstall::silent",
- GTK_TYPE_BOOL,
- GTK_ARG_READWRITE,
- ARG_SILENT);
- gtk_object_add_arg_type ("EazelInstall::debug",
- GTK_TYPE_BOOL,
- GTK_ARG_READWRITE,
- ARG_DEBUG);
- gtk_object_add_arg_type ("EazelInstall::test",
- GTK_TYPE_BOOL,
- GTK_ARG_READWRITE,
- ARG_TEST);
- gtk_object_add_arg_type ("EazelInstall::force",
- GTK_TYPE_BOOL,
- GTK_ARG_READWRITE,
- ARG_FORCE);
- gtk_object_add_arg_type ("EazelInstall::depend",
- GTK_TYPE_BOOL,
- GTK_ARG_READWRITE,
- ARG_DEPEND);
- gtk_object_add_arg_type ("EazelInstall::upgrade",
- GTK_TYPE_BOOL,
- GTK_ARG_READWRITE,
- ARG_UPGRADE);
- gtk_object_add_arg_type ("EazelInstall::uninstall",
- GTK_TYPE_BOOL,
- GTK_ARG_READWRITE,
- ARG_UNINSTALL);
- gtk_object_add_arg_type ("EazelInstall::downgrade",
- GTK_TYPE_BOOL,
- GTK_ARG_READWRITE,
- ARG_DOWNGRADE);
- gtk_object_add_arg_type ("EazelInstall::protocol",
- GTK_TYPE_ENUM,
- GTK_ARG_READWRITE,
- ARG_PROTOCOL);
- gtk_object_add_arg_type ("EazelInstall::tmp_dir",
- GTK_TYPE_POINTER,
- GTK_ARG_READWRITE,
- ARG_TMP_DIR);
- gtk_object_add_arg_type ("EazelInstall::rpmrc_file",
- GTK_TYPE_POINTER,
- GTK_ARG_READWRITE,
- ARG_RPMRC_FILE);
- gtk_object_add_arg_type ("EazelInstall::server",
- GTK_TYPE_POINTER,
- GTK_ARG_READWRITE,
- ARG_SERVER);
- gtk_object_add_arg_type ("EazelInstall::ssl_rename",
- GTK_TYPE_BOOL,
- GTK_ARG_READWRITE,
- ARG_SSL_RENAME);
- gtk_object_add_arg_type ("EazelInstall::package_list_storage_path",
- GTK_TYPE_POINTER,
- GTK_ARG_READWRITE,
- ARG_PACKAGE_LIST_STORAGE_PATH);
- gtk_object_add_arg_type ("EazelInstall::package_list",
- GTK_TYPE_POINTER,
- GTK_ARG_READWRITE,
- ARG_PACKAGE_LIST);
- gtk_object_add_arg_type ("EazelInstall::root_dir",
- GTK_TYPE_POINTER,
- GTK_ARG_READWRITE,
- ARG_ROOT_DIRS);
- gtk_object_add_arg_type ("EazelInstall::transaction_dir",
- GTK_TYPE_POINTER,
- GTK_ARG_READWRITE,
- ARG_TRANSACTION_DIR);
- gtk_object_add_arg_type ("EazelInstall::server_port",
- GTK_TYPE_UINT,
- GTK_ARG_READWRITE,
- ARG_SERVER_PORT);
- gtk_object_add_arg_type ("EazelInstall::cgi_path",
- GTK_TYPE_POINTER,
- GTK_ARG_READWRITE,
- ARG_CGI_PATH);
- gtk_object_add_arg_type ("EazelInstall::eazel_auth",
- GTK_TYPE_BOOL,
- GTK_ARG_READWRITE,
- ARG_EAZEL_AUTH);
-}
-
-static void
-eazel_install_initialize (EazelInstall *service) {
- GList *list;
-#ifndef EAZEL_INSTALL_NO_CORBA
- GNOME_Trilobite_Eazel_Install corba_service;
-#endif /* EAZEL_INSTALL_NO_CORBA */
-
- g_assert (service != NULL);
- g_assert (EAZEL_IS_INSTALL (service));
-
-#ifndef EAZEL_INSTALL_NO_CORBA
- corba_service = eazel_install_create_corba_object (BONOBO_OBJECT (service));
-
- /* This sets the bonobo structures in service using the corba object */
- if (!bonobo_object_construct (BONOBO_OBJECT (service), corba_service)) {
- g_error ("bonobo_object_construct failed");
- }
-#endif /* EAZEL_INSTALL_NO_CORBA */
-
- service->private = g_new0 (EazelInstallPrivate,1);
- service->private->topts = g_new0 (TransferOptions, 1);
- service->private->iopts = g_new0 (InstallOptions, 1);
- service->private->root_dirs = NULL;
- service->private->cur_root = NULL;
- if (g_get_home_dir ()) {
- service->private->transaction_dir = g_strdup_printf ("%s/.nautilus/transactions", g_get_home_dir () );
- } else {
- service->private->transaction_dir = NULL;
- g_message (_("Transactions are not stored, could not find home dir"));
- }
- service->private->logfile = NULL;
- service->private->logfilename = NULL;
- service->private->log_to_stderr = FALSE;
- service->private->name_to_package_hash = g_hash_table_new ((GHashFunc)g_str_hash,
- (GCompareFunc)g_str_equal);
- service->private->dedupe_hash = g_hash_table_new ((GHashFunc)g_str_hash,
- (GCompareFunc)g_str_equal);
- service->private->dep_ok_hash = g_hash_table_new ((GHashFunc)g_str_hash,
- (GCompareFunc)g_str_equal);
- service->private->downloaded_files = NULL;
- service->private->transaction = NULL;
- service->private->failed_packages = NULL;
- service->private->revert = FALSE;
- service->private->ssl_rename = FALSE;
- service->private->ignore_file_conflicts = FALSE;
-
- service->private->softcat = eazel_softcat_new ();
- eazel_softcat_set_packages_per_query (service->private->softcat, 50);
-
- eazel_install_set_rpmrc_file (service, "/usr/lib/rpm/rpmrc");
-
- /* when running as part of trilobite, don't catch logs */
-#ifdef EAZEL_INSTALL_NO_CORBA
- g_log_set_handler (G_LOG_DOMAIN,
- G_LOG_LEVEL_DEBUG | G_LOG_LEVEL_MESSAGE | G_LOG_LEVEL_WARNING | G_LOG_LEVEL_ERROR,
- (GLogFunc)eazel_install_log,
- service);
-#endif
-
- trilobite_debug (_("Transactions are stored in %s"), service->private->transaction_dir);
-
- list = NULL;
-#ifndef EAZEL_INSTALL_SLIM
- if (eazel_install_configure_use_local_db ()) {
- char *tmp = NULL;
-
- tmp = g_strdup_printf ("%s/.nautilus/packagedb/", g_get_home_dir ());
- list = g_list_prepend (list, g_strdup (g_get_home_dir ()));
- list = g_list_prepend (list, tmp);
- }
-#endif
-
- service->private->package_system = eazel_package_system_new (list);
- eazel_package_system_set_debug (service->private->package_system,
- EAZEL_PACKAGE_SYSTEM_DEBUG_FAIL);
- gtk_signal_connect (GTK_OBJECT (service->private->package_system),
- "start",
- (GtkSignalFunc)eazel_install_start_signal,
- service);
- gtk_signal_connect (GTK_OBJECT (service->private->package_system),
- "progress",
- (GtkSignalFunc)eazel_install_progress_signal,
- service);
- gtk_signal_connect (GTK_OBJECT (service->private->package_system),
- "failed",
- (GtkSignalFunc)eazel_install_failed_signal,
- service);
- gtk_signal_connect (GTK_OBJECT (service->private->package_system),
- "end",
- (GtkSignalFunc)eazel_install_end_signal,
- service);
-}
-
-GtkType
-eazel_install_get_type() {
- static GtkType service_type = 0;
-
- /* First time it's called ? */
- if (!service_type)
- {
- static const GtkTypeInfo service_info =
- {
- "EazelInstall",
- sizeof (EazelInstall),
- sizeof (EazelInstallClass),
- (GtkClassInitFunc) eazel_install_class_initialize,
- (GtkObjectInitFunc) eazel_install_initialize,
- /* reserved_1 */ NULL,
- /* reserved_2 */ NULL,
- (GtkClassInitFunc) NULL,
- };
-
-#ifdef EAZEL_INSTALL_NO_CORBA
- service_type = gtk_type_unique (gtk_object_get_type (), &service_info);
-#else
- service_type = gtk_type_unique (bonobo_object_get_type (), &service_info);
-#endif /* EAZEL_INSTALL_NO_CORBA */
- }
-
- return service_type;
-}
-
-EazelInstall *
-eazel_install_new (void)
-{
- EazelInstall *service;
-
- service = EAZEL_INSTALL (gtk_object_new (TYPE_EAZEL_INSTALL, NULL));
- gtk_object_ref (GTK_OBJECT (service));
- gtk_object_sink (GTK_OBJECT (service));
-
- return service;
-}
-
-EazelInstall *
-eazel_install_new_with_config (void)
-{
- EazelInstall *service;
- TransferOptions *topts;
- InstallOptions *iopts;
-
- iopts = init_default_install_configuration ();
- topts = init_default_transfer_configuration ();
-
- if (iopts==NULL || topts==NULL) {
- return NULL;
- }
-
- service = EAZEL_INSTALL (gtk_object_new (TYPE_EAZEL_INSTALL,
- "verbose", iopts->mode_verbose,
- "silent", iopts->mode_silent,
- "debug", iopts->mode_debug,
- "test", iopts->mode_test,
- "force", iopts->mode_force,
- "depend", iopts->mode_depend,
- "upgrade", iopts->mode_update,
- "uninstall", iopts->mode_uninstall,
- "downgrade", iopts->mode_downgrade,
- "protocol", iopts->protocol,
- "tmp_dir", topts->tmp_dir,
- "transaction_dir", iopts->transaction_dir,
- "rpmrc_file", topts->rpmrc_file,
- "package_list_storage_path", topts->pkg_list_storage_path,
- NULL));
- gtk_object_ref (GTK_OBJECT (service));
- gtk_object_sink (GTK_OBJECT (service));
-
- eazel_install_configure_softcat (service->private->softcat);
-
- transferoptions_destroy (topts);
- installoptions_destroy (iopts);
-
- return service;
-}
-
-
-/*****************************************
- install stuff
-*****************************************/
-
-/* if there's an older tmpdir left over from a previous attempt, use it */
-static char *
-find_old_tmpdir (const char *prefix)
-{
- DIR *dirfd;
- struct dirent *file;
- char *parent_dir, *base_prefix;
- char *old_tmpdir;
- char *p;
- struct stat statbuf;
-
- /* find parent dir of prefix */
- parent_dir = g_strdup (prefix);
- p = strrchr (parent_dir, '/');
- if (p == NULL) {
- g_free (parent_dir);
- parent_dir = g_strdup ("/");
- base_prefix = g_strdup (prefix);
- } else {
- base_prefix = g_strdup (p+1);
- *p = '\0';
- }
-
- old_tmpdir = NULL;
- dirfd = opendir (parent_dir);
- if (dirfd != NULL) {
- while ((file = readdir (dirfd)) != NULL) {
- if ((old_tmpdir == NULL) && (strlen (file->d_name) > strlen (base_prefix)) &&
- (strncmp (file->d_name, base_prefix, strlen (base_prefix)) == 0)) {
- old_tmpdir = g_strdup_printf ("%s/%s", parent_dir, file->d_name);
- if ((lstat (old_tmpdir, &statbuf) == 0) &&
- ((statbuf.st_mode & 0077) == 0) &&
- (statbuf.st_mode & S_IFDIR) &&
- ((statbuf.st_mode & S_IFLNK) != S_IFLNK) &&
- (statbuf.st_nlink == 2) &&
- (statbuf.st_uid == getuid ())) {
- /* acceptable */
- trilobite_debug ("found an old tmpdir: %s", old_tmpdir);
- } else {
- g_free (old_tmpdir);
- old_tmpdir = NULL;
- }
- }
- }
- }
- closedir (dirfd);
-
- g_free (parent_dir);
- g_free (base_prefix);
-
- return old_tmpdir;
-}
-
-static int
-create_temporary_directory (EazelInstall *service)
-{
- int result = 0;
- char *tmpdir = g_strdup (eazel_install_get_tmp_dir (service));
- struct stat statbuf;
- struct passwd *pwentry;
- char *prefix;
- int tries;
-
- if (tmpdir != NULL) {
- if (lstat (tmpdir, &statbuf) == 0) {
- if ((statbuf.st_mode & S_IFDIR) &&
- ((statbuf.st_mode & S_IFLNK) != S_IFLNK) &&
- (statbuf.st_nlink == 2) &&
- (statbuf.st_uid == getuid ()) &&
- (chmod (tmpdir, 0700) == 0)) {
- /* acceptable existing directory */
- } else {
- /* unacceptable: throw it away and start over */
- g_warning ("Sinister-looking temporary directory %s (ignoring)", tmpdir);
- g_free (tmpdir);
- tmpdir = NULL;
- }
- } else {
- /* doesn't even exist: try to create */
- if (mkdir (tmpdir, 0700) == 0) {
- /* A-OK! */
- } else {
- g_warning ("Unable to create temporary directory %s (%s)", tmpdir, strerror (errno));
- g_free (tmpdir);
- tmpdir = NULL;
- }
- }
- }
-
-#define RANDCHAR ('A' + (rand () % 23))
- if (tmpdir == NULL) {
- pwentry = getpwuid (getuid ());
- prefix = g_strdup_printf ("/tmp/nautilus-installer-%s.",
- (pwentry == NULL) ? "unknown" : pwentry->pw_name);
- tmpdir = find_old_tmpdir (prefix);
- if (tmpdir == NULL) {
- trilobite_debug ("No acceptable temporary directory set; creating one...");
-
- srand (time (NULL));
- for (tries = 0; tries < 50; tries++) {
- tmpdir = g_strdup_printf ("%s%c%c%c%c%c%c%d", prefix,
- RANDCHAR, RANDCHAR, RANDCHAR, RANDCHAR,
- RANDCHAR, RANDCHAR, (rand () % 1000));
- /* it's important that the mkdir here be atomic */
- if (mkdir (tmpdir, 0700) == 0) {
- trilobite_debug ("Created temporary directory \"%s\"", tmpdir);
- break;
- }
- g_free (tmpdir);
- tmpdir = NULL;
- }
- if (tries >= 50) {
- g_warning ("Unable to create temporary directory (%s)", strerror (errno));
- }
- }
- g_free (prefix);
- }
-
- if (tmpdir != NULL) {
- eazel_install_set_tmp_dir (service, tmpdir);
- result = 1;
- }
-
- g_free (tmpdir);
- return result;
-} /* end create_temporary_directory */
-
-gboolean
-eazel_install_fetch_remote_package_list (EazelInstall *service)
-{
- gboolean retval;
- char *url;
- char *destination;
-
- EAZEL_INSTALL_SANITY_VAL(service, FALSE);
-
- trilobite_debug (_("Getting package list from remote server ...\n"));
-
- url = g_strdup_printf ("http://%s:%d%s%s",
- eazel_install_get_server (service),
- eazel_install_get_server_port (service),
- eazel_install_get_package_list_storage_path (service)[0]=='/'?"":"/",
- eazel_install_get_package_list_storage_path (service));
- destination = g_strdup (eazel_install_get_package_list (service));
-
- retval = eazel_install_fetch_file (service,
- url,
- "package list",
- destination,
- NULL);
-
- if (!retval) {
- g_warning (_("Unable to retrieve package-list.xml!\n"));
- }
-
- g_free (destination);
- g_free (url);
- return retval;
-}
-
-#ifdef EAZEL_INSTALL_NO_CORBA
-static void
-eazel_install_log (const char *domain,
- GLogLevelFlags flags,
- const char *message,
- EazelInstall *service)
-{
- char *format;
-
- EAZEL_INSTALL_SANITY (service);
-
- if (flags & G_LOG_LEVEL_DEBUG) {
- format = "d: %s\n";
- } else if (flags & G_LOG_LEVEL_MESSAGE) {
- format = " : %s\n";
- } else if (flags & G_LOG_LEVEL_WARNING) {
- format = "w: %s\n";
- } else if (flags & G_LOG_LEVEL_ERROR) {
- format = "E: %s\n";
- } else {
- format = "?: %s\n";
- }
-
- if ((flags & G_LOG_LEVEL_DEBUG) && ! service->private->iopts->mode_debug) {
- /* don't log debug stuff to stderr unless debug mode is on */
- return;
- }
-
- if (service->private->logfile != NULL) {
- fprintf (service->private->logfile, format, message);
- fflush (service->private->logfile);
- }
- if (service->private->log_to_stderr || (service->private->logfile == NULL)) {
- fprintf (stderr, format, message);
- fflush (stderr);
- }
-}
-#endif
-
-void
-eazel_install_set_log (EazelInstall *service,
- FILE *logfp)
-{
- if (service->private->logfile != NULL) {
- fclose (service->private->logfile);
- }
- service->private->logfile = logfp;
-}
-
-void
-eazel_install_open_log (EazelInstall *service,
- const char *fname)
-{
- FILE *fp;
-
- EAZEL_INSTALL_SANITY (service);
-
- fp = fopen (fname, "wt");
- if (fp != NULL) {
- eazel_install_set_log (service, fp);
- if (service->private->logfilename) {
- g_free (service->private->logfilename);
- }
- service->private->logfilename = g_strdup (fname);
- } else {
- g_warning (_("Cannot write to file %s, using default log handler"), fname);
- }
-}
-
-void
-eazel_install_log_to_stderr (EazelInstall *service,
- gboolean log_to_stderr)
-{
- service->private->log_to_stderr = log_to_stderr;
-}
-
-gboolean
-eazel_install_failed_because_of_disk_full (EazelInstall *service)
-{
- return service->private->disk_full;
-}
-
-static gboolean
-eazel_install_alter_mode_on_temp (EazelInstall *service,
- mode_t mode)
-{
- GList *iterator;
- gboolean result = TRUE;
-
- EAZEL_INSTALL_SANITY_VAL (service, FALSE);
-
- trilobite_debug ("locking dir to 0%o", mode);
-
- /* First set mode 400 on all files */
- if (chmod (eazel_install_get_tmp_dir (service), mode + 0100) != 0) {
- trilobite_debug ("cannot change %s to 0%o", eazel_install_get_tmp_dir (service),
- mode + 0100);
- result = FALSE;
- }
-
- for (iterator = service->private->downloaded_files; iterator; iterator = g_list_next (iterator)) {
- char *filename = (char*)iterator->data;
- if (filename) {
- if (chmod (filename, mode) != 0) {
- trilobite_debug ("cannot change %s to 0%o", filename, mode);
- result = FALSE;
- }
- }
- }
-
- trilobite_debug ("locking done");
-
- return result;
-}
-
-gboolean
-eazel_install_lock_tmp_dir (EazelInstall *service)
-{
- return eazel_install_alter_mode_on_temp (service, 0400);
-}
-
-gboolean
-eazel_install_unlock_tmp_dir (EazelInstall *service)
-{
- return eazel_install_alter_mode_on_temp (service, 0600);
-}
-
-void
-eazel_install_delete_downloads (EazelInstall *service)
-{
- GList *iterator;
- char *filename;
-
- EAZEL_INSTALL_SANITY (service);
-
- if (service->private->downloaded_files) {
- trilobite_debug ("deleting the package files:");
- for (iterator = g_list_first (service->private->downloaded_files); iterator != NULL;
- iterator = g_list_next (iterator)) {
- filename = (char*)iterator->data;
- trilobite_debug ("deleting file '%s'", filename);
- if (unlink (filename) != 0) {
- g_warning ("unable to delete file %s !", filename);
- }
- }
-
- /* don't try to delete them again later */
- g_list_foreach (service->private->downloaded_files, (GFunc)g_free, NULL);
- g_list_free (service->private->downloaded_files);
- service->private->downloaded_files = NULL;
- }
- if (rmdir (eazel_install_get_tmp_dir (service)) != 0) {
- g_warning ("unable to delete directory %s !",
- eazel_install_get_tmp_dir (service));
- }
-}
-
-void
-eazel_install_install_packages (EazelInstall *service,
- GList *categories,
- const char *root)
-{
- EazelInstallOperationStatus result;
- EAZEL_INSTALL_SANITY (service);
-
- trilobite_debug ("eazel_install_install_packages (..., %d cats, %s)",
- g_list_length (categories),
- root);
- trilobite_debug ("eazel_install_install_packages (upgrade = %d, downgrade = %d, force = %d)",
- eazel_install_get_upgrade (service),
- eazel_install_get_downgrade (service),
- eazel_install_get_force (service));
-
-#ifndef EAZEL_INSTALL_SLIM
- /* we're about to call g_main_iteraton sometimes, so grab a ref on ourself to avoid vanishing. */
- bonobo_object_ref (BONOBO_OBJECT (service));
-#endif /* EAZEL_INSTALL_SLIM */
-
- if (create_temporary_directory (service)) {
- if (categories == NULL && eazel_install_get_package_list (service) == NULL) {
- char *tmp;
- tmp = g_strdup_printf ("%s/package-list.xml", eazel_install_get_tmp_dir (service));
- eazel_install_set_package_list (service, tmp);
- unlink (tmp); /* in case one was sitting around from last time */
- g_free (tmp);
-
- eazel_install_fetch_remote_package_list (service);
- }
-
- g_free (service->private->cur_root);
- service->private->cur_root = g_strdup (root?root:DEFAULT_RPM_DB_ROOT);
- eazel_install_set_uninstall (service, FALSE);
-
- result = install_packages (service, categories);
-
- if (result == EAZEL_INSTALL_NOTHING) {
- g_warning (_("Install failed"));
- }
-
- trilobite_debug ("service->private->downloaded_files = %p",
- (unsigned int)service->private->downloaded_files);
-
- g_free (service->private->cur_root);
- service->private->cur_root = NULL;
- } else {
- result = EAZEL_INSTALL_NOTHING;
- }
-
- eazel_install_emit_done (service, result & EAZEL_INSTALL_INSTALL_OK);
-
-#ifndef EAZEL_INSTALL_SLIM
- bonobo_object_unref (BONOBO_OBJECT (service));
-#endif /* EAZEL_INSTALL_SLIM */
-}
-
-void
-eazel_install_uninstall_packages (EazelInstall *service, GList *categories, const char *root)
-{
- EazelInstallOperationStatus result;
- EAZEL_INSTALL_SANITY (service);
-
- trilobite_debug ("eazel_install_uninstall_packages (..., %d cats, %s)",
- g_list_length (categories),
- root);
-
- g_free (service->private->cur_root);
- service->private->cur_root = g_strdup (root?root:DEFAULT_RPM_DB_ROOT);
- eazel_install_set_uninstall (service, TRUE);
-
- if (categories == NULL && eazel_install_get_package_list (service) == NULL) {
- char *tmp;
- tmp = g_strdup_printf ("%s/package-list.xml", eazel_install_get_tmp_dir (service));
- eazel_install_set_package_list (service, tmp);
- unlink (tmp);
- g_free (tmp);
-
- eazel_install_fetch_remote_package_list (service);
- }
-
- result = uninstall_packages (service, categories);
-
- if (result == EAZEL_INSTALL_NOTHING) {
- g_warning (_("Uninstall failed"));
- }
-
- eazel_install_emit_done (service, result & EAZEL_INSTALL_UNINSTALL_OK);
-}
-
-void
-eazel_install_revert_transaction_from_xmlstring (EazelInstall *service,
- const char *xml,
- int size,
- const char *root)
-{
- GList *packages;
- EazelInstallOperationStatus result;
-
- g_free (service->private->cur_root);
- service->private->cur_root = g_strdup (root?root:DEFAULT_RPM_DB_ROOT);
-
- packages = parse_memory_transaction_file (xml, size);
-
- service->private->revert = TRUE;
-
- if (create_temporary_directory (service)) {
- result = revert_transaction (service, packages);
- } else {
- result = EAZEL_INSTALL_NOTHING;
- }
- service->private->revert = FALSE;
-
- eazel_install_emit_done (service, result & EAZEL_INSTALL_REVERSION_OK);
-}
-
-
-void
-eazel_install_revert_transaction_from_file (EazelInstall *service,
- const char *filename,
- const char *root)
-{
- xmlDocPtr doc;
- xmlChar *mem;
- int size;
-
- doc = xmlParseFile (filename);
- xmlDocDumpMemory (doc, &mem, &size);
- eazel_install_revert_transaction_from_xmlstring (service, mem, size, root);
- g_free (mem);
- xmlFreeDoc (doc);
-}
-
-GList*
-eazel_install_query_package_system (EazelInstall *service,
- const char *query,
- int flags,
- const char *root)
-{
- GList *result;
- g_message ("eazel_install_query_package_system (...,%s,...)", query);
-
- g_free (service->private->cur_root);
- service->private->cur_root = g_strdup (root);
-
- result = eazel_package_system_query (service->private->package_system,
- root,
- (const gpointer)query,
- EAZEL_PACKAGE_SYSTEM_QUERY_MATCHES,
- PACKAGE_FILL_EVERYTHING);
- return result;
-}
-
-void
-eazel_install_add_repository (EazelInstall *service, const char *dir)
-{
- service->private->local_repositories = g_list_prepend (service->private->local_repositories, g_strdup (dir));
-}
-
-static void
-eazel_install_do_transaction_save_report_helper (xmlNodePtr node,
- GList *packages)
-{
- GList *iterator;
-
- for (iterator = packages; iterator; iterator = g_list_next (iterator)) {
- PackageData *pack;
- char *tmp;
- pack = (PackageData*)iterator->data;
- switch (pack->modify_status) {
- case PACKAGE_MOD_INSTALLED:
- tmp = g_strdup_printf ("Installed %s", pack->name);
- xmlNewChild (node, NULL, "DESCRIPTION", tmp);
- g_free (tmp);
- break;
- case PACKAGE_MOD_UNINSTALLED:
- tmp = g_strdup_printf ("Uninstalled %s", pack->name);
- xmlNewChild (node, NULL, "DESCRIPTION", tmp);
- g_free (tmp);
- break;
- default:
- break;
- }
- if (pack->modifies) {
- eazel_install_do_transaction_save_report_helper (node, pack->modifies);
- }
- }
-}
-
-static gboolean
-eazel_install_is_dir (const char *path)
-{
- struct stat statbuf;
-
- stat (path, &statbuf);
-
- return S_ISDIR (statbuf.st_mode);
-}
-
-
-
-void
-eazel_install_save_transaction_report (EazelInstall *service)
-{
- FILE *outfile;
- xmlDocPtr doc;
- xmlNodePtr node, root;
- char *name = NULL;
-
- if (eazel_install_get_transaction_dir (service) == NULL) {
- g_warning ("Transaction directory not set, not storing transaction report");
- }
-
- /* Ensure the transaction dir is present */
- if (! eazel_install_is_dir (eazel_install_get_transaction_dir (service))) {
- int retval;
- retval = mkdir (eazel_install_get_transaction_dir (service), 0755);
- if (retval < 0) {
- if (errno != EEXIST) {
- g_warning (_("Could not create transaction directory (%s)! ***\n"),
- eazel_install_get_transaction_dir (service));
- return;
- }
- }
- }
-
- /* Create xml */
- doc = xmlNewDoc ("1.0");
- root = node = xmlNewNode (NULL, "TRANSACTION");
- xmlDocSetRootElement (doc, node);
-
- /* Make a unique name */
- name = g_strdup_printf ("%s/transaction.%lu", eazel_install_get_transaction_dir (service),
- (unsigned long) time (NULL));
- while (!access (name, F_OK)) {
- g_free (name);
- sleep (1);
- name = g_strdup_printf ("%s/transaction.%lu",
- eazel_install_get_transaction_dir (service),
- (unsigned long) time (NULL));
- }
-
- trilobite_debug (_("Writing transaction to %s"), name);
-
- /* Open and save */
- outfile = fopen (name, "w");
- xmlAddChild (root, eazel_install_packagelist_to_xml (service->private->transaction, FALSE));
- node = xmlAddChild (node, xmlNewNode (NULL, "DESCRIPTIONS"));
-
- {
- char *tmp;
- tmp = g_strdup_printf ("%lu", (unsigned long) time (NULL));
- xmlNewChild (node, NULL, "DATE", tmp);
- g_free (tmp);
- }
-
- eazel_install_do_transaction_save_report_helper (node, service->private->transaction);
-
- xmlDocDump (outfile, doc);
-
- fclose (outfile);
- g_free (name);
-}
-
-void
-eazel_install_init_transaction (EazelInstall *service)
-{
- /* Null the list of files met in the transaction */
- g_list_free (service->private->transaction);
- service->private->transaction = NULL;
-
- /* Null the list of files met in the transaction */
- g_list_free (service->private->failed_packages);
- service->private->failed_packages = NULL;
-}
-
-/************************************************
- Signal emitters and default handlers.
- The default handlers check for the existance of
- a corba callback, and if true, do the callback
-**************************************************/
-
-void
-eazel_install_emit_file_conflict_check (EazelInstall *service,
- const PackageData *pack)
-{
- EAZEL_INSTALL_SANITY(service);
- gtk_signal_emit (GTK_OBJECT (service), signals[FILE_CONFLICT_CHECK], pack);
-}
-
-void
-eazel_install_emit_file_conflict_check_default (EazelInstall *service,
- const PackageData *pack)
-{
-#ifndef EAZEL_INSTALL_NO_CORBA
- CORBA_Environment ev;
- CORBA_exception_init (&ev);
- EAZEL_INSTALL_SANITY(service);
- if (service->callback != CORBA_OBJECT_NIL) {
- GNOME_Trilobite_Eazel_PackageDataStruct *package;
- package = corba_packagedatastruct_from_packagedata (pack);
- GNOME_Trilobite_Eazel_InstallCallback_file_conflict_check (service->callback,
- package,
- &ev);
- CORBA_free (package);
- }
- CORBA_exception_free (&ev);
-#endif /* EAZEL_INSTALL_NO_CORBA */
-}
-
-void
-eazel_install_emit_file_uniqueness_check (EazelInstall *service,
- const PackageData *pack)
-{
- EAZEL_INSTALL_SANITY(service);
- gtk_signal_emit (GTK_OBJECT (service), signals[FILE_UNIQUENESS_CHECK], pack);
-}
-
-void
-eazel_install_emit_file_uniqueness_check_default (EazelInstall *service,
- const PackageData *pack)
-{
-#ifndef EAZEL_INSTALL_NO_CORBA
- CORBA_Environment ev;
- CORBA_exception_init (&ev);
- EAZEL_INSTALL_SANITY(service);
- if (service->callback != CORBA_OBJECT_NIL) {
- GNOME_Trilobite_Eazel_PackageDataStruct *package;
- package = corba_packagedatastruct_from_packagedata (pack);
- GNOME_Trilobite_Eazel_InstallCallback_file_uniqueness_check (service->callback,
- package,
- &ev);
- CORBA_free (package);
- }
- CORBA_exception_free (&ev);
-#endif /* EAZEL_INSTALL_NO_CORBA */
-}
-
-void
-eazel_install_emit_feature_consistency_check (EazelInstall *service,
- const PackageData *pack)
-{
- EAZEL_INSTALL_SANITY(service);
- gtk_signal_emit (GTK_OBJECT (service), signals[FEATURE_CONSISTENCY_CHECK], pack);
-}
-
-
-void
-eazel_install_emit_feature_consistency_check_default (EazelInstall *service,
- const PackageData *pack)
-{
-#ifndef EAZEL_INSTALL_NO_CORBA
- CORBA_Environment ev;
- CORBA_exception_init (&ev);
- EAZEL_INSTALL_SANITY(service);
- if (service->callback != CORBA_OBJECT_NIL) {
- GNOME_Trilobite_Eazel_PackageDataStruct *package;
- package = corba_packagedatastruct_from_packagedata (pack);
- GNOME_Trilobite_Eazel_InstallCallback_feature_consistency_check (service->callback,
- package,
- &ev);
- CORBA_free (package);
- }
- CORBA_exception_free (&ev);
-#endif /* EAZEL_INSTALL_NO_CORBA */
-}
-
-void
-eazel_install_emit_install_progress (EazelInstall *service,
- const PackageData *pack,
- int package_num, int num_packages,
- int package_size_completed, int package_size_total,
- int total_size_completed, int total_size)
-{
- EAZEL_INSTALL_SANITY(service);
- gtk_signal_emit (GTK_OBJECT (service), signals[INSTALL_PROGRESS],
- pack,
- package_num, num_packages,
- package_size_completed, package_size_total,
- total_size_completed, total_size);
-
-}
-
-void
-eazel_install_emit_install_progress_default (EazelInstall *service,
- const PackageData *pack,
- int package_num, int num_packages,
- int package_size_completed, int package_size_total,
- int total_size_completed, int total_size)
-{
-#ifndef EAZEL_INSTALL_NO_CORBA
- CORBA_Environment ev;
- CORBA_exception_init (&ev);
- EAZEL_INSTALL_SANITY(service);
- if (service->callback != CORBA_OBJECT_NIL) {
- GNOME_Trilobite_Eazel_PackageDataStruct *package;
- package = corba_packagedatastruct_from_packagedata (pack);
- GNOME_Trilobite_Eazel_InstallCallback_install_progress (service->callback,
- package,
- package_num, num_packages,
- package_size_completed, package_size_total,
- total_size_completed, total_size,
- &ev);
- CORBA_free (package);
- }
- CORBA_exception_free (&ev);
-#endif /* EAZEL_INSTALL_NO_CORBA */
-}
-
-void
-eazel_install_emit_uninstall_progress (EazelInstall *service,
- const PackageData *pack,
- int package_num, int num_packages,
- int package_size_completed, int package_size_total,
- int total_size_completed, int total_size)
-{
- EAZEL_INSTALL_SANITY(service);
- gtk_signal_emit (GTK_OBJECT (service), signals[UNINSTALL_PROGRESS],
- pack,
- package_num, num_packages,
- package_size_completed, package_size_total,
- total_size_completed, total_size);
-
-}
-
-void
-eazel_install_emit_uninstall_progress_default (EazelInstall *service,
- const PackageData *pack,
- int package_num, int num_packages,
- int package_size_completed, int package_size_total,
- int total_size_completed, int total_size)
-{
-#ifndef EAZEL_INSTALL_NO_CORBA
- CORBA_Environment ev;
- CORBA_exception_init (&ev);
- EAZEL_INSTALL_SANITY(service);
-
- if (service->callback != CORBA_OBJECT_NIL) {
- GNOME_Trilobite_Eazel_PackageDataStruct *package;
- package = corba_packagedatastruct_from_packagedata (pack);
- GNOME_Trilobite_Eazel_InstallCallback_uninstall_progress (service->callback,
- package,
- package_num, num_packages,
- package_size_completed, package_size_total,
- total_size_completed, total_size,
- &ev);
- CORBA_free (package);
- }
- CORBA_exception_free (&ev);
-#endif /* EAZEL_INSTALL_NO_CORBA */
-}
-
-void
-eazel_install_emit_download_progress (EazelInstall *service,
- const PackageData *pack,
- int amount,
- int total)
-{
- EAZEL_INSTALL_SANITY(service);
- gtk_signal_emit (GTK_OBJECT (service), signals[DOWNLOAD_PROGRESS], pack, amount, total);
-}
-
-void
-eazel_install_emit_download_progress_default (EazelInstall *service,
- const PackageData *pack,
- int amount,
- int total)
-{
-#ifndef EAZEL_INSTALL_NO_CORBA
- CORBA_Environment ev;
- CORBA_exception_init (&ev);
- EAZEL_INSTALL_SANITY(service);
- if (service->callback != CORBA_OBJECT_NIL) {
- GNOME_Trilobite_Eazel_PackageDataStruct *package;
- package = corba_packagedatastruct_from_packagedata (pack);
- GNOME_Trilobite_Eazel_InstallCallback_download_progress (service->callback, package, amount, total, &ev);
- if (ev._major != CORBA_NO_EXCEPTION) {
- /* user has aborted us and gone home -- tell VFS to STOP! */
- service->private->cancel_download = TRUE;
- }
- CORBA_free (package);
- }
- CORBA_exception_free (&ev);
-#endif /* EAZEL_INSTALL_NO_CORBA */
-}
-
-static unsigned long
-eazel_install_get_size_increasement (EazelInstall *service,
- GList *packages)
-{
- const GList *iterator;
- unsigned long result = 0;
- for (iterator = packages; iterator; iterator = g_list_next (iterator)) {
- PackageData *pack = (PackageData*)iterator->data;
- GList *modit;
- result += pack->bytesize;
- if (pack->modifies) {
- for (modit = pack->modifies; modit; modit = g_list_next (modit)) {
- PackageData *modpack = (PackageData*)modit->data;
- result -= modpack->bytesize;
- }
-
- }
- }
- return result;
-}
-
-gboolean
-eazel_install_emit_preflight_check (EazelInstall *service,
- GList *packages)
-{
- unsigned long size_packages, num_packages;
- gboolean result;
- GList *flat_packages;
-
- EAZEL_INSTALL_SANITY_VAL(service, FALSE);
-
- flat_packages = flatten_packagedata_dependency_tree (packages);
- size_packages = eazel_install_get_size_increasement (service, flat_packages);
- num_packages = g_list_length (flat_packages);
- g_list_free (flat_packages);
-
-#if 0
- /* FIXME: ARGH ARGH ARGH, this circumvents ORBit's buffersize error */
- if (num_packages > 50) {
- GList *foo = NULL;
-
- trilobite_debug ("hest hest hest");
-
- foo = g_list_prepend (foo, packages->data);
- gtk_signal_emit (GTK_OBJECT (service),
- signals[PREFLIGHT_CHECK],
- foo,
- size_packages,
- num_packages,
- &result);
- return result;
-
- }
-#endif
-
- gtk_signal_emit (GTK_OBJECT (service),
- signals[PREFLIGHT_CHECK],
- packages,
- size_packages,
- num_packages,
- &result);
-
- return result;
-}
-
-gboolean
-eazel_install_emit_preflight_check_default (EazelInstall *service,
- GList *packages,
- int total_bytes,
- int total_packages)
-{
-#ifndef EAZEL_INSTALL_NO_CORBA
- CORBA_Environment ev;
- CORBA_boolean result = FALSE;
- GNOME_Trilobite_Eazel_PackageDataStructList *package_tree;
- GNOME_Trilobite_Eazel_Operation corba_op;
-
- CORBA_exception_init (&ev);
- EAZEL_INSTALL_SANITY_VAL (service, FALSE);
-
- if (service->private->revert) {
- corba_op = GNOME_Trilobite_Eazel_OPERATION_REVERT;
- } else if (eazel_install_get_uninstall (service)==TRUE) {
- corba_op = GNOME_Trilobite_Eazel_OPERATION_UNINSTALL;
- } else {
- corba_op = GNOME_Trilobite_Eazel_OPERATION_INSTALL;
- }
-
- if (service->callback != CORBA_OBJECT_NIL) {
- package_tree = corba_packagedatastructlist_from_packagedata_tree (packages);
- result = GNOME_Trilobite_Eazel_InstallCallback_preflight_check (service->callback,
- corba_op,
- package_tree,
- total_bytes,
- total_packages,
- &ev);
- if (ev._major != CORBA_NO_EXCEPTION) {
- /* abort on corba failure */
- result = FALSE;
- }
- CORBA_free (package_tree);
- }
- CORBA_exception_free (&ev);
- return (gboolean)result;
-#else /* EAZEL_INSTALL_NO_CORBA */
- return TRUE;
-#endif /* EAZEL_INSTALL_NO_CORBA */
-}
-
-gboolean
-eazel_install_emit_save_transaction (EazelInstall *service,
- GList *packages)
-{
- gboolean result;
-
- EAZEL_INSTALL_SANITY_VAL(service, FALSE);
-
-#if 0
- /* FIXME: ARGH ARGH ARGH, this circumvents ORBit's buffersize error */
- if (g_list_length (packages) > 50) {
- GList *foo = NULL;
-
- trilobite_debug ("hest hest hest");
-
- foo = g_list_prepend (foo, packages->data);
- gtk_signal_emit (GTK_OBJECT (service),
- signals[SAVE_TRANSACTION],
- foo,
- &result);
- return result;
-
- }
-#endif
-
- gtk_signal_emit (GTK_OBJECT (service),
- signals[SAVE_TRANSACTION],
- packages,
- &result);
-
- return result;
-}
-
-gboolean
-eazel_install_emit_save_transaction_default (EazelInstall *service,
- GList *packages)
-{
-#ifndef EAZEL_INSTALL_NO_CORBA
- CORBA_Environment ev;
- CORBA_boolean result = FALSE;
- GNOME_Trilobite_Eazel_PackageDataStructList *package_tree;
- GNOME_Trilobite_Eazel_Operation corba_op;
-
- CORBA_exception_init (&ev);
- EAZEL_INSTALL_SANITY_VAL (service, FALSE);
-
- if (service->private->revert) {
- corba_op = GNOME_Trilobite_Eazel_OPERATION_REVERT;
- } else if (eazel_install_get_uninstall (service)==TRUE) {
- corba_op = GNOME_Trilobite_Eazel_OPERATION_UNINSTALL;
- } else {
- corba_op = GNOME_Trilobite_Eazel_OPERATION_INSTALL;
- }
-
- if (service->callback != CORBA_OBJECT_NIL) {
- package_tree = corba_packagedatastructlist_from_packagedata_tree (packages);
- result = GNOME_Trilobite_Eazel_InstallCallback_save_transaction (service->callback,
- corba_op,
- package_tree,
- &ev);
- if (ev._major != CORBA_NO_EXCEPTION) {
- /* abort on corba failure */
- result = FALSE;
- }
- CORBA_free (package_tree);
- }
- CORBA_exception_free (&ev);
- return (gboolean)result;
-#else /* EAZEL_INSTALL_NO_CORBA */
- return FALSE;
-#endif /* EAZEL_INSTALL_NO_CORBA */
-}
-
-void
-eazel_install_emit_download_failed (EazelInstall *service,
- const PackageData *pack)
-{
- EAZEL_INSTALL_SANITY(service);
- gtk_signal_emit (GTK_OBJECT (service), signals[DOWNLOAD_FAILED], pack);
-}
-
-void
-eazel_install_emit_download_failed_default (EazelInstall *service,
- const PackageData *pack)
-{
-#ifndef EAZEL_INSTALL_NO_CORBA
- CORBA_Environment ev;
- CORBA_exception_init (&ev);
- EAZEL_INSTALL_SANITY(service);
- if (service->callback != CORBA_OBJECT_NIL) {
- GNOME_Trilobite_Eazel_PackageDataStruct *package;
- package = corba_packagedatastruct_from_packagedata (pack);
- GNOME_Trilobite_Eazel_InstallCallback_download_failed (service->callback, package, &ev);
- if (ev._major != CORBA_NO_EXCEPTION) {
- /* user has aborted us and gone home -- tell VFS to STOP! */
- service->private->cancel_download = TRUE;
- }
- CORBA_free (package);
- }
- CORBA_exception_free (&ev);
-#endif /* EAZEL_INSTALL_NO_CORBA */
-}
-
-void
-eazel_install_emit_md5_check_failed (EazelInstall *service,
- const PackageData *pd,
- const char *actual_md5)
-{
- EAZEL_INSTALL_SANITY(service);
- gtk_signal_emit (GTK_OBJECT (service), signals[MD5_CHECK_FAILED], pd, actual_md5);
-}
-
-void
-eazel_install_emit_md5_check_failed_default (EazelInstall *service,
- const PackageData *pack,
- const char *actual_md5)
-{
-#ifndef EAZEL_INSTALL_NO_CORBA
- CORBA_Environment ev;
- CORBA_exception_init (&ev);
- EAZEL_INSTALL_SANITY(service);
- if (service->callback != CORBA_OBJECT_NIL) {
- GNOME_Trilobite_Eazel_PackageDataStruct *corbapack;
-
- corbapack = corba_packagedatastruct_from_packagedata (pack);
-
- GNOME_Trilobite_Eazel_InstallCallback_md5_check_failed (service->callback,
- corbapack,
- actual_md5,
- &ev);
- CORBA_free (corbapack);
- }
- CORBA_exception_free (&ev);
-#endif /* EAZEL_INSTALL_NO_CORBA */
-}
-
-void
-eazel_install_emit_install_failed (EazelInstall *service,
- const PackageData *pd)
-{
- EAZEL_INSTALL_SANITY(service);
- gtk_signal_emit (GTK_OBJECT (service), signals[INSTALL_FAILED], pd);
-}
-
-void
-eazel_install_emit_install_failed_default (EazelInstall *service,
- const PackageData *pack)
-{
-#ifndef EAZEL_INSTALL_NO_CORBA
- CORBA_Environment ev;
- GNOME_Trilobite_Eazel_PackageDataStructList *package_tree;
- GList *list;
-
- EAZEL_INSTALL_SANITY (service);
- CORBA_exception_init (&ev);
- if (service->callback != CORBA_OBJECT_NIL) {
- list = g_list_prepend (NULL, (void *)pack);
- package_tree = corba_packagedatastructlist_from_packagedata_tree (list);
- g_list_free (list);
-
- GNOME_Trilobite_Eazel_InstallCallback_install_failed (service->callback, package_tree, &ev);
- CORBA_free (package_tree);
- }
- CORBA_exception_free (&ev);
-#endif /* EAZEL_INSTALL_NO_CORBA */
-}
-
-void
-eazel_install_emit_uninstall_failed (EazelInstall *service,
- const PackageData *pd)
-{
- EAZEL_INSTALL_SANITY(service);
- gtk_signal_emit (GTK_OBJECT (service), signals[UNINSTALL_FAILED], pd);
-}
-
-void
-eazel_install_emit_uninstall_failed_default (EazelInstall *service,
- const PackageData *pack)
-{
-#ifndef EAZEL_INSTALL_NO_CORBA
- CORBA_Environment ev;
- GNOME_Trilobite_Eazel_PackageDataStructList *package_tree;
- GList *list;
-
- EAZEL_INSTALL_SANITY (service);
- CORBA_exception_init (&ev);
- if (service->callback != CORBA_OBJECT_NIL) {
- list = g_list_prepend (NULL, (void *)pack);
- package_tree = corba_packagedatastructlist_from_packagedata_tree (list);
- g_list_free (list);
-
- GNOME_Trilobite_Eazel_InstallCallback_uninstall_failed (service->callback, package_tree, &ev);
- CORBA_free (package_tree);
- }
- CORBA_exception_free (&ev);
-#endif /* EAZEL_INSTALL_NO_CORBA */
-}
-
-void
-eazel_install_emit_dependency_check (EazelInstall *service,
- const PackageData *package,
- const PackageDependency *needs)
-{
- PackageData *needed_package;
-
- EAZEL_INSTALL_SANITY(service);
-
- needed_package = packagedata_copy (needs->package, FALSE);
- if (needs->version) {
- g_free (needed_package->version);
- needed_package->version = NULL;
- g_free (needed_package->minor);
- needed_package->minor = NULL;
- needed_package->version = g_strdup (needs->version);
- }
- gtk_signal_emit (GTK_OBJECT (service), signals[DEPENDENCY_CHECK], package, needed_package);
- gtk_object_unref (GTK_OBJECT (needed_package));
-}
-
-void
-eazel_install_emit_dependency_check_pre_ei2 (EazelInstall *service,
- const PackageData *package,
- const PackageData *needs)
-{
- EAZEL_INSTALL_SANITY(service);
- gtk_signal_emit (GTK_OBJECT (service), signals[DEPENDENCY_CHECK], package, needs);
-}
-
-void
-eazel_install_emit_dependency_check_default (EazelInstall *service,
- const PackageData *pack,
- const PackageData *needs)
-{
-#ifndef EAZEL_INSTALL_NO_CORBA
- CORBA_Environment ev;
- CORBA_exception_init (&ev);
- EAZEL_INSTALL_SANITY(service);
- if (service->callback != CORBA_OBJECT_NIL) {
- GNOME_Trilobite_Eazel_PackageDataStruct *corbapack;
- GNOME_Trilobite_Eazel_PackageDataStruct *corbaneeds;
-
- corbapack = corba_packagedatastruct_from_packagedata (pack);
- corbaneeds = corba_packagedatastruct_from_packagedata (needs);
-
- /* An old hack that we removed when we fixed bug 3460.
- * We should delete it some day.
- */
- /*
- if (needs->name == NULL && needs->provides) {
- CORBA_free (corbaneeds->name);
- corbaneeds->name = CORBA_string_dup (needs->provides->data);
- }
- */
-
- GNOME_Trilobite_Eazel_InstallCallback_dependency_check (service->callback,
- corbapack,
- corbaneeds, &ev);
- CORBA_free (corbapack);
- CORBA_free (corbaneeds);
- }
- CORBA_exception_free (&ev);
-#endif /* EAZEL_INSTALL_NO_CORBA */
-}
-
-void
-eazel_install_emit_done (EazelInstall *service, gboolean result)
-{
- EAZEL_INSTALL_SANITY(service);
-
- trilobite_debug ("emit_done (result = %s)", result ? "TRUE" : "FALSE");
- gtk_signal_emit (GTK_OBJECT (service), signals[DONE], result);
-}
-
-void
-eazel_install_emit_done_default (EazelInstall *service, gboolean result)
-{
-#ifndef EAZEL_INSTALL_NO_CORBA
- CORBA_Environment ev;
- CORBA_exception_init (&ev);
- EAZEL_INSTALL_SANITY(service);
- if (service->callback != CORBA_OBJECT_NIL) {
- GNOME_Trilobite_Eazel_InstallCallback_done (service->callback, result, &ev);
- }
- CORBA_exception_free (&ev);
-#endif /* EAZEL_INSTALL_NO_CORBA */
-}
-
-
-/* Welcome to define madness. These are all the get/set methods. There is nothing of
- * interest beyond this point, except for this dragon:
- _ _
- _ //` `\
- _,-"\% // /``\`\
- ~^~ >__^ |% // / } `\`\
- ) )%// / } } }`\`\
- / (%/'/.\_/\_/\_/\`/
- ( ' `-._`
- \ , ( \ _`-.__.-;%>
- /_`\ \ `\ \." `-..-'`
- ``` /_/`"-=-'`/_/
- jgs ``` ```
-*/
-
-
-static void
-string_list_copy (GList **in,
- const GList *strings) {
- GList *iterator;
- const GList *iterator_c;
-
- for (iterator = *in; iterator; iterator=iterator->next) {
- g_free (iterator->data);
- }
- g_list_free (*in);
-
- for (iterator_c = strings; iterator_c; iterator_c = iterator_c->next) {
- (*in) = g_list_prepend (*in, g_strdup ((char*)iterator_c->data));
- }
-}
-
-/* wrapper functions for softcat */
-char *
-eazel_install_get_server (EazelInstall *service) {
- EAZEL_INSTALL_SANITY_VAL (service, NULL);
- return g_strdup (eazel_softcat_get_server_host (service->private->softcat));
-}
-
-guint
-eazel_install_get_server_port (EazelInstall *service) {
- EAZEL_INSTALL_SANITY_VAL (service, 0);
- return (guint)eazel_softcat_get_server_port (service->private->softcat);
-}
-
-char *
-eazel_install_get_username (EazelInstall *service) {
- const char *username;
- EAZEL_INSTALL_SANITY_VAL (service, NULL);
- eazel_softcat_get_authn (service->private->softcat, &username);
- return g_strdup (username);
-}
-
-gboolean
-eazel_install_get_eazel_auth (EazelInstall *service) {
- EAZEL_INSTALL_SANITY_VAL (service, FALSE);
- return eazel_softcat_get_authn (service->private->softcat, NULL);
-}
-
-char *
-eazel_install_get_cgi_path (EazelInstall *service) {
- EAZEL_INSTALL_SANITY_VAL (service, NULL);
- return g_strdup (eazel_softcat_get_cgi_path (service->private->softcat));
-}
-
-void
-eazel_install_set_server (EazelInstall *service, const char *server)
-{
- EAZEL_INSTALL_SANITY (service);
- eazel_softcat_set_server_host (service->private->softcat, server);
-}
-
-void
-eazel_install_set_server_port (EazelInstall *service, guint port)
-{
- EAZEL_INSTALL_SANITY (service);
- eazel_softcat_set_server_port (service->private->softcat, (int)port);
-}
-
-void
-eazel_install_set_username (EazelInstall *service, const char *username)
-{
- EAZEL_INSTALL_SANITY (service);
- eazel_softcat_set_username (service->private->softcat, username);
-}
-
-void
-eazel_install_set_eazel_auth (EazelInstall *service, gboolean auth)
-{
- EAZEL_INSTALL_SANITY (service);
- eazel_softcat_set_authn_flag (service->private->softcat, auth);
-}
-
-void
-eazel_install_set_cgi_path (EazelInstall *service, const char *cgi_path)
-{
- EAZEL_INSTALL_SANITY (service);
- eazel_softcat_set_cgi_path (service->private->softcat, cgi_path);
-}
-
-void eazel_install_set_debug (EazelInstall *service, gboolean debug) {
- EAZEL_INSTALL_SANITY (service);
- service->private->iopts->mode_debug = debug;
- if (debug) {
-#ifdef ESKIL
- eazel_package_system_set_debug (service->private->package_system,
- EAZEL_PACKAGE_SYSTEM_DEBUG_VERBOSE);
-#else
- eazel_package_system_set_debug (service->private->package_system,
- EAZEL_PACKAGE_SYSTEM_DEBUG_FAIL);
-#endif
- } else {
- eazel_package_system_set_debug (service->private->package_system,
- EAZEL_PACKAGE_SYSTEM_DEBUG_FAIL);
- }
-}
-
-ei_mutator_impl (verbose, gboolean, iopts->mode_verbose);
-ei_mutator_impl (silent, gboolean, iopts->mode_silent);
-ei_mutator_impl (test, gboolean, iopts->mode_test);
-ei_mutator_impl (force, gboolean, iopts->mode_force);
-ei_mutator_impl (depend, gboolean, iopts->mode_depend);
-ei_mutator_impl (upgrade, gboolean, iopts->mode_update);
-ei_mutator_impl (uninstall, gboolean, iopts->mode_uninstall);
-ei_mutator_impl (downgrade, gboolean, iopts->mode_downgrade);
-ei_mutator_impl (protocol, URLType, iopts->protocol);
-ei_mutator_impl_copy (tmp_dir, char*, topts->tmp_dir, g_strdup);
-ei_mutator_impl_copy (rpmrc_file, char*, topts->rpmrc_file, g_strdup);
-ei_mutator_impl_copy (package_list_storage_path, char*, topts->pkg_list_storage_path, g_strdup);
-ei_mutator_impl_copy (package_list, char*, iopts->pkg_list, g_strdup);
-ei_mutator_impl_copy (transaction_dir, char*, transaction_dir, g_strdup);
-ei_mutator_impl (ssl_rename, gboolean, ssl_rename);
-ei_mutator_impl (ignore_file_conflicts, gboolean, ignore_file_conflicts);
-ei_mutator_impl (ei2, gboolean, ei2);
-
-ei_access_impl (verbose, gboolean, iopts->mode_verbose, FALSE);
-ei_access_impl (silent, gboolean, iopts->mode_silent, FALSE);
-ei_access_impl (debug, gboolean, iopts->mode_debug, FALSE);
-ei_access_impl (test, gboolean, iopts->mode_test, FALSE);
-ei_access_impl (force, gboolean, iopts->mode_force, FALSE);
-ei_access_impl (depend, gboolean, iopts->mode_depend, FALSE);
-ei_access_impl (upgrade, gboolean, iopts->mode_update, FALSE);
-ei_access_impl (uninstall, gboolean, iopts->mode_uninstall, FALSE);
-ei_access_impl (downgrade, gboolean, iopts->mode_downgrade, FALSE);
-ei_access_impl (protocol, URLType , iopts->protocol, PROTOCOL_LOCAL);
-ei_access_impl (tmp_dir, char*, topts->tmp_dir, NULL);
-ei_access_impl (rpmrc_file, char*, topts->rpmrc_file, NULL);
-ei_access_impl (package_list_storage_path, char*, topts->pkg_list_storage_path, NULL);
-ei_access_impl (package_list, char*, iopts->pkg_list, NULL);
-ei_access_impl (transaction_dir, char*, transaction_dir, NULL);
-ei_access_impl (root_dirs, GList*, root_dirs, NULL);
-ei_access_impl (ssl_rename, gboolean, ssl_rename, FALSE);
-ei_access_impl (ignore_file_conflicts, gboolean, ignore_file_conflicts, FALSE);
-ei_access_impl (ei2, gboolean, ei2, FALSE);
-
-void eazel_install_set_root_dirs (EazelInstall *service,
- const GList *new_roots)
-{
- string_list_copy (&service->private->root_dirs, new_roots);
-}
-
diff --git a/components/services/install/lib/eazel-install-private.h b/components/services/install/lib/eazel-install-private.h
deleted file mode 100644
index e65104444..000000000
--- a/components/services/install/lib/eazel-install-private.h
+++ /dev/null
@@ -1,118 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: Eskil Heyn Olsen <eskil@eazel.com>
- *
- */
-
-#ifndef EAZEL_INSTALL_PRIVATE_H
-#define EAZEL_INSTALL_PRIVATE_H
-
-#include "eazel-install-public.h"
-#include "eazel-package-system.h"
-#include "eazel-softcat.h"
-
-/* Funky define to step a GList iterator one ahead */
-#define glist_step(iterator) iterator = g_list_next (iterator)
-
-#define DEFAULT_RPM_DB_ROOT "/var/lib/rpm"
-
-struct _EazelInstallPrivate {
- TransferOptions *topts;
- InstallOptions *iopts;
-
- /* Used in rpm-glue */
- GList *root_dirs; /* Holds the root dirs for package databases. Eazel package database
- glue must handle this as seen fit */
- char *cur_root; /* For a given operation, this holds the current root dir */
- int install_flags;
- int interface_flags;
- int problem_filters;
- char *transaction_dir;
-
- gboolean ei2; /* This for the transition period. ei2==true means use the
- new ei2 stuff */
-
- gboolean ssl_rename; /* If true, rename the hosts part in all urls to
- localhost. This is to make stuff work
- with ssl tunneling */
-
- gboolean ignore_file_conflicts; /* Instructs the installer to ignore file conflicts */
-
- gboolean revert; /* If true, the current operation is a reversion */
-
- /* This holds the files that were downloaded */
- GList *downloaded_files;
-
- gboolean use_local_package_list;
-
- EazelPackageSystem *package_system;
-
- /* hacky way to implement the old style signals with the new package system object */
- unsigned long infoblock[6];
-
- /* This hash maps from package name-version-release to the
- package. Packages are added in eazel-install-rpm-glue.c do_rpm_install
- It's used in the progress stuff to lookup the correct
- package.
- It's cleaned up in the end of eazel_install_start_transaction,
- but not erased. */
- GHashTable *name_to_package_hash;
-
- /* During an operation, this logs the toplevel packages
- that were installed */
- GList *transaction;
-
- /* During an operation, this logs all packages that failed */
- GList *failed_packages;
-
- /* The logfile used for the object */
- FILE *logfile;
- char *logfilename;
- gboolean log_to_stderr;
-
- /* TRUE if the rpm subcommand is running */
- volatile gboolean subcommand_running;
-
- /* used to cancel a download before it finished */
- gboolean cancel_download;
-
- /* hacky way to notice if the disk is full */
- gboolean disk_full;
-
- /* look in these local directories for packages before downloading */
- GList *local_repositories;
-
- /* context to use for softcat queries */
- EazelSoftCat *softcat;
-
- /* These are hashtables used in eazel-install-logic2.c */
- GHashTable *dedupe_hash; /* This hash matches from eazel_id to PackageData objects,
- and is used to quickly identify dupes after getting the softcat
- information */
- GHashTable *dep_ok_hash; /* This hash matches from eazel_id to enum (found in eazel-install-logic2.c),
- and is used during check for dependencies which are required. If the
- string occurs in the hash, the package has already been checked
- for, and the returned enum denotes the dependency state.
- The hash also matches from a eazel_id-sense-version concatenation
- to a PackageData for the case where the dependency has both a version
- and sense */
-};
-
-#endif /* EAZEL_INSTALL_PRIVATE_H */
diff --git a/components/services/install/lib/eazel-install-problem.c b/components/services/install/lib/eazel-install-problem.c
deleted file mode 100644
index df12babad..000000000
--- a/components/services/install/lib/eazel-install-problem.c
+++ /dev/null
@@ -1,1859 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Copyright (C) 2000 Eazel, Inc
- * Copyright (C) 1998-1999 James Henstridge
- * Copyright (C) 1998 Red Hat Software, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: Eskil Heyn Olsen <eskil@eazel.com>
- */
-
-#include <eazel-install-problem.h>
-
-#include <libtrilobite/trilobite-i18n.h>
-
-#include <string.h>
-
-static GtkObjectClass *eazel_install_problem_parent_class;
-
-#define ASSERT_SANITY(s) g_assert (s!=NULL); \
- g_assert (EAZEL_IS_INSTALL_PROBLEM(s));
-
-#define P_SANITY(s) g_return_if_fail (s!=NULL); \
- g_return_if_fail (EAZEL_IS_INSTALL_PROBLEM(s));
-
-#define P_SANITY_VAL(s,val) g_return_val_if_fail (s!=NULL, val); \
- g_return_val_if_fail (EAZEL_IS_INSTALL_PROBLEM(s), val);
-
-
-#undef EIP_DEBUG
-
-/* Data argument to get_detailed_errors_foreach.
- Contains the installer and a path in the tree
- leading to the actual package */
-typedef struct {
- EazelInstallProblem *problem;
- GList *errors;
- GList *path;
- GList *packs;
- GList *handled;
-} GetErrorsForEachData;
-
-#ifdef EIP_DEBUG
-static void
-eazel_install_problem_debug_attempts (int *key,
- GList *val,
- EazelInstallProblem *problem)
-{
- g_message ("eazel_install_problem_debug_attempts key = %d", *key);
- g_message ("eazel_install_problem_debug_attempts val.length = %d", g_list_length (val));
-}
-#endif
-
-static void
-get_detailed_messages_breaks_foreach (PackageBreaks *breakage, GetErrorsForEachData *data)
-{
- PackageData *previous_pack = NULL;
- PackageData *top_pack = NULL;
- GList **errors = &(data->errors);
- char *top_name = NULL;
- char *previous_name = NULL;
- char *package_broken_name = NULL;;
-
- if (data->path) {
- previous_pack = PACKAGEDATA(data->path->data);
- previous_name = packagedata_get_readable_name (previous_pack);
- top_pack = PACKAGEDATA(g_list_last (data->path)->data);
- if (top_pack == previous_pack) {
- top_pack = NULL;
- } else {
- top_name = packagedata_get_readable_name (top_pack);
- }
- }
-
- package_broken_name = packagedata_get_readable_name (packagebreaks_get_package (breakage));
-
- if (IS_PACKAGEFILECONFLICT (breakage)) {
- char *message;
-
- if (top_pack != NULL) {
- message = g_strdup_printf ("Conflict between %s (required by %s) and %s",
- previous_name,
- top_name,
- package_broken_name);
- } else {
- message = g_strdup_printf ("Conflict between %s and %s",
- previous_name,
- package_broken_name);
- }
- (*errors) = g_list_append (*errors, message);
- } else if (IS_PACKAGEFEATUREMISSING (breakage)) {
- PackageFeatureMissing *missing = PACKAGEFEATUREMISSING (breakage);
- missing = NULL;
- } else {
- char *message;
-
- message = g_strdup_printf ("Feature dependency between %s and %s",
- previous_name,
- package_broken_name);
- (*errors) = g_list_append (*errors, message);
- }
-
- g_free (top_name);
- g_free (previous_name);
- g_free (package_broken_name);
-}
-
-static void
-get_detailed_messages_foreach (GtkObject *foo, GetErrorsForEachData *data)
-{
- char *message = NULL;
- char *required = NULL;
- char *required_by = NULL;
- char *top_name = NULL;
- GList **errors = &(data->errors);
- PackageData *previous_pack = NULL;
- PackageData *top_pack = NULL;
- PackageData *pack = NULL;
-
- if (IS_PACKAGEDATA (foo)) {
- pack = PACKAGEDATA (foo);
- } else if (IS_PACKAGEBREAKS (foo)) {
- pack = packagebreaks_get_package (PACKAGEBREAKS (foo));
- } else if (IS_PACKAGEDEPENDENCY (foo)) {
- pack = PACKAGEDEPENDENCY (foo)->package;
- } else {
- g_assert_not_reached ();
- }
-
-
- if (data->path) {
- previous_pack = PACKAGEDATA(data->path->data);
- top_pack = PACKAGEDATA(g_list_last (data->path)->data);
- if (top_pack == previous_pack) {
- previous_pack = NULL;
- }
- required_by = packagedata_get_readable_name (top_pack);
- top_name = packagedata_get_readable_name (top_pack);
- }
- required = packagedata_get_readable_name (pack);
-
- if (g_list_find (data->handled, pack)) { return; }
-
- switch (pack->status) {
- case PACKAGE_UNKNOWN_STATUS:
- break;
- case PACKAGE_CANCELLED:
- if (required_by) {
- if (pack->modifies!=NULL) {
- message = g_strdup_printf (_("%s was cancelled"), required);
- }
- }
- break;
- case PACKAGE_SOURCE_NOT_SUPPORTED:
- message = g_strdup_printf (_("%s is a source package, which is not yet supported"),
- required);
- break;
- case PACKAGE_FILE_CONFLICT:
- /* this will be reported below, when parsing the PackageBreaks */
- break;
- case PACKAGE_DEPENDENCY_FAIL:
- if (pack->depends) {
-
- } else {
- if (previous_pack && previous_pack->status == PACKAGE_BREAKS_DEPENDENCY) {
- if (required_by) {
-
- } else {
- message = g_strdup_printf (_("%s would break other packages"), required);
- }
- } else {
- message = g_strdup_printf (_("%s would break"), required);
- }
- }
- break;
- case PACKAGE_BREAKS_DEPENDENCY:
- if (required_by) {
- message = g_strdup_printf (_("%s would break %s"), required, required_by);
- } else {
- message = g_strdup_printf (_("%s would break other packages"), required);
- }
- break;
- case PACKAGE_INVALID:
- message = g_strdup_printf (_("%s is damaged"), required);
- break;
- case PACKAGE_CANNOT_OPEN:
- if (previous_pack) {
- message = g_strdup_printf (_("%s requires %s, which could not be found on the server"),
- required_by,required);
- } else {
- message = g_strdup_printf (_("%s for %s could not be found on the server"),
- required,
- trilobite_get_distribution_name (pack->distribution,
- TRUE, FALSE));
-
- }
- break;
- case PACKAGE_PARTLY_RESOLVED:
- break;
- case PACKAGE_ALREADY_INSTALLED:
- if (pack->modifies==NULL) {
- message = g_strdup_printf (_("%s is already installed"), required);
- }
- break;
- case PACKAGE_CIRCULAR_DEPENDENCY:
- if (previous_pack == NULL) {
- message = g_strdup_printf ("%s depends on itself, internal error",
- required);
- } else {
- if (previous_pack->status == PACKAGE_CIRCULAR_DEPENDENCY) {
- if (strcmp (required_by, required)==0) {
- message = g_strdup_printf ("%s depends on itself. internal error",
- required);
- } else {
- if (g_list_length (data->path) >= 3) {
- PackageData *causing_package = PACKAGEDATA((g_list_nth (data->path, 1))->data);
- char *cause = packagedata_get_readable_name (causing_package);
- message = g_strdup_printf ("%s and %s are mutexed because of %s",
- required_by,
- required,
- cause);
- g_free (cause);
- } else {
- message = g_strdup_printf ("%s and %s exclude each other, but were both needed",
- required_by,
- required);
- }
- }
- }
- }
- break;
- case PACKAGE_RESOLVED:
- break;
- case PACKAGE_PACKSYS_FAILURE:
- message = g_strdup_printf ("Cannot access the local package system");
- break;
- }
-
- if (message != NULL) {
- (*errors) = g_list_append (*errors, message);
- } else if (pack->status == PACKAGE_CANCELLED) {
- switch (pack->modify_status) {
- case PACKAGE_MOD_UNTOUCHED:
- break;
- case PACKAGE_MOD_DOWNGRADED:
- message = g_strdup_printf (_("%s, which is newer, needs downgrade and downgrade is not enabled"),
- required);
- break;
- case PACKAGE_MOD_UPGRADED:
- message = g_strdup_printf (_("%s, which is older, needs upgrade and upgrade is not enabled"),
- required);
- break;
- case PACKAGE_MOD_INSTALLED:
- break;
- case PACKAGE_MOD_UNINSTALLED:
- break;
- }
-
- if (message != NULL) {
- (*errors) = g_list_append (*errors, message);
- }
- }
-
- g_free (required);
- g_free (required_by);
- g_free (top_name);
-
- /* Create the path list */
- data->path = g_list_prepend (data->path, pack);
- data->handled = g_list_prepend (data->handled, pack);
-
- if (pack->status != PACKAGE_CANCELLED) {
- g_list_foreach (pack->depends, (GFunc)get_detailed_messages_foreach, data);
- g_list_foreach (pack->modifies, (GFunc)get_detailed_messages_foreach, data);
- g_list_foreach (pack->breaks, (GFunc)get_detailed_messages_breaks_foreach, data);
- }
-
- /* Pop the currect pack from the path */
- data->path = g_list_remove (data->path, pack);
-}
-
-static void
-get_detailed_uninstall_messages_foreach (GtkObject *foo,
- GetErrorsForEachData *data)
-{
- char *message = NULL;
- char *required = NULL;
- char *required_by = NULL;
- char *top_name = NULL;
- GList **errors = &(data->errors);
- PackageData *previous_pack = NULL;
- PackageData *top_pack = NULL;
- PackageData *pack = NULL;
-
- if (IS_PACKAGEDATA (foo)) {
- pack = PACKAGEDATA (foo);
- } else if (IS_PACKAGEBREAKS (foo)) {
- pack = packagebreaks_get_package (PACKAGEBREAKS (foo));
- } else if (IS_PACKAGEDEPENDENCY (foo)) {
- pack = PACKAGEDEPENDENCY (foo)->package;
- } else {
- g_assert_not_reached ();
- }
-
- if (data->path) {
- previous_pack = PACKAGEDATA(data->path->data);
- top_pack = PACKAGEDATA(g_list_last (data->path)->data);
- if (top_pack == previous_pack) {
- previous_pack = NULL;
- }
- required = packagedata_get_readable_name (previous_pack);
- top_name = packagedata_get_readable_name (top_pack);
- }
- required_by = packagedata_get_readable_name (pack);
-
- switch (pack->status) {
- case PACKAGE_UNKNOWN_STATUS:
- case PACKAGE_CANCELLED:
- break;
- case PACKAGE_SOURCE_NOT_SUPPORTED:
- message = g_strdup_printf (_("%s is a source package, which is not yet supported"),
- required);
- break;
- case PACKAGE_FILE_CONFLICT:
- break;
- case PACKAGE_DEPENDENCY_FAIL:
- case PACKAGE_BREAKS_DEPENDENCY:
- if (previous_pack) {
- message = g_strdup_printf (_("%s requires %s"),
- required_by, required);
- } else if (top_pack) {
- message = g_strdup_printf (_("%s requires %s"),
- required_by, top_name);
- }
- break;
- break;
- case PACKAGE_INVALID:
- break;
- case PACKAGE_CANNOT_OPEN:
- message = g_strdup_printf (_("%s is not installed and could not be found on server"),
- required_by);
- break;
- case PACKAGE_PARTLY_RESOLVED:
- break;
- case PACKAGE_ALREADY_INSTALLED:
- if (pack->modifies == NULL) {
- message = g_strdup_printf (_("%s is already installed"), required);
- }
- break;
- case PACKAGE_CIRCULAR_DEPENDENCY:
- break;
- case PACKAGE_RESOLVED:
- break;
- case PACKAGE_PACKSYS_FAILURE:
- message = g_strdup_printf ("Cannot access the local package system");
- break;
- }
-
- if (message != NULL) {
- (*errors) = g_list_append (*errors, message);
- }
-
- g_free (required);
- g_free (required_by);
- g_free (top_name);
-
- /* Create the path list */
- data->path = g_list_prepend (data->path, pack);
-
- g_list_foreach (pack->depends, (GFunc)get_detailed_uninstall_messages_foreach, data);
- g_list_foreach (pack->modifies, (GFunc)get_detailed_uninstall_messages_foreach, data);
- g_list_foreach (pack->breaks, (GFunc)get_detailed_uninstall_messages_foreach, data);
-
- /* Pop the currect pack from the path */
- data->path = g_list_remove (data->path, pack);
-}
-
-static int
-compare_problem_case (EazelInstallProblemCase *a, EazelInstallProblemCase *b)
-{
- int result = -1;
- if (a->problem == b->problem) {
- switch (a->problem) {
- case EI_PROBLEM_UPDATE:
- result = eazel_install_package_compare (a->u.update.pack,
- b->u.update.pack);
- break;
- case EI_PROBLEM_FORCE_INSTALL_BOTH:
- result = (eazel_install_package_compare (a->u.force_install_both.pack_1,
- b->u.force_install_both.pack_1) ||
- eazel_install_package_compare (a->u.force_install_both.pack_2,
- b->u.force_install_both.pack_2));
- break;
- case EI_PROBLEM_REMOVE:
- result = eazel_install_package_compare (a->u.remove.pack,
- b->u.remove.pack);
- break;
- case EI_PROBLEM_FORCE_REMOVE:
- result = eazel_install_package_compare (a->u.force_remove.pack,
- b->u.force_remove.pack);
- break;
- case EI_PROBLEM_INCONSISTENCY:
- result = 0;
- break;
- case EI_PROBLEM_BASE:
- g_warning ("%s:%d: should not be reached", __FILE__, __LINE__);
- g_assert_not_reached ();
- break;
- case EI_PROBLEM_CANNOT_SOLVE:
- result = compare_problem_case (a->u.cannot_solve.problem,
- b->u.cannot_solve.problem);
- break;
- case EI_PROBLEM_CONTINUE_WITH_FLAG:
- result = (a->u.continue_with_flag.flag == a->u.continue_with_flag.flag);
- break;
- case EI_PROBLEM_CASCADE_REMOVE: {
- GList *a_iterator;
- result = 0;
- /* same number of packages ? */
- if (g_list_length (a->u.cascade.packages) != g_list_length (b->u.cascade.packages)) {
- result = 1;
- } else
- /* Check that all packages in a occur in b */
- for (a_iterator = a->u.cascade.packages;
- a_iterator && !result; a_iterator = g_list_next (a_iterator)) {
- PackageData *a_pack = PACKAGEDATA(a_iterator->data);
- GList *b_iterator;
- for (b_iterator = b->u.cascade.packages; b_iterator;
- b_iterator = g_list_next (b_iterator)) {
- PackageData *b_pack = PACKAGEDATA(b_iterator->data);
- result = eazel_install_package_compare (a_pack, b_pack);
- }
- }
- }
- break;
- }
- }
- return result;
-}
-
-static gboolean
-add_case (EazelInstallProblem *problem,
- EazelInstallProblemCase *pcase,
- GList **output)
-{
- GList *already_attempted = NULL;
- GList *case_list;
-
-#ifdef EIP_DEBUG
- g_message ("add_case, pcase->problem = %d", pcase->problem);
- g_message ("g_hash_table_size (problem->attempts) = %d",
- g_hash_table_size (problem->attempts));
-#endif /* EIP_DEBUG */
-
- /* Did a previous atttempt generate this case ? */
- /* first get the list for this case type */
- case_list = g_hash_table_lookup (problem->attempts,
- &(pcase->problem));
-#ifdef EIP_DEBUG
- g_message ("g_list_length (case_list) = %d",
- g_list_length (case_list));
-#endif /* EIP_DEBUG */
- /* then lookup the problem */
- already_attempted = g_list_find_custom (case_list,
- pcase,
- (GCompareFunc)compare_problem_case);
-
- if (already_attempted) {
-#ifdef EIP_DEBUG
- g_message (" already_attempted 1");
-#endif /* EIP_DEBUG */
- return FALSE;
- }
-
- /* No, have we already tried this in this attempt then ? */
- case_list = g_hash_table_lookup (problem->pre_step_attempts,
- &(pcase->problem));
- already_attempted = NULL;
- already_attempted = g_list_find_custom (case_list,
- pcase,
- (GCompareFunc)compare_problem_case);
- if (!already_attempted) {
- /* No ? Then add it */
- if (!problem->in_step_problem_mode) {
- case_list = g_list_prepend (case_list,
- pcase);
- g_hash_table_insert (problem->pre_step_attempts,
- &(pcase->problem),
- case_list);
- }
- (*output) = g_list_prepend (*output,
- pcase);
- } else {
-#ifdef EIP_DEBUG
- g_message (" already_attempted 2");
-#endif /* EIP_DEBUG */
- }
-
-#ifdef EIP_DEBUG
- g_hash_table_foreach (problem->attempts,
- (GHFunc)eazel_install_problem_debug_attempts,
- problem);
-#endif
- return TRUE;
-}
-
-static void
-add_cannot_solve_case (EazelInstallProblem *problem,
- EazelInstallProblemCase *org_pcase,
- GList **output)
-{
- EazelInstallProblemCase *pcase = eazel_install_problem_case_new (EI_PROBLEM_CANNOT_SOLVE);
-
-#ifdef EIP_DEBUG
- g_message ("add_cannot_solve_case");
-#endif /* EIP_DEBUG */
-
- pcase->u.cannot_solve.problem = org_pcase;
-
- if (!add_case (problem, pcase, output)) {
- eazel_install_problem_case_destroy (pcase);
- g_warning ("%s:%d : Adding an EI_PROBLEM_CANNOT_SOLVE failed", __FILE__,__LINE__);
- }
-}
-
-static void
-add_continue_with_flag_case (EazelInstallProblem *problem,
- EazelInstallProblemCase *org_pcase,
- EazelInstallProblemContinueFlag flag,
- gboolean file_conflict,
- GList **output)
-{
- EazelInstallProblemCase *pcase = eazel_install_problem_case_new (EI_PROBLEM_CONTINUE_WITH_FLAG);
-
- pcase->u.cannot_solve.problem = org_pcase;
- pcase->file_conflict = file_conflict;
- pcase->u.continue_with_flag.flag = flag;
-
-#ifdef EIP_DEBUG
- g_message ("add_continue_with_flag_case %p %d %d",
- pcase, flag,
- pcase->u.continue_with_flag.flag);
-#endif /* EIP_DEBUG */
-
-
- if (!add_case (problem, pcase, output)) {
- eazel_install_problem_case_destroy (pcase);
- add_cannot_solve_case (problem, org_pcase, output);
- }
-}
-
-static void
-add_force_install_both_case (EazelInstallProblem *problem,
- PackageData *pack_1,
- PackageData *pack_2,
- GList **output)
-{
- EazelInstallProblemCase *pcase = eazel_install_problem_case_new (EI_PROBLEM_FORCE_INSTALL_BOTH);
-
-#ifdef EIP_DEBUG
- g_message ("add_force_install_both_case");
-#endif /* EIP_DEBUG */
- gtk_object_ref (GTK_OBJECT (pack_1));
- gtk_object_ref (GTK_OBJECT (pack_2));
-
- pcase->u.force_install_both.pack_1 = pack_1;
- pcase->u.force_install_both.pack_2 = pack_2;
-
- if (!add_case (problem, pcase, output)) {
- add_continue_with_flag_case (problem,
- pcase,
- EazelInstallProblemContinueFlag_FORCE,
- FALSE,
- output);
- }
-}
-
-static void
-add_force_remove_case (EazelInstallProblem *problem,
- PackageData *pack,
- gboolean file_conflict,
- GList **output)
-{
- EazelInstallProblemCase *pcase = eazel_install_problem_case_new (EI_PROBLEM_FORCE_REMOVE);
-
-#ifdef EIP_DEBUG
- g_message ("add_force_remove_case");
-#endif /* EIP_DEBUG */
-
- gtk_object_ref (GTK_OBJECT (pack));
- pcase->u.force_remove.pack = pack;
- pcase->file_conflict = file_conflict;
-
- if (!add_case (problem, pcase, output)) {
- add_continue_with_flag_case (problem,
- pcase,
- EazelInstallProblemContinueFlag_FORCE,
- file_conflict, output);
- }
-}
-
-static void
-add_remove_case (EazelInstallProblem *problem,
- PackageData *pack,
- gboolean file_conflict,
- GList **output)
-{
-
- EazelInstallProblemCase *pcase = eazel_install_problem_case_new (EI_PROBLEM_REMOVE);
-
-#ifdef EIP_DEBUG
- g_message ("add_remove_case");
-#endif /* EIP_DEBUG */
-
- gtk_object_ref (GTK_OBJECT (pack));
- pcase->u.remove.pack = pack;
- pcase->file_conflict = file_conflict;
-
- if (!add_case (problem, pcase, output)) {
- eazel_install_problem_case_destroy (pcase);
- add_force_remove_case (problem, pack, file_conflict, output);
- }
-}
-
-static void
-add_update_case (EazelInstallProblem *problem,
- PackageData *pack,
- gboolean file_conflict,
- GList **output)
-{
- EazelInstallProblemCase *pcase = eazel_install_problem_case_new (EI_PROBLEM_UPDATE);
- PackageData *copy = packagedata_new ();
-#ifdef EIP_DEBUG
- g_message ("add_update_case");
-#endif /* EIP_DEBUG */
-
- copy->name = g_strdup (pack->name);
- copy->distribution = pack->distribution;
- copy->archtype = g_strdup (pack->archtype);
-
- pcase->u.update.pack = copy;
- pcase->file_conflict = file_conflict;
-
- if (!add_case (problem, pcase, output)) {
- add_remove_case (problem, pack, file_conflict, output);
- }
-}
-
-static void
-add_cascade_remove (EazelInstallProblem *problem,
- GList **packs,
- gboolean file_conflict,
- GList **output)
-{
- EazelInstallProblemCase *pcase = eazel_install_problem_case_new (EI_PROBLEM_CASCADE_REMOVE);
-
-#ifdef EIP_DEBUG
- g_message ("add_cascade_remove_case");
-#endif /* EIP_DEBUG */
-
- pcase->u.cascade.packages = (*packs);
- pcase->file_conflict = file_conflict;
-
- if (!add_case (problem, pcase, output)) {
- GList *iterator;
- for (iterator = *packs; iterator; iterator = g_list_next (iterator)) {
- PackageData *pack = PACKAGEDATA(iterator->data);
- add_force_remove_case (problem, pack, file_conflict, output);
- }
- eazel_install_problem_case_destroy (pcase);
- }
-}
-
-static void
-get_detailed_cases_breaks_foreach (PackageBreaks *breakage, GetErrorsForEachData *data)
-{
-}
-
-/*
- FIXME bugzilla.eazel.com
- Needs to handle the following :
- - package status looks ok, check modification_status
-*/
-static void
-get_detailed_cases_foreach (GtkObject *foo,
- GetErrorsForEachData *data)
-{
- /* GList **errors = &(data->errors); */
- PackageData *previous_pack = NULL;
- PackageData *pack = NULL;
- gboolean no_problem_added = TRUE;
-
- if (IS_PACKAGEDATA (foo)) {
- pack = PACKAGEDATA (foo);
- } else if (IS_PACKAGEBREAKS (foo)) {
- pack = packagebreaks_get_package (PACKAGEBREAKS (foo));
- } else if (IS_PACKAGEDEPENDENCY (foo)) {
- pack = PACKAGEDEPENDENCY (foo)->package;
- } else {
- g_assert_not_reached ();
- }
-
-#ifdef EIP_DEBUG
- g_message ("get_detailed_cases_foreach (%p)", pack);
- g_message ("get_detailed_cases_foreach (data->path = %p)", data->path);
- g_message ("get_detailed_cases_foreach (pack->status = %s)",
- packagedata_status_enum_to_str (pack->status));
- g_message ("get_detailed_cases_foreach (pack->modify_status = %s)",
- packagedata_modstatus_enum_to_str (pack->modify_status));
-#endif /* EIP_DEBUG */
-
- if (g_list_find (data->handled, pack)) { return; }
-
- if (data->path) {
- previous_pack = PACKAGEDATA (data->path->data);
- }
-
- switch (pack->status) {
- case PACKAGE_UNKNOWN_STATUS:
- break;
- case PACKAGE_CANCELLED:
- break;
- case PACKAGE_SOURCE_NOT_SUPPORTED:
- break;
- case PACKAGE_FILE_CONFLICT:
- break;
- case PACKAGE_DEPENDENCY_FAIL:
- if (pack->depends) {
- } else {
- if (previous_pack && previous_pack->status == PACKAGE_BREAKS_DEPENDENCY) {
- add_update_case (data->problem, pack, FALSE, &(data->errors));
- no_problem_added = FALSE;
- } else {
- g_warning ("%s:%d : oops", __FILE__,__LINE__);
- }
- }
- break;
- case PACKAGE_BREAKS_DEPENDENCY:
- break;
- case PACKAGE_INVALID:
- if (previous_pack) {
- add_remove_case (data->problem, pack, FALSE, &(data->errors));
- no_problem_added = FALSE;
- }
- break;
- case PACKAGE_CANNOT_OPEN:
- break;
- case PACKAGE_PARTLY_RESOLVED:
- break;
- case PACKAGE_ALREADY_INSTALLED:
- break;
- case PACKAGE_CIRCULAR_DEPENDENCY:
- if (previous_pack && previous_pack->status == PACKAGE_CIRCULAR_DEPENDENCY) {
- add_force_install_both_case (data->problem, pack, previous_pack, &(data->errors));
- no_problem_added = FALSE;
- } else {
- /*
- add_cannot_solve_case (data->problem,
- NULL,
- &(data->errors));
- */
- }
- break;
- case PACKAGE_RESOLVED:
- break;
- case PACKAGE_PACKSYS_FAILURE:
- break;
- }
-
- if (no_problem_added) {
- if (pack->status == PACKAGE_CANCELLED) {
- switch (pack->modify_status) {
- case PACKAGE_MOD_UNTOUCHED:
- break;
- case PACKAGE_MOD_DOWNGRADED:
- add_continue_with_flag_case (data->problem,
- NULL,
- EazelInstallProblemContinueFlag_DOWNGRADE,
- FALSE,
- &(data->errors));
- no_problem_added = FALSE;
- break;
- case PACKAGE_MOD_UPGRADED:
- add_continue_with_flag_case (data->problem,
- NULL,
- EazelInstallProblemContinueFlag_UPGRADE,
- FALSE,
- &(data->errors));
- no_problem_added = FALSE;
- break;
- case PACKAGE_MOD_INSTALLED:
- break;
- case PACKAGE_MOD_UNINSTALLED:
- break;
- }
- }
- }
-
- /* Create the path list */
- data->path = g_list_prepend (data->path, pack);
- data->handled = g_list_prepend (data->handled, pack);
-
- g_list_foreach (pack->depends, (GFunc)get_detailed_cases_foreach, data);
- g_list_foreach (pack->modifies, (GFunc)get_detailed_cases_foreach, data);
- g_list_foreach (pack->breaks, (GFunc)get_detailed_cases_breaks_foreach, data);
-
- /* Pop the currect pack from the path */
- data->path = g_list_remove (data->path, pack);
-}
-
-/*
- FIXME bugzilla.eazel.com
- Needs to handle the following :
- - package status looks ok, check modification_status
-*/
-static void
-get_detailed_uninstall_cases_foreach (GtkObject *foo, GetErrorsForEachData *data)
-{
- PackageData *previous_pack = NULL;
- PackageData *pack = NULL;
-
- if (IS_PACKAGEDATA (foo)) {
- pack = PACKAGEDATA (foo);
- } else if (IS_PACKAGEBREAKS (foo)) {
- pack = packagebreaks_get_package (PACKAGEBREAKS (foo));
- } else if (IS_PACKAGEDEPENDENCY (foo)) {
- pack = PACKAGEDEPENDENCY (foo)->package;
- } else {
- g_assert_not_reached ();
- }
-
-#ifdef EIP_DEBUG
- g_message ("get_detailed_uninstall_cases_foreach (data->path = %p)", data->path);
- g_message ("get_detailed_uninstall_cases_foreach (pack->status = %s)",
- packagedata_status_enum_to_str (pack->status));
-#endif /* EIP_DEBUG */
-
- if (data->path) {
- previous_pack = PACKAGEDATA(data->path->data);
- }
-
- if (pack->toplevel) {
- data->packs = NULL;
- }
-
- switch (pack->status) {
- case PACKAGE_UNKNOWN_STATUS:
- case PACKAGE_CANCELLED:
- break;
- case PACKAGE_SOURCE_NOT_SUPPORTED:
- break;
- case PACKAGE_FILE_CONFLICT:
- break;
- case PACKAGE_DEPENDENCY_FAIL:
- case PACKAGE_BREAKS_DEPENDENCY:
- /* This is what a uninstall fail tree will normally have */
- gtk_object_ref (GTK_OBJECT (pack));
- data->packs = g_list_prepend (data->packs, pack);
- break;
- case PACKAGE_INVALID:
- break;
- case PACKAGE_CANNOT_OPEN:
- break;
- case PACKAGE_PARTLY_RESOLVED:
- break;
- case PACKAGE_ALREADY_INSTALLED:
- break;
- case PACKAGE_CIRCULAR_DEPENDENCY:
- break;
- case PACKAGE_RESOLVED:
- break;
- case PACKAGE_PACKSYS_FAILURE:
- break;
- }
-
- /* Create the path list */
- data->path = g_list_prepend (data->path, pack);
-
- g_list_foreach (pack->depends, (GFunc)get_detailed_uninstall_cases_foreach, data);
- g_list_foreach (pack->modifies, (GFunc)get_detailed_uninstall_cases_foreach, data);
- g_list_foreach (pack->breaks, (GFunc)get_detailed_uninstall_cases_foreach, data);
-
- /* Pop the currect pack from the path */
- data->path = g_list_remove (data->path, pack);
- if (g_list_length (data->path) == 0) {
- g_list_free (data->path);
- data->path = NULL;
- }
-
- if (pack->toplevel && pack->status == PACKAGE_BREAKS_DEPENDENCY) {
- /* This is just to make sure the toplevel is first */
- data->packs = g_list_reverse (data->packs);
- add_cascade_remove (data->problem, &(data->packs), FALSE, &(data->errors));
- }
-}
-
-static char*
-eazel_install_problem_case_to_string (EazelInstallProblemCase *pcase, gboolean name_only)
-{
- char *message = NULL;
- switch (pcase->problem) {
- case EI_PROBLEM_UPDATE: {
- char *required = packagedata_get_readable_name (pcase->u.update.pack);
- if (! name_only) {
- /* TRANSLATORS : This string is a solution to a dependency problem,
- %s is a package name or filename */
- message = g_strdup_printf (_("Check for a new version of %s"), required);
- }
- g_free (required);
- }
- break;
- case EI_PROBLEM_FORCE_INSTALL_BOTH: {
- char *required_1 = packagedata_get_readable_name (pcase->u.force_install_both.pack_1);
- char *required_2 = packagedata_get_readable_name (pcase->u.force_install_both.pack_2);
- if (! name_only) {
- /* TRANSLATORS : This string is a solution to a dependency problem,
- both %s's are package names or filenames */
- message = g_strdup_printf (_("Install both %s and %s"),
- required_1,
- required_2);
- }
- g_free (required_1);
- g_free (required_2);
- }
- break;
- case EI_PROBLEM_REMOVE: {
- char *required = packagedata_get_readable_name (pcase->u.remove.pack);
- if (name_only) {
- message = required;
- } else {
- /* TRANSLATORS : This string is a solution to a dependency problem,
- %s is a package name or filename */
- message = g_strdup_printf (_("Remove %s from your system"), required);
- g_free (required);
- }
- }
- break;
- case EI_PROBLEM_FORCE_REMOVE: {
- char *required = packagedata_get_readable_name (pcase->u.force_remove.pack);
- if (name_only) {
- message = required;
- } else {
- /* TRANSLATORS : This string is a solution to a dependency problem,
- %s is a package name or filename. "Force" is in the rpm sense of force,
- meaning that no dependency checking etc will be done */
- message = g_strdup_printf (_("Force the removal of %s from your system"), required);
- g_free (required);
- }
- }
- break;
- case EI_PROBLEM_INCONSISTENCY: {
- if (! name_only) {
- /* TRANSLATORS : This string is a solution to a dependency problem */
- message = g_strdup (_("Package database has an inconsistency"));
- }
- }
- break;
- case EI_PROBLEM_BASE:
- g_warning ("%s:%d: should not be reached", __FILE__, __LINE__);
- break;
- case EI_PROBLEM_CANNOT_SOLVE: {
- char *tmp = eazel_install_problem_case_to_string (pcase->u.cannot_solve.problem, name_only);
- if (! name_only) {
- message = g_strdup_printf ("I could not solve \"%s\"", tmp);
- }
- g_free (tmp);
- }
- break;
- case EI_PROBLEM_CASCADE_REMOVE: {
- GList *iterator;
- GString *str;
-
- if (name_only) {
- str = g_string_new ("");
- } else {
- str = g_string_new ("Remove these packages: ");
- }
- iterator = pcase->u.cascade.packages;
- while (iterator) {
- PackageData *pack = PACKAGEDATA(iterator->data);
- iterator = g_list_next (iterator);
- if (iterator) {
- if (g_list_next (iterator)) {
- str = g_string_append (str, pack->name);
- str = g_string_append (str, ", ");
- } else {
- str = g_string_append (str, pack->name);
- str = g_string_append (str, ", ");
- }
- } else {
- str = g_string_append (str, pack->name);
- }
- }
- message = g_strdup (str->str);
- g_string_free (str, TRUE);
- }
- break;
- case EI_PROBLEM_CONTINUE_WITH_FLAG: {
- if (!name_only) {
- switch (pcase->u.continue_with_flag.flag) {
- case EazelInstallProblemContinueFlag_FORCE:
- message = g_strdup_printf (_("Continue with force"));
- break;
- case EazelInstallProblemContinueFlag_UPGRADE:
- message = g_strdup_printf (_("Allow upgrades"));
- break;
- case EazelInstallProblemContinueFlag_DOWNGRADE:
- message = g_strdup_printf (_("Allow downgrade"));
- break;
- }
- }
- }
- break;
- }
- return message;
-}
-
-static void
-eazel_install_problem_case_foreach_to_string (EazelInstallProblemCase *pcase,
- GList **output)
-{
- char *message = eazel_install_problem_case_to_string (pcase, FALSE);
- if (message) {
- (*output) = g_list_prepend (*output,
- message);
- }
-}
-
-static void
-eazel_install_problem_case_foreach_to_package_names (EazelInstallProblemCase *pcase,
- GList **output)
-{
- char *message = eazel_install_problem_case_to_string (pcase, TRUE);
- if (message) {
- (*output) = g_list_prepend (*output,
- message);
- }
-}
-
-static void
-eazel_install_problem_case_foreach_destroy (EazelInstallProblemCase *pcase,
- gpointer unused)
-{
- switch (pcase->problem) {
- case EI_PROBLEM_UPDATE:
- gtk_object_unref (GTK_OBJECT (pcase->u.update.pack));
- break;
- case EI_PROBLEM_FORCE_INSTALL_BOTH:
- gtk_object_unref (GTK_OBJECT (pcase->u.force_install_both.pack_1));
- gtk_object_unref (GTK_OBJECT (pcase->u.force_install_both.pack_2));
- break;
- case EI_PROBLEM_REMOVE:
- gtk_object_unref (GTK_OBJECT (pcase->u.remove.pack));
- break;
- case EI_PROBLEM_FORCE_REMOVE:
- gtk_object_unref (GTK_OBJECT (pcase->u.force_remove.pack));
- break;
- case EI_PROBLEM_INCONSISTENCY:
- break;
- case EI_PROBLEM_BASE:
- g_warning ("%s:%d: should not be reached", __FILE__, __LINE__);
- break;
- case EI_PROBLEM_CANNOT_SOLVE:
- eazel_install_problem_case_foreach_destroy (pcase->u.cannot_solve.problem, NULL);
- break;
- case EI_PROBLEM_CONTINUE_WITH_FLAG:
- break;
- case EI_PROBLEM_CASCADE_REMOVE:
- g_list_foreach (pcase->u.cascade.packages,
- (GFunc)gtk_object_unref,
- NULL);
- break;
- }
- g_free (pcase);
-}
-
-EazelInstallProblemCase*
-eazel_install_problem_case_new (EazelInstallProblemEnum problem_type)
-{
- EazelInstallProblemCase *result;
- result = g_new0 (EazelInstallProblemCase, 1);
- result->problem = problem_type;
- result->file_conflict = FALSE;
- /* g_new0 ensures that all union members are NULL */
- return result;
-}
-
-void
-eazel_install_problem_case_destroy (EazelInstallProblemCase *pcase)
-{
- eazel_install_problem_case_foreach_destroy (pcase, NULL);
-}
-
-void
-eazel_install_problem_case_list_destroy (GList *list)
-{
- g_list_foreach (list, (GFunc)eazel_install_problem_case_foreach_destroy, NULL);
-}
-
-EazelInstallProblem*
-eazel_install_problem_new (void)
-{
- EazelInstallProblem *problem;
-
- problem = EAZEL_INSTALL_PROBLEM (gtk_object_new (TYPE_EAZEL_INSTALL_PROBLEM, NULL));
- gtk_object_ref (GTK_OBJECT (problem));
- gtk_object_sink (GTK_OBJECT (problem));
- return problem;
-}
-
-static gboolean
-finalize_attempts_hash_cleanup (gpointer key,
- GList *val,
- gpointer unused)
-{
- eazel_install_problem_case_list_destroy (val);
- return TRUE;
-}
-
-static void
-eazel_install_problem_finalize (GtkObject *object) {
- EazelInstallProblem *problem;
-
- ASSERT_SANITY (object);
-#ifdef EIP_DEBUG
- g_message ("eazel_install_problem_finalize");
-#endif
- problem = EAZEL_INSTALL_PROBLEM (object);
- g_hash_table_foreach_remove (problem->attempts,
- (GHRFunc)finalize_attempts_hash_cleanup,
- NULL);
- g_hash_table_destroy (problem->attempts);
-
- if (GTK_OBJECT_CLASS (eazel_install_problem_parent_class)->finalize) {
- GTK_OBJECT_CLASS (eazel_install_problem_parent_class)->finalize (object);
- }
-}
-
-static void
-eazel_install_problem_class_initialize (EazelInstallProblemClass *klass)
-{
- GtkObjectClass *object_class;
-
- object_class = (GtkObjectClass*)klass;
- object_class->finalize = eazel_install_problem_finalize;
-}
-
-static void
-eazel_install_problem_initialize (EazelInstallProblem *problem) {
- P_SANITY (problem);
- problem->attempts = g_hash_table_new (g_int_hash, g_int_equal);
- problem->pre_step_attempts = g_hash_table_new (g_int_hash, g_int_equal);
-}
-
-GtkType
-eazel_install_problem_get_type (void)
-{
- GtkType parent_type;
- static GtkType obj_type = 0;
-
- /* First time it's called ? */
- if (!obj_type)
- {
- static const GtkTypeInfo obj_info =
- {
- "EazelInstallProblem",
- sizeof (EazelInstallProblem),
- sizeof (EazelInstallProblemClass),
- (GtkClassInitFunc) eazel_install_problem_class_initialize,
- (GtkObjectInitFunc) eazel_install_problem_initialize,
- /* reserved_1 */ NULL,
- /* reserved_2 */ NULL,
- (GtkClassInitFunc) NULL,
- };
-
- parent_type = gtk_object_get_type ();
- eazel_install_problem_parent_class = gtk_type_class (parent_type);
- obj_type = gtk_type_unique (parent_type, &obj_info);
- }
-
- return obj_type;
-}
-
-static gboolean
-problem_step_foreach_remove (int *key,
- GList *val,
- GHashTable *joint)
-{
- GList *real_list;
-#ifdef EIP_DEBUG
- g_message ("problem_step_foreach_remove, key = %d", *key);
-#endif
- real_list = g_hash_table_lookup (joint, key);
- if (real_list) {
- real_list = g_list_concat (real_list,
- val);
- } else {
- real_list = val;
- }
- g_hash_table_insert (joint, key, real_list);
-
- return TRUE;
-}
-
-void
-eazel_install_problem_step (EazelInstallProblem *problem)
-{
- P_SANITY (problem);
-#ifdef EIP_DEBUG
- g_message ("g_hash_table_size (problem->pre_step_attempts) = %d",
- g_hash_table_size (problem->pre_step_attempts));
- g_message ("g_hash_table_size (problem->attempts) = %d",
- g_hash_table_size (problem->attempts));
-#endif
- g_hash_table_foreach_remove (problem->pre_step_attempts,
- (GHRFunc)problem_step_foreach_remove,
- problem->attempts);
-#ifdef EIP_DEBUG
- g_message ("g_hash_table_size (problem->pre_step_attempts) = %d",
- g_hash_table_size (problem->pre_step_attempts));
- g_message ("g_hash_table_size (problem->attempts) = %d",
- g_hash_table_size (problem->attempts));
- g_hash_table_foreach (problem->attempts,
- (GHFunc)eazel_install_problem_debug_attempts,
- problem);
-#endif
-}
-
-/* This returns a GList<EazelInstallProblemCase> list containing the
- encountered problems in the given PackageData tree */
-void
-eazel_install_problem_tree_to_case (EazelInstallProblem *problem,
- PackageData *pack,
- gboolean uninstall,
- GList **output)
-{
- GetErrorsForEachData data;
-
- P_SANITY (problem);
-
-#ifdef EIP_DEBUG
- g_message ("eazel_install_problem_tree_to_case ( pack = %p, uninstall=%s)",
- pack,
- uninstall ? "TRUE" : "FALSE");
-#endif
-
- data.problem = problem;
- data.errors = (*output);
- data.path = NULL;
- data.handled = NULL;
- problem->in_step_problem_mode = FALSE;
-
- gtk_object_ref (GTK_OBJECT (pack));
-
- if (uninstall) {
- get_detailed_uninstall_cases_foreach (GTK_OBJECT (pack), &data);
- } else {
- get_detailed_cases_foreach (GTK_OBJECT (pack), &data);
- }
-
- gtk_object_unref (GTK_OBJECT (pack));
- (*output) = data.errors;
-}
-
-/* This returns a GList<char*> list containing the
- encountered problems in the given PackageData tree */
-GList*
-eazel_install_problem_tree_to_string (EazelInstallProblem *problem,
- PackageData *pack,
- gboolean uninstall)
-{
- GList *result = NULL;
- GetErrorsForEachData data;
-
- P_SANITY_VAL (problem, result);
-
- data.problem = problem;
- data.errors = NULL;
- data.path = NULL;
- data.handled = NULL;
-
- gtk_object_ref (GTK_OBJECT (pack));
- if (uninstall) {
- get_detailed_uninstall_messages_foreach (GTK_OBJECT (pack), &data);
- } else {
- get_detailed_messages_foreach (GTK_OBJECT (pack), &data);
- }
-
- gtk_object_unref (GTK_OBJECT (pack));
- result = data.errors;
-
- return result;
-}
-
-
-/* This returns a GList<char*> list containing the
- encountered problems in the given PackageData tree */
-GList*
-eazel_install_problem_cases_to_string (EazelInstallProblem *problem,
- GList *cases)
-{
- GList *result = NULL;
- g_list_foreach (cases,
- (GFunc)eazel_install_problem_case_foreach_to_string,
- &result);
- return result;
-}
-
-/* Like above, but only returns the package names, and only for packages that are about to be removed */
-GList *
-eazel_install_problem_cases_to_package_names (EazelInstallProblem *problem,
- GList *cases)
-{
- GList *result = NULL;
- g_list_foreach (cases,
- (GFunc)eazel_install_problem_case_foreach_to_package_names,
- &result);
- return result;
-}
-
-EazelInstallProblemEnum
-eazel_install_problem_find_dominant_problem_type (EazelInstallProblem *problem,
- GList *problems)
-{
- GList *iterator;
- EazelInstallProblemEnum dominant = EI_PROBLEM_BASE;
-
- for (iterator = problems; iterator; iterator = g_list_next (iterator)) {
- EazelInstallProblemCase *pcase = (EazelInstallProblemCase*)(iterator->data);
- if (pcase->problem > dominant) {
- dominant = pcase->problem;
-#ifdef EIP_DEBUG
- {
- char *message = eazel_install_problem_case_to_string (pcase, FALSE);
- g_message ("dominant problem is now %d", dominant);
- g_message ("aka %s", message);
- g_free (message);
- }
-#endif
- }
- }
- return dominant;
-}
-
-static GList*
-find_problems_of_type (EazelInstallProblem *problem,
- GList *problems,
- EazelInstallProblemEnum problem_type)
-{
- GList *iterator;
- GList *result = NULL;
-
- for (iterator = problems; iterator; iterator = g_list_next (iterator)) {
- EazelInstallProblemCase *pcase = (EazelInstallProblemCase*)(iterator->data);
- if (pcase->problem == problem_type) {
- result = g_list_prepend (result, pcase);
- }
- }
-
- return result;
-}
-
-static GList*
-find_dominant_problems (EazelInstallProblem *problem,
- GList **problems)
-{
- EazelInstallProblemEnum dominant_problem_type;
- GList *dominant_problems;
- GList *iterator;
-
- dominant_problem_type = eazel_install_problem_find_dominant_problem_type (problem,
- *problems);
- dominant_problems = find_problems_of_type (problem, *problems, dominant_problem_type);
-
- for (iterator = dominant_problems; iterator; iterator = g_list_next (iterator)) {
- (*problems) = g_list_remove (*problems, iterator->data);
- }
-
- if (g_list_length (*problems) == 0) {
- /* g_list_free (*problems); */
- (*problems) = NULL;
- }
- return dominant_problems;
-}
-
-static GList*
-build_categories_from_problem_list (EazelInstallProblem *problem,
- GList *problems)
-{
- GList *iterator;
- GList *result = NULL;
- GList *packages = NULL;
-
- for (iterator = problems; iterator; iterator = g_list_next (iterator)) {
- EazelInstallProblemCase *pcase = (EazelInstallProblemCase*)(iterator->data);
-
- switch (pcase->problem) {
- case EI_PROBLEM_UPDATE:
- gtk_object_ref (GTK_OBJECT (pcase->u.update.pack));
- packages = g_list_prepend (packages, pcase->u.update.pack);
- break;
- case EI_PROBLEM_FORCE_INSTALL_BOTH:
- gtk_object_ref (GTK_OBJECT (pcase->u.force_install_both.pack_1));
- gtk_object_ref (GTK_OBJECT (pcase->u.force_install_both.pack_2));
- packages = g_list_prepend (packages, pcase->u.force_install_both.pack_1);
- packages = g_list_prepend (packages, pcase->u.force_install_both.pack_2);
- break;
- case EI_PROBLEM_REMOVE:
- gtk_object_ref (GTK_OBJECT (pcase->u.remove.pack));
- packages = g_list_prepend (packages, pcase->u.remove.pack);
- break;
- case EI_PROBLEM_FORCE_REMOVE:
- gtk_object_ref (GTK_OBJECT (pcase->u.force_remove.pack));
- packages = g_list_prepend (packages, pcase->u.force_remove.pack);
- break;
- case EI_PROBLEM_CASCADE_REMOVE: {
- GList *iterator;
- for (iterator = pcase->u.cascade.packages; iterator; iterator = g_list_next (iterator)) {
- packages = g_list_prepend (packages, iterator->data);
- }
- }
- break;
- case EI_PROBLEM_CONTINUE_WITH_FLAG:
- case EI_PROBLEM_INCONSISTENCY:
- case EI_PROBLEM_CANNOT_SOLVE:
- break;
- case EI_PROBLEM_BASE:
- g_warning ("%s:%d: should not be reached", __FILE__, __LINE__);
- g_assert_not_reached ();
- break;
- }
- }
-
- if (packages) {
- CategoryData *category = categorydata_new ();
- category->name = g_strdup ("The pain...");
- category->packages = packages;
- result = g_list_prepend (result, category);
- }
-
- return result;
-}
-
-void
-eazel_install_problem_use_set (EazelInstallProblem *problem,
- GList *problems)
-{
- GList *iterator;
-
- for (iterator = problems; iterator; iterator = g_list_next (iterator)) {
- EazelInstallProblemCase *pcase = (EazelInstallProblemCase*)iterator->data;
- GList *case_list;
-
- case_list = g_hash_table_lookup (problem->attempts,
- &(pcase->problem));
-
- case_list = g_list_prepend (case_list,
- pcase);
-
- g_hash_table_insert (problem->pre_step_attempts,
- &(pcase->problem),
- case_list);
- }
-}
-
-/*
- If you're not satisfied with the given dominant problem,
- use this to get a peek at what the next step will be */
-GList *
-eazel_install_problem_step_problem (EazelInstallProblem *problem,
- EazelInstallProblemEnum problem_type,
- GList *problems)
-{
- GList *result = NULL;
- GList *unwanted = NULL;
- GList *iterator;
-
- problem->in_step_problem_mode = TRUE;
-
- unwanted = find_problems_of_type (problem, problems, problem_type);
- g_message ("eazel_install_problem_discard_problem %d unwanted", g_list_length (unwanted));
- for (iterator = unwanted; iterator; iterator = g_list_next (iterator)) {
- EazelInstallProblemCase *pcase = (EazelInstallProblemCase*)iterator->data;
-
- switch (pcase->problem) {
- case EI_PROBLEM_UPDATE:
- g_message ("%s:%d, conflict = %s", __FILE__, __LINE__, pcase->file_conflict ? "TRUE":"FALSE");
- add_remove_case (problem,
- pcase->u.update.pack,
- pcase->file_conflict,
- &result);
- break;
- case EI_PROBLEM_CONTINUE_WITH_FLAG:
- g_message ("%s:%d, conflict = %s", __FILE__, __LINE__, pcase->file_conflict ? "TRUE":"FALSE");
- add_cannot_solve_case (problem,
- pcase,
- &result);
- break;
- case EI_PROBLEM_FORCE_INSTALL_BOTH:
- g_message ("%s:%d, conflict = %s", __FILE__, __LINE__, pcase->file_conflict ? "TRUE":"FALSE");
- add_continue_with_flag_case (problem,
- pcase,
- EazelInstallProblemContinueFlag_FORCE,
- pcase->file_conflict,
- &result);
- break;
- case EI_PROBLEM_CASCADE_REMOVE:
- g_message ("%s:%d, conflict = %s", __FILE__, __LINE__, pcase->file_conflict ? "TRUE":"FALSE");
- add_force_remove_case (problem,
- pcase->u.force_remove.pack,
- pcase->file_conflict,
- &result);
- break;
- case EI_PROBLEM_REMOVE:
- g_message ("%s:%d, conflict = %s", __FILE__, __LINE__, pcase->file_conflict ? "TRUE":"FALSE");
- add_force_remove_case (problem,
- pcase->u.remove.pack,
- pcase->file_conflict,
- &result);
- break;
- case EI_PROBLEM_FORCE_REMOVE:
- g_message ("%s:%d, conflict = %s", __FILE__, __LINE__, pcase->file_conflict ? "TRUE":"FALSE");
- add_continue_with_flag_case (problem,
- pcase,
- EazelInstallProblemContinueFlag_FORCE,
- pcase->file_conflict,
- &result);
- break;
- case EI_PROBLEM_INCONSISTENCY:
- g_message ("%s:%d, conflict = %s", __FILE__, __LINE__, pcase->file_conflict ? "TRUE":"FALSE");
- result = g_list_prepend (result, pcase);
- break;
- case EI_PROBLEM_CANNOT_SOLVE:
- g_message ("%s:%d, conflict = %s", __FILE__, __LINE__, pcase->file_conflict ? "TRUE":"FALSE");
- result = g_list_prepend (result, pcase);
- break;
- case EI_PROBLEM_BASE:
- g_assert_not_reached ();
- break;
- }
- }
- g_message ("eazel_install_problem_discard_problem %d left", g_list_length (result));
-
- return result;
-}
-
-/* #IFDEF HELL!!!
- This function can be compiled for the corba object
- or the raw gtk object...
- wonderfull eh ? */
-
-/* Given a series of problems, it will remove
- the most important ones, and execute them given
- a EazelInstall service object */
-
-#ifndef EAZEL_INSTALL_NO_CORBA
-static void
-eazel_install_problem_done (EazelInstallCallback *service,
- gboolean result,
- gboolean *done)
-{
- (*done) = TRUE;
-}
-
-static void
-eazel_install_problem_wait_for_completion (EazelInstallProblem *problem,
- EazelInstallCallback *service)
-{
- guint handle;
- gboolean done = FALSE;
- handle = gtk_signal_connect (GTK_OBJECT (service), "done",
- GTK_SIGNAL_FUNC (eazel_install_problem_done),
- (gpointer)&done);
-
- while (!done) {
- g_main_iteration (TRUE);
- }
-
- gtk_signal_disconnect (GTK_OBJECT (service), handle);
-}
-#endif
-
-/*
- FIXME:
- I need to hookup to service's "done" signal, if successfull, erase
- the contents of install_categories
- */
-void
-eazel_install_problem_handle_cases (EazelInstallProblem *problem,
-#ifdef EAZEL_INSTALL_NO_CORBA
- EazelInstall *service,
-#else /* EAZEL_INSTALL_NO_CORBA */
- EazelInstallCallback *service,
-#endif /* EAZEL_INSTALL_NO_CORBA */
-
- GList **problems,
- GList **install_categories,
- GList **uninstall_categories,
- char *root)
-{
- EazelInstallProblemEnum dominant_problem_type;
- GList *dominant_problems;
- gboolean service_force, service_update, service_downgrade, service_uninstall;
- gboolean force = FALSE, update = FALSE, downgrade = FALSE;
- GList *categories, *final_categories = NULL;
-#ifndef EAZEL_INSTALL_NO_CORBA
- CORBA_Environment ev;
- GNOME_Trilobite_Eazel_Install corba_service = eazel_install_callback_corba_objref (service);
-#endif /* EAZEL_INSTALL_NO_CORBA */
-
- if (problems==NULL) { return; }
- if ((*problems)==NULL) { return; }
-
- P_SANITY (problem);
-
- /* the service_ are used to store the current values */
- service_force = FALSE;
- service_update = FALSE;
- service_downgrade = FALSE;
- service_uninstall = FALSE;
-
- /* These are used to set new values */
- force = FALSE;
- update = FALSE;
- downgrade = FALSE;
-
- if (install_categories && uninstall_categories) {
- g_warning ("%s: didn't expect both install_categories and uninstall_categories to be set",
- G_GNUC_PRETTY_FUNCTION);
- }
- if (uninstall_categories) {
- service_uninstall = TRUE;
- } else {
- service_uninstall = FALSE;
- }
-
-#ifndef EAZEL_INSTALL_NO_CORBA
- CORBA_exception_init (&ev);
-#endif /* EAZEL_INSTALL_NO_CORBA */
-
- /* Parse list and find which case->problem enum is the most
- interesting. Now extract all these from problems */
- dominant_problem_type = eazel_install_problem_find_dominant_problem_type (problem, *problems);
- dominant_problems = find_dominant_problems (problem, problems);
- categories = build_categories_from_problem_list (problem, dominant_problems);
-
- /* update the attemps hashtables */
- eazel_install_problem_step (problem);
-
- /* set up the installer object and fire off that sucker
- First get the old values to we can reset them */
-#ifdef EAZEL_INSTALL_NO_CORBA
- service_force = eazel_install_get_force (service);
- service_update = eazel_install_get_upgrade (service);
- service_downgrade = eazel_install_get_downgrade (service);
-#else /* EAZEL_INSTALL_NO_CORBA */
- service_force = GNOME_Trilobite_Eazel_Install__get_force (corba_service, &ev);
- service_update = GNOME_Trilobite_Eazel_Install__get_upgrade (corba_service, &ev);
- service_downgrade = GNOME_Trilobite_Eazel_Install__get_downgrade (corba_service, &ev);
-#endif /* EAZEL_INSTALL_NO_CORBA */
-
- force = service_force;
- update = service_update;
- downgrade = service_downgrade;
-
- /* now determine the new parameters */
- switch (dominant_problem_type) {
- case EI_PROBLEM_UPDATE:
- force = FALSE;
- update = TRUE;
- downgrade = FALSE;
- break;
- case EI_PROBLEM_CONTINUE_WITH_FLAG: {
- GList *iterator;
-
- for (iterator = dominant_problems; iterator; iterator = g_list_next (iterator)) {
- EazelInstallProblemCase *pcase = (EazelInstallProblemCase*)iterator->data;
- switch (pcase->u.continue_with_flag.flag) {
- case EazelInstallProblemContinueFlag_FORCE:
- force = TRUE;
- break;
- case EazelInstallProblemContinueFlag_UPGRADE:
- update = TRUE;
- break;
- case EazelInstallProblemContinueFlag_DOWNGRADE:
- downgrade = TRUE;
- break;
- }
- }
- break;
- }
- case EI_PROBLEM_FORCE_INSTALL_BOTH:
- force = TRUE;
- update = TRUE;
- downgrade = FALSE;
- break;
- case EI_PROBLEM_CASCADE_REMOVE:
- case EI_PROBLEM_REMOVE:
- force = FALSE;
- update = TRUE;
- downgrade = FALSE;
- break;
- case EI_PROBLEM_FORCE_REMOVE:
- force = TRUE;
- update = FALSE;
- downgrade = TRUE;
- break;
- case EI_PROBLEM_INCONSISTENCY:
- case EI_PROBLEM_CANNOT_SOLVE:
- break;
- case EI_PROBLEM_BASE:
- g_warning ("%s:%d: should not be reached", __FILE__, __LINE__);
- break;
- }
-
- /* set the new parameters */
-#ifdef EAZEL_INSTALL_NO_CORBA
- eazel_install_set_force (service, force);
- eazel_install_set_upgrade (service, update);
- eazel_install_set_downgrade (service, downgrade);
-#else /* EAZEL_INSTALL_NO_CORBA */
- GNOME_Trilobite_Eazel_Install__set_force (corba_service, force, &ev);
- GNOME_Trilobite_Eazel_Install__set_upgrade (corba_service, update, &ev);
- GNOME_Trilobite_Eazel_Install__set_downgrade (corba_service, downgrade, &ev);
-#endif /* EAZEL_INSTALL_NO_CORBA */
-
- /* do we add any of the usergiven cateogries ? */
- switch (dominant_problem_type) {
- case EI_PROBLEM_CASCADE_REMOVE:
- if (service_uninstall) {
- final_categories = g_list_concat (g_list_copy (categories),
- categorydata_list_copy (*uninstall_categories));
- } else {
- final_categories = g_list_copy (categories);
- }
- break;
- case EI_PROBLEM_CONTINUE_WITH_FLAG:
- if (service_uninstall) {
- if (!categories) {
- final_categories = categorydata_list_copy (*uninstall_categories);
- } else {
- final_categories = g_list_concat (g_list_copy (categories),
- categorydata_list_copy (*uninstall_categories));
- }
- } else if (install_categories) {
- if (!categories) {
- final_categories = categorydata_list_copy (*install_categories);
- } else {
- final_categories = g_list_concat (g_list_copy (categories),
- categorydata_list_copy (*install_categories));
- }
- } else {
- final_categories = g_list_copy (categories);
- }
- break;
- case EI_PROBLEM_UPDATE:
- case EI_PROBLEM_FORCE_INSTALL_BOTH:
- /* Add the install_categories */
- if (install_categories) {
- final_categories = g_list_concat (g_list_copy (categories),
- categorydata_list_copy (*install_categories));
- } else {
- final_categories = g_list_copy (categories);
- }
- break;
- case EI_PROBLEM_REMOVE:
- case EI_PROBLEM_FORCE_REMOVE:
- /* Add the uninstall categories */
- final_categories = g_list_copy (categories);
- break;
- case EI_PROBLEM_INCONSISTENCY:
- case EI_PROBLEM_CANNOT_SOLVE:
- g_message ("%s:%d I have no clue ?!", __FILE__, __LINE__);
- break;
- case EI_PROBLEM_BASE:
- g_warning ("%s:%d: should not be reached", __FILE__, __LINE__);
- break;
- }
-
- /* fire it off */
- switch (dominant_problem_type) {
- case EI_PROBLEM_CONTINUE_WITH_FLAG:
- if (service_uninstall) {
-#ifdef EAZEL_INSTALL_NO_CORBA
- eazel_install_uninstall_packages (service, final_categories, root);
-#else /* EAZEL_INSTALL_NO_CORBA */
- eazel_install_callback_uninstall_packages (service, final_categories, root, &ev);
-#endif /* EAZEL_INSTALL_NO_CORBA */
- } else {
-#ifdef EAZEL_INSTALL_NO_CORBA
- eazel_install_install_packages (service, final_categories, root);
-#else /* EAZEL_INSTALL_NO_CORBA */
- eazel_install_callback_install_packages (service, final_categories, root, &ev);
-#endif /* EAZEL_INSTALL_NO_CORBA */
- }
- break;
- case EI_PROBLEM_UPDATE:
- case EI_PROBLEM_FORCE_INSTALL_BOTH:
-#ifdef EAZEL_INSTALL_NO_CORBA
- eazel_install_install_packages (service, final_categories, root);
-#else /* EAZEL_INSTALL_NO_CORBA */
- eazel_install_callback_install_packages (service, final_categories, root, &ev);
-#endif /* EAZEL_INSTALL_NO_CORBA */
- break;
- case EI_PROBLEM_CASCADE_REMOVE:
- case EI_PROBLEM_REMOVE:
- case EI_PROBLEM_FORCE_REMOVE:
-#ifdef EAZEL_INSTALL_NO_CORBA
- eazel_install_uninstall_packages (service, final_categories, root);
-#else /* EAZEL_INSTALL_NO_CORBA */
- eazel_install_callback_uninstall_packages (service, final_categories, root, &ev);
-#endif /* EAZEL_INSTALL_NO_CORBA */
- break;
- case EI_PROBLEM_INCONSISTENCY:
- case EI_PROBLEM_CANNOT_SOLVE:
- g_message ("%s:%d I have no clue ?!", __FILE__, __LINE__);
- break;
- case EI_PROBLEM_BASE:
- g_warning ("%s:%d: should not be reached", __FILE__, __LINE__);
- break;
- }
-
-#ifndef EAZEL_INSTALL_NO_CORBA
- eazel_install_problem_wait_for_completion (problem, service);
-#endif
-
-#ifdef EAZEL_INSTALL_NO_CORBA
- eazel_install_set_force (service, service_force);
- eazel_install_set_upgrade (service, service_update);
- eazel_install_set_downgrade (service, service_downgrade);
-#else /* EAZEL_INSTALL_NO_CORBA */
- GNOME_Trilobite_Eazel_Install__set_force (corba_service, service_force, &ev);
- GNOME_Trilobite_Eazel_Install__set_upgrade (corba_service, service_update, &ev);
- GNOME_Trilobite_Eazel_Install__set_downgrade (corba_service, service_downgrade, &ev);
-#endif /* EAZEL_INSTALL_NO_CORBA */
-
-#ifndef EAZEL_INSTALL_NO_CORBA
- CORBA_exception_free (&ev);
-#endif /* EAZEL_INSTALL_NO_CORBA */
-
- /* the dominant problems list are not leaked, as they're
- kept in problem->attempts */
- g_list_free (dominant_problems);
- categorydata_list_destroy (final_categories);
-
-}
diff --git a/components/services/install/lib/eazel-install-problem.h b/components/services/install/lib/eazel-install-problem.h
deleted file mode 100644
index cb6cf3a88..000000000
--- a/components/services/install/lib/eazel-install-problem.h
+++ /dev/null
@@ -1,228 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: Eskil Heyn Olsen <eskil@eazel.com>
- */
-
-
-/*
- How to use :
- Create an instance e of EazelInstallProblem pr. complete operation you're going to try.
- (Eg. installing nautilus). Whenever the install_failed signal is called,
- call eazel_install_problem_tree_to_case (e, package). This will return
- a list of problems (you can call several times before pr. operation attempt.
- Note, that every case is only reported pr tree. So if you're installing package
- A and B, and they both cause case C, you can get case C twice.
- Now do with these cases as you want, optionally call
- eazel_install_problem_handle_cases untill the problem list is empty. If
- you do not use eazel_install_problem_handle_cases, but manually prioritize the
- problems, be sure to call eazel_install_problem_step between operation executions.
- */
-
-#ifndef EAZEL_INSTALL_PROBLEM_H
-#define EAZEL_INSTALL_PROBLEM_H
-
-#include "eazel-package-system-types.h"
-#ifdef EAZEL_INSTALL_NO_CORBA
-#include "eazel-install-public.h"
-#else /* EAZEL_INSTALL_NO_CORBA */
-#include "eazel-install-corba-callback.h"
-#endif /* EAZEL_INSTALL_NO_CORBA */
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-#define TYPE_EAZEL_INSTALL_PROBLEM (eazel_install_problem_get_type ())
-#define EAZEL_INSTALL_PROBLEM(obj) (GTK_CHECK_CAST ((obj), TYPE_EAZEL_INSTALL_PROBLEM, EazelInstallProblem))
-#define EAZEL_INSTALL_PROBLEM_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), TYPE_EAZEL_INSTALL_PROBLEM, EazelInstallProblemClass))
-#define EAZEL_IS_INSTALL_PROBLEM(obj) (GTK_CHECK_TYPE ((obj), TYPE_EAZEL_INSTALL_PROBLEM))
-#define EAZEL_IS_INSTALL_PROBLEM_CLASS(klass)(GTK_CHECK_CLASS_TYPE ((klass), TYPE_EAZEL_INSTALL_PROBLEM))
-
-typedef enum _EazelInstallProblemContinueFlag EazelInstallProblemContinueFlag;
-typedef enum _EazelInstallProblemEnum EazelInstallProblemEnum;
-typedef struct _EazelInstallProblemCase EazelInstallProblemCase;
-typedef struct _EazelInstallProblemClass EazelInstallProblemClass;
-typedef struct _EazelInstallProblem EazelInstallProblem;
-
-/* Please, in switches on this enum, do not handle
- default, but always handle all the enums.
- That ways you cannot add a enum without
- getting compiler borkage to let you know you're
- about to fuck up. */
-
-enum _EazelInstallProblemEnum {
- EI_PROBLEM_BASE = 0,
- EI_PROBLEM_UPDATE, /* package is in the way, update or remove */
- EI_PROBLEM_CONTINUE_WITH_FLAG, /* Ok, just barge ahead with the operation */
- EI_PROBLEM_REMOVE, /* Remove a package might help */
- EI_PROBLEM_FORCE_INSTALL_BOTH, /* two packages are fighting it out, install both ? */
- EI_PROBLEM_CASCADE_REMOVE, /* Delete a lot of stuff */
- EI_PROBLEM_FORCE_REMOVE, /* Okaeh, force remove the package */
- EI_PROBLEM_CANNOT_SOLVE, /* The water is too deep */
- EI_PROBLEM_INCONSISTENCY /* There's an inconsistency in the db */
-};
-
-enum _EazelInstallProblemContinueFlag {
- EazelInstallProblemContinueFlag_FORCE = 0x1,
- EazelInstallProblemContinueFlag_UPGRADE = 0x2,
- EazelInstallProblemContinueFlag_DOWNGRADE = 0x4
-};
-
-struct _EazelInstallProblemCase {
- EazelInstallProblemEnum problem;
- gboolean file_conflict;
- union {
- struct {
- EazelInstallProblemContinueFlag flag;
- } continue_with_flag;
- struct {
- PackageData *pack;
- } update;
- struct {
- PackageData *pack_1;
- PackageData *pack_2;
- } force_install_both;
- struct {
- PackageData *pack;
- } remove;
- struct {
- PackageData *pack;
- } force_remove;
- struct {
- EazelInstallProblemCase *problem;
- } cannot_solve;
- struct {
- EazelInstallProblemCase *problem;
- } force;
- struct {
- GList *packages;
- } cascade;
- } u;
-};
-
-EazelInstallProblemCase *eazel_install_problem_case_new (EazelInstallProblemEnum problem_type);
-void eazel_install_problem_case_destroy (EazelInstallProblemCase *pcase);
-void eazel_install_problem_case_list_destroy (GList *list);
-
-struct _EazelInstallProblemClass {
- GtkObjectClass parent_class;
-};
-
-struct _EazelInstallProblem {
- /* Parent stuff */
- GtkObject parent;
-
- /* Private vars */
- /* The fist set of attributes are lists of previously encountered problems.
- If I'm about to add a problem with the same stuff, don't,
- but "upgrade it".
- Eg for install:
- EI_PROBLEM_UPDATE -> EI_PROBLEM_REMOVE
- EI_PROBLEM_REMOVE -> EI_PROBLEM_CASCADE_REMOVE
- EI_PROBLEM_CASCADE_REMOVE -> EI_PROBLEM_FORCE_REMOVE
- EI_PROBLEM_FORCE_REMOVE -> EI_PROBLEM_CONTINUE_WITH_FORCE
- EI_PROBLEM_CONTINUE_WITH_FORCE -> EI_PROBLEM_CANNOT_SOLVE
-
- Uninstall will start at EI_PROBLEM_CASCADE_REMOVE
- for uninstall, EI_PROBLEM_CONTINUE_WITH_FORCE == EI_PROBLEM_FORCE_REMOVE
-
- This logic is implemented in the add_*_case functions and
- in eazel_install_problem_step_problem.
- */
-
- GHashTable *attempts;
- /* This is the list of problems currently being build,
- called eazel_install_problem_step moves these into
- atttempts */
- GHashTable *pre_step_attempts;
- gboolean in_step_problem_mode;
-};
-
-EazelInstallProblem *eazel_install_problem_new (void);
-GtkType eazel_install_problem_get_type (void);
-
-void eazel_install_problem_step (EazelInstallProblem *problem);
-
-/* This returns a GList<EazelInstallProblemCase> list containing the
- encountered problems in the given PackageData tree */
-void eazel_install_problem_tree_to_case (EazelInstallProblem *problem,
- PackageData *pack,
- gboolean uninstall,
- GList **output);
-
-/* This returns a GList<char*> list containing the
- encountered problems in the given PackageData tree */
-GList * eazel_install_problem_tree_to_string (EazelInstallProblem *problem,
- PackageData *pack,
- gboolean uninstall);
-
-/* This returns a GList<char*> list containing the
- encountered problems in the given PackageData tree */
-GList * eazel_install_problem_cases_to_string (EazelInstallProblem *problem,
- GList *cases);
-
-/* Like above, but only returns the package names, and only for packages that are about to be removed */
-GList * eazel_install_problem_cases_to_package_names (EazelInstallProblem *problem,
- GList *cases);
-
-/* This lets you know which type of problems the next call
- to eazel_install_handle_cases will handle. So if eg.
- the next type is EI_PROBLEM_FORCE_REMOVE, you can alert the user */
-EazelInstallProblemEnum
-eazel_install_problem_find_dominant_problem_type (EazelInstallProblem *problem,
- GList *problems);
-
-/*
- If you're not satisfied with the given dominant problem,
- use this to get a peek at what the next step will be.
- If you like the result, you can g_list_free the "problems",
- if not, g_list_free the result. Do _not_ destroy the
- problem's themselves.
- If you like the result, pass them to eazel_install_problem_use_set
-*/
-GList *
-eazel_install_problem_step_problem (EazelInstallProblem *problem,
- EazelInstallProblemEnum problem_type,
- GList *problems);
-
-void
-eazel_install_problem_use_set (EazelInstallProblem *problem,
- GList *problems);
-
-/* Given a series of problems, it will remove
- the most important ones, and execute them given
- a EazelInstall service object */
-void eazel_install_problem_handle_cases (EazelInstallProblem *problem,
-#ifdef EAZEL_INSTALL_NO_CORBA
- EazelInstall *service,
-#else /* EAZEL_INSTALL_NO_CORBA */
- EazelInstallCallback *service,
-#endif /* EAZEL_INSTALL_NO_CORBA */
-
- GList **problems,
- GList **install_categories,
- GList **uninstall_categories,
- char *root);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* EAZEL_INSTALL_PROBLEM_H */
diff --git a/components/services/install/lib/eazel-install-protocols.c b/components/services/install/lib/eazel-install-protocols.c
deleted file mode 100644
index ad3d089f5..000000000
--- a/components/services/install/lib/eazel-install-protocols.c
+++ /dev/null
@@ -1,712 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Copyright (C) 2000 Eazel, Inc
- * Copyright (C) 1998-1999 James Henstridge
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: Eskil Heyn Olsen <eskil@eazel.com>
- * Robey Pointer <robey@eazel.com>
- * J Shane Culpepper <pepper@eazel.com>
- */
-
-/* eazel-install - services command line install/update/uninstall
- * component. This program will parse the eazel-services-config.xml
- * file and install a services generated package-list.xml.
- */
-
-#include <config.h>
-#include "eazel-install-protocols.h"
-#include "eazel-install-private.h"
-#include "eazel-softcat.h"
-#include "eazel-package-system.h"
-
-#include <libtrilobite/trilobite-core-utils.h>
-#include <libtrilobite/trilobite-i18n.h>
-
-#include <ghttp.h>
-#include <glib.h>
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <string.h>
-
-
-#undef EIP_FAIL_ALL_DOWNLOADS
-
-
-#ifndef EAZEL_INSTALL_SLIM
-#include <libgnomevfs/gnome-vfs.h>
-#endif /* EAZEL_INSTALL_SLIM */
-
-typedef struct {
- EazelInstall *service;
- const PackageData *package;
-} gnome_vfs_callback_struct;
-
-typedef gboolean (*eazel_install_file_fetch_function) (gpointer *obj,
- char *url,
- const char *file_to_report,
- const char *target_file,
- const PackageData *package);
-
-
-#ifdef EAZEL_INSTALL_SLIM
-
-gboolean http_fetch_remote_file (EazelInstall *service,
- char *url,
- const char *file_to_report,
- const char* target_file,
- const PackageData *package);
-gboolean ftp_fetch_remote_file (EazelInstall *service,
- char *url,
- const char *file_to_report,
- const char* target_file,
- const PackageData *package);
-#else /* EAZEL_INSTALL_SLIM */
-gboolean gnome_vfs_fetch_remote_file (EazelInstall *service,
- char *url,
- const char *file_to_report,
- const char *target_file,
- const PackageData *package);
-#endif /* EAZEL_INSTALL_SLIM */
-gboolean local_fetch_remote_file (EazelInstall *service,
- char *url,
- const char *file_to_report,
- const char* target_file,
- const PackageData *package);
-
-
-#ifdef EAZEL_INSTALL_SLIM
-gboolean
-http_fetch_remote_file (EazelInstall *service,
- char *url,
- const char *file_to_report,
- const char* target_file,
- const PackageData *package)
-{
- int length;
- gboolean get_failed;
- ghttp_request* request;
- ghttp_status status;
- char* body;
- FILE* file;
- int total_bytes = 0;
- int last_flush_bytes = 0;
- gboolean first_emit;
- const char *report;
- char *target_file_premove;
-
- report = file_to_report ? file_to_report : g_basename (target_file);
- trilobite_debug (_("Downloading %s..."), url);
-
- target_file_premove = g_strdup_printf ("%s~", target_file);
-
- file = fopen (target_file_premove, "wb");
- get_failed = FALSE;
- length = -1;
- request = NULL;
- body = NULL;
- first_emit = TRUE;
-
- if (file == NULL) {
- get_failed = TRUE;
- g_warning (_("Could not open target file %s"), target_file_premove);
- g_free (target_file_premove);
- return FALSE;
- }
-
- request = ghttp_request_new();
- if (!request) {
- g_warning (_("Could not create an http request !"));
- get_failed = TRUE;
- }
-
- /* bootstrap installer does it this way */
- if (g_getenv ("http_proxy") != NULL) {
- if (ghttp_set_proxy (request, g_getenv ("http_proxy")) != 0) {
- g_warning (_("Proxy: Invalid uri !"));
- get_failed = TRUE;
- }
- }
- if (ghttp_set_uri (request, url) != 0) {
- g_warning (_("Invalid uri !"));
- get_failed = TRUE;
- }
-
- ghttp_set_header (request, http_hdr_Connection, "close");
- ghttp_set_header (request, http_hdr_User_Agent, trilobite_get_useragent_string (NULL));
- if (ghttp_prepare (request) != 0) {
- g_warning (_("Could not prepare http request !"));
- get_failed = TRUE;
- }
-
- if (ghttp_set_sync (request, ghttp_async)) {
- g_warning (_("Couldn't get async mode "));
- get_failed = TRUE;
- }
-
- while ((status = ghttp_process (request)) == ghttp_not_done) {
- ghttp_current_status curStat = ghttp_get_status (request);
-
- total_bytes = curStat.bytes_total;
- /* Ensure first emit is with amount==0 */
- if (first_emit && total_bytes > 0) {
- eazel_install_emit_download_progress (service, package, 0, total_bytes);
- first_emit = FALSE;
- }
- /* And that amount==0 & amount==total only occurs once */
- if (curStat.bytes_read!=0 && (curStat.bytes_read != curStat.bytes_total)) {
- eazel_install_emit_download_progress (service,
- package,
- curStat.bytes_read,
- curStat.bytes_total);
- }
-
- /* arbitrary -- flush every 16k or so */
- if (curStat.bytes_read > last_flush_bytes + 16384) {
- ghttp_flush_response_buffer (request);
- length = ghttp_get_body_len (request);
- body = ghttp_get_body (request);
- if (body != NULL) {
- if (fwrite (body, length, 1, file) < 1) {
- /* probably out of disk space */
- g_warning (_("DISK FULL: could not write %s"), target_file);
- service->private->disk_full = TRUE;
- get_failed = TRUE;
- break;
- }
- } else {
- g_warning (_("Could not get request body!"));
- get_failed = TRUE;
- break;
- }
- last_flush_bytes = curStat.bytes_read;
- }
-
- g_main_iteration (FALSE);
- }
- /* Last emit amount==total */
- eazel_install_emit_download_progress (service, package, total_bytes, total_bytes);
-
- if (ghttp_status_code (request) != 200) {
- g_warning (_("HTTP error: %d %s"), ghttp_status_code (request),
- ghttp_reason_phrase (request));
- get_failed = TRUE;
- }
- if (ghttp_status_code (request) != 404) {
- length = ghttp_get_body_len (request);
- body = ghttp_get_body (request);
- if (body != NULL) {
- if (fwrite (body, length, 1, file) < 1) {
- /* probably out of disk space */
- g_warning (_("DISK FULL: could not write %s"), target_file);
- service->private->disk_full = TRUE;
- get_failed = TRUE;
- }
- } else {
- g_warning (_("Could not get request body!"));
- get_failed = TRUE;
- }
- } else {
- get_failed = TRUE;
- }
-
- if (request) {
- ghttp_request_destroy (request);
- }
- if (fclose (file) != 0) {
- g_warning (_("DISK FULL: could not write %s"), target_file);
- service->private->disk_full = TRUE;
- get_failed = TRUE;
- }
-
- if (! get_failed) {
- rename (target_file_premove, target_file);
- }
- g_free (target_file_premove);
-
- return (! get_failed);
-} /* end http_fetch_remote_file */
-
-gboolean
-ftp_fetch_remote_file (EazelInstall *service,
- char *url,
- const char *file_to_report,
- const char* target_file,
- const PackageData *package)
-{
- trilobite_debug (_("Downloading %s..."), url);
- trilobite_debug (_("FTP not supported yet"));
- return FALSE;
-}
-
-#else /* EAZEL_INSTALL_SLIM */
-
-static int
-gnome_vfs_xfer_callback (GnomeVFSXferProgressInfo *info,
- gnome_vfs_callback_struct *cbstruct)
-
-{
- static gboolean initial_emit;
- static gboolean last_emit;
- EazelInstall *service = cbstruct->service;
- const PackageData *package = cbstruct->package;
-
- switch (info->status) {
- case GNOME_VFS_XFER_PROGRESS_STATUS_VFSERROR:
- trilobite_debug ("GnomeVFS Error: %s\n",
- gnome_vfs_result_to_string (info->vfs_status));
- return FALSE;
- break;
- case GNOME_VFS_XFER_PROGRESS_STATUS_OVERWRITE:
- trilobite_debug ("Overwriting `%s' with `%s'",
- info->target_name, info->source_name);
- return TRUE;
- break;
- case GNOME_VFS_XFER_PROGRESS_STATUS_OK:
- if (service->private->cancel_download) {
- /* tell gnome-vfs to STOP */
- trilobite_debug ("telling gnome-vfs to cancel download");
- return FALSE;
- }
- switch (info->phase) {
- case GNOME_VFS_XFER_PHASE_INITIAL:
- initial_emit = TRUE;
- last_emit = FALSE;
- return TRUE;
-
- case GNOME_VFS_XFER_PHASE_COLLECTING:
- case GNOME_VFS_XFER_PHASE_READYTOGO:
- case GNOME_VFS_XFER_PHASE_OPENSOURCE:
- case GNOME_VFS_XFER_PHASE_OPENTARGET:
- case GNOME_VFS_XFER_CHECKING_DESTINATION:
- case GNOME_VFS_XFER_PHASE_CLOSESOURCE:
- case GNOME_VFS_XFER_PHASE_CLOSETARGET:
- case GNOME_VFS_XFER_PHASE_FILECOMPLETED:
- return TRUE;
-
- case GNOME_VFS_XFER_PHASE_COPYING:
-#ifdef EIP_FAIL_ALL_DOWNLOADS
- if (info->bytes_copied > 1024*8) {
- return FALSE;
- }
-#endif /* EIP_FAIL_ALL_DOWNLOADS */
-
- /* gnome-vfs had a period of time where it emitted bytes_copied = file_size+1k */
- if (info->bytes_copied > info->file_size) {
- g_warning ("VFS bug: lying about filesize, copying %ld > %ld",
- (glong)info->bytes_copied,
- (glong)info->file_size);
- return TRUE;
- }
- /***/
-
- if (initial_emit && info->file_size>0) {
- initial_emit = FALSE;
- eazel_install_emit_download_progress (service,
- package,
- 0,
- info->file_size);
- } else if (info->bytes_copied == info->file_size) {
- if (!last_emit) {
- last_emit = TRUE;
- eazel_install_emit_download_progress (service,
- package,
- info->file_size,
- info->file_size);
- }
- } else if (info->bytes_copied > 0) {
- eazel_install_emit_download_progress (service,
- package,
- info->bytes_copied,
- info->file_size);
-
- }
-
-/*
- g_message ("Transferring (file %ld/%ld, byte %ld/%ld in file, "
- "%" GNOME_VFS_SIZE_FORMAT_STR "/%" GNOME_VFS_SIZE_FORMAT_STR " total)",
- info->file_index,
- info->files_total,
- (glong) info->bytes_copied,
- (glong) info->file_size,
- info->total_bytes_copied,
- info->bytes_total);
-*/
- return TRUE;
- case GNOME_VFS_XFER_PHASE_COMPLETED:
- if (!last_emit) {
- last_emit = TRUE;
- eazel_install_emit_download_progress (service,
- package,
- info->file_size,
- info->file_size);
- }
- return TRUE;
- default:
- trilobite_debug ("Unexpected VFS phase %d", info->phase);
- return TRUE; /* keep going anyway */
- }
- break;
- case GNOME_VFS_XFER_PROGRESS_STATUS_DUPLICATE:
- trilobite_debug ("Duplicate");
- return FALSE;
- default:
- trilobite_debug ("Unknown status");
- return FALSE;
- }
-
- return FALSE;
-}
-
-gboolean
-gnome_vfs_fetch_remote_file (EazelInstall *service,
- char *url,
- const char *file_to_report,
- const char *target_file,
- const PackageData *package)
-{
- GnomeVFSResult result;
- GnomeVFSXferOptions xfer_options = 0;
- GnomeVFSURI *src_uri;
- GnomeVFSURI *dest_uri;
- char *t_file;
- char *target_file_premove;
- gnome_vfs_callback_struct *cbstruct;
-
- target_file_premove = g_strdup_printf ("%s~", target_file);
-
- /* this will always be a file: uri */
- t_file = g_strdup_printf ("file://%s", target_file_premove);
-
- trilobite_debug ("downloading %s", url);
-
- src_uri = gnome_vfs_uri_new (url);
- g_assert (src_uri != NULL);
- if (eazel_install_get_ssl_rename (service)) {
- trilobite_debug ("ssl renaming %s to localhost", gnome_vfs_uri_get_host_name (src_uri));
- gnome_vfs_uri_set_host_name (src_uri, "localhost");
- gnome_vfs_uri_set_host_port (src_uri, eazel_install_get_server_port (service));
- }
-
- dest_uri = gnome_vfs_uri_new (target_file_premove);
- g_assert (dest_uri != NULL);
-
- /* Setup the userdata for the callback, I need both the
- service object to emit signals too, and the filename to report */
- cbstruct = g_new0 (gnome_vfs_callback_struct, 1);
- cbstruct->service = service;
- cbstruct->package = package;
-
- /* Execute the gnome_vfs copy */
- result = gnome_vfs_xfer_uri (src_uri, dest_uri,
- xfer_options,
- GNOME_VFS_XFER_ERROR_MODE_QUERY,
- GNOME_VFS_XFER_OVERWRITE_MODE_QUERY,
- (GnomeVFSXferProgressCallback)gnome_vfs_xfer_callback,
- cbstruct);
-
- if (result==GNOME_VFS_OK) {
- chmod (target_file, 0600);
- trilobite_debug ("File download successful");
- rename (target_file_premove, target_file);
- } else {
- trilobite_debug ("File download failed");
- unlink (target_file_premove);
- if (result == GNOME_VFS_ERROR_BAD_PARAMETERS) {
- trilobite_debug ("gnome_vfs_xfer_uri returned BAD_PARAMETERS");
- }
- if (service->private->cancel_download) {
- trilobite_debug ("download was cancelled from afar");
- }
- }
-
- /* Free the various stuff */
- g_free (t_file);
- g_free (cbstruct);
-
- /* Unref all the uri's */
- gnome_vfs_uri_unref (src_uri);
- gnome_vfs_uri_unref (dest_uri);
-
- return result == GNOME_VFS_OK ? TRUE : FALSE;
-}
-#endif /* EAZEL_INSTALL_SLIM */
-
-gboolean
-local_fetch_remote_file (EazelInstall *service,
- char *url,
- const char *file_to_report,
- const char* target_file,
- const PackageData *package)
-{
- gboolean result;
- const char *report;
-
- report = file_to_report ? file_to_report : g_basename (target_file);
- trilobite_debug (_("Checking local file %s..."), target_file);
- result = FALSE;
- if (access (target_file, R_OK|W_OK) == 0) {
- struct stat sbuf;
- stat (target_file, &sbuf);
- /* Emit bogus download progress */
- eazel_install_emit_download_progress (service, package, 0, sbuf.st_size);
- eazel_install_emit_download_progress (service, package, sbuf.st_size, sbuf.st_size);
- result = TRUE;
- }
- return result;
-}
-
-static eazel_install_file_fetch_function*
-eazel_install_fill_file_fetch_table (void)
-{
- eazel_install_file_fetch_function *res;
-
- res = g_new0 (eazel_install_file_fetch_function, 3);
-#ifdef EAZEL_INSTALL_SLIM
- res [PROTOCOL_HTTP] = (eazel_install_file_fetch_function)http_fetch_remote_file;
- res [PROTOCOL_FTP] = (eazel_install_file_fetch_function)ftp_fetch_remote_file;
-#else /* EAZEL_INSTALL_SLIM */
- res [PROTOCOL_HTTP] = (eazel_install_file_fetch_function)gnome_vfs_fetch_remote_file;
- res [PROTOCOL_FTP] = (eazel_install_file_fetch_function)gnome_vfs_fetch_remote_file;
-#endif /* EAZEL_INSTALL_SLIM */
- res [PROTOCOL_LOCAL] = (eazel_install_file_fetch_function)local_fetch_remote_file;
-
- return res;
-}
-
-static void
-my_copy_file (const char *orig, const char *dest)
-{
- int ofd, nfd;
- char buffer[1024];
- int n, n2, count;
-
- ofd = open (orig, O_RDONLY);
- if (ofd < 0) {
- return;
- }
- nfd = open (dest, O_CREAT|O_WRONLY, 0644);
- if (nfd < 0) {
- close (ofd);
- return;
- }
-
- while (1) {
- n = read (ofd, buffer, sizeof (buffer));
- if (n <= 0) {
- break;
- }
- count = 0;
- while (count < n) {
- n2 = write (nfd, buffer+count, n-count);
- if (n2 < 0) {
- /* error */
- close (ofd);
- close (nfd);
- unlink (dest);
- return;
- }
- count += n2;
- }
- }
- close (ofd);
- close (nfd);
- return;
-}
-
-gboolean
-eazel_install_fetch_file (EazelInstall *service,
- char *url,
- const char *file_to_report,
- const char* target_file,
- const PackageData *package)
-{
- gboolean result;
- GList *iter;
- char *filename;
-
- static eazel_install_file_fetch_function *func_table = NULL;
-
- if (!func_table) {
- func_table = eazel_install_fill_file_fetch_table ();
- }
-
- result = FALSE;
-
- g_return_val_if_fail (url!=NULL, FALSE);
- g_return_val_if_fail (target_file!=NULL, FALSE);
-
- for (iter = g_list_first (service->private->local_repositories); iter != NULL; iter = g_list_next (iter)) {
- filename = g_strdup_printf ("%s/%s", (char *)(iter->data), g_basename (target_file));
- if (!access (filename, F_OK)) {
- /* copy this file to target_file */
- trilobite_debug ("%s found at %s, copying", file_to_report, filename);
- my_copy_file (filename, target_file);
- }
- g_free (filename);
- }
-
- if (!access (target_file, F_OK)) {
- /* File is already present, so just emit to progress callbacks and get on with
- your life */
- struct stat buf;
- stat (target_file, &buf);
- trilobite_debug ("%s already present, not downloading", target_file);
- eazel_install_emit_download_progress (service, package, 0, buf.st_size);
- eazel_install_emit_download_progress (service, package, buf.st_size, buf.st_size);
- result = TRUE;
- } else {
- result = (func_table [eazel_install_get_protocol (service)])((gpointer)service,
- url,
- file_to_report,
- target_file,
- package);
- }
-
- if (!result) {
- g_warning (_("Failed to retrieve %s!"),
- file_to_report ? file_to_report : g_basename (target_file));
- eazel_install_emit_download_failed (service, package);
- }
-
- return result;
-}
-
-
-static const char*
-filename_from_url (const char *url)
-{
- static char *filename = NULL;
- const char *ptr;
-
- g_return_val_if_fail (url!=NULL, NULL);
-
- g_free (filename);
-
- ptr = url + strlen (url);
- while ((ptr != url) && (*ptr != '/')) {
- ptr--;
- }
- if (ptr == url) {
- filename = g_strdup (ptr);
- } else {
- filename = g_strdup (ptr + 1);
- }
-
- return filename;
-}
-
-gboolean
-eazel_install_fetch_package (EazelInstall *service,
- PackageData* package)
-{
- gboolean result = FALSE;
- char* url = NULL;
- char* targetname = NULL;
- char *name = g_strdup (package->name);
- char *version = g_strdup (package->version);
-
- if (packagedata_is_suite (package)) {
- trilobite_debug ("suites has no urls...");
- g_free (name);
- g_free (version);
- return TRUE;
- }
-
- if (package->remote_url != NULL) {
- url = g_strdup (package->remote_url);
- } else {
- switch (eazel_install_get_protocol (service)) {
- case PROTOCOL_FTP:
- case PROTOCOL_HTTP:
- {
- if (eazel_softcat_get_info (service->private->softcat, package, EAZEL_SOFTCAT_SENSE_GE,
- PACKAGE_FILL_NO_PROVIDES | PACKAGE_FILL_NO_DEPENDENCIES)
- == EAZEL_SOFTCAT_SUCCESS) {
- url = g_strdup (package->remote_url);
- } else {
- url = NULL;
- }
- }
- break;
- case PROTOCOL_LOCAL:
- url = g_strdup_printf ("%s", rpmfilename_from_packagedata (package));
- break;
- };
- }
-
- if (url == NULL) {
- char *rname = packagedata_get_readable_name (package);
- g_warning (_("Could not get an URL for %s"), rname);
- g_free (rname);
- } else {
- targetname = g_strdup_printf ("%s/%s",
- eazel_install_get_tmp_dir (service),
- filename_from_url (url));
- result = eazel_install_fetch_file (service, url, package->name, targetname, package);
- if (result) {
- package = eazel_package_system_load_package (service->private->package_system,
- package,
- targetname,
- PACKAGE_FILL_NO_DIRS_IN_PROVIDES|PACKAGE_FILL_NO_DEPENDENCIES);
-
- if (name) {
- if (strcmp (name, package->name)) {
- g_warning (_("Downloaded package does not have the correct name"));
- g_warning (_("Package %s should have had name %s"),
- package->name, name);
- result = FALSE;
- }
- }
-/*
- if (version) {
- if (rpmvercmp (package->version, version)<0) {
- g_warning (_("Downloaded package does not have the correct version"));
- g_warning (_("Package %s had version %s and not %s"),
- package->name, package->version, version);
- result = FALSE;
- }
- }
-*/
- }
- }
-
- if (result) {
- /* By always adding the file to the downloaded_files list,
- we enforce md5 check on files that were present but should have
- been downloaded */
- if (! g_list_find_custom (service->private->downloaded_files, (char *)targetname,
- (GCompareFunc)g_strcasecmp)) {
- service->private->downloaded_files = g_list_prepend (service->private->downloaded_files,
- g_strdup (targetname));
- }
- } else {
- g_warning (_("File download failed"));
- unlink (targetname);
- }
- g_free (name);
- g_free (version);
- g_free (targetname);
- g_free (url);
-
- return result;
-}
-
-
diff --git a/components/services/install/lib/eazel-install-protocols.h b/components/services/install/lib/eazel-install-protocols.h
deleted file mode 100644
index 47c5f1a00..000000000
--- a/components/services/install/lib/eazel-install-protocols.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: J Shane Culpepper <pepper@eazel.com>
- */
-
-/* eazel-install - services command line install/update/uninstall
- * component. This program will parse the eazel-services-config.xml
- * file and install a services generated package-list.xml.
- */
-
-#ifndef EAZEL_INSTALL_PROTOCOLS_H
-#define EAZEL_INSTALL_PROTOCOLS_H
-
-#include "eazel-package-system-types.h"
-#include "eazel-install-public.h"
-
-gboolean eazel_install_fetch_file (EazelInstall *service,
- char *url,
- const char *file_to_report,
- const char *target_file,
- const PackageData *package);
-
-gboolean eazel_install_fetch_package (EazelInstall *service,
- PackageData *package);
-
-void eazel_install_fetch_definitive_category_info (EazelInstall *service,
- CategoryData *category);
-
-void dump_packages (GList *packages);
-
-#endif /* EAZEL_INSTALL_PROTOCOLS_H */
diff --git a/components/services/install/lib/eazel-install-public.h b/components/services/install/lib/eazel-install-public.h
deleted file mode 100644
index 5214f3a18..000000000
--- a/components/services/install/lib/eazel-install-public.h
+++ /dev/null
@@ -1,345 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: Eskil Heyn Olsen <eskil@eazel.com>
- *
- */
-
-/*
- If compiled with EAZEL_INSTALL_NO_CORBA,
- the object should _NOT_ use Bonobo, OAF, ORBIT
- and whatnot. This is to facilite the statically linked nautilus bootstrap thingy
- */
-
-#ifndef EAZEL_INSTALL_PUBLIC_H
-#define EAZEL_INSTALL_PUBLIC_H
-
-#include <libgnome/gnome-defs.h>
-#ifndef EAZEL_INSTALL_NO_CORBA
-#include "bonobo.h"
-#include "trilobite-eazel-install.h"
-#endif /* EAZEL_INSTALL_NO_CORBA */
-
-#include "eazel-package-system-types.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-#define TYPE_EAZEL_INSTALL (eazel_install_get_type ())
-#define EAZEL_INSTALL(obj) (GTK_CHECK_CAST ((obj), TYPE_EAZEL_INSTALL, EazelInstall))
-#define EAZEL_INSTALL_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), TYPE_EAZEL_INSTALL, EazelInstallClass))
-#define EAZEL_IS_INSTALL(obj) (GTK_CHECK_TYPE ((obj), TYPE_EAZEL_INSTALL))
-#define EAZEL_IS_INSTALL_CLASS(klass)(GTK_CHECK_CLASS_TYPE ((klass), TYPE_EAZEL_INSTALL))
-
-typedef enum {
- EAZEL_INSTALL_NOTHING = 0x0,
- EAZEL_INSTALL_INSTALL_OK = 0x1,
- EAZEL_INSTALL_UNINSTALL_OK = 0x2,
- EAZEL_INSTALL_REVERSION_OK = 0x4
-} EazelInstallOperationStatus;
-
-typedef enum {
- EAZEL_INSTALL_STATUS_NEW_PACKAGE,
- EAZEL_INSTALL_STATUS_UPGRADES,
- EAZEL_INSTALL_STATUS_DOWNGRADES,
- EAZEL_INSTALL_STATUS_QUO
-} EazelInstallStatus;
-
-typedef struct _EazelInstall EazelInstall;
-typedef struct _EazelInstallClass EazelInstallClass;
-
-struct _EazelInstallClass
-{
-#ifdef EAZEL_INSTALL_NO_CORBA
- GtkObjectClass parent_class;
-#else
- BonoboObjectClass parent_class;
-#endif /* EAZEL_INSTALL_NO_CORBA */
- /* signal prototypes */
- void (*download_progress) (EazelInstall *service, const PackageData *package, int amount, int total);
- void (*file_conflict_check) (EazelInstall *service, const PackageData *package);
- void (*file_uniqueness_check) (EazelInstall *service, const PackageData *package);
- void (*feature_consistency_check) (EazelInstall *service, const PackageData *package);
-
- gboolean (*preflight_check) (EazelInstall *service,
- GList *packages,
- int total_bytes,
- int total_packages);
- gboolean (*save_transaction) (EazelInstall *service,
- GList *packages);
-
- void (*install_progress) (EazelInstall *service,
- const PackageData *pack,
- int package_num, int num_packages,
- int package_size_completed, int package_size_total,
- int total_size_completed, int total_size);
- void (*uninstall_progress) (EazelInstall *service,
- const PackageData *pack,
- int package_num, int num_packages,
- int package_size_completed, int package_size_total,
- int total_size_completed, int total_size);
- void (*dependency_check) (EazelInstall *service, const PackageData *pack, const PackageData *needed);
- /*
- if the set URLType is PROTOCOL_HTTP, info is a HTTPError struc
- */
- void (*download_failed) (EazelInstall *service, const PackageData *package);
- /*
- if RPM_FAIL is RPM_SRC_NOT_SUPPORTED, info is NULL
- RPM_DEP_FAIL, info is a GSList of required packages (PackageData objects)
- RPM_NOT_AN_RPM, info is NULL
- */
- void (*md5_check_failed) (EazelInstall *service, const PackageData *pd, const char *actual_md5);
- void (*install_failed) (EazelInstall *service, const PackageData *pd);
- void (*uninstall_failed) (EazelInstall *service, const PackageData *pd);
-
- gboolean (*delete_files) (EazelInstall *service);
-
- void (*done) (EazelInstall *service, gboolean result);
-#ifndef EAZEL_INSTALL_NO_CORBA
- gpointer servant_vepv;
-#endif /* EAZEL_INSTALL_NO_CORBA */
-};
-
-typedef struct _EazelInstallPrivate EazelInstallPrivate;
-
-struct _EazelInstall
-{
-#ifdef EAZEL_INSTALL_NO_CORBA
- GtkObject parent;
-#else
- BonoboObject parent;
- GNOME_Trilobite_Eazel_InstallCallback callback;
-#endif /* EAZEL_INSTALL_NO_CORBA */
- EazelInstallPrivate *private;
-};
-
-EazelInstall *eazel_install_new (void);
-EazelInstall *eazel_install_new_with_config (void);
-GtkType eazel_install_get_type (void);
-void eazel_install_unref (GtkObject *object);
-
-#ifndef EAZEL_INSTALL_NO_CORBA
-POA_GNOME_Trilobite_Eazel_Install__epv *eazel_install_get_epv (void);
-GNOME_Trilobite_Eazel_Install eazel_install_create_corba_object (BonoboObject *service);
-#endif /* EAZEL_INSTALL_NO_CORBA */
-
-void eazel_install_set_log (EazelInstall *service,
- FILE *logfp);
-void eazel_install_open_log (EazelInstall *service,
- const char *fname);
-void eazel_install_log_to_stderr (EazelInstall *service,
- gboolean log_to_stderr);
-gboolean eazel_install_failed_because_of_disk_full (EazelInstall *service);
-void eazel_install_add_repository (EazelInstall *service, const char *dir);
-
-/* This sets mode 500 on tmpdir and all files in
- private->downloaded_files */
-gboolean eazel_install_lock_tmp_dir (EazelInstall *service);
-/* This sets mode 700 on tmpdir and downloaded files */
-gboolean eazel_install_unlock_tmp_dir (EazelInstall *service);
-
-void eazel_install_emit_file_conflict_check (EazelInstall *service,
- const PackageData *pack);
-void eazel_install_emit_file_uniqueness_check (EazelInstall *service,
- const PackageData *pack);
-void eazel_install_emit_feature_consistency_check (EazelInstall *service,
- const PackageData *pack);
-void eazel_install_emit_install_progress (EazelInstall *service,
- const PackageData *pack,
- int package_num, int num_packages,
- int package_size_completed, int package_size_total,
- int total_size_completed, int total_size);
-void eazel_install_emit_uninstall_progress (EazelInstall *service,
- const PackageData *pack,
- int package_num, int num_packages,
- int package_size_completed, int package_size_total,
- int total_size_completed, int total_size);
-void eazel_install_emit_download_progress (EazelInstall *service,
- const PackageData *package,
- int amount,
- int total);
-gboolean eazel_install_emit_preflight_check (EazelInstall *service,
- GList *packages);
-gboolean eazel_install_emit_save_transaction (EazelInstall *service,
- GList *packages);
-void eazel_install_emit_download_failed (EazelInstall *service,
- const PackageData *package);
-void eazel_install_emit_md5_check_failed (EazelInstall *service,
- const PackageData *pd,
- const char *actual_md5);
-void eazel_install_emit_install_failed (EazelInstall *service,
- const PackageData *pd);
-void eazel_install_emit_uninstall_failed (EazelInstall *service,
- const PackageData *pd);
-void eazel_install_emit_dependency_check (EazelInstall *service,
- const PackageData *package,
- const PackageDependency *needed);
-void eazel_install_emit_dependency_check_pre_ei2 (EazelInstall *service,
- const PackageData *package,
- const PackageData *needed);
-void eazel_install_emit_done (EazelInstall *service,
- gboolean result);
-
-/* This is in flux */
-
-gboolean eazel_install_fetch_remote_package_list (EazelInstall *service);
-
-void eazel_install_install_packages (EazelInstall *service,
- GList *categories,
- const char *root);
-
-void eazel_install_uninstall_packages (EazelInstall *service,
- GList *categories,
- const char *root);
-
-GList* eazel_install_query_package_system (EazelInstall *service,
- const char *query,
- int flags,
- const char *root);
-
-void eazel_install_revert_transaction_from_xmlstring (EazelInstall *service,
- const char *xml,
- int size,
- const char *root);
-
-void eazel_install_revert_transaction_from_file (EazelInstall *service,
- const char *filename,
- const char *root);
-
-void eazel_install_delete_downloads (EazelInstall *service);
-
-void eazel_install_init_transaction (EazelInstall *service);
-void eazel_install_save_transaction_report (EazelInstall *service);
-
-/******************************************************************************/
-/* Beware, from hereonafter, it's #def madness, to make the get/set functions */
-
-#define EAZEL_INSTALL_SANITY_VAL(name, ret)\
- g_return_val_if_fail (name != NULL, ret); \
- g_return_val_if_fail (EAZEL_IS_INSTALL (name), ret); \
- g_return_val_if_fail (name->private->softcat != NULL, ret); \
- g_return_val_if_fail (EAZEL_IS_SOFTCAT (name->private->softcat), ret); \
- g_assert (name->private != NULL); \
- g_assert (name->private->iopts != NULL); \
- g_assert (name->private->topts != NULL)
-
-#define EAZEL_INSTALL_SANITY(name)\
- g_return_if_fail (name != NULL); \
- g_return_if_fail (EAZEL_IS_INSTALL (name)); \
- g_return_if_fail (name->private->softcat != NULL); \
- g_return_if_fail (EAZEL_IS_SOFTCAT (name->private->softcat)); \
- g_assert (name->private != NULL); \
- g_assert (name->private->iopts != NULL); \
- g_assert (name->private->topts != NULL)
-
-#define ei_access_decl(name, type) \
-type eazel_install_get_##name (EazelInstall *service)
-
-#define ei_access_impl(name, type, var, defl) \
-type eazel_install_get_##name (EazelInstall *service) { \
- EAZEL_INSTALL_SANITY_VAL (service, defl); \
- return service->private->var; \
-}
-
-#define ei_mutator_decl(name, type) \
-void eazel_install_set_##name (EazelInstall *service, \
- const type name)
-
-#define ei_mutator_impl(name, type, var) \
-void eazel_install_set_##name (EazelInstall *service, \
- type name) { \
- EAZEL_INSTALL_SANITY (service); \
- service->private->var = name; \
-}
-
-#define ei_mutator_impl_copy(name, type, var, copyfunc) \
-void eazel_install_set_##name (EazelInstall *service, \
- const type name) { \
- EAZEL_INSTALL_SANITY (service); \
- g_free (service->private->var); \
- service->private->var = copyfunc ( name ); \
-}
-
-/* When adding fields to EazelInstall object, add
- _mutator_decl here
- _access_decl here
- ARG_ in -object.c
- code in eazel_install_set_arg
- code in eazel_install_class_initialize
- _mutator_impl in -object.c
- _access_impl in -object.c
-*/
-
-ei_mutator_decl (verbose, gboolean);
-ei_mutator_decl (silent, gboolean);
-ei_mutator_decl (debug, gboolean);
-ei_mutator_decl (test, gboolean);
-ei_mutator_decl (force, gboolean);
-ei_mutator_decl (depend, gboolean);
-ei_mutator_decl (upgrade, gboolean);
-ei_mutator_decl (uninstall, gboolean);
-ei_mutator_decl (downgrade, gboolean);
-ei_mutator_decl (protocol, URLType);
-ei_mutator_decl (tmp_dir, char*);
-ei_mutator_decl (rpmrc_file, char*);
-ei_mutator_decl (server, char*);
-ei_mutator_decl (username, char*);
-ei_mutator_decl (package_list_storage_path, char*);
-ei_mutator_decl (package_list, char*);
-ei_mutator_decl (root_dirs, GList*);
-ei_mutator_decl (transaction_dir, char*);
-ei_mutator_decl (server_port, guint);
-ei_mutator_decl (cgi_path, char*);
-ei_mutator_decl (eazel_auth, gboolean);
-ei_mutator_decl (ssl_rename, gboolean);
-ei_mutator_decl (ignore_file_conflicts, gboolean);
-ei_mutator_decl (ei2, gboolean);
-
-ei_access_decl (verbose, gboolean);
-ei_access_decl (silent, gboolean);
-ei_access_decl (debug, gboolean);
-ei_access_decl (test, gboolean);
-ei_access_decl (force, gboolean);
-ei_access_decl (depend, gboolean);
-ei_access_decl (upgrade, gboolean);
-ei_access_decl (uninstall, gboolean);
-ei_access_decl (downgrade, gboolean);
-ei_access_decl (protocol, URLType );
-ei_access_decl (tmp_dir, char*);
-ei_access_decl (rpmrc_file, char*);
-ei_access_decl (server, char*);
-ei_access_decl (username, char*);
-ei_access_decl (package_list_storage_path, char*);
-ei_access_decl (package_list, char*);
-ei_access_decl (root_dirs, GList*);
-ei_access_decl (transaction_dir, char*);
-ei_access_decl (server_port, guint);
-ei_access_decl (cgi_path, char*);
-ei_access_decl (eazel_auth, gboolean);
-ei_access_decl (ssl_rename, gboolean);
-ei_access_decl (ignore_file_conflicts, gboolean);
-ei_access_decl (ei2, gboolean);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* EAZEL_INSTALL_PUBLIC_H */
-
diff --git a/components/services/install/lib/eazel-install-query-lex.l b/components/services/install/lib/eazel-install-query-lex.l
deleted file mode 100644
index 8c3fb1501..000000000
--- a/components/services/install/lib/eazel-install-query-lex.l
+++ /dev/null
@@ -1,96 +0,0 @@
-%{
-
-/*
-This was mostly grabbed from gnome/oaf/oafd/ac-query-lex.l
-*/
-
-#include <glib.h>
-#include <eazel-install-query-parse.h>
-
-#include <string.h>
-#include <stdlib.h>
-#define YY_NO_UNPUT
-
-static char* putSymbol( char *_name );
-static char* putString( char *_name );
-static int yywrap(void);
-int yylex (void);
-void initFlex( const char *_code );
-
-%}
-
-DIGIT [0-9]
-
-%%
-
-"==" { return Q_EQ; }
-"!=" { return Q_NEQ; }
-"<" { return Q_LT; }
-">" { return Q_GT; }
-"<=" { return Q_LEQ; }
-">=" { return Q_GEQ; }
-
-"." { return Q_PERIOD; }
-
-{DIGIT}+ { yylval.val_number = atof( yytext ); return Q_CONST_NUMBER; }
-{DIGIT}+"."{DIGIT}+ { char *ptr; yylval.val_version_major = atof( yytext );
- ptr = strchr (yytext, '.'); ptr++;
- yylval.val_version_minor = atof (ptr); return Q_CONST_VERSION; }
-
-"'"(\\'|[^'])+"'" { yylval.val_string = putString( yytext ); return Q_CONST_STRING; }
-[a-zA-Z_-][a-zA-Z0-9_:-]* { yylval.val_string = putSymbol( yytext ); return Q_CONST_ID; }
-
-[ \t\n\r]+ /* eat up whitespace */
-
-. { return PARSE_ERROR; }
-
-%%
-
-static char *
-putSymbol( char *_name )
-{
- return g_strdup(_name);
-}
-
-static char *
-putString( char *_str )
-{
- int l = strlen( _str );
- char *p = (char*)g_malloc( l + 1);
- char *s = _str + 1;
- char *d = p;
- while ( s < _str + l - 1 )
- {
- if ( *s != '\\' )
- *d++ = *s++;
- else
- {
- s++;
- if ( *s == '\\' )
- *d++ = '\\';
- else if ( *s == 'n' )
- *d++ = '\n';
- else if ( *s == 'r' )
- *d++ = '\r';
- else if ( *s == 't' )
- *d++ = '\t';
- s++;
- }
- }
-
- *d = 0;
- return p;
-}
-
-void
-initFlex( const char *_code )
-{
- yy_switch_to_buffer( yy_scan_string( _code ) );
-}
-
-static int
-yywrap(void)
-{
- yy_delete_buffer( YY_CURRENT_BUFFER );
- return 1;
-}
diff --git a/components/services/install/lib/eazel-install-query-parse.h b/components/services/install/lib/eazel-install-query-parse.h
deleted file mode 100644
index b978e4234..000000000
--- a/components/services/install/lib/eazel-install-query-parse.h
+++ /dev/null
@@ -1,26 +0,0 @@
-typedef union
-{
- char *val_string;
- int val_number;
- int val_version_major, val_version_minor;
- int val_enum;
-} YYSTYPE;
-
-#define Q_CONST_STRING 257
-#define Q_CONST_NUMBER 258
-#define Q_CONST_VERSION 259
-#define Q_CONST_ID 260
-
-#define Q_EQ 272
-#define Q_NEQ 273
-#define Q_LEQ 274
-#define Q_GEQ 275
-#define Q_LT 276
-#define Q_GT 277
-
-#define Q_PERIOD 282
-
-#define PARSE_ERROR 283
-
-
-extern YYSTYPE yylval;
diff --git a/components/services/install/lib/eazel-install-query.h b/components/services/install/lib/eazel-install-query.h
deleted file mode 100644
index 9915fc703..000000000
--- a/components/services/install/lib/eazel-install-query.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: Eskil Heyn Olsen <eskil@eazel.com>
- */
-
-#ifndef EAZEL_INSTALL_QUERY_H
-#define EAZEL_INSTALL_QUERY_H
-
-#include "eazel-package-system-types.h"
-#include "eazel-install-public.h"
-
-typedef enum {
- EI_SIMPLE_QUERY_OWNS,
- EI_SIMPLE_QUERY_PROVIDES,
- EI_SIMPLE_QUERY_REQUIRES,
- EI_SIMPLE_QUERY_MATCHES
-} EazelInstallSimpleQueryEnum;
-
-/* Performs a simple query for "input", using
- the enum flag.
-
- neglists is the number of GList* provided to the function. These
- lists should contain pacakage that should _not_ be returned in the
- result. So normally you will just use it like :
-
- GList *matches = eazel_install_simple_query (service, "somepackage",
- EI_SIMPLE_QUERY_MATCHES, 0, NULL);
-*/
-
-GList* eazel_install_simple_query (EazelInstall *service,
- const char *input,
- EazelInstallSimpleQueryEnum flag,
- int neglists, ...);
-
-#endif /* EAZEL_INSTALL_QUERY_H */
diff --git a/components/services/install/lib/eazel-install-rpm-signature.c b/components/services/install/lib/eazel-install-rpm-signature.c
deleted file mode 100644
index 24c16993e..000000000
--- a/components/services/install/lib/eazel-install-rpm-signature.c
+++ /dev/null
@@ -1,396 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-
-/*
- * Verifies that the signature on an RPM is good, and returns a
- * string identifying who signed it.
- *
- * Copyright (C) 2000 Eazel, Inc
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the Free
- * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * Authors: Robey Pointer <robey@eazel.com>
- *
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-#include <fcntl.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <glib.h>
-#include <netinet/in.h>
-#include <libtrilobite/trilobite-core-utils.h>
-#include "eazel-install-rpm-signature.h"
-
-/* some older versions of librpm are COMPLETELY INCOMPATIBLE with newer versions,
- * even though they have the same library version number!
- * so, parsing the RPM file headers must be done by hand. :( :( :(
- */
-
-#define RPM_MAGIC_1 0xED
-#define RPM_MAGIC_2 0xAB
-#define RPM_MAGIC_3 0xEE
-#define RPM_MAGIC_4 0xDB
-
-#define RPM_GPG_BLOCK 0x3ED
-
-typedef struct {
- gint32 magic;
- gint32 reserved;
- gint32 entries;
- gint32 data_size;
-} RPMHeader;
-
-typedef struct {
- gint32 tag;
- gint32 type;
- gint32 offset;
- gint32 count;
-} RPMEntry;
-
-
-/* returns 0 on success,
- * -1 if this isn't an RPM, or is incompatible somehow
- */
-static int
-read_rpm_lead (int fd)
-{
- unsigned char buffer[96];
- guint bytes = 0;
- int n;
-
- while (bytes < sizeof (buffer)) {
- n = read (fd, buffer + bytes, sizeof (buffer) - bytes);
- if (n <= 0) {
- return -1;
- }
- bytes += n;
- }
-
- if ((buffer[0] != RPM_MAGIC_1) || (buffer[1] != RPM_MAGIC_2) ||
- (buffer[2] != RPM_MAGIC_3) || (buffer[3] != RPM_MAGIC_4)) {
- return -1;
- }
- /* version number >= 2.0 */
- if (buffer[4] < 2) {
- return -1;
- }
- /* type = 0 */
- if ((buffer[6] != 0) || (buffer[7] != 0)) {
- return -1;
- }
- /* header signature (5) */
- if ((buffer[78] != 0) || (buffer[79] != 5)) {
- return -1;
- }
-
- return 0;
-}
-
-/* returns -1 if there is no GPG signature, 0 on success */
-/* on success, you must g_free the signature when done */
-static int
-read_rpm_signature (int fd, char **signature, int *signature_len)
-{
- RPMHeader header;
- RPMEntry *entry = NULL;
- int n, i, bytes;
- int offset;
- char buffer[256];
-
- *signature = NULL;
-
- for (bytes = 0; bytes < (int) sizeof (header); ) {
- n = read (fd, &header + bytes, sizeof (header) - bytes);
- if (n <= 0) {
- return -1;
- }
- bytes += n;
- }
-
- header.entries = ntohl (header.entries);
- header.data_size = ntohl (header.data_size);
- entry = g_new0 (RPMEntry, header.entries);
-
- for (bytes = 0; bytes < (int) (header.entries * sizeof (RPMEntry)); ) {
- n = read (fd, entry + bytes, (header.entries * sizeof (RPMEntry)) - bytes);
- if (n <= 0) {
- goto bail;
- }
- bytes += n;
- }
-
- offset = -1;
- for (i = 0; i < header.entries; i++) {
- entry[i].tag = ntohl (entry[i].tag);
- entry[i].offset = ntohl (entry[i].offset);
- entry[i].count = ntohl (entry[i].count);
-
- if (entry[i].tag == RPM_GPG_BLOCK) {
- /* found a gpg block! */
- offset = entry[i].offset;
- *signature_len = entry[i].count;
- }
- }
-
- if (offset < 0) {
- /* didn't find any gpg block */
- goto bail;
- }
-
- for (bytes = 0; bytes < offset; ) {
- n = read (fd, buffer, MIN (offset - bytes, (int) sizeof (buffer)));
- if (n <= 0) {
- goto bail;
- }
- bytes += n;
- }
-
- *signature = g_malloc (*signature_len);
- for (bytes = 0; bytes < *signature_len; ) {
- n = read (fd, *signature + bytes, *signature_len - bytes);
- if (n <= 0) {
- goto bail;
- }
- bytes += n;
- }
-
- /* now we must move the file pointer past all this meta-data */
- /* round header data size up to a 4-byte boundary */
- if (header.data_size % 4) {
- header.data_size += 4 - (header.data_size % 4);
- }
- offset = header.data_size - (*signature_len + offset);
- for (bytes = 0; bytes < offset; ) {
- n = read (fd, buffer, MIN (offset - bytes, (int) sizeof (buffer)));
- if (n <= 0) {
- goto bail;
- }
- bytes += n;
- }
-
- g_free (entry);
- return 0;
-
-bail:
- if (*signature != NULL) {
- g_free (*signature);
- *signature = NULL;
- }
- if (entry) {
- g_free (entry);
- }
- return -1;
-}
-
-
-/* there ought to be a general-purpose function for this in glib (grumble) */
-#define tr_randchar ("abcdefghijklmnopqrstuvwxyz123456"[rand()%32])
-static char *
-trilobite_make_temp_file (int *fd)
-{
- char *filename;
- long pid, pidmax;
-
- pid = ((long)getpid() * 100);
- pidmax = pid + 99;
-
- while (pid <= pidmax) {
- filename = g_strdup_printf ("%s/trilobite-%ld%c%c%c%c", g_get_tmp_dir(), pid,
- tr_randchar, tr_randchar, tr_randchar, tr_randchar);
- *fd = open (filename, O_RDWR|O_CREAT|O_EXCL, 0600);
- if (*fd >= 0) {
- return filename;
- }
-
- /* try again */
- g_free (filename);
- pid++;
- }
-
- /* tried 100 combos, none worked. give up. */
- return NULL;
-}
-
-
-/* verify the signature on an RPM file, given a keyring to use, and the filename of the RPM.
- *
- * returns 0 if the signature is ok,
- * 1 if the signature is bad,
- * 2 if the RPM isn't signed (or doesn't exist),
- * -1 if it was unable to check for some reason
- */
-int
-trilobite_check_rpm_signature (const char *filename, const char *keyring_filename, char **signer_name)
-{
- int key_fd = -1;
- int rpm_fd = -1;
- int stdin_fd, stdout_fd, stderr_fd;
- char *temp_filename = NULL;
- char *p;
- char *signature = NULL;
- int err;
- int i;
- int status;
- int bytes;
- char *gpg_paths[] = { "/usr/bin/gpg", "/bin/gpg", "/usr/local/bin/gpg", NULL };
- char *argv[] = { "gpg", "--batch", "--no-verbose", "--quiet", "--no-secmem-warning",
- "--no-default-keyring", "--status-fd", "1", "--keyring", "%KEYRING%",
- "--verify", "%FILENAME%",
- NULL };
- char buffer[1024];
- char line[128];
- FILE *gnupg_file = NULL;
-
- *signer_name = NULL;
-
- /* read the signature out of the RPM */
- rpm_fd = open (filename, O_RDONLY);
- if (rpm_fd < 0) {
- goto bail;
- }
- if (read_rpm_lead (rpm_fd) != 0) {
- goto bail;
- }
- if (read_rpm_signature (rpm_fd, &signature, &bytes) != 0) {
- goto bail_nosig;
- }
-
- /* must write the signature into a temporary file for gpg */
- temp_filename = trilobite_make_temp_file (&key_fd);
- if (temp_filename == NULL) {
- goto bail;
- }
- if (write (key_fd, signature, bytes) < bytes) {
- goto bail;
- }
- close (key_fd);
- key_fd = -1;
-
- /* fill in keyring and temp filename */
- for (i = 0; argv[i] != NULL; i++) {
- if (strcmp (argv[i], "%KEYRING%") == 0) {
- argv[i] = (char *)keyring_filename;
- }
- if (strcmp (argv[i], "%FILENAME%") == 0) {
- argv[i] = temp_filename;
- }
- }
-
- for (i = 0, err = 0; (gpg_paths[i] != NULL) && (err == 0); i++) {
- /* all GPG crap output goes to stderr, which we'll ignore.
- * status output is going to stdout, so we can scan it to
- * find out which key was used.
- */
- err = trilobite_pexec (gpg_paths[i], argv, &stdin_fd, &stdout_fd, &stderr_fd);
- }
- if (err == 0) {
- /* can't find gpg */
- goto bail;
- }
-
- /* write all of the rpm file into stdin */
- while (1) {
- bytes = read (rpm_fd, buffer, sizeof (buffer));
- if (bytes <= 0) {
- break;
- }
- if (write (stdin_fd, buffer, bytes) != bytes) {
- break;
- }
- }
- close (rpm_fd);
- rpm_fd = -1;
- close (stdin_fd);
- wait (&status);
-
- /* gpg is finished */
- close (stderr_fd);
- unlink (temp_filename);
- temp_filename = NULL;
-
- if (!WIFEXITED (status)) {
- /* failed to verify the signature */
- close (stdout_fd);
- return 1;
- }
-
- /* read GNUPG status lines */
- gnupg_file = fdopen (stdout_fd, "r");
- if (gnupg_file == NULL) {
- close (stdout_fd);
- goto bail;
- }
-
- err = -1; /* gpg didn't say anything? */
-
- while (! feof (gnupg_file)) {
- fgets (line, 128, gnupg_file);
- if (feof (gnupg_file)) {
- break;
- }
- line[127] = 0;
- if (line[strlen (line) - 1] == '\n') {
- line[strlen (line) - 1] = 0;
- }
-
- /* get the name of the signer */
- if (strncmp (line, "[GNUPG:] ", 9) == 0) {
- p = strstr (line, "GOODSIG ");
- if (p != NULL) {
- p += 8;
- while (*p && (*p != ' ')) {
- p++;
- }
- if (*p) {
- g_free (*signer_name);
- *signer_name = g_strdup (p+1);
- err = 0;
- }
- }
-
- p = strstr (line, "BADSIG ");
- if (p != NULL) {
- err = 1;
- }
- }
- }
-
- fclose (gnupg_file);
- return err;
-
-bail_nosig:
- if (signature != NULL) {
- g_free (signature);
- }
- return 2;
-
-bail:
- if (rpm_fd >= 0) {
- close (rpm_fd);
- }
- if (key_fd >= 0) {
- close (key_fd);
- }
- if (temp_filename != NULL) {
- unlink (temp_filename);
- }
- if (signature != NULL) {
- g_free (signature);
- }
- return -1;
-}
diff --git a/components/services/install/lib/eazel-install-rpm-signature.h b/components/services/install/lib/eazel-install-rpm-signature.h
deleted file mode 100644
index 5f1bf0c75..000000000
--- a/components/services/install/lib/eazel-install-rpm-signature.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-
-/*
- * Verifies that the signature on an RPM is good, and returns a
- * string identifying who signed it.
- *
- * Copyright (C) 2000 Eazel, Inc
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the Free
- * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * Authors: Robey Pointer <robey@eazel.com>
- *
- */
-
-#ifndef _EAZEL_INSTALL_RPM_SIGNATURE_H_
-#define _EAZEL_INSTALL_RPM_SIGNATURE_H_
-
-int trilobite_check_rpm_signature (const char *filename, const char *keyring_filename, char **signer_name);
-
-#endif /* _EAZEL_INSTALL_RPM_SIGNATURE_H_ */
diff --git a/components/services/install/lib/eazel-install-tests.c b/components/services/install/lib/eazel-install-tests.c
deleted file mode 100644
index 08d4c0b6b..000000000
--- a/components/services/install/lib/eazel-install-tests.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: J Shane Culpepper <pepper@eazel.com>
- */
-
-/* eazel-install - services command line install/update/uninstall
- * component. This program will parse the eazel-services-config.xml
- * file and install a services generated package-list.xml.
- */
-
-#include <config.h>
-#include "eazel-install-tests.h"
-#include <gnome.h>
-
-void
-dump_package_list (PackageData* pkg) {
- g_print (_("*** Begin pkg dump ***\n"));
- g_print ("name = %s\n", pkg->name);
- g_print ("version = %s\n", pkg->version);
- g_print ("minor = %s\n", pkg->minor);
- g_print ("archtype = %s\n", pkg->archtype);
- g_print ("bytesize = %d\n", pkg->bytesize);
- g_print ("description = %s\n", pkg->description);
- g_print (_("*** End pkg dump ***\n"));
-} /* end dump_package_list */
diff --git a/components/services/install/lib/eazel-install-tests.h b/components/services/install/lib/eazel-install-tests.h
deleted file mode 100644
index bc0a80f38..000000000
--- a/components/services/install/lib/eazel-install-tests.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: J Shane Culpepper <pepper@eazel.com>
- */
-
-/* eazel-install - services command line install/update/uninstall
- * component. This program will parse the eazel-services-config.xml
- * file and install a services generated package-list.xml.
- */
-
-#ifndef EAZEL_INSTALL_TESTS_H
-#define EAZEL_INSTALL_TESTS_H
-
-#include "eazel-package-system-types.h"
-
-void dump_package_list (PackageData* pkg);
-
-#endif /* EAZEL_INSTALL_TESTS_H */
diff --git a/components/services/install/lib/eazel-install-xml-package-list.c b/components/services/install/lib/eazel-install-xml-package-list.c
deleted file mode 100644
index 1d0445b85..000000000
--- a/components/services/install/lib/eazel-install-xml-package-list.c
+++ /dev/null
@@ -1,1017 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Copyright (C) 2000 Eazel, Inc
- * Copyright (C) 2000 Helix Code, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: J Shane Culpepper <pepper@eazel.com>
- * Joe Shaw <joe@helixcode.com>
- * Eskil Heyn Olsen <eskil@eazel.com>
- * Robey Pointer <robey@eazel.com>
- */
-
-/* eazel-install - services command line install/update/uninstall
- * component. This program will parse the eazel-services-config.xml
- * file and install a services generated package-list.xml.
- */
-
-#include <config.h>
-#include "eazel-softcat.h" /* for softcat sense flags */
-#include "eazel-install-xml-package-list.h"
-
-#include <libtrilobite/trilobite-core-utils.h>
-#include <libtrilobite/trilobite-core-network.h>
-#include <libtrilobite/trilobite-i18n.h>
-#include <gnome-xml/parser.h>
-#include <gnome-xml/xmlmemory.h>
-#include <glib.h>
-#include <string.h>
-
-static PackageData* parse_package (xmlNode* package, gboolean set_toplevel);
-static CategoryData* parse_category (xmlNode* cat);
-static int parse_pkg_template (const char* pkg_template_file, char** result);
-static PackageData* osd_parse_softpkg (xmlNodePtr softpkg);
-
-
-
-static PackageData*
-parse_package (xmlNode* package, gboolean set_toplevel) {
-
- xmlNodePtr dep;
- PackageData* rv;
- char *tmp;
-
- rv = packagedata_new ();
-
- rv->name = trilobite_xml_get_string (package, "NAME");
- rv->version = trilobite_xml_get_string (package, "VERSION");
- rv->minor = trilobite_xml_get_string (package, "MINOR");
- rv->archtype = trilobite_xml_get_string (package, "ARCH");
-
- tmp = trilobite_xml_get_string (package, "STATUS");
- if (tmp) {
- rv->status = packagedata_status_str_to_enum (tmp);
- g_free (tmp);
- }
-
- tmp = trilobite_xml_get_string (package, "MODSTATUS");
- if (tmp) {
- rv->modify_status = packagedata_modstatus_str_to_enum (tmp);
- g_free (tmp);
- }
-
- tmp = trilobite_xml_get_string (package, "BYTESIZE");
- if (tmp != NULL) {
- rv->bytesize = atoi (tmp);
- g_free (tmp);
- } else {
- rv->bytesize = 0;
- }
-
- tmp = trilobite_xml_get_string (package, "FILESIZE");
- if (tmp != NULL) {
- rv->filesize = atoi (tmp);
- g_free (tmp);
- } else {
- rv->filesize = 0;
- }
-
- tmp = trilobite_xml_get_string (package, "PROVIDES");
- if (tmp) {
- char **files;
- int iterator;
-
- files = g_strsplit (tmp, G_SEARCHPATH_SEPARATOR_S, 0);
- if (files) {
- /* we don't free the individual files[x]'s, as
- they end up in the package data object */
- for (iterator = 0; files[iterator]; iterator++) {
- rv->provides = g_list_prepend (rv->provides,
- files[iterator]);
- }
- rv->provides = g_list_reverse (rv->provides);
- g_free (files);
- }
- g_free (tmp);
- }
-
- rv->summary = trilobite_xml_get_string (package, "SUMMARY");
- rv->description = trilobite_xml_get_string (package, "DESCRIPTION");
- rv->distribution = trilobite_get_distribution ();
- if (set_toplevel) {
- rv->toplevel = TRUE;
- }
-
- /* Dependency Lists */
- rv->breaks = NULL;
- rv->modifies = NULL;
-
- dep = package->xmlChildrenNode;
- while (dep) {
- if (g_strcasecmp (dep->name, "DEPENDENCY") == 0) {
- PackageDependency *dependency = packagedependency_new ();
- PackageData* depend;
-
- depend = parse_package (dep, FALSE);
- dependency->package = depend;
- packagedata_add_pack_to_depends (rv, dependency);
- } else if (g_strcasecmp (dep->name, "MODIFIES") == 0) {
- PackageData* depend;
-
- depend = parse_package (dep, FALSE);
- packagedata_add_pack_to_modifies (rv, depend);
- }
-
- dep = dep->next;
-
- }
-
- return rv;
-
-} /* end parse package */
-
-static CategoryData*
-parse_category (xmlNode* cat) {
-
- CategoryData* category;
- PackageData* pakdat;
- xmlNode* pkg;
- xmlNode* pkg2;
- char *text, *textp;
-
- category = categorydata_new ();
- category->name = trilobite_xml_get_string (cat, "name");
-
- pkg = cat->xmlChildrenNode;
- if (pkg == NULL) {
- g_print (_("*** No package nodes! (cat has no children) ***"));
- g_free (category);
- g_error (_("*** Bailing from package parse! ***"));
- }
- while (pkg) {
- pkg2 = pkg->xmlChildrenNode;
- if (g_strcasecmp (pkg->name, "PACKAGES") == 0) {
- if (pkg2 == NULL) {
- g_print (_("*** No package nodes! ***"));
- g_free (category);
- g_error (_("*** Bailing from package parse! ***"));
- }
- while (pkg2) {
- if (g_strcasecmp (pkg2->name, "PACKAGE") != 0) {
- g_error (_("*** Malformed package node!"));
- } else {
- pakdat = parse_package (pkg2, TRUE);
- category->packages = g_list_append (category->packages, pakdat);
- }
- pkg2 = pkg2->next;
- }
- } else if (g_strcasecmp (pkg->name, "DEPENDS") == 0) {
- if (pkg2 == NULL) {
- g_print (_("*** No depends nodes! ***"));
- g_free (category);
- g_error (_("*** Bailing from package parse! ***"));
- }
- while (pkg2) {
- if (g_strcasecmp (pkg2->name, "ON") != 0) {
- g_error (_("*** Malformed depends node!"));
- } else {
- text = xmlNodeGetContent (pkg2);
- trilobite_debug ("%s deps on %s", category->name, text);
- category->depends = g_list_prepend (category->depends, g_strdup (text));
- free (text);
- }
- pkg2 = pkg2->next;
- }
- } else if (g_strcasecmp (pkg->name, "EXCLUSIVE") == 0) {
- category->exclusive = TRUE;
- } else if (g_strcasecmp (pkg->name, "DEFAULT") == 0) {
- category->default_choice = TRUE;
- } else if (g_strcasecmp (pkg->name, "DESCRIPTION") == 0) {
- text = xmlNodeGetContent (pkg);
- /* remove leading and trailing linefeeds (xml artifact) */
- while ((strlen (text) > 0) && (text[strlen (text) - 1] == '\n')) {
- text[strlen (text) - 1] = '\0';
- }
- for (textp = text; (*textp == '\n'); textp++)
- ;
- category->description = g_strdup (textp);
- free (text);
- } else {
- g_error (_("*** Unknown node type '%s'"), pkg->name);
- }
- pkg = pkg->next;
- }
-
- return category;
-
-} /* end parse_category */
-
-/* parse the contents of the CATEGORIES node */
-static GList*
-parse_shared (xmlNodePtr base)
-{
- xmlNodePtr category;
- GList* rv;
-
- rv = NULL;
- if (base == NULL) {
- g_warning (_("*** The pkg list file contains no data! ***\n"));
- return NULL;
- }
-
- if (g_strcasecmp (base->name, "CATEGORIES") != 0) {
- g_print (_("*** Cannot find the CATEGORIES xmlnode! ***\n"));
- g_warning (_("*** Bailing from categories parse! ***\n"));
- return NULL;
- }
-
- category = base->xmlChildrenNode;
- if (category == NULL) {
- g_print (_("*** No Categories! ***\n"));
- g_warning (_("*** Bailing from category parse! ***\n"));
- return NULL;
- }
-
- while (category) {
- CategoryData* catdat;
-
- catdat = parse_category (category);
- rv = g_list_append (rv, catdat);
- category = category->next;
- }
-
- return rv;
-}
-
-GList*
-parse_memory_xml_package_list (const char *mem, int size)
-{
- xmlDocPtr doc;
- GList *list;
-
- g_return_val_if_fail (mem!=NULL, NULL);
-
- doc = xmlParseMemory ((char*)mem, size);
- if (doc == NULL) {
- xmlFreeDoc (doc);
- return NULL;
- }
-
- list = parse_shared (doc->root);
- xmlFreeDoc (doc);
- return list;
-}
-
-GList*
-parse_memory_transaction_file (const char *mem,
- int size)
-{
- xmlDocPtr doc;
- xmlNodePtr base;
- xmlNodePtr packages;
- GList* rv;
-
- g_return_val_if_fail (mem!=NULL, NULL);
-
- doc = xmlParseMemory ((char*)mem, size);
- rv = NULL;
- if (doc == NULL) {
- xmlFreeDoc (doc);
- return NULL;
- }
-
- base = doc->root;
- if (g_strcasecmp (base->name, "TRANSACTION")) {
- g_print (_("*** Cannot find the TRANSACTION xmlnode! ***\n"));
- xmlFreeDoc (doc);
- g_warning (_("*** Bailing from transaction parse! ***\n"));
- return NULL;
- }
-
- packages = doc->root->xmlChildrenNode->xmlChildrenNode;
- if(packages == NULL) {
- g_print (_("*** No packages! ***\n"));
- xmlFreeDoc (doc);
- g_warning (_("*** Bailing from transaction parse! ***\n"));
- return NULL;
- }
-
- while (packages) {
- PackageData *pack;
- pack = parse_package (packages, TRUE);
- rv = g_list_append (rv, pack);
- packages = packages->next;
- }
- return rv;
-}
-
-GList*
-parse_local_xml_package_list (const char* pkg_list_file, char **splash_text, char **finish_text)
-{
- xmlDocPtr doc;
- xmlNodePtr base, node;
- GList *list;
- CategoryData *catdat;
- char *text, *textp;
-
- g_return_val_if_fail (pkg_list_file != NULL, NULL);
-
- doc = xmlParseFile (pkg_list_file);
- list = NULL;
-
- if (doc == NULL) {
- fprintf (stderr, "*** Unable to open pkg list file %s\n", pkg_list_file);
- goto out;
- }
-
- base = doc->root;
- if (base == NULL) {
- g_print (_("*** No category nodes! ***"));
- goto out;
- }
- if (g_strcasecmp (base->name, "CATEGORIES") != 0) {
- g_print (_("*** Cannot find the CATEGORIES xmlnode! ***"));
- goto out;
- }
- node = base->xmlChildrenNode;
- list = NULL;
- while (node) {
- if (g_strcasecmp (node->name, "CATEGORY") == 0) {
- catdat = parse_category (node);
- list = g_list_append (list, catdat);
- } else if (g_strcasecmp (node->name, "SPLASH-TEXT") == 0) {
- if (splash_text != NULL) {
- text = xmlNodeGetContent (node);
- /* remove leading and trailing linefeeds (xml artifact) */
- while ((strlen (text) > 0) && (text[strlen (text) - 1] == '\n')) {
- text[strlen (text) - 1] = '\0';
- }
- for (textp = text; (*textp == '\n'); textp++)
- ;
- *splash_text = g_strdup (textp);
- free (text);
- }
- } else if (g_strcasecmp (node->name, "FINISH-TEXT") == 0) {
- if (finish_text != NULL) {
- text = xmlNodeGetContent (node);
- /* remove leading and trailing linefeeds (xml artifact) */
- while ((strlen (text) > 0) && (text[strlen (text) - 1] == '\n')) {
- text[strlen (text) - 1] = '\0';
- }
- for (textp = text; (*textp == '\n'); textp++)
- ;
- *finish_text = g_strdup (textp);
- free (text);
- }
- } else {
- g_print (_("*** Unknown node %s"), node->name);
- }
- node = node->next;
- }
-
-out:
- xmlFreeDoc (doc);
- return list;
-}
-
-gboolean
-generate_xml_package_list (const char* pkg_template_file,
- const char* target_file) {
-
-/* This function will accept a colon delimited list of packages and generate
- * an xml package list for eazel-install. The pkg_template_function should
- * be of the following format:
- *
- * category name : package name : version : minor : archtype : bytesize : summary
- *
- * Example:
- * Essential Packages:anaconda:7.0:1:i386:2722261:The redhat installer
- */
-
- xmlDocPtr doc;
- char* retbuf;
- int index;
- char** entry_array;
- char** package_array;
- char *tags[] = {"NAME", "VERSION", "MINOR", "ARCH", "BYTESIZE", "SUMMARY", NULL};
- int num_tags = 5;
- int lines;
- char *cur_category = g_strdup ("");
-
- doc = xmlNewDoc ("1.0");
- doc->root = xmlNewDocNode (doc, NULL, "CATEGORIES", NULL);
-
- lines = parse_pkg_template (pkg_template_file, &retbuf);
-
- if (lines) {
- entry_array = g_strsplit (retbuf, "\n", lines);
-
- for (index = 0; index < lines; index++) {
- if (entry_array[index] == NULL) {
- break;
- }
-
- package_array = g_strsplit (entry_array[index], ":", num_tags+1);
-
- if (package_array && package_array[0]) {
- xmlNodePtr packages;
- xmlNodePtr category;
- xmlNodePtr package;
- xmlNodePtr data;
- int i;
-
- /* FIXME: I added this to get rid of
- * an uninitialized variable warning,
- * but I think it's probably
- * wrong. (Darin)
- */
- packages = NULL;
-
- /* NOTE: This xmlGetProp leaks, since its return value
- is forgotten */
- if ((doc->root->xmlChildrenNode == NULL) ||
- (strlen (package_array[0]) && strcmp (cur_category, package_array[0]))) {
- g_free (cur_category);
- cur_category = g_strdup (package_array[0]);
- category = xmlNewChild (doc->root, NULL, "CATEGORY", NULL);
- xmlSetProp (category, "name", package_array[0]);
- packages = xmlNewChild (category, NULL, "PACKAGES", NULL);
- g_message ("Category %s...", cur_category);
- }
-
- package = xmlNewChild (packages, NULL, "PACKAGE", NULL);
-
- for (i = 0; i <= num_tags; i++) {
- if (package_array[i+1]) {
- data = xmlNewChild (package, NULL, tags[i], package_array[i+1]);
- } else {
- trilobite_debug ("line %d, tag %d (%s) is missing", index+1, i+1, tags[i]);
- }
- }
- g_strfreev (package_array);
- }
- }
- }
-
- if (doc == NULL) {
- g_warning (_("*** Error generating xml package list! ***\n"));
- xmlFreeDoc (doc);
- return FALSE;
- }
-
- /* Check for existing file and if, rename, trying to find a .x
- extension (x being a number) that isn't taken */
- if (!access (target_file, F_OK)) {
- char *new_name;
- int c;
- c = 0;
- new_name = NULL;
- do {
- g_free (new_name);
- c++;
- new_name = g_strdup_printf ("%s.%d", target_file, c);
- } while (!access (new_name, F_OK));
- rename (target_file, new_name);
- g_free (new_name);
- }
- xmlSaveFile (target_file, doc);
- xmlFreeDoc (doc);
- return TRUE;
-
-} /* end generate_xml_package_list */
-
-/**
- This just opens the specified file, read it and returns the number of lines
- and reads the contents into "result".
- */
-static int
-parse_pkg_template (const char* pkg_template_file, char **result) {
-
- FILE* input_file;
- char buffer[256];
- GString* string_data;
- int lines_read;
-
- g_assert (result!=NULL);
-
- string_data = g_string_new("");
- (*result) = NULL;
- lines_read = 0;
-
- input_file = fopen (pkg_template_file, "r");
-
- if (input_file == NULL) {
- g_warning (_("*** Error reading package list! ***\n"));
- return 0;
- }
-
- while (fgets (buffer, 255, input_file) != NULL) {
- lines_read++;
- g_string_append (string_data, buffer);
- }
-
- fclose (input_file);
-
- (*result) = g_strdup (string_data->str);
- g_string_free (string_data, TRUE);
-
- return lines_read;
-} /* end parse_pkg_template */
-
-/* Creates and returns an xmlnode for a packagedata struct.
- If given a droot and a title, uses that so create a subnode
- (primarily used for the recursiveness of PackageData objects.
- If not, creates a node with the name "PACKAGE" */
-static xmlNodePtr
-eazel_install_packagedata_to_xml_int (const PackageData *pack,
- char *title,
- xmlNodePtr droot,
- gboolean include_provides,
- GList **path)
-{
- xmlNodePtr root, node;
- char *tmp;
- GList *iterator;
-
- if (droot) {
- g_assert (title != NULL);
- root = xmlNewChild (droot, NULL, title, NULL);
- } else {
- root = xmlNewNode (NULL, "PACKAGE");
- }
-
- node = xmlNewChild (root, NULL, "NAME", pack->name);
- node = xmlNewChild (root, NULL, "VERSION", pack->version);
- node = xmlNewChild (root, NULL, "MINOR", pack->minor);
- node = xmlNewChild (root, NULL, "ARCH", pack->archtype);
- node = xmlNewChild (root, NULL, "SUMMARY", pack->summary);
- node = xmlNewChild (root, NULL, "DESCRIPTION", pack->description);
- node = xmlNewChild (root, NULL, "STATUS", packagedata_status_enum_to_str (pack->status));
- node = xmlNewChild (root, NULL, "MODSTATUS", packagedata_modstatus_enum_to_str (pack->modify_status));
-
- tmp = trilobite_get_distribution_name(pack->distribution, FALSE, FALSE);
- node = xmlNewChild (root, NULL, "DISTRIBUTION", tmp);
- g_free (tmp);
- if (pack->distribution.version_major!=-1) {
- tmp = g_strdup_printf ("%d", pack->distribution.version_major);
- xmlSetProp (node, "major", tmp);
- g_free (tmp);
- }
- if (pack->distribution.version_minor!=-1) {
- tmp = g_strdup_printf ("%d", pack->distribution.version_minor);
- xmlSetProp (node, "minor", tmp);
- g_free (tmp);
- }
-
- if (pack->bytesize==0) {
- node = xmlNewChild (root, NULL, "BYTESIZE", NULL);
- } else {
- tmp = g_strdup_printf ("%u", pack->bytesize);
- node = xmlNewChild (root, NULL, "BYTESIZE", tmp);
- g_free (tmp);
- }
-
- if (pack->filesize==0) {
- node = xmlNewChild (root, NULL, "FILESIZE", NULL);
- } else {
- tmp = g_strdup_printf ("%u", pack->filesize);
- node = xmlNewChild (root, NULL, "FILESIZE", tmp);
- g_free (tmp);
- }
-
- if (include_provides && pack->provides) {
- tmp = g_strdup ((char*)(pack->provides->data));
- for (iterator = g_list_next (pack->provides); iterator; iterator = g_list_next (iterator)) {
- char *fname = (char*)(iterator->data);
- char *tmp1;
- tmp1 = g_strdup_printf ("%s%c%s", tmp, G_SEARCHPATH_SEPARATOR, fname);
- g_free (tmp);
- tmp = tmp1;
- }
- node = xmlNewChild (root, NULL, "PROVIDES", tmp);
- }
-
- for (iterator = pack->depends; iterator; iterator = iterator->next) {
- if (g_list_find (*path, PACKAGEDEPENDENCY (iterator->data)->package) == NULL) {
- (*path) = g_list_prepend (*path, PACKAGEDEPENDENCY (iterator->data)->package);
- eazel_install_packagedata_to_xml_int (PACKAGEDEPENDENCY (iterator->data)->package,
- "DEPENDENCY",
- root,
- include_provides,
- path);
- (*path) = g_list_remove (*path, PACKAGEDEPENDENCY (iterator->data)->package);
- }
- }
- for (iterator = pack->modifies; iterator; iterator = iterator->next) {
- GList *subpath = NULL;
- eazel_install_packagedata_to_xml_int (PACKAGEDATA (iterator->data),
- "MODIFIES",
- root,
- include_provides,
- &subpath);
- }
-
- return root;
-}
-
-xmlNodePtr
-eazel_install_packagedata_to_xml (const PackageData *pack,
- gboolean include_provides)
-{
- GList *path = NULL;
-
- return eazel_install_packagedata_to_xml_int (pack, NULL, NULL, include_provides, &path);
-}
-
-xmlNodePtr
-eazel_install_packagelist_to_xml (GList *packages, gboolean include_provides)
-{
- xmlNodePtr node;
- GList *iterator;
-
- trilobite_debug ("eazel_install_packagelist_to_xml (%d packages)", g_list_length (packages));
- node = xmlNewNode (NULL, "PACKAGES");
- for (iterator = packages; iterator; iterator = iterator->next) {
- xmlAddChild (node,
- eazel_install_packagedata_to_xml (PACKAGEDATA (iterator->data),
- include_provides)
- );
- }
-
- return node;
-}
-
-xmlNodePtr
-eazel_install_categorydata_to_xml (const CategoryData *category)
-{
- xmlNodePtr node;
-
- node = xmlNewNode (NULL, "CATEGORY");
- xmlSetProp (node, "name", category->name);
- xmlAddChild (node, eazel_install_packagelist_to_xml (category->packages, TRUE));
-
- return node;
-}
-
-static PackageDependency *
-osd_parse_provides (PackageData *pack, xmlNodePtr node, GList **feature_list)
-{
- xmlNodePtr child;
- GList *list = NULL;
- PackageDependency *dep = NULL;
- char *tmp;
- gboolean got_package = FALSE;
-
- child = node->xmlChildrenNode;
- while (child) {
- if (g_strcasecmp (child->name, "FILE") == 0) {
- tmp = xmlNodeGetContent (child);
- list = g_list_prepend (list, g_strdup (tmp));
- xmlFree (tmp);
- } else if (g_strcasecmp (child->name, "PACKAGE") == 0) {
- if (got_package) {
- g_warning ("multiple packages in dep list for %s!", pack->name);
- } else {
- dep = packagedependency_new ();
- dep->version = trilobite_xml_get_string (child, "version");
- tmp = trilobite_xml_get_string (child, "sense");
- if (atoi (tmp) > 0) {
- /* old-style numeric "12" sense */
- dep->sense = eazel_softcat_convert_sense_flags (atoi (tmp));
- } else {
- /* new-style symbolic ">=" sense */
- dep->sense = eazel_softcat_string_to_sense_flags (tmp);
- }
- if (dep->sense == 0) {
- g_warning ("unreadable sense %s from softcat :(", tmp);
- }
- g_free (tmp);
- got_package = TRUE;
- }
- } else if (g_strcasecmp (child->name, "FEATURE") == 0) {
- tmp = xmlNodeGetContent (child);
- list = g_list_prepend (list, g_strdup (tmp));
- xmlFree (tmp);
- } else {
- trilobite_debug ("Unknown tag %s in xml", child->name);
- }
- child = child->next;
- }
-
- list = g_list_reverse (list);
- *feature_list = list;
- return dep;
-}
-
-static void
-osd_parse_dependency (PackageData *pack, xmlNodePtr node)
-{
- xmlNodePtr child;
- PackageData *softpack = NULL;
- PackageDependency *dep = NULL;
- GList *features = NULL;
-
- child = node->xmlChildrenNode;
- while (child) {
- if (g_strcasecmp (child->name, "PROVIDES") == 0) {
- dep = osd_parse_provides (pack, child, &features);
- } else if (g_strcasecmp (child->name, "SOFTPKG") == 0) {
- /* dependent softpkg */
- softpack = osd_parse_softpkg (child);
- } else {
- /* unparsed part of dependency */
- }
- child = child->next;
- }
-
- if (softpack != NULL) {
- if ((features != NULL) && (softpack->features == NULL)) {
- /* softcat sends separate PROVIDES and SOFTPKG: connect them */
- softpack->features = features;
- }
- if (dep == NULL) {
- dep = packagedependency_new ();
- }
- /* attach this package to a depends struct */
- pack->depends = g_list_prepend (pack->depends, dep);
- dep->package = softpack;
- } else if (features != NULL) {
- g_warning ("stranded PROVIDES block in the dependency info!");
- g_list_foreach (features, (GFunc)g_free, NULL);
- g_list_free (features);
- features = NULL;
- }
-}
-
-static void
-osd_parse_file_list (PackageData *pack, xmlNodePtr node)
-{
- xmlNodePtr child;
- char *tmp, *filename, *dir;
-
- child = node->xmlChildrenNode;
- while (child) {
- if (g_strcasecmp (child->name, "FILE") == 0) {
- tmp = xmlNodeGetContent (child);
- dir = trilobite_xml_get_string (child, "DIRECTORY");
- if (dir != NULL) {
- filename = g_strdup_printf ("%s/", tmp);
- g_free (dir);
- } else {
- filename = g_strdup (tmp);
- }
- xmlFree (tmp);
- pack->provides = g_list_prepend (pack->provides, filename);
- } else {
- /* bad : thing in file list that isn't a file */
- trilobite_debug ("XML file list contains %s (not FILE)", child->name);
- }
- child = child->next;
- }
- pack->provides = g_list_reverse (pack->provides);
-}
-
-static void
-osd_parse_feature_list (PackageData *pack, xmlNodePtr node)
-{
- xmlNodePtr child;
- char *tmp;
-
- child = node->xmlChildrenNode;
- while (child) {
- if (g_strcasecmp (child->name, "FEATURE") == 0) {
- tmp = xmlNodeGetContent (child);
- pack->features = g_list_prepend (pack->features, g_strdup (tmp));
- xmlFree (tmp);
- } else {
- trilobite_debug ("XML feature list contains %s (not FILE)", child->name);
- }
- child = child->next;
- }
- pack->features = g_list_reverse (pack->features);
-}
-
-static gboolean
-osd_parse_implementation (PackageData *pack,
- xmlNodePtr node)
-{
- xmlNodePtr child;
- char *tmp;
-
- child = node->xmlChildrenNode;
- while (child) {
- if (g_strcasecmp (child->name, "PROCESSOR")==0) {
- pack->archtype = trilobite_xml_get_string (child, "VALUE");
- } else if (g_strcasecmp (child->name, "OS")==0) {
- tmp = trilobite_xml_get_string (child, "VALUE");
- if (tmp) {
- pack->distribution.name = trilobite_get_distribution_enum (tmp,
- TRUE);
- g_free (tmp);
- }
- } else if (g_strcasecmp (child->name, "CODEBASE")==0) {
- char *tmp;
- pack->remote_url = trilobite_xml_get_string (child, "HREF");
- tmp = trilobite_xml_get_string (child, "SIZE");
- if (tmp != NULL) {
- pack->bytesize = strtoul (tmp, NULL, 10);
- g_free (tmp);
- } else {
- pack->bytesize = 0;
- }
- tmp = trilobite_xml_get_string (child, "RPM-SIZE");
- if (tmp != NULL) {
- pack->filesize = strtoul (tmp, NULL, 10);
- g_free (tmp);
- } else {
- pack->filesize = 0;
- }
- } else if (g_strcasecmp (child->name, "FILES") == 0) {
- /* oh boy... exhaustive file list */
- osd_parse_file_list (pack, child);
- } else if (g_strcasecmp (child->name, "FEATURES") == 0) {
- /* list of "features" (usually shared libs) in the toplevel package */
- osd_parse_feature_list (pack, child);
- } else if (g_strcasecmp (child->name, "DEPENDENCY")==0) {
- tmp = trilobite_xml_get_string (child, "ACTION");
- if (tmp != NULL) {
- if (strcasecmp (tmp, "Install") == 0) {
- osd_parse_dependency (pack, child);
- } else if (strcasecmp (tmp, "Unresolved") == 0) {
- g_warning ("Unresolved dependencies! Get Adam on the bat-phone!");
- return FALSE;
- } else {
- g_warning ("Unknown ACTION: '%s'", tmp);
- }
- }
- } else {
- /* trilobite_debug ("unparsed tag \"%s\" in IMPLEMENTATION", child->name); */
- }
- child = child->next;
- }
-
- return TRUE;
-}
-
-static PackageData*
-osd_parse_softpkg (xmlNodePtr softpkg)
-{
- PackageData *result;
- xmlNodePtr child;
- char *tmp;
-
- result = packagedata_new ();
-
- result->name = trilobite_xml_get_string (softpkg, "NAME");
- result->version = trilobite_xml_get_string (softpkg, "VERSION");
- result->minor = trilobite_xml_get_string (softpkg, "REVISION");
- result->md5 = trilobite_xml_get_string (softpkg, "MD5");
-
- child = softpkg->xmlChildrenNode;
- while (child) {
- if (g_strcasecmp (child->name, "ABSTRACT")==0) {
- tmp = xmlNodeGetContent (child);
- result->summary = g_strdup (tmp);
- while ((strlen (result->summary) > 0) &&
- (result->summary[strlen (result->summary)-1] <= ' ')) {
- result->summary[strlen (result->summary)-1] = '\0';
- }
- xmlFree (tmp);
- } else if (g_strcasecmp (child->name, "IMPLEMENTATION")==0) {
- if (osd_parse_implementation (result, child) == FALSE) {
- gtk_object_unref (GTK_OBJECT (result));
- return NULL;
- }
- } else if (g_strcasecmp (child->name, "EAZEL_ID") == 0) {
- result->eazel_id = trilobite_xml_get_string (child, "VALUE");
- } else {
- /* trilobite_debug ("unparsed tag \"%s\" in SOFTPKG", child->name); */
- }
- child = child->next;
- }
-
- return result;
-}
-
-static GList *
-osd_parse_shared (xmlDocPtr doc, char **db_revision)
-{
- GList *result;
- xmlNodePtr base, child;
-
- result = NULL;
- *db_revision = NULL;
-
- base = doc->root;
- if (base == NULL) {
- g_warning (_("*** The osd xml contains no data! ***\n"));
- return result;
- }
-
- if (g_strcasecmp (base->name, "PACKAGES") != 0) {
- g_warning (_("*** Bailing from osd parse! ***\n"));
- return result;
- }
-
- child = base->xmlChildrenNode;
- while (child) {
- if (g_strcasecmp (child->name, "SOFTPKG") == 0) {
- PackageData *pack;
- pack = osd_parse_softpkg (child);
- if (pack) {
- result = g_list_prepend (result, pack);
- } else {
- trilobite_debug ("SOFTPKG parse failed");
- }
- } else if (g_strcasecmp (child->name, "DB_CONTROL") == 0) {
- if (*db_revision != NULL) {
- g_warning ("weird: softcat has multiple DB versions simultaneously");
- g_free (*db_revision);
- }
- *db_revision = trilobite_xml_get_string (child, "VALUE");
- if ((*db_revision != NULL) && (strlen (*db_revision) == 0)) {
- /* empty revision of "" should just be dropped */
- g_free (*db_revision);
- *db_revision = NULL;
- } else {
- trilobite_debug ("(softcat db revision %s)", *db_revision);
- }
- } else {
- trilobite_debug ("child is not a SOFTPKG, but a \"%s\"", child->name);
- }
- child = child->next;
- }
-
- return result;
-}
-
-/* returns FALSE if the XML was all horked */
-gboolean
-eazel_install_packagelist_parse (GList **list, const char *mem, int size, char **db_revision)
-{
- xmlDocPtr doc;
- char *ptr, *docptr, *end;
- char *nextnl, *cur;
-
- *list = NULL;
- if (mem == NULL) {
- return FALSE;
- }
-
- docptr = g_malloc (size+1);
- memcpy (docptr, mem, size);
- docptr [size] = 0;
-
- /* (grumble grumble) softcat puts <XMP> crap around the doc sometimes */
- /* and also, libxml is very intolerant of whitespace */
- ptr = docptr;
- while ((size > 2) && ((ptr[0] != '<') || (ptr[1] != '?'))) {
- ptr++;
- size--;
- }
- end = ptr + size - 1;
- while ((size > 10) &&
- ((*end <= ' ') || (strcasecmp (end-5, "</xmp>") == 0))) {
- if (*end <= ' ') {
- *end-- = '\0';
- size--;
- } else {
- end -= 6;
- size -= 6;
- end[1] = '\0';
- }
- }
-
- doc = xmlParseMemory (ptr, size);
-
- if (doc == NULL) {
- g_warning (_("Could not parse the xml (length %d)"), size);
- for (cur = ptr; (nextnl = strchr (cur, '\n')) != NULL; ) {
- *nextnl = '\0';
- trilobite_debug ("XML: %s", cur);
- cur = nextnl + 1;
- }
- g_free (docptr);
- return FALSE;
- }
-
- *list = osd_parse_shared (doc, db_revision);
-
- xmlFreeDoc (doc);
- g_free (docptr);
- return TRUE;
-}
diff --git a/components/services/install/lib/eazel-install-xml-package-list.h b/components/services/install/lib/eazel-install-xml-package-list.h
deleted file mode 100644
index 5f7967f03..000000000
--- a/components/services/install/lib/eazel-install-xml-package-list.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Copyright (C) 2000 Eazel, Inc
- * Copyright (C) 2000 Helix Code, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: J Shane Culpepper <pepper@eazel.com>
- * Joe Shaw <joe@helixcode.com>
- */
-
-/* eazel-install - services command line install/update/uninstall
- * component. This program will parse the eazel-services-config.xml
- * file and install a services generated package-list.xml.
- */
-
-#ifndef EAZEL_INSTALL_XML_PACKAGE_LIST_H
-#define EAZEL_INSTALL_XML_PACKAGE_LIST_H
-
-#include "eazel-package-system-types.h"
-#include <gnome-xml/tree.h>
-
-GList* parse_memory_xml_package_list (const char *mem, int size);
-GList* parse_local_xml_package_list (const char* pkg_list_file, char **splash_text, char **finish_text);
-GList* parse_memory_transaction_file (const char *mem, int size);
-
-void free_categories (GList* categories);
-gboolean generate_xml_package_list (const char* pkg_template_file,
- const char* target_file);
-
-xmlNodePtr eazel_install_packagedata_to_xml (const PackageData *pack, gboolean include_provides);
-xmlNodePtr eazel_install_packagelist_to_xml (GList *packages, gboolean include_provides);
-xmlNodePtr eazel_install_categorydata_to_xml (const CategoryData *category);
-
-gboolean eazel_install_packagelist_parse (GList **list, const char *mem, int size, char **db_revision);
-
-#endif /* EAZEL_INSTALL_XML_PACKAGE_LIST_H */
diff --git a/components/services/install/lib/eazel-package-system-dpkg.c b/components/services/install/lib/eazel-package-system-dpkg.c
deleted file mode 100644
index 6329c709a..000000000
--- a/components/services/install/lib/eazel-package-system-dpkg.c
+++ /dev/null
@@ -1,497 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: Eskil Heyn Olsen <eskil@eazel.com>
- * Ian McKellar <ian@eazel.com>
- *
- */
-
-#include <config.h>
-#include <gnome.h>
-#include "eazel-package-system-dpkg.h"
-#include "eazel-package-system-private.h"
-#include <libtrilobite/trilobite-core-utils.h>
-#include <ctype.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-
-#define MAX_LINE_LEN 4096
-#define ROOT "su -c "
-#define DPKG_STATUS_FILE "/var/lib/dpkg/status"
-
-typedef struct {
- char *name;
- char *version;
- char *minor;
- char *archtype;
-
- char *summary;
- char *description;
-
- char *status;
-} DebPackage;
-
-typedef gboolean (*PackageParseCallback) (const DebPackage *package,
- gpointer data);
-
-EazelPackageSystem* eazel_package_system_implementation (GList*);
-
-/* This is the parent class pointer */
-static EazelPackageSystemClass *eazel_package_system_dpkg_parent_class;
-
-static void
-debpackage_free (DebPackage *package)
-{
- g_free (package->name);
- g_free (package->version);
- g_free (package->minor);
- g_free (package->archtype);
- g_free (package->summary);
- g_free (package->description);
- g_free (package->status);
- g_free (package);
-}
-
-static void
-debpackage_fill_packagedata (const DebPackage *dpkg,
- PackageData *pdata)
-{
- g_return_if_fail (dpkg != NULL);
- g_return_if_fail (pdata != NULL);
-
- if (dpkg->name) {
- pdata->name = g_strdup (dpkg->name);
- }
- if (dpkg->version) {
- pdata->version = g_strdup (dpkg->version);
- }
- if (dpkg->minor) {
- pdata->minor = g_strdup (dpkg->minor);
- }
- if (dpkg->archtype) {
- pdata->archtype = g_strdup (dpkg->archtype);
- }
- if (dpkg->summary) {
- pdata->summary = g_strdup (dpkg->summary);
- }
- if (dpkg->description) {
- pdata->description = g_strdup (dpkg->description);
- }
-
- /* FIXME is there an equivalent of status? */
-}
-
-static void
-strip_trailing_whitespace (char *string)
-{
- int i = strlen (string)-1;
-
- while ( (i>=0) && isspace(string[i])) {
- string[i] = '\0';
- i--;
- }
-}
-
-
-static void
-parse_packages (FILE *packages_file,
- PackageParseCallback cb,
- gpointer user_data)
-{
- char line[MAX_LINE_LEN+1];
- char *value;
- char **previous = NULL;
- DebPackage *package;
-
- g_return_if_fail (packages_file != NULL);
-
- package = g_new0 (DebPackage, 1);
-
- while (!feof (packages_file) && !ferror (packages_file)) {
- fgets (line, MAX_LINE_LEN, packages_file);
- strip_trailing_whitespace (line);
- //g_print ("line: %s\n", line);
-
- if (isspace (line[0])) {
- /* continuation */
- if (previous) {
- char *tmp1, *tmp2 = *previous;
-
- //g_print("continuing line...\n");
- tmp1 = g_strconcat (tmp2, "\n", line+1, NULL);
- g_free (tmp2);
- *previous = tmp1;
- }
- continue;
- }
-
- value = strchr (line, ':');
-
- if (value == NULL) {
- /* found start of new package */
- (cb)(package, user_data); /*check return? FIXME*/
- debpackage_free (package);
- package = g_new0 (DebPackage, 1);
- previous = NULL;
- continue;
- }
-
- *value = '\0';
- value++;
- while (isspace (*value)) {
- *value = '\0';
- value++;
- }
-
- previous = NULL;
-
- if (!strcmp (line, "Package")) {
- package->name = g_strdup (value);
- previous = &package->name;
- } else if (!strcmp (line, "Version")) {
- /* FIXME: is this the defn of minor */
- char *minor = strrchr (line, '-');
-
- if (minor) {
- *minor = '\0';
- minor++;
- package->minor = g_strdup (value);
- }
- package->version = g_strdup (value);
- previous = &package->version;
- } else if (!strcmp (line, "Architecture")) {
- package->archtype = g_strdup (value);
- previous = &package->archtype;
- } else if (!strcmp (line, "Description")) {
- package->summary = g_strdup (value);
- package->description = g_strdup (value);
- previous = &package->description;
- } else if (!strcmp (line, "Status")) {
- package->status = g_strdup (value);
- previous = &package->status;
- } else {
- //g_print ("Ignoring [%s][%s]\n", line, value);
- }
- }
- (cb)(package, user_data);
- debpackage_free (package);
-}
-
-static gboolean
-load_package_callback (const DebPackage *package,
- gpointer data)
-{
- PackageData *pdata = data;
-
- //g_print ("cb: %s\n", package->name);
- //g_print ("cb desc: %s\n", package->description);
- debpackage_fill_packagedata (package, pdata);
- return TRUE;
-}
-
-static PackageData*
-eazel_package_system_dpkg_load_package (EazelPackageSystemDpkg *system,
- PackageData *in_package,
- const char *filename,
- int detail_level)
-{
- PackageData *result = in_package;
- char *dpkg_cmd;
- FILE *dpkg_file;
-
- g_assert (system != NULL);
- g_assert (EAZEL_IS_PACKAGE_SYSTEM_DPKG (system));
- trilobite_debug ("eazel_package_system_dpkg_load_package");
-
- dpkg_cmd = g_strdup_printf ("dpkg --field %s", filename);
- dpkg_file = popen (dpkg_cmd, "r");
- if (dpkg_file == NULL) {
- g_warning ("failed to run `%s'", dpkg_cmd);
- }
- g_free (dpkg_cmd);
-
- if (result == NULL) {
- result = packagedata_new ();
- }
-
- parse_packages (dpkg_file, load_package_callback, result);
-
- result->filename = g_strdup (filename);
-
- pclose (dpkg_file);
-
- return result;
-}
-
-struct QueryData {
- gpointer key;
- EazelPackageSystemQueryEnum flag;
- GList *packages;
-};
-
-static gboolean
-query_callback (const DebPackage *package,
- gpointer data)
-{
- struct QueryData *query_data = data;
- PackageData *pd;
-
- //g_print ("cb: %s\n", package->name);
-
- if ( (package->status == NULL) ||
- strcmp (package->status, "install ok installed")) {
- /* hmm - not actually installed */
- //g_print ("cb discarding\n");
- return TRUE;
- }
- //g_print ("cb keeping\n");
-
- /* FIXME: umm - actually check that it matches */
-
- pd = packagedata_new ();
- debpackage_fill_packagedata (package, pd);
- query_data->packages = g_list_append (query_data->packages, pd);
- return TRUE;
-}
-
-static GList*
-eazel_package_system_dpkg_query (EazelPackageSystemDpkg *system,
- const char *dbpath,
- const gpointer key,
- EazelPackageSystemQueryEnum flag,
- int detail_level)
-{
- struct QueryData query_data;
- FILE *status;
-
- g_assert (system != NULL);
- g_assert (EAZEL_IS_PACKAGE_SYSTEM_DPKG (system));
- trilobite_debug ("eazel_package_system_dpkg_query");
-
- query_data.key = key;
- query_data.flag = flag;
- query_data.packages = NULL;
-
- /* FIMXE: lock db! */
-
- status = fopen (DPKG_STATUS_FILE, "rt");
-
- if (status == NULL) return NULL;
-
- parse_packages (status, query_callback, &query_data);
-
- fclose (status);
-
- return query_data.packages;
-}
-
-static void
-eazel_package_system_dpkg_install (EazelPackageSystemDpkg *epsystem,
- const char *dbpath,
- GList* packages,
- unsigned long flags)
-{
- char *dpkg_cmd;
- int result;
- PackageData *pdata;
-
- g_assert (epsystem != NULL);
- g_assert (EAZEL_IS_PACKAGE_SYSTEM_DPKG (epsystem));
- trilobite_debug ("eazel_package_system_dpkg_install");
- /* Code Here */
-
- while (packages) {
- pdata = (PackageData *)packages->data;
-
- dpkg_cmd = g_strdup_printf (ROOT "dpkg --unpack %s",
- pdata->filename);
- result = system (dpkg_cmd);
- g_free (dpkg_cmd);
-
- /* FIXME: erm - perhaps pop up some kind of zvt???? */
- dpkg_cmd = g_strdup_printf (ROOT "dpkg --configure %s",
- pdata->name);
- result = system (dpkg_cmd);
- g_free (dpkg_cmd);
- g_free (dpkg_cmd);
-
- packages = packages->next;
- }
-
-}
-
-static void
-eazel_package_system_dpkg_uninstall (EazelPackageSystemDpkg *system,
- const char *dbpath,
- GList* packages,
- unsigned long flags)
-{
- g_assert (system != NULL);
- g_assert (EAZEL_IS_PACKAGE_SYSTEM_DPKG (system));
- trilobite_debug ("eazel_package_system_dpkg_uninstall");
- /* Code Here */
-}
-
-static void
-eazel_package_system_dpkg_verify (EazelPackageSystemDpkg *system,
- GList* packages)
-{
- g_assert (system != NULL);
- g_assert (EAZEL_IS_PACKAGE_SYSTEM_DPKG (system));
- trilobite_debug ("eazel_package_system_dpkg_verify");
- /* Code Here */
-}
-
-static int
-eazel_package_system_dpkg_compare_version (EazelPackageSystemDpkg *system,
- const char *a,
- const char *b)
-{
- g_assert (system != NULL);
- g_assert (EAZEL_IS_PACKAGE_SYSTEM_DPKG (system));
- trilobite_debug ("eazel_package_system_dpkg_compare_version");
- /* Code Here */
- return 0;
-}
-
-
-/************************************
- Database mtime implementation
-************************************/
-static time_t
-eazel_package_system_dpkg_database_mtime (EazelPackageSystemDpkg *system)
-{
- struct stat st;
-
- if (stat (DPKG_STATUS_FILE, &st) == 0) {
- return st.st_mtime;
- } else {
- return (time_t)0;
- }
-
-
-}
-
-/*****************************************
- GTK+ object stuff
-*****************************************/
-
-static void
-eazel_package_system_dpkg_finalize (GtkObject *object)
-{
- EazelPackageSystemDpkg *system;
-
- g_return_if_fail (object != NULL);
- g_return_if_fail (EAZEL_PACKAGE_SYSTEM_DPKG (object));
-
- system = EAZEL_PACKAGE_SYSTEM_DPKG (object);
-
- if (GTK_OBJECT_CLASS (eazel_package_system_dpkg_parent_class)->finalize) {
- GTK_OBJECT_CLASS (eazel_package_system_dpkg_parent_class)->finalize (object);
- }
-}
-
-static void
-eazel_package_system_dpkg_class_initialize (EazelPackageSystemDpkgClass *klass)
-{
- GtkObjectClass *object_class;
-
- object_class = (GtkObjectClass*)klass;
- object_class->finalize = eazel_package_system_dpkg_finalize;
-
- eazel_package_system_dpkg_parent_class = gtk_type_class (eazel_package_system_get_type ());
-}
-
-static void
-eazel_package_system_dpkg_initialize (EazelPackageSystemDpkg *system) {
- g_assert (system != NULL);
- g_assert (EAZEL_IS_PACKAGE_SYSTEM_DPKG (system));
-}
-
-GtkType
-eazel_package_system_dpkg_get_type() {
- static GtkType system_type = 0;
-
- /* First time it's called ? */
- if (!system_type)
- {
- static const GtkTypeInfo system_info =
- {
- "EazelPackageSystemDpkg",
- sizeof (EazelPackageSystemDpkg),
- sizeof (EazelPackageSystemDpkgClass),
- (GtkClassInitFunc) eazel_package_system_dpkg_class_initialize,
- (GtkObjectInitFunc) eazel_package_system_dpkg_initialize,
- /* reserved_1 */ NULL,
- /* reserved_2 */ NULL,
- (GtkClassInitFunc) NULL,
- };
-
- system_type = gtk_type_unique (eazel_package_system_get_type (), &system_info);
- }
-
- return system_type;
-}
-
-EazelPackageSystemDpkg *
-eazel_package_system_dpkg_new (GList *dbpaths)
-{
- EazelPackageSystemDpkg *system;
-
- system = EAZEL_PACKAGE_SYSTEM_DPKG (gtk_object_new (TYPE_EAZEL_PACKAGE_SYSTEM_DPKG, NULL));
-
- gtk_object_ref (GTK_OBJECT (system));
- gtk_object_sink (GTK_OBJECT (system));
-
- return system;
-}
-
-EazelPackageSystem*
-eazel_package_system_implementation (GList *dbpaths)
-{
- EazelPackageSystem *result;
-
- trilobite_debug ("eazel_package_system_implementation (dpkg)");
-
- result = EAZEL_PACKAGE_SYSTEM (eazel_package_system_dpkg_new (dbpaths));
-
- result->private->load_package
- = (EazelPackageSytemLoadPackageFunc)eazel_package_system_dpkg_load_package;
-
- result->private->query
- = (EazelPackageSytemQueryFunc)eazel_package_system_dpkg_query;
-
- result->private->install
- = (EazelPackageSytemInstallFunc)eazel_package_system_dpkg_install;
-
- result->private->uninstall
- = (EazelPackageSytemUninstallFunc)eazel_package_system_dpkg_uninstall;
-
- result->private->verify
- = (EazelPackageSytemVerifyFunc)eazel_package_system_dpkg_verify;
-
- result->private->compare_version
- = (EazelPackageSystemCompareVersionFunc)eazel_package_system_dpkg_compare_version;
-
- result->private->database_mtime
- = (EazelPackageSystemDatabaseMtimeFunc)eazel_package_system_dpkg_database_mtime;
-
- return result;
-}
diff --git a/components/services/install/lib/eazel-package-system-dpkg.h b/components/services/install/lib/eazel-package-system-dpkg.h
deleted file mode 100644
index f55fb5074..000000000
--- a/components/services/install/lib/eazel-package-system-dpkg.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: Eskil Heyn Olsen <eskil@eazel.com>
- * Ian McKellar <ian@eazel.com>
- *
- */
-
-#ifndef EAZEL_PACKAGE_SYSTEM_DPKG_H
-#define EAZEL_PACKAGE_SYSTEM_DPKG_H
-
-#include "eazel-package-system.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-#define TYPE_EAZEL_PACKAGE_SYSTEM_DPKG (eazel_package_system_dpkg_get_type ())
-#define EAZEL_PACKAGE_SYSTEM_DPKG(obj) (GTK_CHECK_CAST ((obj), TYPE_EAZEL_PACKAGE_SYSTEM_DPKG, EazelPackageSystemDpkg))
-#define EAZEL_PACKAGE_SYSTEM_DPKG_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), TYPE_EAZEL_PACKAGE_SYSTEM_DPKG, EazelPackageSystemDpkgClass))
-#define EAZEL_IS_PACKAGE_SYSTEM_DPKG(obj) (GTK_CHECK_TYPE ((obj), TYPE_EAZEL_PACKAGE_SYSTEM_DPKG))
-#define EAZEL_IS_PACKAGE_SYSTEM_DPKG_CLASS(klass)(GTK_CHECK_CLASS_TYPE ((klass), TYPE_EAZEL_PACKAGE_SYSTEM_DPKG))
-
-typedef struct _EazelPackageSystemDpkg EazelPackageSystemDpkg;
-typedef struct _EazelPackageSystemDpkgClass EazelPackageSystemDpkgClass;
-
-
-struct _EazelPackageSystemDpkgClass
-{
- EazelPackageSystemClass parent_class;
-};
-
-struct _EazelPackageSystemDpkg
-{
- EazelPackageSystem parent;
-};
-
-EazelPackageSystemDpkg *eazel_package_system_dpkg_new (GList *dbpaths);
-GtkType eazel_package_system_dpkg_get_type (void);
-
-#endif /* EAZEL_PACKAGE_SYSTEM_DPKG_H */
-
diff --git a/components/services/install/lib/eazel-package-system-private.h b/components/services/install/lib/eazel-package-system-private.h
deleted file mode 100644
index b1f62642d..000000000
--- a/components/services/install/lib/eazel-package-system-private.h
+++ /dev/null
@@ -1,109 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: Eskil Heyn Olsen <eskil@eazel.com>
- *
- */
-
-#ifndef EAZEL_PACKAGE_SYSTEM_PRIVATE_H
-#define EAZEL_PACKAGE_SYSTEM_PRIVATE_H
-
-#include "eazel-package-system.h"
-
-#define EAZEL_PACKAGE_SYSTEM_PROGRESS_LONGS 6
-
-#define EPS_SANE(val) g_return_if_fail (val!=NULL); \
- g_return_if_fail (EAZEL_IS_PACKAGE_SYSTEM (val)); \
- g_return_if_fail (val->private);
-
-#define EPS_SANE_VAL(val, v) g_return_val_if_fail (val!=NULL, v); \
- g_return_val_if_fail (EAZEL_IS_PACKAGE_SYSTEM (val), v); \
- g_return_val_if_fail (val->private, v);
-
-#define EPS_API(val) g_assert (val!=NULL); g_assert (EAZEL_IS_PACKAGE_SYSTEM (val)); g_assert (val->private);
-
-#define info(system, s...) if (eazel_package_system_get_debug (EAZEL_PACKAGE_SYSTEM (system)) & EAZEL_PACKAGE_SYSTEM_DEBUG_INFO) { trilobite_debug (s); }
-#define fail(system, s...) if (eazel_package_system_get_debug (EAZEL_PACKAGE_SYSTEM (system)) & EAZEL_PACKAGE_SYSTEM_DEBUG_FAIL) { trilobite_debug (s); }
-#define verbose(system, s...) if (eazel_package_system_get_debug (EAZEL_PACKAGE_SYSTEM (system)) & EAZEL_PACKAGE_SYSTEM_DEBUG_VERBOSE) { trilobite_debug (s); }
-
-typedef EazelPackageSystem*(*EazelPackageSystemConstructorFunc) (GList*);
-
-typedef PackageData* (*EazelPackageSytemLoadPackageFunc) (EazelPackageSystem*,
- PackageData*,
- const char*,
- int);
-typedef GList* (*EazelPackageSytemQueryFunc) (EazelPackageSystem*,
- const char*,
- gpointer key,
- EazelPackageSystemQueryEnum,
- int);
-typedef void (*EazelPackageSytemInstallFunc) (EazelPackageSystem*,
- const char*,
- GList*,
- unsigned long);
-typedef void (*EazelPackageSytemUninstallFunc) (EazelPackageSystem*,
- const char *,
- GList*,
- unsigned long);
-typedef gboolean (*EazelPackageSytemVerifyFunc) (EazelPackageSystem*,
- const char*,
- GList*);
-typedef int (*EazelPackageSystemCompareVersionFunc) (EazelPackageSystem*,
- const char *,
- const char *);
-typedef time_t (*EazelPackageSystemDatabaseMtimeFunc) (EazelPackageSystem*);
-
-struct _EazelPackageSystemPrivate {
- EazelPackageSytemLoadPackageFunc load_package;
- EazelPackageSytemQueryFunc query;
- EazelPackageSytemInstallFunc install;
- EazelPackageSytemUninstallFunc uninstall;
- EazelPackageSytemVerifyFunc verify;
- EazelPackageSystemCompareVersionFunc compare_version;
- EazelPackageSystemDatabaseMtimeFunc database_mtime;
-
- EazelPackageSystemDebug debug;
-};
-
-EazelPackageSystem *eazel_package_system_new_real (void);
-
-gboolean eazel_package_system_emit_start (EazelPackageSystem*,
- EazelPackageSystemOperation,
- const PackageData*);
-gboolean eazel_package_system_emit_progress (EazelPackageSystem*,
- EazelPackageSystemOperation,
- const PackageData*,
- unsigned long[EAZEL_PACKAGE_SYSTEM_PROGRESS_LONGS]);
-gboolean eazel_package_system_emit_failed (EazelPackageSystem*,
- EazelPackageSystemOperation,
- const PackageData*);
-gboolean eazel_package_system_emit_end (EazelPackageSystem*,
- EazelPackageSystemOperation,
- const PackageData*);
-
-void eazel_package_system_marshal_BOOL__ENUM_POINTER (GtkObject *object,
- GtkSignalFunc func,
- gpointer func_data,
- GtkArg *args);
-void eazel_package_system_marshal_BOOL__ENUM_POINTER_POINTER (GtkObject *object,
- GtkSignalFunc func,
- gpointer func_data,
- GtkArg *args);
-
-#endif /* EAZEL_PACKAGE_SYSTEM_PRIVATE_H */
diff --git a/components/services/install/lib/eazel-package-system-rpm3-private.h b/components/services/install/lib/eazel-package-system-rpm3-private.h
deleted file mode 100644
index 8766c3cb2..000000000
--- a/components/services/install/lib/eazel-package-system-rpm3-private.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: Eskil Heyn Olsen <eskil@eazel.com>
- *
- */
-
-#ifndef EAZEL_PACKAGE_SYSTEM_RPM3_PRIVATE_H
-#define EAZEL_PACKAGE_SYSTEM_RPM3_PRIVATE_H
-
-#include "eazel-package-system-rpm3.h"
-#include <rpm/rpmlib.h>
-
-gboolean eazel_package_system_rpm3_open_dbs (EazelPackageSystemRpm3 *system);
-gboolean eazel_package_system_rpm3_close_dbs (EazelPackageSystemRpm3 *system);
-gboolean eazel_package_system_rpm3_free_dbs (EazelPackageSystemRpm3 *system);
-void eazel_package_system_rpm3_create_dbs (EazelPackageSystemRpm3 *system, GList*);
-void eazel_package_system_rpm3_packagedata_fill_from_header (EazelPackageSystemRpm3 *system,
- PackageData *pack,
- Header hd,
- int detail_level);
-rpmdb eazel_package_system_rpm3_get_db (EazelPackageSystemRpm3 *system,
- const char *dbpath);
-void eazel_package_system_rpm3_get_and_set_string_tag (Header hd,
- int tag,
- char **str);
-
-PackageData* eazel_package_system_rpm3_load_package (EazelPackageSystemRpm3 *system,
- PackageData *in_package,
- const char *filename,
- int detail_level);
-void eazel_package_system_rpm3_install (EazelPackageSystemRpm3 *system,
- const char *dbpath,
- GList* packages,
- unsigned long flags);
-void eazel_package_system_rpm3_uninstall (EazelPackageSystemRpm3 *system,
- const char *dbpath,
- GList* packages,
- unsigned long flags);
-gboolean eazel_package_system_rpm3_verify (EazelPackageSystemRpm3 *system,
- const char *dbpath,
- GList* packages);
-
-int eazel_package_system_rpm3_compare_version (EazelPackageSystem *system,
- const char *a,
- const char *b);
-
-GList* eazel_package_system_rpm3_query (EazelPackageSystemRpm3 *system,
- const char *dbpath,
- const gpointer key,
- EazelPackageSystemQueryEnum flag,
- int detail_level);
-
-void eazel_package_system_rpm3_query_requires (EazelPackageSystemRpm3 *system,
- const char *dbpath,
- const gpointer *key,
- int detail_level,
- GList **result);
-void eazel_package_system_rpm3_query_requires_feature (EazelPackageSystemRpm3 *system,
- const char *dbpath,
- const gpointer *key,
- int detail_level,
- GList **result);
-time_t eazel_package_system_rpm3_database_mtime (EazelPackageSystemRpm3 *system);
-
-struct RpmQueryPiggyBag {
- EazelPackageSystemRpm3 *system;
- gpointer key;
- EazelPackageSystemQueryEnum flag;
- int detail_level;
- GList **result;
-};
-
-struct _EazelPackageSystemRpm3Private
-{
- GList *dbpaths; /* GList*< pair < char *dbpath, char *root> > */
- GHashTable *db_to_root;
- GHashTable *dbs;
-
-};
-
-#endif /* EAZEL_PACKAGE_SYSTEM_RPM3_PRIVATE_H */
diff --git a/components/services/install/lib/eazel-package-system-rpm3.c b/components/services/install/lib/eazel-package-system-rpm3.c
deleted file mode 100644
index 71ffec005..000000000
--- a/components/services/install/lib/eazel-package-system-rpm3.c
+++ /dev/null
@@ -1,2056 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: Eskil Heyn Olsen <eskil@eazel.com>
- *
- */
-
-/*
- IMPLEMENTATION NOTE:
-
- Originally, the rpm3 package system module would open the dbs
- in _new, and close the in _finalize. Addtionally, it would
- close before any rpm spawning and reopen afterwards. This
- close/reopen was needed since rpm needs exclusive lock on
- the db files.
-
- However, since I now also use the packagesystem object in
- rpmview/packageview, that meant I would keep the db system
- open when installing, thus the install would fail, since
- the view had a open fd on the db's.
-
- So now, before any operation, I open the db's and close
- afterwards. This sucks pretty much, since eg. during file conflicts
- checking in libeazelinstall, I execute potientially several hundred
- queries in a row - and each query opens/closes the db's. Blech.
-
-*/
-
-#include <config.h>
-
-#ifdef HAVE_RPM
-
-#ifdef HAVE_RPM_30
-#define A_DB_FILE "packages.rpm"
-#elif HAVE_RPM_40
-#define A_DB_FILE "Packages"
-#endif
-
-#ifndef A_DB_FILE
-#error Unknown DB system
-#endif
-
-#include <glib.h>
-#include <gtk/gtk.h>
-#include <string.h>
-#include <locale.h>
-#include "eazel-package-system-rpm3-private.h"
-#include "eazel-package-system-private.h"
-#include <libtrilobite/trilobite-core-utils.h>
-#include <libtrilobite/trilobite-i18n.h>
-
-#include <rpm/rpmlib.h>
-#include <rpm/rpmmacro.h>
-#include <rpm/misc.h>
-
-#include <ctype.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-
-#include <locale.h>
-
-#include <libtrilobite/trilobite-root-helper.h>
-
-#define DEFAULT_DB_PATH "/var/lib/rpm"
-#define DEFAULT_ROOT "/"
-
-#define USE_PERCENT
-
-EazelPackageSystem* eazel_package_system_implementation (GList*);
-
-/* This is the parent class pointer */
-static EazelPackageSystemClass *eazel_package_system_rpm3_parent_class;
-
-/************************************************************
-*************************************************************/
-
-#define PERCENTS_PER_RPM_HASH 2
-
-struct RpmMonitorPiggyBag {
- EazelPackageSystemRpm3 *system;
- EazelPackageSystemOperation op;
-
- unsigned long packages_installed, total_packages;
- unsigned long bytes_installed, total_bytes;
-
- GList *packages_to_expect;
- GList *packages_seen;
-
-#ifdef USE_PERCENT
- char separator;
- char line[80];
- /* state 1 waiting for package name
- 2 waiting for %%
- 3 reading percentages
- */
- int state;
- int bytes_read_in_line;
- char *package_name;
-#else
- GString *package_name;
-#endif
- PackageData *pack;
- double pct;
-
- GHashTable *name_to_package;
-
- volatile gboolean subcommand_running;
-};
-
-static struct RpmMonitorPiggyBag
-rpmmonitorpiggybag_new (EazelPackageSystemRpm3 *system,
- EazelPackageSystemOperation op)
-{
- struct RpmMonitorPiggyBag pig;
-#ifdef USE_PERCENT
- struct lconv *lc;
-#endif
-
-#ifdef USE_PERCENT
- lc = localeconv ();
- pig.separator = *(lc->decimal_point);
- info (system, "decimal separator is '%c'", pig.separator);
- pig.state = 1;
- pig.bytes_read_in_line = 0;
- pig.line[0] = '\0';
- pig.package_name = NULL;
-#else
- pig.pack = NULL;
- pig.package_name = NULL;
-#endif
- pig.pct = 0.0;
- pig.system = system;
- pig.op = op;
-
- pig.packages_seen = NULL;
- pig.packages_installed = 0;
- pig.bytes_installed = 0;
-
- return pig;
-}
-
-/* Code to get and set a string field from
- a Header */
-void
-eazel_package_system_rpm3_get_and_set_string_tag (Header hd,
- int tag,
- char **str)
-{
- char *tmp;
-
- g_assert (str);
-
- headerGetEntry (hd,
- tag, NULL,
- (void **) &tmp, NULL);
- g_free (*str);
- (*str) = g_strdup (tmp);
-}
-
-/* Creates argument list for rpm */
-static void
-make_rpm_argument_list (EazelPackageSystemRpm3 *system,
- EazelPackageSystemOperation op,
- unsigned long flags,
- const char *dbpath,
- GList *packages,
- GList **args)
-{
- GList *iterator;
-
- for (iterator = packages; iterator; iterator = g_list_next (iterator)) {
- PackageData *pack = (PackageData*)iterator->data;
- if (op == EAZEL_PACKAGE_SYSTEM_OPERATION_INSTALL) {
- (*args) = g_list_prepend (*args, g_strdup (pack->filename));
- } else if (op == EAZEL_PACKAGE_SYSTEM_OPERATION_UNINSTALL) {
- (*args) = g_list_prepend (*args, packagedata_get_name (pack));
- } else {
- g_assert (0);
- }
- }
-
- if (dbpath) {
- if (op == EAZEL_PACKAGE_SYSTEM_OPERATION_INSTALL &&
- !(flags & EAZEL_PACKAGE_SYSTEM_OPERATION_DOWNGRADE) &&
- !(flags & EAZEL_PACKAGE_SYSTEM_OPERATION_UPGRADE)) {
- if (strcmp (dbpath, DEFAULT_DB_PATH)) {
- char *root = g_hash_table_lookup (system->private->db_to_root, dbpath);
- (*args) = g_list_prepend (*args, g_strdup (root));
- (*args) = g_list_prepend (*args, g_strdup ("--prefix"));
- }
- }
- (*args) = g_list_prepend (*args, g_strdup (dbpath));
- (*args) = g_list_prepend (*args, g_strdup ("--dbpath"));
- }
-
- if (flags & EAZEL_PACKAGE_SYSTEM_OPERATION_TEST) {
- (*args) = g_list_prepend (*args, g_strdup ("--test"));
- }
-
- if (flags & EAZEL_PACKAGE_SYSTEM_OPERATION_FORCE) {
- (*args) = g_list_prepend (*args, g_strdup ("--nodeps"));
- if (op == EAZEL_PACKAGE_SYSTEM_OPERATION_INSTALL) {
- (*args) = g_list_prepend (*args, g_strdup ("--force"));
- }
- }
-
- /* If the magic epoch ignore is set (and we dont' already have the force flag),
- set force */
- if (GPOINTER_TO_INT (gtk_object_get_data (GTK_OBJECT (system), "ignore-epochs")) == 1) {
- if (~flags & EAZEL_PACKAGE_SYSTEM_OPERATION_FORCE) {
- (*args) = g_list_prepend (*args, g_strdup ("--force"));
- }
- }
-
- if (op == EAZEL_PACKAGE_SYSTEM_OPERATION_UNINSTALL) {
- (*args) = g_list_prepend (*args, g_strdup ("-e"));
- } else {
- if (flags & EAZEL_PACKAGE_SYSTEM_OPERATION_DOWNGRADE) {
- (*args) = g_list_prepend (*args, g_strdup ("--oldpackage"));
- }
- if (flags & EAZEL_PACKAGE_SYSTEM_OPERATION_UPGRADE ||
- flags & EAZEL_PACKAGE_SYSTEM_OPERATION_DOWNGRADE) {
-#ifdef USE_PERCENT
- (*args) = g_list_prepend (*args, g_strdup ("--percent"));
- (*args) = g_list_prepend (*args, g_strdup ("-Uv"));
-#else
- (*args) = g_list_prepend (*args, g_strdup ("-Uvh"));
-#endif
- } else {
-#ifdef USE_PERCENT
- (*args) = g_list_prepend (*args, g_strdup ("--percent"));
- (*args) = g_list_prepend (*args, g_strdup ("-iv"));
-#else
- (*args) = g_list_prepend (*args, g_strdup ("-ivh"));
-#endif
- }
- }
-}
-
-static void
-destroy_string_list (GList *list)
-{
- g_list_foreach (list, (GFunc)g_free, NULL);
- g_list_free (list);
-}
-
-static GHashTable*
-rpm_make_names_to_package_hash (GList *packages)
-{
- GList *iterator;
- GHashTable *result;
-
- result = g_hash_table_new (g_str_hash, g_str_equal);
-
- for (iterator = packages; iterator; iterator = g_list_next (iterator)) {
- char *tmp;
- PackageData *pack;
-
- pack = (PackageData*)iterator->data;
- tmp = g_strdup_printf ("%s", pack->name);
- g_hash_table_insert (result,
- tmp,
- iterator->data);
- }
- return result;
-}
-
-/* A GHRFunc to clean
- out the name_to_package hash table
-*/
-static gboolean
-clear_name_to_package (char *key,
- PackageData *pack,
- gpointer unused)
-{
- g_free (key);
- return TRUE;
-}
-
-static unsigned long
-get_total_size_of_packages (const GList *packages)
-{
- const GList *iterator;
- unsigned long result = 0;
- for (iterator = packages; iterator; iterator = g_list_next (iterator)) {
- PackageData *pack = (PackageData*)iterator->data;
- result += pack->bytesize;
- }
- return result;
-}
-
-static void
-eazel_package_system_rpm3_set_mod_status (EazelPackageSystemRpm3 *system,
- EazelPackageSystemOperation op,
- PackageData *pack)
-{
- if (pack->modify_status == PACKAGE_MOD_UNTOUCHED) {
- switch (op) {
- case EAZEL_PACKAGE_SYSTEM_OPERATION_INSTALL:
- pack->modify_status = PACKAGE_MOD_INSTALLED;
- break;
- case EAZEL_PACKAGE_SYSTEM_OPERATION_UNINSTALL:
- pack->modify_status = PACKAGE_MOD_UNINSTALLED;
- break;
- default:
- break;
- }
- }
-}
-
-static gboolean
-err_monitor_func (GIOChannel *source,
- GIOCondition condition,
- struct RpmMonitorPiggyBag *pig)
-{
- char tmp;
- ssize_t bytes_read;
-
- bytes_read = 0;
- g_io_channel_read (source, &tmp, 1, &bytes_read);
- fprintf (stderr, "%c", tmp);
- fflush (stderr);
-
- if (! bytes_read) {
- return FALSE;
- }
-
- return TRUE;
-}
-
-#ifdef USE_PERCENT
-/* This monitors an rpm process pipe and emits
- signals during execution */
-/* Ahhh, the joy of not having C++ and not just be able
- to define a function class, but instead I get to carry
- the pig around.... */
-static gboolean
-monitor_rpm_process_pipe_percent_output (GIOChannel *source,
- GIOCondition condition,
- struct RpmMonitorPiggyBag *pig)
-{
- char tmp;
- ssize_t bytes_read;
-
- bytes_read = 0;
- g_io_channel_read (source, &tmp, 1, &bytes_read);
-
- if (! bytes_read) {
- pig->subcommand_running = FALSE;
- return FALSE;
- }
-
- if (bytes_read) {
- if (isspace (tmp)) {
- switch (pig->state) {
- case 1:
- if (pig->package_name) {
- g_free (pig->package_name);
- }
- /* Reset */
- pig->pct = 0.0;
-
- pig->package_name = g_strdup (pig->line);
- pig->pack = g_hash_table_lookup (pig->name_to_package, pig->package_name);
-
- if (pig->pack==NULL) {
- char *dash;
- dash = strrchr (pig->package_name, '-');
- while (dash && pig->pack==NULL) {
- *dash = '\0';
- pig->pack = g_hash_table_lookup (pig->name_to_package,
- pig->package_name);
- dash = strrchr (pig->package_name, '-');
- }
- }
-
- if (pig->pack==NULL) {
- if (pig->package_name &&
- ((strcmp (pig->package_name, "warning:") == 0) ||
- (strcmp (pig->package_name, "error:") == 0) ||
- (strcmp (pig->package_name, "cannot") == 0))) {
- fail (pig->system, "rpm says \"%s\"", pig->package_name);
- } else if (pig->package_name) {
- verbose (pig->system, "lookup \"%s\" failed",
- pig->package_name);
- }
- } else {
- unsigned long longs[EAZEL_PACKAGE_SYSTEM_PROGRESS_LONGS];
-
- info (pig->system, "matched \"%s\"", pig->package_name);
-
- pig->packages_installed ++;
-
- longs[0] = 0;
- longs[1] = pig->pack->bytesize;
- longs[2] = pig->packages_installed;
- longs[3] = pig->total_packages;
- longs[4] = pig->bytes_installed;
- longs[5] = pig->total_bytes;
-
- eazel_package_system_emit_start (EAZEL_PACKAGE_SYSTEM (pig->system),
- pig->op,
- pig->pack);
- eazel_package_system_emit_progress (EAZEL_PACKAGE_SYSTEM (pig->system),
- pig->op,
- pig->pack,
- longs);
- /* switch state */
- pig->state = 2;
- }
-
- break;
-
- case 2:
- if (strncmp (pig->line, "%%", 2) == 0) {
- pig->state = 3;
- }
- break;
-
- case 3: {
- double pct;
-
- /* Assume we don't go to state 1 */
- pig->state = 2;
-
- /* Grab the percentage */
- pct = strtod (pig->line, NULL);
- /* fix rounding errors */
- pct = ((int)(pct*1000))/1000.0;
-
- /* Higher ? */
- if (pct > pig->pct) {
- unsigned long longs[EAZEL_PACKAGE_SYSTEM_PROGRESS_LONGS];
- int amount;
-
- pig->pct = pct;
- if (pig->pct == 100.0) {
- amount = pig->pack->bytesize;
- } else {
- amount = (int)((pig->pack->bytesize * pig->pct) / 100.0);
- }
-
- longs[0] = amount;
- longs[1] = pig->pack->bytesize;
- longs[2] = pig->packages_installed;
- longs[3] = pig->total_packages;
- longs[4] = pig->bytes_installed + amount;
- longs[5] = pig->total_bytes;
-
- eazel_package_system_emit_progress (EAZEL_PACKAGE_SYSTEM (pig->system),
- pig->op,
- pig->pack,
- longs);
-
- /* Done with package ? */
- if (pig->pct == 100.0) {
- pig->state = 1;
- pig->bytes_installed += pig->pack->bytesize;
- pig->packages_seen = g_list_prepend (pig->packages_seen,
- pig->pack);
-
- eazel_package_system_rpm3_set_mod_status (pig->system,
- pig->op,
- pig->pack);
-
- eazel_package_system_emit_end (EAZEL_PACKAGE_SYSTEM (pig->system),
- pig->op,
- pig->pack);
-
- g_free (pig->package_name);
- pig->package_name = NULL;
- pig->pack = NULL;
- pig->pct = 0.0;
- }
-
- }
- }
- break;
- default:
- g_assert_not_reached ();
- }
- pig->bytes_read_in_line = 0;
- } else {
- if (pig->bytes_read_in_line > 79) {
- trilobite_debug ("Read more than I expected, resetting");
- pig->bytes_read_in_line = 0;
- } else {
- pig->line[pig->bytes_read_in_line] = tmp;
- pig->bytes_read_in_line++;
- pig->line[pig->bytes_read_in_line] = '\0';
- }
- }
- }
-
- pig->subcommand_running = TRUE;
- return TRUE;
-}
-#endif
-
-#ifndef USE_PERCENT
-/* This monitors an rpm process pipe and emits
- signals during execution */
-static gboolean
-monitor_rpm_process_pipe (GIOChannel *source,
- GIOCondition condition,
- struct RpmMonitorPiggyBag *pig)
-{
- char tmp;
- ssize_t bytes_read;
- gboolean result = TRUE;
-
- g_io_channel_read (source, &tmp, 1, &bytes_read);
-
- if (bytes_read) {
- /* Percentage output, parse and emit... */
- if (tmp=='#') {
- int amount = 0;
- if (pig->pack == NULL) {
- return TRUE;
- }
- pig->pct += PERCENTS_PER_RPM_HASH;
- if (pig->pct == 100.0) {
- amount = pig->pack->bytesize;
- } else {
- amount = (int)((pig->pack->bytesize * pig->pct)/100.0);
- }
- if (pig->pack && amount) {
- unsigned long longs[EAZEL_PACKAGE_SYSTEM_PROGRESS_LONGS];
-
- longs[0] = amount;
- longs[1] = pig->pack->bytesize;
- longs[2] = pig->packages_installed;
- longs[3] = pig->total_packages;
- longs[4] = pig->bytes_installed + amount;
- longs[5] = pig->total_bytes;
-
- eazel_package_system_emit_progress (EAZEL_PACKAGE_SYSTEM (pig->system),
- pig->op,
- pig->pack,
- longs);
- }
- /* By invalidating the pointer here, we
- only emit with amount==total once and
- also emit end here */
- if (pig->pct == 100.0) {
- pig->bytes_installed += pig->pack->bytesize;
- pig->packages_seen = g_list_prepend (pig->packages_seen,
- pig->pack);
- info (pig->system, "seen.size = %d", g_list_length (pig->packages_seen));
- eazel_package_system_emit_end (EAZEL_PACKAGE_SYSTEM (pig->system),
- pig->op,
- pig->pack);
-
- pig->pack = NULL;
- pig->pct = 0.0;
- g_string_free (pig->package_name, TRUE);
- pig->package_name = NULL;
- }
- } else if (!isspace (tmp)) {
- /* Paranoia check */
- if (pig->package_name) {
- g_string_free (pig->package_name, TRUE);
- }
-
- /* Reset */
- pig->package_name = g_string_new (NULL);
- pig->pack = NULL;
-
- /* Read untill we hit a space */
- while (bytes_read && !isspace (tmp)) {
- g_string_append_c (pig->package_name, tmp);
- g_io_channel_read (source, &tmp, 1, &bytes_read);
- }
-
- /* It's not a #, and we've read a full word */
-
- /* first check is this an expected file name ? */
- if (pig->package_name &&
- pig->package_name->str &&
- g_list_find_custom (pig->packages_to_expect,
- pig->package_name->str,
- (GCompareFunc)eazel_install_package_name_compare)) {
- if (pig->package_name) {
- pig->pack = g_hash_table_lookup (pig->name_to_package, pig->package_name->str);
- }
- } else {
- fail (pig->system, "\"%s\" wasn't expected", pig->package_name->str);
- }
-
-
- if (pig->pack==NULL) {
- if (pig->package_name &&
- pig->package_name->str &&
- ((strcmp (pig->package_name->str, "warning:") == 0) ||
- (strcmp (pig->package_name->str, "error:") == 0) ||
- (strcmp (pig->package_name->str, "cannot") == 0))) {
- while (tmp != '\n') {
- g_string_append_c (pig->package_name, tmp);
- g_io_channel_read (source, &tmp, 1, &bytes_read);
- }
- fail (pig->system, "rpm says \"%s\"", pig->package_name->str);
- } else if (pig->package_name) {
- verbose (pig->system, "lookup \"%s\" failed", pig->package_name->str);
- }
- } else {
- unsigned long longs[EAZEL_PACKAGE_SYSTEM_PROGRESS_LONGS];
- info (pig->system, "matched \"%s\"", pig->package_name->str);
- pig->pct = 0.0;
- pig->packages_installed ++;
-
- longs[0] = 0;
- longs[1] = pig->pack->bytesize;
- longs[2] = pig->packages_installed;
- longs[3] = pig->total_packages;
- longs[4] = pig->bytes_installed;
- longs[5] = pig->total_bytes;
-
- eazel_package_system_emit_start (EAZEL_PACKAGE_SYSTEM (pig->system),
- pig->op,
- pig->pack);
- eazel_package_system_emit_progress (EAZEL_PACKAGE_SYSTEM (pig->system),
- pig->op,
- pig->pack,
- longs);
-
- }
- }
- }
-
- if (bytes_read == 0) {
- result = FALSE;
- } else {
- result = TRUE;
- }
-
- pig->subcommand_running = result;
-
- return result;
-}
-#endif
-
-static void
-rpm_create_db (char *dbpath,
- char *root,
- EazelPackageSystemRpm3 *system)
-{
- addMacro (NULL, "_dbpath", NULL, "/", 0);
-
- if (strcmp (root, "/")) {
- info (system, "Creating %s", dbpath);
- mkdir (dbpath, 0700);
- rpmdbInit (dbpath, 0644);
- }
-}
-
-void
-eazel_package_system_rpm3_create_dbs (EazelPackageSystemRpm3 *system,
- GList *dbpaths)
-{
- GList *iterator;
-
- g_assert (system);
- g_assert (EAZEL_IS_PACKAGE_SYSTEM_RPM3 (system));
- g_assert (system->private->dbs);
-
- system->private->dbpaths = dbpaths;
- for (iterator = dbpaths; iterator; iterator = g_list_next (iterator)) {
- char *db = (char*)iterator->data;
- char *root = (char*)(iterator = g_list_next (iterator))->data;
-
- info (system, "Adding %s as root for %s", root, db);
- g_hash_table_insert (system->private->db_to_root, db, root);
- }
-
- g_hash_table_foreach (system->private->db_to_root, (GHFunc)rpm_create_db, system);
-
- info (system, "Read rpmrc file");
- rpmReadConfigFiles ("/usr/lib/rpm/rpmrc", NULL);
-}
-
-/* This is not a safe way of lockchecking,
- since after the check, a process may still gain
- a lock on a_file.
- This is not a major problem, as the case we're looking
- for is when a process is running from start */
-static gboolean
-eazel_package_system_rpm3_db_locked (EazelPackageSystemRpm3 *system,
- char *dbpath)
-{
- char *a_file;
- struct flock lock;
- int fd;
- gboolean result = FALSE;
-
- lock.l_type = F_RDLCK;
- lock.l_start = 0;
- lock.l_whence = 0;
- lock.l_len = 0;
-
- a_file = g_strdup_printf ("%s/%s", dbpath, A_DB_FILE);
- fd = open (a_file, O_RDONLY);
-
- /* verbose (system, "lock checking %s", a_file); */
-
- if (fd == -1) {
- /* fail (system, "Could not get lock info for %s during open phase", a_file); */
- } else {
- if (fcntl (fd, F_SETLK, &lock)) {
- fail (system, "Could not get lock for %s", a_file);
- result = TRUE;
- if (EAZEL_PACKAGE_SYSTEM (system)->err==NULL) {
- EAZEL_PACKAGE_SYSTEM (system)->err = g_new0 (EazelPackageSystemError, 1);
- EAZEL_PACKAGE_SYSTEM (system)->err->e = EazelPackageSystemError_DB_ACCESS;
- EAZEL_PACKAGE_SYSTEM (system)->err->u.db_access.pid = lock.l_pid;
- EAZEL_PACKAGE_SYSTEM (system)->err->u.db_access.path = dbpath;
- }
- } else {
- result = FALSE;
- }
- }
-
- close (fd);
- g_free (a_file);
-
- return result;
-}
-
-static gboolean
-eazel_package_system_rpm3_dbs_locked (EazelPackageSystemRpm3 *system)
-{
- GList *iterator;
- gboolean result = FALSE;
- GList *remove = NULL;
-
- for (iterator = system->private->dbpaths; iterator; iterator = g_list_next (g_list_next (iterator))) {
- char *path;
- char *foo = g_list_next (iterator)->data;
-
- path = (char*)iterator->data;
- if (eazel_package_system_rpm3_db_locked (system, path)) {
- result = TRUE;
- fail (system, "Removed %s since it's locked", path);
- remove = g_list_prepend (remove, path);
- remove = g_list_prepend (remove, foo);
- }
- }
-
- for (iterator = remove; iterator; iterator = g_list_next (iterator)) {
- system->private->dbpaths = g_list_remove (system->private->dbpaths, iterator->data);
- g_hash_table_remove (system->private->db_to_root, iterator->data);
- }
- g_list_free (remove);
-
- return result;
-}
-
-static void
-rpm_open_db (char *dbpath,
- char *root,
- EazelPackageSystemRpm3 *system)
-{
- rpmdb db;
-
- addMacro(NULL, "_dbpath", NULL, "/", 0);
- if (rpmdbOpen (dbpath, &db, O_RDONLY, 0644)) {
- fail (system, "Opening packages database in %s failed (a)", dbpath);
- } else {
- if (db) {
- info (system, _("Opened packages database in %s"), dbpath);
- g_hash_table_insert (system->private->dbs,
- g_strdup (dbpath),
- db);
- } else {
- fail (system, _("Opening packages database in %s failed"), dbpath);
- }
- }
-}
-
-gboolean
-eazel_package_system_rpm3_open_dbs (EazelPackageSystemRpm3 *system)
-{
- g_assert (system);
- g_assert (EAZEL_IS_PACKAGE_SYSTEM_RPM3 (system));
- g_assert (system->private->dbs);
-
- if (eazel_package_system_rpm3_dbs_locked (system)) {
- g_warning ("Some db's are locked!");
- }
-
- if (g_hash_table_size (system->private->db_to_root) == 0) {
- return FALSE;
- }
-
- g_hash_table_foreach (system->private->db_to_root,
- (GHFunc)rpm_open_db,
- system);
-
- return TRUE;
-}
-
-static gboolean
-rpm_close_db (char *key,
- rpmdb db,
- EazelPackageSystemRpm3 *system)
-{
- if (db) {
- info (system, _("Closing db for %s (open)"), key);
- rpmdbClose (db);
- db = NULL;
- g_free (key);
- } else {
- fail (system, _("Closing db for %s (not open)"), key);
- }
-
- return TRUE;
-}
-
-gboolean
-eazel_package_system_rpm3_close_dbs (EazelPackageSystemRpm3 *system)
-{
- /* Close all the db's */
- g_assert (system->private->dbs);
- g_hash_table_foreach_remove (system->private->dbs,
- (GHRFunc)rpm_close_db,
- system);
- return TRUE;
-}
-
-static gboolean
-rpm_free_db (char *key,
- char *root,
- EazelPackageSystemRpm3 *system)
-{
- g_free (key);
- g_free (root);
- return TRUE;
-}
-
-gboolean
-eazel_package_system_rpm3_free_dbs (EazelPackageSystemRpm3 *system)
-{
- /* Close all the db's */
- g_assert (system->private->dbs);
- g_hash_table_foreach_remove (system->private->db_to_root,
- (GHRFunc)rpm_free_db,
- system);
- return TRUE;
-}
-
-/************************************************************
- Load Package implemementation
-*************************************************************/
-
-static EazelSoftCatSense
-rpm_sense_to_softcat_sense (EazelPackageSystemRpm3 *system,
- int rpm_sense)
-{
- EazelSoftCatSense result = 0;
-
- if (rpm_sense & RPMSENSE_ANY) {
- result |= EAZEL_SOFTCAT_SENSE_ANY;
- } else {
- if (rpm_sense & RPMSENSE_EQUAL) {
- result |= EAZEL_SOFTCAT_SENSE_EQ;
- }
- if (rpm_sense & RPMSENSE_GREATER) {
- result |= EAZEL_SOFTCAT_SENSE_GT;
- }
- if (rpm_sense & RPMSENSE_LESS) {
- result |= EAZEL_SOFTCAT_SENSE_LT;
- }
- }
-
- return result;
-}
-
-/* This is used for those freaky packages (Acrobat-3.01-2.i386.rpm)
- that both provides libs and requires the same (libagm.so libpfs.so) */
-static gboolean
-check_require_is_not_a_feature (const char *requires_name,
- const char **provides_names,
- int provide_count)
-{
- int i;
-
- if (requires_name == NULL) {
- return TRUE;
- }
-
- for (i = 0; i < provide_count; i++) {
- if (provides_names[i] && strcmp (requires_name, provides_names[i])==0) {
- return FALSE;
- }
- }
- return TRUE;
-}
-
-void
-eazel_package_system_rpm3_packagedata_fill_from_header (EazelPackageSystemRpm3 *system,
- PackageData *pack,
- Header hd,
- int detail_level)
-{
- unsigned long *sizep;
- unsigned long *epochp;
-
- eazel_package_system_rpm3_get_and_set_string_tag (hd, RPMTAG_NAME, &pack->name);
- eazel_package_system_rpm3_get_and_set_string_tag (hd, RPMTAG_VERSION, &pack->version);
- eazel_package_system_rpm3_get_and_set_string_tag (hd, RPMTAG_RELEASE, &pack->minor);
-
- eazel_package_system_rpm3_get_and_set_string_tag (hd, RPMTAG_ARCH, &pack->archtype);
- if (~detail_level & PACKAGE_FILL_NO_TEXT) {
- eazel_package_system_rpm3_get_and_set_string_tag (hd, RPMTAG_DESCRIPTION, &pack->description);
- eazel_package_system_rpm3_get_and_set_string_tag (hd, RPMTAG_SUMMARY, &pack->summary);
- }
-
- headerGetEntry (hd,
- RPMTAG_SIZE, NULL,
- (void **) &sizep, NULL);
-
- pack->bytesize = *sizep;
-
- /* Load the crack that is epoch/serial */
- if (!headerGetEntry (hd, RPMTAG_EPOCH, NULL, (void**)&epochp, NULL)) {
- pack->epoch = 0;
- } else {
- pack->epoch = *epochp;
- }
-
- pack->packsys_struc = (gpointer)hd;
-
- pack->fillflag = detail_level;
-
- {
- char **obsoletes = NULL;
- int count = 0;
- int i;
- /* FIXME: bugzilla.eazel.com 6903
- obsoletes is not a string, it's a stringlist! */
-
- headerGetEntry (hd,
- RPMTAG_OBSOLETENAME, NULL,
- (void**)&obsoletes,
- &count);
-
- for (i = 0; i < count; i++) {
- pack->obsoletes = g_list_prepend (pack->obsoletes, g_strdup (obsoletes[i]));
- }
- free (obsoletes);
- }
-
- /* FIXME: bugzilla.eazel.com 4863 */
- if (~detail_level & PACKAGE_FILL_NO_PROVIDES) {
- char **paths = NULL;
- char **paths_copy = NULL;
- char **names = NULL;
- int *indexes = NULL;
- int count = 0;
- int index = 0;
- int num_paths = 0;
- uint_16 *file_modes;
-
- g_list_foreach (pack->provides, (GFunc)g_free, NULL);
- g_list_free (pack->provides);
- pack->provides = NULL;
-
- /* RPM v.3.0.4 and above has RPMTAG_BASENAMES, this will not work
- with any version below 3.0.4 */
-
- headerGetEntry (hd,
- RPMTAG_DIRINDEXES, NULL,
- (void**)&indexes, NULL);
- headerGetEntry (hd,
- RPMTAG_DIRNAMES, NULL,
- (void**)&paths, &num_paths);
- headerGetEntry (hd,
- RPMTAG_BASENAMES, NULL,
- (void**)&names, &count);
- headerGetEntry (hd,
- RPMTAG_FILEMODES, NULL,
- (void**)&file_modes, NULL);
-
- /* Copy all paths and shave off last /.
- This is needed to remove the dir entries from
- the packagedata's provides list. */
- paths_copy = g_new0 (char*, num_paths);
- for (index=0; index<num_paths; index++) {
- paths_copy[index] = g_strdup (paths[index]);
- paths_copy[index][strlen (paths_copy[index]) - 1] = 0;
- }
-
- /* Now loop through all the basenames */
- for (index=0; index<count; index++) {
- char *fullname = NULL;
- if (paths) {
- fullname = g_strdup_printf ("%s/%s", paths_copy[indexes[index]], names[index]);
- } else {
- fullname = g_strdup (names[index]);
- }
-#if 0
- fprintf (stderr, "file_modes[%s] = 0%o %s\n",
- fullname, file_modes[index],
- (file_modes[index] & 040000) ? "DIR" : "file" );
-#endif
-
- if (detail_level & PACKAGE_FILL_NO_DIRS_IN_PROVIDES) {
- if (file_modes[index] & 040000) {
- g_free (fullname);
- fullname = NULL;
- }
- }
- if (fullname) {
-#if 0
- fprintf (stderr, "%s provides %s\n", pack->name, fullname);
-#endif
- pack->provides = g_list_prepend (pack->provides, fullname);
- }
- }
- pack->provides = g_list_reverse (pack->provides);
- for (index=0; index<num_paths; index++) {
- g_free (paths_copy[index]);
- }
- g_free (paths_copy);
- free ((void*)paths);
- free ((void*)names);
- }
-
-
- if (~detail_level & PACKAGE_FILL_NO_DEPENDENCIES) {
- const char **requires_name, **requires_version, **provides_names;
- int *requires_flag;
- int count, provide_count;
- int index;
-
- headerGetEntry (hd,
- RPMTAG_PROVIDENAME, NULL,
- (void**)&provides_names,
- &provide_count);
- headerGetEntry (hd,
- RPMTAG_REQUIRENAME, NULL,
- (void**)&requires_name,
- &count);
- headerGetEntry (hd,
- RPMTAG_REQUIREVERSION, NULL,
- (void**)&requires_version,
- NULL);
- headerGetEntry (hd,
- RPMTAG_REQUIREFLAGS, NULL,
- (void**)&requires_flag,
- NULL);
-
- for (index = 0; index < count; index++) {
- PackageData *package = packagedata_new ();
- PackageDependency *pack_dep = packagedependency_new ();
-
- /* If it's a lib*.so* or a /yadayada, but not ld-linux.so
- or rpmlib( add to provides */
- if ((strncmp (requires_name[index], "lib", 3)==0 &&
- strstr (requires_name[index], ".so")) ||
- (*requires_name[index]=='/')) {
- if (check_require_is_not_a_feature (requires_name[index],
- provides_names,
- provide_count) == TRUE) {
- package->features = g_list_prepend (package->features,
- g_strdup (requires_name[index]));
- }
- } else if ((strncmp (requires_name[index], "ld-linux.so", 11) == 0) ||
- (strncmp (requires_name[index], "rpmlib(", 7) == 0)) {
- /* foo */
- } else {
- /* Otherwise, add as a package name */
- package->name = g_strdup (requires_name[index]);
- /* and set the version if not empty */
- pack_dep->version = *requires_version[index]=='\0' ?
- NULL : g_strdup (requires_version[index]);
- }
- /* If anything set, add dep */
- if (package->name || package->features) {
- pack_dep->sense = rpm_sense_to_softcat_sense (system,
- requires_flag[index]);
- package->archtype = trilobite_get_distribution_arch ();
- pack_dep->package = package;
- pack->depends = g_list_prepend (pack->depends, pack_dep);
- } else {
- gtk_object_unref (GTK_OBJECT (pack_dep));
- gtk_object_unref (GTK_OBJECT (package));
- }
- }
- free ((void*)provides_names);
- free ((void*)requires_name);
- free ((void*)requires_version);
-
- }
-
- if (~detail_level & PACKAGE_FILL_NO_FEATURES) {
- const char **provides_name;
- int count;
- int index;
-
- headerGetEntry (hd,
- RPMTAG_PROVIDENAME, NULL,
- (void**)&provides_name,
- &count);
-
- for (index = 0; index < count; index++) {
- pack->features = g_list_prepend (pack->features,
- g_strdup (provides_name[index]));
- }
-
- free ((void*)provides_name);
-
-
- }
-
-}
-
-static gboolean
-rpm_packagedata_fill_from_file (EazelPackageSystemRpm3 *system,
- PackageData *pack,
- const char *filename,
- int detail_level)
-{
- static FD_t fd;
- Header hd;
- int rpm_result;
-
- /* Set filename field */
- if (pack->filename != filename) {
- g_free (pack->filename);
- pack->filename = g_strdup (filename);
- }
-
- /* FIXME: Would be better to call a package_data_ function to do this. */
- if (pack->packsys_struc) {
- headerFree ((Header) pack->packsys_struc);
- pack->packsys_struc = NULL;
- }
-
- /* Open rpm */
- fd = fdOpen (filename, O_RDONLY, 0);
-
- if (fd == NULL) {
- g_warning (_("Cannot open %s"), filename);
- pack->status = PACKAGE_CANNOT_OPEN;
- return FALSE;
- }
-
- /* Get Header block */
- rpm_result = rpmReadPackageHeader (fd, &hd, &pack->source_package, NULL, NULL);
- if (rpm_result == 0) {
- eazel_package_system_rpm3_packagedata_fill_from_header (system, pack, hd, detail_level);
- pack->status = PACKAGE_UNKNOWN_STATUS;
- }
-
- fdClose (fd);
-
- return (rpm_result == 0) ? TRUE : FALSE;
-}
-
-static PackageData*
-rpm_packagedata_new_from_file (EazelPackageSystemRpm3 *system,
- const char *file,
- int detail_level)
-{
- PackageData *pack;
-
- pack = packagedata_new ();
-
- if (rpm_packagedata_fill_from_file (system, pack, file, detail_level)==FALSE) {
- trilobite_debug ("RPM3 unable to fill from file '%s'", file);
- gtk_object_unref (GTK_OBJECT (pack));
- pack = NULL;
- }
-
- return pack;
-}
-
-PackageData*
-eazel_package_system_rpm3_load_package (EazelPackageSystemRpm3 *system,
- PackageData *in_package,
- const char *filename,
- int detail_level)
-{
- PackageData *result = NULL;
-
- if (in_package) {
- result = in_package;
- if (rpm_packagedata_fill_from_file (system, result, filename, detail_level)==FALSE) {
- trilobite_debug ("RPM3 unable to fill from file '%s'", filename);
- result = NULL;
- }
- } else {
- result = rpm_packagedata_new_from_file (system, filename, detail_level);
- }
-
- return result;
-}
-
-/************************************************************
- Query implemementation
-*************************************************************/
-
-rpmdb
-eazel_package_system_rpm3_get_db (EazelPackageSystemRpm3 *system,
- const char *dbpath)
-{
- rpmdb db;
-
- db = g_hash_table_lookup (system->private->dbs, dbpath);
- if (!db) {
- fail (system, "query could not access db in %s", dbpath);
- return NULL;
- }
- return db;
-}
-
-#ifdef HAVE_RPM_30
-static void
-eazel_package_system_rpm3_query_impl (EazelPackageSystemRpm3 *system,
- const char *dbpath,
- const char* key,
- EazelPackageSystemQueryEnum flag,
- int detail_level,
- GList **result)
-{
- rpmdb db = eazel_package_system_rpm3_get_db (system, dbpath);
- int rc = 1;
- dbiIndexSet matches;
-
- if (!db) {
- return;
- }
-
- switch (flag) {
- case EAZEL_PACKAGE_SYSTEM_QUERY_OWNS:
- info (system, "query (in %s) OWNS %s", dbpath, key);
- rc = rpmdbFindByFile (db, key, &matches);
- break;
- case EAZEL_PACKAGE_SYSTEM_QUERY_PROVIDES:
- info (system, "query (in %s) PROVIDES %s", dbpath, key);
- rc = rpmdbFindByProvides (db, key, &matches);
- break;
- case EAZEL_PACKAGE_SYSTEM_QUERY_MATCHES:
- info (system, "query (in %s) MATCHES %s", dbpath, key);
- rc = rpmdbFindPackage (db, key, &matches);
- break;
- case EAZEL_PACKAGE_SYSTEM_QUERY_REQUIRES:
- info (system, "query (in %s) REQUIRES %s", dbpath, key);
- rc = rpmdbFindByRequiredBy (db, key, &matches);
- break;
- default:
- g_warning ("Unknown query flag %d", flag);
- g_assert_not_reached ();
- }
-
- if (rc == 0) {
- unsigned int i;
-
- info (system, "%d hits", dbiIndexSetCount (matches));
- for (i = 0; i < dbiIndexSetCount (matches); i++) {
- unsigned int offset;
- Header hd;
- PackageData *pack;
-
- offset = dbiIndexRecordOffset (matches, i);
- hd = rpmdbGetRecord (db, offset);
- pack = packagedata_new ();
- eazel_package_system_rpm3_packagedata_fill_from_header (system,
- pack,
- hd,
- detail_level);
- g_free (pack->install_root);
- pack->install_root = g_strdup (dbpath);
- if (g_list_find_custom (*result,
- pack,
- (GCompareFunc)eazel_install_package_compare)!=NULL) {
- info (system, "%s already in set", pack->name);
- gtk_object_unref (GTK_OBJECT (pack));
- } else {
- (*result) = g_list_prepend (*result, pack);
- }
- }
- dbiFreeIndexRecord (matches);
- } else {
- info (system, "0 hits");
- }
-}
-
-static void
-eazel_package_system_rpm3_query_substr (EazelPackageSystemRpm3 *system,
- const char *dbpath,
- const char *key,
- int detail_level,
- GList **result)
-{
- int offset;
- rpmdb db = eazel_package_system_rpm3_get_db (system, dbpath);
-
- if (!db) {
- return;
- }
-
- for (offset = rpmdbFirstRecNum (db); offset; offset = rpmdbNextRecNum (db, offset)) {
- Header hd;
- char *name = NULL;
-
- hd = rpmdbGetRecord (db, offset);
-
- eazel_package_system_rpm3_get_and_set_string_tag (hd, RPMTAG_NAME, &name);
-
- /* If key occurs in name, create package and add to result */
- if (strstr (name, key)) {
- PackageData *pack = packagedata_new ();
- eazel_package_system_rpm3_packagedata_fill_from_header (system,
- pack,
- hd,
- detail_level);
- (*result) = g_list_prepend (*result, pack);
- } else {
- headerFree (hd);
- }
- g_free (name);
- }
-
-}
-
-static void
-eazel_package_system_rpm3_query_foreach (char *dbpath,
- rpmdb db,
- struct RpmQueryPiggyBag *pig)
-{
- info (pig->system, "eazel_package_system_rpm3_query_foreach");
- switch (pig->flag) {
- case EAZEL_PACKAGE_SYSTEM_QUERY_OWNS:
- case EAZEL_PACKAGE_SYSTEM_QUERY_PROVIDES:
- case EAZEL_PACKAGE_SYSTEM_QUERY_MATCHES:
- eazel_package_system_rpm3_query_impl (pig->system,
- dbpath,
- pig->key,
- pig->flag,
- pig->detail_level,
- pig->result);
- break;
- case EAZEL_PACKAGE_SYSTEM_QUERY_REQUIRES:
- eazel_package_system_rpm3_query_requires (pig->system,
- dbpath,
- pig->key,
- pig->detail_level,
- pig->result);
- break;
- case EAZEL_PACKAGE_SYSTEM_QUERY_REQUIRES_FEATURE:
- eazel_package_system_rpm3_query_requires_feature (pig->system,
- dbpath,
- pig->key,
- pig->detail_level,
- pig->result);
- break;
- case EAZEL_PACKAGE_SYSTEM_QUERY_SUBSTR:
- eazel_package_system_rpm3_query_substr (pig->system,
- dbpath,
- pig->key,
- pig->detail_level,
- pig->result);
- break;
- default:
- g_warning ("Unknown query flag %d", pig->flag);
- g_assert_not_reached ();
- }
-}
-#endif /* HAVE_RPM_30 */
-
-void
-eazel_package_system_rpm3_query_requires (EazelPackageSystemRpm3 *system,
- const char *dbpath,
- const gpointer *key,
- int detail_level,
- GList **result)
-{
- const PackageData *pack = (PackageData*)key;
-
- if (pack->name) {
- (EAZEL_PACKAGE_SYSTEM_RPM3_CLASS (GTK_OBJECT (system)->klass)->query_impl) (EAZEL_PACKAGE_SYSTEM (system),
- dbpath,
- pack->name,
- EAZEL_PACKAGE_SYSTEM_QUERY_REQUIRES,
- detail_level,
- result);
- }
- if (pack->provides) {
- GList *iterator;
- /* FIXME: ideally, this could use package->features instead, that would
- be safer then doing the strstr check. But for now, I just check if
- fkey is "lib.*\.so.*", or "/bin/.*" or "/sbin/.*" */
- for (iterator = pack->provides; iterator; iterator = g_list_next (iterator)) {
- const char *fkey = (const char*)iterator->data;
- if ((strncmp (g_basename (fkey), "lib", 3)==0 && strstr (fkey, ".so")) ||
- strncmp (fkey, "/bin/", 5)==0 ||
- strncmp (fkey, "/sbin/", 6)==0) {
- (EAZEL_PACKAGE_SYSTEM_RPM3_CLASS (GTK_OBJECT (system)->klass)->query_impl) (EAZEL_PACKAGE_SYSTEM (system),
- dbpath,
- g_basename (fkey),
- EAZEL_PACKAGE_SYSTEM_QUERY_REQUIRES,
- detail_level,
- result);
- }
- }
- info (system, "result set size is now %d", g_list_length (*result));
- }
-}
-
-void
-eazel_package_system_rpm3_query_requires_feature (EazelPackageSystemRpm3 *system,
- const char *dbpath,
- const gpointer *key,
- int detail_level,
- GList **result)
-{
- (EAZEL_PACKAGE_SYSTEM_RPM3_CLASS (GTK_OBJECT (system)->klass)->query_impl) (EAZEL_PACKAGE_SYSTEM (system),
- dbpath,
- (gpointer)key,
- EAZEL_PACKAGE_SYSTEM_QUERY_REQUIRES,
- detail_level,
- result);
-}
-
-GList*
-eazel_package_system_rpm3_query (EazelPackageSystemRpm3 *system,
- const char *dbpath,
- const gpointer key,
- EazelPackageSystemQueryEnum flag,
- int detail_level)
-{
- GList *result = NULL;
- struct RpmQueryPiggyBag pig;
-
- info (system, "eazel_package_system_rpm3_query (dbpath=\"%s\", key=%p, flag=%d, detail=%d)",
- dbpath, key, flag, detail_level);
-
- pig.system = system;
- pig.key = key;
- pig.flag = flag;
- pig.detail_level = detail_level;
- pig.result = &result;
-
- if (!eazel_package_system_rpm3_open_dbs (system)) {
- return NULL;
- }
-
- if (dbpath==NULL) {
- g_hash_table_foreach (system->private->dbs,
- (GHFunc)(EAZEL_PACKAGE_SYSTEM_RPM3_CLASS (GTK_OBJECT (system)->klass)->query_foreach),
- &pig);
- } else {
- (EAZEL_PACKAGE_SYSTEM_RPM3_CLASS (GTK_OBJECT (system)->klass)->query_foreach) (dbpath, NULL, &pig);
- }
- eazel_package_system_rpm3_close_dbs (system);
-
- return result;
-}
-
-/************************************************************
- Install implemementation
-*************************************************************/
-
-static void
-display_arguments (EazelPackageSystemRpm3 *system,
- GList *args)
-{
- char *str, *tmp;
- GList *iterator;
-
- str = g_strdup ("rpm");
- for (iterator = args; iterator; iterator = g_list_next (iterator)) {
- tmp = g_strdup_printf ("%s %s", str, (char*)iterator->data);
- g_free (str);
- str = tmp;
- /* Since there is a max length on g_message output ... */
- if (strlen (str) > 600) {
- fail (system, "%s", str);
- g_free (str);
- str = g_strdup ("");
- }
- }
- fail (system, "%s", str);
-}
-
-static void
-monitor_subcommand_pipe (EazelPackageSystemRpm3 *system,
- int fd,
- int errfd,
- GIOFunc monitor_func,
- struct RpmMonitorPiggyBag *pig)
-{
- GIOChannel *channel, *err_channel;
- guint out_src, err_src;
-
- pig->subcommand_running = TRUE;
- channel = g_io_channel_unix_new (fd);
- err_channel = g_io_channel_unix_new (errfd);
-
- info (system, "beginning monitor on out %d err %d", fd, errfd);
- out_src = g_io_add_watch_full (channel, 10, G_IO_IN | G_IO_ERR | G_IO_NVAL | G_IO_HUP,
- monitor_func,
- pig, NULL);
- err_src = g_io_add_watch_full (err_channel, 10, G_IO_IN | G_IO_ERR | G_IO_NVAL | G_IO_HUP,
- (GIOFunc)err_monitor_func,
- pig, NULL);
-
- while (pig->subcommand_running) {
-#if 0
- /* this is evil and it still doesn't work, so foo. */
- while (gdk_events_pending ()) {
- gtk_main_do_event (gdk_event_get ());
- }
-#endif
- gtk_main_iteration ();
- }
-
- g_source_remove (out_src);
- g_source_remove (err_src);
-
- info (system, "ending monitor on out %d err %d", fd, errfd);
-}
-
-static void
-eazel_package_system_rpm3_set_state (EazelPackageSystemRpm3 *system,
- GList *packages,
- PackageSystemStatus status) {
- GList *iterator;
- for (iterator = packages; iterator; iterator = g_list_next (iterator)) {
- PackageData *pack = PACKAGEDATA (iterator->data);
- pack->status = status;
- }
-}
-
-
-/* returns TRUE on success */
-static gboolean
-manual_rpm_command (GList *args, int *fd, int *errfd)
-{
- char **argv;
- int i, child_pid;
- GList *iterator;
- gboolean result;
-
- /* Create argv list */
- argv = g_new0 (char*, g_list_length (args) + 2);
- argv[0] = g_strdup ("rpm");
- i = 1;
- for (iterator = args; iterator; iterator = g_list_next (iterator)) {
- argv[i] = g_strdup (iterator->data);
- i++;
- }
- argv[i] = NULL;
-
- if (access ("/bin/rpm", R_OK|X_OK)!=0) {
- g_warning ("/bin/rpm missing or not executable for uid");
- result = FALSE;
- goto out;
- }
- /* start /bin/rpm... */
- if ((child_pid = trilobite_pexec ("/bin/rpm", argv, NULL, fd, errfd)) == 0) {
- g_warning ("Could not start rpm");
- result = FALSE;
- } else {
- trilobite_debug ("/bin/rpm running (pid %d, stdout %d, XX stderr %d)", child_pid, *fd, *errfd);
- result = TRUE;
- }
-
-out:
- for (i = 0; argv[i]; i++) {
- g_free (argv[i]);
- }
- g_free (argv);
- return result;
-}
-
-static void
-eazel_package_system_rpm3_execute (EazelPackageSystemRpm3 *system,
- struct RpmMonitorPiggyBag *pig,
- GList *args)
-{
- TrilobiteRootHelper *root_helper;
- int fd, errfd;
- gboolean go = TRUE;
-
- display_arguments (system, args);
-
- root_helper = gtk_object_get_data (GTK_OBJECT (system), "trilobite-root-helper");
- if (root_helper) {
- TrilobiteRootHelperStatus root_helper_stat;
-
- root_helper_stat = trilobite_root_helper_start (root_helper);
- if (root_helper_stat != TRILOBITE_ROOT_HELPER_SUCCESS) {
- g_warning ("Error in starting trilobite_root_helper");
- go = FALSE;
- } else if (trilobite_root_helper_run (root_helper,
- TRILOBITE_ROOT_HELPER_RUN_RPM, args, &fd) !=
- TRILOBITE_ROOT_HELPER_SUCCESS) {
- g_warning ("Error in running trilobite_root_helper");
- trilobite_root_helper_destroy (GTK_OBJECT (root_helper));
- go = FALSE;
- }
- } else {
- /* start /bin/rpm manually -- we're in bootstrap installer mode */
- go = manual_rpm_command (args, &fd, &errfd);
- }
- if (go) {
-#ifdef USE_PERCENT
- monitor_subcommand_pipe (system, fd, errfd, (GIOFunc)monitor_rpm_process_pipe_percent_output, pig);
-#else
- monitor_subcommand_pipe (system, fd, (GIOFunc)monitor_rpm_process_pipe, pig);
-#endif
- } else {
- eazel_package_system_rpm3_set_state (system, pig->packages_to_expect, PACKAGE_CANCELLED);
- /* FIXME: fail all the packages in pig */
- }
-}
-
-/* If any package in "packages" does not occur in "seen",
- emit failed signal */
-static void
-check_if_all_packages_seen (EazelPackageSystemRpm3 *system,
- const char *dbpath,
- EazelPackageSystemOperation op,
- int flags,
- GList *packages,
- GList *seen)
-{
- GList *iterator;
-
- /* HACK: that fixes bugzilla.eazel.com 4914 */
- eazel_package_system_rpm3_open_dbs (system);
-
- for (iterator = packages; iterator; iterator = g_list_next (iterator)) {
- PackageData *pack = (PackageData*)iterator->data;
-
- if (flags & EAZEL_PACKAGE_SYSTEM_OPERATION_TEST) {
- eazel_package_system_emit_start (EAZEL_PACKAGE_SYSTEM (system),
- op,
- pack);
- eazel_package_system_rpm3_set_mod_status (system,
- op,
- pack);
- eazel_package_system_emit_end (EAZEL_PACKAGE_SYSTEM (system),
- op,
- pack);
- continue;
- }
-
- /* HACK: that fixes bugzilla.eazel.com 4914 */
- if (op==EAZEL_PACKAGE_SYSTEM_OPERATION_UNINSTALL) {
- if (eazel_package_system_is_installed (EAZEL_PACKAGE_SYSTEM (system),
- dbpath,
- pack->name,
- pack->version,
- pack->minor,
- EAZEL_SOFTCAT_SENSE_EQ)) {
- fail (system, "%s is still installed", pack->name);
- eazel_package_system_emit_failed (EAZEL_PACKAGE_SYSTEM (system), op, pack);
- } else {
- eazel_package_system_emit_start (EAZEL_PACKAGE_SYSTEM (system),
- op,
- pack);
- eazel_package_system_rpm3_set_mod_status (system,
- op,
- pack);
- eazel_package_system_emit_end (EAZEL_PACKAGE_SYSTEM (system),
- op,
- pack);
- }
- } else {
- if (!g_list_find_custom (seen,
- pack,
- (GCompareFunc)eazel_install_package_compare)) {
- fail (system, "did not see %s", pack->name);
- eazel_package_system_emit_failed (EAZEL_PACKAGE_SYSTEM (system),
- op, pack);
- }
- }
- }
-
- /* HACK: that fixes bugzilla.eazel.com 4914 */
- eazel_package_system_rpm3_close_dbs (system);
-}
-
-
-static void
-eazel_package_system_rpm3_install_uninstall (EazelPackageSystemRpm3 *system,
- EazelPackageSystemOperation op,
- const char *dbpath,
- GList* packages,
- unsigned long flags)
-{
- struct RpmMonitorPiggyBag pig = rpmmonitorpiggybag_new (system, op);
- GList *args = NULL;
-
- pig.system = system;
- pig.op = op;
-
- pig.total_packages = g_list_length (packages);
- pig.total_bytes = get_total_size_of_packages (packages);
- pig.packages_to_expect = packages;
- pig.name_to_package = rpm_make_names_to_package_hash (packages);
-
- make_rpm_argument_list (system, op, flags, dbpath, packages, &args);
- eazel_package_system_rpm3_execute (system, &pig, args);
- destroy_string_list (args);
-
- check_if_all_packages_seen (system, dbpath, op, flags, packages, pig.packages_seen);
- g_list_free (pig.packages_seen);
-
- g_hash_table_foreach_remove (pig.name_to_package, (GHRFunc)clear_name_to_package, NULL);
- g_hash_table_destroy (pig.name_to_package);
-}
-
-void
-eazel_package_system_rpm3_install (EazelPackageSystemRpm3 *system,
- const char *dbpath,
- GList* packages,
- unsigned long flags)
-{
- info (system, "eazel_package_system_rpm3_install");
-
- eazel_package_system_rpm3_install_uninstall (system,
- EAZEL_PACKAGE_SYSTEM_OPERATION_INSTALL,
- dbpath,
- packages,
- flags);
-}
-
-/************************************************************
- Uninstall implemementation
-*************************************************************/
-
-void
-eazel_package_system_rpm3_uninstall (EazelPackageSystemRpm3 *system,
- const char *dbpath,
- GList* packages,
- unsigned long flags)
-{
- info (system, "eazel_package_system_rpm3_uninstall");
- eazel_package_system_rpm3_install_uninstall (system,
- EAZEL_PACKAGE_SYSTEM_OPERATION_UNINSTALL,
- dbpath,
- packages,
- flags);
-}
-
-/************************************************************
- Verify implemementation
-*************************************************************/
-
-static gboolean
-eazel_package_system_rpm3_verify_impl (EazelPackageSystemRpm3 *system,
- const char *root,
- PackageData *package,
- unsigned long *info,
- gboolean *cont)
-{
- unsigned int i;
- int v_result;
- unsigned long infoblock[EAZEL_PACKAGE_SYSTEM_PROGRESS_LONGS];
- gboolean result;
- char *p_name = packagedata_get_readable_name (package);
-
- g_assert (package->packsys_struc);
-
- infoblock[0] = 0;
- infoblock[1] = g_list_length (package->provides);
- infoblock[2] = info[0];
- infoblock[3] = info[1];
- infoblock[4] = info[2];
- infoblock[5] = info[3];
-
- (*cont) = eazel_package_system_emit_start (EAZEL_PACKAGE_SYSTEM (system),
- EAZEL_PACKAGE_SYSTEM_OPERATION_VERIFY,
- package);
- /* abort if signal returns false */
- if (*cont == FALSE) {
- g_free (p_name);
- return FALSE;
- }
-
- result = TRUE;
-
- for (i = 0; i < g_list_length (package->provides); i++) {
- int res;
- /* next file... */
- infoblock [0]++;
- infoblock [4]++;
-
- info (system, "checking file %d/%d \"%s\" from \"%s\"",
- infoblock[0], g_list_length (package->provides),
- (char*)((g_list_nth (package->provides, i))->data),
- p_name);
-
- (*cont) = eazel_package_system_emit_progress (EAZEL_PACKAGE_SYSTEM (system),
- EAZEL_PACKAGE_SYSTEM_OPERATION_VERIFY,
- package,
- infoblock); /* abort if signal returns false */
- if (*cont == FALSE) {
- result = FALSE;
- break;
- }
- res = rpmVerifyFile ("", (Header)package->packsys_struc, i, &v_result, RPMVERIFY_NONE);
- if (v_result!=0) {
- fail (system, "file %d (%s) failed", i,
- (char*)((g_list_nth (package->provides, i))->data));
- (*cont) = eazel_package_system_emit_failed (EAZEL_PACKAGE_SYSTEM (system),
- EAZEL_PACKAGE_SYSTEM_OPERATION_VERIFY,
- package);
-
- result = FALSE;
-
- /* abort if signal returns false */
- if (*cont == FALSE) {
- break;
- }
- }
-
- }
- /* Update the total-amount-completed counter */
- info[2] = infoblock[4];
-
- if (*cont) {
- (*cont) = eazel_package_system_emit_end (EAZEL_PACKAGE_SYSTEM (system),
- EAZEL_PACKAGE_SYSTEM_OPERATION_VERIFY,
- package);
- /* no need to check, called will abort if *cont == FALSE */
- }
- g_free (p_name);
- return result;
-}
-
-static unsigned long
-get_num_of_files_in_packages (GList *packages)
-{
- GList *iterator;
- unsigned long result = 0;
- for (iterator = packages; iterator; iterator = g_list_next (iterator)) {
- PackageData *pack = (PackageData*)iterator->data;
- result += g_list_length (pack->provides);
- }
- return result;
-}
-
-gboolean
-eazel_package_system_rpm3_verify (EazelPackageSystemRpm3 *system,
- const char *dbpath,
- GList* packages)
-{
- GList *iterator;
- char *root = ""; /* FIXME: fill this using dbpath */
- unsigned long info[4];
- gboolean cont = TRUE;
- gboolean result = TRUE;
-
- info[0] = 0;
- info[1] = g_list_length (packages);
- info[2] = 0; /* updated by eazel_package_system_rpm3_verify_impl */
- info[3] = get_num_of_files_in_packages (packages);
-
- info (system, "eazel_package_system_rpm3_verify");
-
- if (!eazel_package_system_rpm3_open_dbs (system)) {
- return FALSE;
- }
- for (iterator = packages; iterator; iterator = g_list_next (iterator)) {
- PackageData *pack = (PackageData*)iterator->data;
- info[0] ++;
- if (eazel_package_system_rpm3_verify_impl (system, root, pack, info, &cont) == FALSE) {
- result = FALSE;
- }
- if (cont == FALSE) {
- break;
- }
- }
- eazel_package_system_rpm3_close_dbs (system);
- return result;
-}
-
-/************************************************************
- Version compare implementation
-*************************************************************/
-
-int
-eazel_package_system_rpm3_compare_version (EazelPackageSystem *system,
- const char *a,
- const char *b)
-{
- int result;
- result = rpmvercmp (a, b);
- /* Special bandaid for M18 <> 0.7 mozilla versions */
- if (isdigit (*a) && *b=='M') {
- if (result < 0) { result = abs (result); }
- }
- return result;
-}
-
-/************************************
- Database mtime implementation
-************************************/
-time_t
-eazel_package_system_rpm3_database_mtime (EazelPackageSystemRpm3 *system)
-{
- struct stat st;
-
- if (stat (DEFAULT_DB_PATH "/" A_DB_FILE, &st) == 0) {
- return st.st_mtime;
- } else {
- return (time_t)0;
- }
-
-
-}
-
-/*****************************************
- GTK+ object stuff
-*****************************************/
-
-static void
-eazel_package_system_rpm3_finalize (GtkObject *object)
-{
- EazelPackageSystemRpm3 *system;
-
- g_return_if_fail (object != NULL);
- g_return_if_fail (EAZEL_PACKAGE_SYSTEM_RPM3 (object));
-
- system = EAZEL_PACKAGE_SYSTEM_RPM3 (object);
-
- eazel_package_system_rpm3_free_dbs (system);
- g_hash_table_destroy (system->private->dbs);
-
- if (GTK_OBJECT_CLASS (eazel_package_system_rpm3_parent_class)->finalize) {
- GTK_OBJECT_CLASS (eazel_package_system_rpm3_parent_class)->finalize (object);
- }
-}
-
-static void
-eazel_package_system_rpm3_class_initialize (EazelPackageSystemRpm3Class *klass)
-{
- GtkObjectClass *object_class;
-
- object_class = (GtkObjectClass*)klass;
- object_class->finalize = eazel_package_system_rpm3_finalize;
-
- eazel_package_system_rpm3_parent_class = gtk_type_class (eazel_package_system_get_type ());
-#ifdef HAVE_RPM_30
- klass->query_foreach = (EazelPackageSystemRpmQueryForeachFunc)eazel_package_system_rpm3_query_foreach;
- klass->query_impl = (EazelPackageSystemRpmQueryImplFunc)eazel_package_system_rpm3_query_impl;
-#else
- klass->query_foreach = NULL;
- klass->query_impl = NULL;
-#endif /* HAVE_RPM_30 */
-}
-
-static void
-eazel_package_system_rpm3_initialize (EazelPackageSystemRpm3 *system)
-{
- g_assert (system != NULL);
- g_assert (EAZEL_IS_PACKAGE_SYSTEM_RPM3 (system));
-
- system->private = g_new0 (EazelPackageSystemRpm3Private, 1);
- system->private->dbs = g_hash_table_new (g_str_hash, g_str_equal);
- system->private->db_to_root = g_hash_table_new (g_str_hash, g_str_equal);
-}
-
-GtkType
-eazel_package_system_rpm3_get_type() {
- static GtkType system_type = 0;
-
- /* First time it's called ? */
- if (!system_type)
- {
- static const GtkTypeInfo system_info =
- {
- "EazelPackageSystemRpm3",
- sizeof (EazelPackageSystemRpm3),
- sizeof (EazelPackageSystemRpm3Class),
- (GtkClassInitFunc) eazel_package_system_rpm3_class_initialize,
- (GtkObjectInitFunc) eazel_package_system_rpm3_initialize,
- /* reserved_1 */ NULL,
- /* reserved_2 */ NULL,
- (GtkClassInitFunc) NULL,
- };
-
- system_type = gtk_type_unique (eazel_package_system_get_type (), &system_info);
- }
-
- return system_type;
-}
-
-EazelPackageSystemRpm3 *
-eazel_package_system_rpm3_new (GList *dbpaths)
-{
- EazelPackageSystemRpm3 *system;
-
- g_return_val_if_fail (dbpaths, NULL);
-
- system = EAZEL_PACKAGE_SYSTEM_RPM3 (gtk_object_new (TYPE_EAZEL_PACKAGE_SYSTEM_RPM3, NULL));
-
- gtk_object_ref (GTK_OBJECT (system));
- gtk_object_sink (GTK_OBJECT (system));
-
- eazel_package_system_rpm3_create_dbs (system, dbpaths);
-
- return system;
-}
-
-#ifdef HAVE_RPM_30
-EazelPackageSystem*
-eazel_package_system_implementation (GList *dbpaths)
-{
- EazelPackageSystem *result;
- GList *tdbpaths = dbpaths;
-
- g_message ("Eazel Package System - rpm3 (root %s is db %s)", DEFAULT_ROOT, DEFAULT_DB_PATH);
-
- tdbpaths = g_list_prepend (tdbpaths, g_strdup (DEFAULT_ROOT));
- tdbpaths = g_list_prepend (tdbpaths, g_strdup (DEFAULT_DB_PATH));
- result = EAZEL_PACKAGE_SYSTEM (eazel_package_system_rpm3_new (tdbpaths));
-
- result->private->load_package =
- (EazelPackageSytemLoadPackageFunc)eazel_package_system_rpm3_load_package;
- result->private->query = (EazelPackageSytemQueryFunc)eazel_package_system_rpm3_query;
- result->private->install = (EazelPackageSytemInstallFunc)eazel_package_system_rpm3_install;
- result->private->uninstall = (EazelPackageSytemUninstallFunc)eazel_package_system_rpm3_uninstall;
- result->private->verify = (EazelPackageSytemVerifyFunc)eazel_package_system_rpm3_verify;
- result->private->compare_version =
- (EazelPackageSystemCompareVersionFunc)eazel_package_system_rpm3_compare_version;
- result->private->database_mtime =
- (EazelPackageSystemDatabaseMtimeFunc)eazel_package_system_rpm3_database_mtime;
-
- return result;
-}
-#endif /* HAVE_RPM_30 */
-
-#endif /* HAVE_RPM */
diff --git a/components/services/install/lib/eazel-package-system-rpm3.h b/components/services/install/lib/eazel-package-system-rpm3.h
deleted file mode 100644
index d478ce5a5..000000000
--- a/components/services/install/lib/eazel-package-system-rpm3.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: Eskil Heyn Olsen <eskil@eazel.com>
- *
- */
-
-#ifndef EAZEL_PACKAGE_SYSTEM_RPM3_H
-#define EAZEL_PACKAGE_SYSTEM_RPM3_H
-
-#include "eazel-package-system.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-#define TYPE_EAZEL_PACKAGE_SYSTEM_RPM3 (eazel_package_system_rpm3_get_type ())
-#define EAZEL_PACKAGE_SYSTEM_RPM3(obj) (GTK_CHECK_CAST ((obj), TYPE_EAZEL_PACKAGE_SYSTEM_RPM3, EazelPackageSystemRpm3))
-#define EAZEL_PACKAGE_SYSTEM_RPM3_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), TYPE_EAZEL_PACKAGE_SYSTEM_RPM3, EazelPackageSystemRpm3Class))
-#define EAZEL_IS_PACKAGE_SYSTEM_RPM3(obj) (GTK_CHECK_TYPE ((obj), TYPE_EAZEL_PACKAGE_SYSTEM_RPM3))
-#define EAZEL_IS_PACKAGE_SYSTEM_RPM3_CLASS(klass)(GTK_CHECK_CLASS_TYPE ((klass), TYPE_EAZEL_PACKAGE_SYSTEM_RPM3))
-
-typedef struct _EazelPackageSystemRpm3 EazelPackageSystemRpm3;
-typedef struct _EazelPackageSystemRpm3Class EazelPackageSystemRpm3Class;
-
-typedef void (*EazelPackageSystemRpmQueryForeachFunc) (const char *dbpath,
- gpointer db,
- gpointer pig);
-typedef void (*EazelPackageSystemRpmQueryImplFunc) (EazelPackageSystem *system,
- const char *dbpath,
- const char* key,
- EazelPackageSystemQueryEnum flag,
- int detail_level,
- GList **result);
-
-struct _EazelPackageSystemRpm3Class
-{
- EazelPackageSystemClass parent_class;
-
- EazelPackageSystemRpmQueryForeachFunc query_foreach;
- EazelPackageSystemRpmQueryImplFunc query_impl;
-};
-
-typedef struct _EazelPackageSystemRpm3Private EazelPackageSystemRpm3Private;
-
-struct _EazelPackageSystemRpm3
-{
- EazelPackageSystem parent;
- EazelPackageSystemRpm3Private *private;
-};
-EazelPackageSystemRpm3 *eazel_package_system_rpm3_new (GList *dbpaths);
-GtkType eazel_package_system_rpm3_get_type (void);
-
-#endif /* EAZEL_PACKAGE_SYSTEM_RPM3_H */
-
diff --git a/components/services/install/lib/eazel-package-system-rpm4.c b/components/services/install/lib/eazel-package-system-rpm4.c
deleted file mode 100644
index fddcf2731..000000000
--- a/components/services/install/lib/eazel-package-system-rpm4.c
+++ /dev/null
@@ -1,320 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: Eskil Heyn Olsen <eskil@eazel.com>
- *
- */
-
-#include <config.h>
-
-#ifdef HAVE_RPM
-#ifdef HAVE_RPM_40
-
-#include "eazel-package-system-rpm3-private.h"
-#include "eazel-package-system-rpm4.h"
-#include "eazel-package-system-private.h"
-#include <libtrilobite/trilobite-core-utils.h>
-
-#include <libtrilobite/trilobite-root-helper.h>
-#include <rpm/rpmlib.h>
-
-#include <ctype.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <string.h>
-
-#define DEFAULT_DB_PATH "/var/lib/rpm"
-#define DEFAULT_ROOT "/"
-
-EazelPackageSystem* eazel_package_system_implementation (GList*);
-
-/* This is the parent class pointer */
-static EazelPackageSystemRpm3Class *eazel_package_system_rpm4_parent_class;
-
-static void
-eazel_package_system_rpm4_query_impl (EazelPackageSystemRpm4 *system,
- const char *dbpath,
- const char *key,
- EazelPackageSystemQueryEnum flag,
- int detail_level,
- GList **result)
-{
- rpmdb db = eazel_package_system_rpm3_get_db (EAZEL_PACKAGE_SYSTEM_RPM3 (system), dbpath);
- rpmdbMatchIterator rpm_iterator = NULL;
-
- if (db==NULL) {
- return;
- }
-
- switch (flag) {
- case EAZEL_PACKAGE_SYSTEM_QUERY_OWNS:
- info (system, "query (in %s) OWNS %s", dbpath, key);
- rpm_iterator = rpmdbInitIterator (db, RPMTAG_BASENAMES, key, 0);
- break;
- case EAZEL_PACKAGE_SYSTEM_QUERY_PROVIDES:
- info (system, "query (in %s) PROVIDES %s", dbpath, key);
- rpm_iterator = rpmdbInitIterator (db, RPMTAG_PROVIDENAME, key, 0);
- break;
- case EAZEL_PACKAGE_SYSTEM_QUERY_MATCHES:
- info (system, "query (in %s) MATCHES %s", dbpath, key);
- rpm_iterator = rpmdbInitIterator (db, RPMDBI_LABEL, key, 0);
- break;
- case EAZEL_PACKAGE_SYSTEM_QUERY_REQUIRES:
- info (system, "query (in %s) REQUIRS %s", dbpath, key);
- rpm_iterator = rpmdbInitIterator (db, RPMTAG_REQUIRENAME, key, 0);
- break;
- default:
- g_warning ("Unknown query flag %d", flag);
- g_assert_not_reached ();
- break;
- }
-
- if (rpm_iterator) {
- Header hd;
- info (system, "%d hits", rpmdbGetIteratorCount (rpm_iterator));
-
- for (hd = rpmdbNextIterator (rpm_iterator);
- hd;
- hd = rpmdbNextIterator (rpm_iterator)) {
- PackageData *pack = packagedata_new ();
-
- eazel_package_system_rpm3_packagedata_fill_from_header (EAZEL_PACKAGE_SYSTEM_RPM3 (system),
- pack,
- hd,
- detail_level);
- g_free (pack->install_root);
- pack->install_root = g_strdup (dbpath);
- if (g_list_find_custom (*result,
- pack,
- (GCompareFunc)eazel_install_package_compare)!=NULL) {
- info (system, "%s already in set", pack->name);
- gtk_object_unref (GTK_OBJECT (pack));
- } else {
- (*result) = g_list_prepend (*result, pack);
- }
- }
-
- rpmdbFreeIterator (rpm_iterator);
- }
-}
-
-static void
-eazel_package_system_rpm4_query_substr (EazelPackageSystemRpm4 *system,
- const char *dbpath,
- const char *key,
- int detail_level,
- GList **result)
-{
- rpmdbMatchIterator rpm_iterator = NULL;
- rpmdb db = eazel_package_system_rpm3_get_db (EAZEL_PACKAGE_SYSTEM_RPM3 (system), dbpath);
-
- if (!db) {
- return;
- }
-
- rpm_iterator = rpmdbInitIterator (db, RPMDBI_PACKAGES, NULL, 0);
-
- if (rpm_iterator) {
- Header hd;
-
- info (system, "%d hits", rpmdbGetIteratorCount (rpm_iterator));
-
- for (hd = rpmdbNextIterator (rpm_iterator);
- hd;
- hd = rpmdbNextIterator (rpm_iterator)) {
- char *name = NULL;
-
- eazel_package_system_rpm3_get_and_set_string_tag (hd, RPMTAG_NAME, &name);
-
- /* If key occurs in name, create package and add to result */
- if (strstr (name, key)) {
- PackageData *pack = packagedata_new ();
- eazel_package_system_rpm3_packagedata_fill_from_header (EAZEL_PACKAGE_SYSTEM_RPM3 (system),
- pack,
- hd,
- detail_level);
- (*result) = g_list_prepend (*result, pack);
- } else {
- headerFree (hd);
- }
-
- g_free (name);
- }
- }
-}
-
-static void
-eazel_package_system_rpm4_query_foreach (const char *dbpath,
- rpmdb db,
- struct RpmQueryPiggyBag *pig)
-{
-
- switch (pig->flag) {
- case EAZEL_PACKAGE_SYSTEM_QUERY_OWNS:
- case EAZEL_PACKAGE_SYSTEM_QUERY_PROVIDES:
- case EAZEL_PACKAGE_SYSTEM_QUERY_MATCHES:
- eazel_package_system_rpm4_query_impl (EAZEL_PACKAGE_SYSTEM_RPM4 (pig->system),
- dbpath,
- pig->key,
- pig->flag,
- pig->detail_level,
- pig->result);
- break;
- case EAZEL_PACKAGE_SYSTEM_QUERY_REQUIRES:
- eazel_package_system_rpm3_query_requires (EAZEL_PACKAGE_SYSTEM_RPM3 (pig->system),
- dbpath,
- pig->key,
- pig->detail_level,
- pig->result);
- break;
- case EAZEL_PACKAGE_SYSTEM_QUERY_REQUIRES_FEATURE:
- eazel_package_system_rpm3_query_requires_feature (EAZEL_PACKAGE_SYSTEM_RPM3 (pig->system),
- dbpath,
- pig->key,
- pig->detail_level,
- pig->result);
- break;
- case EAZEL_PACKAGE_SYSTEM_QUERY_SUBSTR:
- eazel_package_system_rpm4_query_substr (EAZEL_PACKAGE_SYSTEM_RPM4 (pig->system),
- dbpath,
- pig->key,
- pig->detail_level,
- pig->result);
- break;
- default:
- g_warning ("Unknown query flag %d", pig->flag);
- g_assert_not_reached ();
- }
-
-}
-
-
-/*****************************************
- GTK+ object stuff
-*****************************************/
-
-static void
-eazel_package_system_rpm4_finalize (GtkObject *object)
-{
- EazelPackageSystemRpm4 *system;
-
- g_return_if_fail (object != NULL);
- g_return_if_fail (EAZEL_PACKAGE_SYSTEM_RPM4 (object));
-
- system = EAZEL_PACKAGE_SYSTEM_RPM4 (object);
-
- if (GTK_OBJECT_CLASS (eazel_package_system_rpm4_parent_class)->finalize) {
- GTK_OBJECT_CLASS (eazel_package_system_rpm4_parent_class)->finalize (object);
- }
-}
-
-static void
-eazel_package_system_rpm4_class_initialize (EazelPackageSystemRpm4Class *klass)
-{
- GtkObjectClass *object_class;
- EazelPackageSystemRpm3Class *rpm3_class;
-
- object_class = (GtkObjectClass*)klass;
- rpm3_class = (EazelPackageSystemRpm3Class*)klass;
-
- eazel_package_system_rpm4_parent_class = gtk_type_class (eazel_package_system_rpm3_get_type ());
-
- object_class->finalize = eazel_package_system_rpm4_finalize;
-
- rpm3_class->query_foreach = (EazelPackageSystemRpmQueryForeachFunc)eazel_package_system_rpm4_query_foreach;
- rpm3_class->query_impl = (EazelPackageSystemRpmQueryImplFunc)eazel_package_system_rpm4_query_impl;
-}
-
-static void
-eazel_package_system_rpm4_initialize (EazelPackageSystemRpm4 *system) {
- g_assert (system != NULL);
- g_assert (EAZEL_IS_PACKAGE_SYSTEM_RPM4 (system));
-}
-
-GtkType
-eazel_package_system_rpm4_get_type() {
- static GtkType system_type = 0;
-
- /* First time it's called ? */
- if (!system_type)
- {
- static const GtkTypeInfo system_info =
- {
- "EazelPackageSystemRpm4",
- sizeof (EazelPackageSystemRpm4),
- sizeof (EazelPackageSystemRpm4Class),
- (GtkClassInitFunc) eazel_package_system_rpm4_class_initialize,
- (GtkObjectInitFunc) eazel_package_system_rpm4_initialize,
- /* reserved_1 */ NULL,
- /* reserved_2 */ NULL,
- (GtkClassInitFunc) NULL,
- };
-
- system_type = gtk_type_unique (eazel_package_system_rpm3_get_type (), &system_info);
- }
-
- return system_type;
-}
-
-EazelPackageSystemRpm4 *
-eazel_package_system_rpm4_new (GList *dbpaths)
-{
- EazelPackageSystemRpm4 *system;
-
- g_return_val_if_fail (dbpaths, NULL);
-
- system = EAZEL_PACKAGE_SYSTEM_RPM4 (gtk_object_new (TYPE_EAZEL_PACKAGE_SYSTEM_RPM4, NULL));
-
- gtk_object_ref (GTK_OBJECT (system));
- gtk_object_sink (GTK_OBJECT (system));
-
- eazel_package_system_rpm3_create_dbs (EAZEL_PACKAGE_SYSTEM_RPM3 (system),
- dbpaths);
-
- return system;
-}
-
-EazelPackageSystem*
-eazel_package_system_implementation (GList *dbpaths)
-{
- EazelPackageSystem *result;
- GList *tdbpaths = dbpaths;
-
- g_message ("Eazel Package System - rpm4");
-
- tdbpaths = g_list_prepend (tdbpaths, g_strdup (DEFAULT_ROOT));
- tdbpaths = g_list_prepend (tdbpaths, g_strdup (DEFAULT_DB_PATH));
- result = EAZEL_PACKAGE_SYSTEM (eazel_package_system_rpm4_new (tdbpaths));
-
- result->private->load_package = (EazelPackageSytemLoadPackageFunc)eazel_package_system_rpm3_load_package;
- result->private->query = (EazelPackageSytemQueryFunc)eazel_package_system_rpm3_query;
- result->private->install = (EazelPackageSytemInstallFunc)eazel_package_system_rpm3_install;
- result->private->uninstall = (EazelPackageSytemUninstallFunc)eazel_package_system_rpm3_uninstall;
- result->private->verify = (EazelPackageSytemVerifyFunc)eazel_package_system_rpm3_verify;
- result->private->compare_version =
- (EazelPackageSystemCompareVersionFunc)eazel_package_system_rpm3_compare_version;
- result->private->database_mtime =
- (EazelPackageSystemDatabaseMtimeFunc)eazel_package_system_rpm3_database_mtime;
-
- return result;
-}
-
-#endif /* HAVE_RPM_40 */
-#endif /* HAVE_RPM */
diff --git a/components/services/install/lib/eazel-package-system-rpm4.h b/components/services/install/lib/eazel-package-system-rpm4.h
deleted file mode 100644
index 9ec4fcb25..000000000
--- a/components/services/install/lib/eazel-package-system-rpm4.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: Eskil Heyn Olsen <eskil@eazel.com>
- *
- */
-
-#ifndef EAZEL_PACKAGE_SYSTEM_RPM4_H
-#define EAZEL_PACKAGE_SYSTEM_RPM4_H
-
-#include "eazel-package-system-rpm3.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-#define TYPE_EAZEL_PACKAGE_SYSTEM_RPM4 (eazel_package_system_rpm4_get_type ())
-#define EAZEL_PACKAGE_SYSTEM_RPM4(obj) (GTK_CHECK_CAST ((obj), TYPE_EAZEL_PACKAGE_SYSTEM_RPM4, EazelPackageSystemRpm4))
-#define EAZEL_PACKAGE_SYSTEM_RPM4_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), TYPE_EAZEL_PACKAGE_SYSTEM_RPM4, EazelPackageSystemRpm4Class))
-#define EAZEL_IS_PACKAGE_SYSTEM_RPM4(obj) (GTK_CHECK_TYPE ((obj), TYPE_EAZEL_PACKAGE_SYSTEM_RPM4))
-#define EAZEL_IS_PACKAGE_SYSTEM_RPM4_CLASS(klass)(GTK_CHECK_CLASS_TYPE ((klass), TYPE_EAZEL_PACKAGE_SYSTEM_RPM4))
-
-typedef struct _EazelPackageSystemRpm4 EazelPackageSystemRpm4;
-typedef struct _EazelPackageSystemRpm4Class EazelPackageSystemRpm4Class;
-
-struct _EazelPackageSystemRpm4Class
-{
- EazelPackageSystemRpm3Class parent_class;
-
-};
-
-struct _EazelPackageSystemRpm4
-{
- EazelPackageSystemRpm3 parent;
-};
-EazelPackageSystemRpm4 *eazel_package_system_rpm4_new (GList *dbpaths);
-GtkType eazel_package_system_rpm4_get_type (void);
-
-#endif /* EAZEL_PACKAGE_SYSTEM_RPM4_H */
-
diff --git a/components/services/install/lib/eazel-package-system-skeleton.c b/components/services/install/lib/eazel-package-system-skeleton.c
deleted file mode 100644
index a62eea61a..000000000
--- a/components/services/install/lib/eazel-package-system-skeleton.c
+++ /dev/null
@@ -1,214 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: Eskil Heyn Olsen <eskil@eazel.com>
- *
- */
-
-#include <config.h>
-#include <gnome.h>
-#include "eazel-package-system-skeleton.h"
-#include "eazel-package-system-private.h"
-#include <libtrilobite/trilobite-core-utils.h>
-
-EazelPackageSystem* eazel_package_system_implementation (GList*);
-
-/* This is the parent class pointer */
-static EazelPackageSystemClass *eazel_package_system_skeleton_parent_class;
-
-static PackageData*
-eazel_package_system_skeleton_load_package (EazelPackageSystemSkeleton *system,
- PackageData *in_package,
- const char *filename,
- int detail_level)
-{
- PackageData *result = NULL;
- g_assert (system != NULL);
- g_assert (EAZEL_IS_PACKAGE_SYSTEM_SKELETON (system));
- trilobite_debug ("eazel_package_system_skeleton_load_package");
- /* Code Here */
- return result;
-}
-
-static GList*
-eazel_package_system_skeleton_query (EazelPackageSystemSkeleton *system,
- const char *dbpath,
- const gpointer key,
- EazelPackageSystemQueryEnum flag,
- int detail_level)
-{
- GList *result = NULL;
- g_assert (system != NULL);
- g_assert (EAZEL_IS_PACKAGE_SYSTEM_SKELETON (system));
- trilobite_debug ("eazel_package_system_skeleton_query");
- /* Code Here */
- return result;
-}
-
-static void
-eazel_package_system_skeleton_install (EazelPackageSystemSkeleton *system,
- const char *dbpath,
- GList* packages,
- unsigned long flags)
-{
- g_assert (system != NULL);
- g_assert (EAZEL_IS_PACKAGE_SYSTEM_SKELETON (system));
- trilobite_debug ("eazel_package_system_skeleton_install");
- /* Code Here */
-}
-
-static void
-eazel_package_system_skeleton_uninstall (EazelPackageSystemSkeleton *system,
- const char *dbpath,
- GList* packages,
- unsigned long flags)
-{
- g_assert (system != NULL);
- g_assert (EAZEL_IS_PACKAGE_SYSTEM_SKELETON (system));
- trilobite_debug ("eazel_package_system_skeleton_uninstall");
- /* Code Here */
-}
-
-static gboolean
-eazel_package_system_skeleton_verify (EazelPackageSystemSkeleton *system,
- GList* packages)
-{
- g_assert (system != NULL);
- g_assert (EAZEL_IS_PACKAGE_SYSTEM_SKELETON (system));
- trilobite_debug ("eazel_package_system_skeleton_verify");
- /* Code Here */
- return FALSE;
-}
-
-static int
-eazel_package_system_skeleton_compare_version (EazelPackageSystemSkeleton *system,
- const char *a,
- const char *b)
-{
- g_assert (system != NULL);
- g_assert (EAZEL_IS_PACKAGE_SYSTEM_SKELETON (system));
- trilobite_debug ("eazel_package_system_skeleton_compare_version");
- /* Code Here */
- return 0;
-}
-
-
-/*****************************************
- GTK+ object stuff
-*****************************************/
-
-static void
-eazel_package_system_skeleton_finalize (GtkObject *object)
-{
- EazelPackageSystemSkeleton *system;
-
- g_return_if_fail (object != NULL);
- g_return_if_fail (EAZEL_PACKAGE_SYSTEM_SKELETON (object));
-
- system = EAZEL_PACKAGE_SYSTEM_SKELETON (object);
-
- if (GTK_OBJECT_CLASS (eazel_package_system_skeleton_parent_class)->finalize) {
- GTK_OBJECT_CLASS (eazel_package_system_skeleton_parent_class)->finalize (object);
- }
-}
-
-static void
-eazel_package_system_skeleton_class_initialize (EazelPackageSystemSkeletonClass *klass)
-{
- GtkObjectClass *object_class;
-
- object_class = (GtkObjectClass*)klass;
- object_class->finalize = eazel_package_system_skeleton_finalize;
-
- eazel_package_system_skeleton_parent_class = gtk_type_class (eazel_package_system_get_type ());
-}
-
-static void
-eazel_package_system_skeleton_initialize (EazelPackageSystemSkeleton *system) {
- g_assert (system != NULL);
- g_assert (EAZEL_IS_PACKAGE_SYSTEM_SKELETON (system));
-}
-
-GtkType
-eazel_package_system_skeleton_get_type() {
- static GtkType system_type = 0;
-
- /* First time it's called ? */
- if (!system_type)
- {
- static const GtkTypeInfo system_info =
- {
- "EazelPackageSystemSkeleton",
- sizeof (EazelPackageSystemSkeleton),
- sizeof (EazelPackageSystemSkeletonClass),
- (GtkClassInitFunc) eazel_package_system_skeleton_class_initialize,
- (GtkObjectInitFunc) eazel_package_system_skeleton_initialize,
- /* reserved_1 */ NULL,
- /* reserved_2 */ NULL,
- (GtkClassInitFunc) NULL,
- };
-
- system_type = gtk_type_unique (eazel_package_system_get_type (), &system_info);
- }
-
- return system_type;
-}
-
-EazelPackageSystemSkeleton *
-eazel_package_system_skeleton_new (GList *dbpaths)
-{
- EazelPackageSystemSkeleton *system;
-
- system = EAZEL_PACKAGE_SYSTEM_SKELETON (gtk_object_new (TYPE_EAZEL_PACKAGE_SYSTEM_SKELETON, NULL));
-
- gtk_object_ref (GTK_OBJECT (system));
- gtk_object_sink (GTK_OBJECT (system));
-
- return system;
-}
-
-EazelPackageSystem*
-eazel_package_system_implementation (GList *dbpaths)
-{
- EazelPackageSystem *result;
-
- trilobite_debug ("eazel_package_system_implementation (skeleton)");
-
- result = EAZEL_PACKAGE_SYSTEM (eazel_package_system_skeleton_new (dbpaths));
-
- result->private->load_package
- = (EazelPackageSytemLoadPackageFunc)eazel_package_system_skeleton_load_package;
-
- result->private->query
- = (EazelPackageSytemQueryFunc)eazel_package_system_skeleton_query;
-
- result->private->install
- = (EazelPackageSytemInstallFunc)eazel_package_system_skeleton_install;
-
- result->private->uninstall
- = (EazelPackageSytemUninstallFunc)eazel_package_system_skeleton_uninstall;
-
- result->private->verify
- = (EazelPackageSytemVerifyFunc)eazel_package_system_skeleton_verify;
-
- result->private->compare_version
- = (EazelPackageSystemCompareVersionFunc)eazel_package_system_skeleton_compare_version;
-
- return result;
-}
diff --git a/components/services/install/lib/eazel-package-system-skeleton.h b/components/services/install/lib/eazel-package-system-skeleton.h
deleted file mode 100644
index dc4e5176b..000000000
--- a/components/services/install/lib/eazel-package-system-skeleton.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: Eskil Heyn Olsen <eskil@eazel.com>
- *
- */
-
-#ifndef EAZEL_PACKAGE_SYSTEM_SKELETON_H
-#define EAZEL_PACKAGE_SYSTEM_SKELETON_H
-
-#include "eazel-package-system.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-#define TYPE_EAZEL_PACKAGE_SYSTEM_SKELETON (eazel_package_system_skeleton_get_type ())
-#define EAZEL_PACKAGE_SYSTEM_SKELETON(obj) (GTK_CHECK_CAST ((obj), TYPE_EAZEL_PACKAGE_SYSTEM_SKELETON, EazelPackageSystemSkeleton))
-#define EAZEL_PACKAGE_SYSTEM_SKELETON_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), TYPE_EAZEL_PACKAGE_SYSTEM_SKELETON, EazelPackageSystemSkeletonClass))
-#define EAZEL_IS_PACKAGE_SYSTEM_SKELETON(obj) (GTK_CHECK_TYPE ((obj), TYPE_EAZEL_PACKAGE_SYSTEM_SKELETON))
-#define EAZEL_IS_PACKAGE_SYSTEM_SKELETON_CLASS(klass)(GTK_CHECK_CLASS_TYPE ((klass), TYPE_EAZEL_PACKAGE_SYSTEM_SKELETON))
-
-typedef struct _EazelPackageSystemSkeleton EazelPackageSystemSkeleton;
-typedef struct _EazelPackageSystemSkeletonClass EazelPackageSystemSkeletonClass;
-
-
-struct _EazelPackageSystemSkeletonClass
-{
- EazelPackageSystemClass parent_class;
-};
-
-struct _EazelPackageSystemSkeleton
-{
- EazelPackageSystem parent;
-};
-
-EazelPackageSystemSkeleton *eazel_package_system_skeleton_new (GList *dbpaths);
-GtkType eazel_package_system_skeleton_get_type (void);
-
-#endif /* EAZEL_PACKAGE_SYSTEM_SKELETON_H */
-
diff --git a/components/services/install/lib/eazel-package-system-types.c b/components/services/install/lib/eazel-package-system-types.c
deleted file mode 100644
index 759785935..000000000
--- a/components/services/install/lib/eazel-package-system-types.c
+++ /dev/null
@@ -1,2120 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Copyright (C) 2000 Eazel, Inc
- * Copyright (C) 2000 Helix Code, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: Eskil Heyn Olsen <eskil@eazel.com>
- * Robey Pointer <robey@eazel.com>
- */
-
-/*
- I'm declaring these _foreach, since we can then export their prototypes in the
- api
- */
-
-#include <config.h>
-#include "eazel-package-system-types.h"
-#include "eazel-softcat.h" /* for softcat sense flags */
-#include <libtrilobite/trilobite-core-utils.h>
-
-#include <rpm/rpmlib.h>
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <string.h>
-
-#undef DEBUG_PACKAGE_ALLOCS
-
-#ifdef DEBUG_PACKAGE_ALLOCS
-static int report_all = 1;
-
-static int package_total_allocs = 0, package_max = 0;
-static int package_allocs = 0;
-GList *packages_allocated = NULL;
-
-static int packagebreaks_allocs = 0;
-static int packagedependency_allocs = 0;
-static int category_allocs = 0;
-
-static gboolean at_exit_registered = FALSE;
-
-static void
-at_exit_package_data_info (void)
-{
- if (packages_allocated == NULL) {
- trilobite_debug ("All packagedata structures deallocated");
- trilobite_debug ("Total of %d allocs, max at once was %d", package_total_allocs, package_max);
- } else {
- GList *iterator;
- trilobite_debug ("Fordømt! %d packagedata structures were leaked", g_list_length (packages_allocated));
- trilobite_debug ("Total of %d allocs, max at once was %d", package_total_allocs, package_max);
- for (iterator = packages_allocated; iterator; iterator = g_list_next (iterator)) {
- PackageData *pack = PACKAGEDATA (iterator->data);
- trilobite_debug ("package %p (%s) not deallocated", pack, pack->name);
- }
- trilobite_debug ("Don't report this as a bug if you're running from CVS or hourly builds");
- }
- if (category_allocs) {
- trilobite_debug ("Fordømt! %d categorydata structures were leaked", category_allocs);
- }
- if (packagebreaks_allocs) {
- trilobite_debug ("Fordømt! %d packagebreaks structures were leaked", packagebreaks_allocs);
- }
-}
-#endif /* DEBUG_PACKAGE_ALLOCS */
-
-static GtkObjectClass *packagedata_parent_class;
-static GtkObjectClass *packagedependency_parent_class;
-static GtkObjectClass *packagebreaks_parent_class;
-static PackageBreaksClass *packagefileconflict_parent_class;
-static PackageBreaksClass *packagefeaturemissing_parent_class;
-
-const char *
-eazel_install_protocol_as_string (URLType protocol)
-{
- switch (protocol) {
- case PROTOCOL_HTTP:
- return "http";
- break;
- case PROTOCOL_FTP:
- return "ftp";
- break;
- case PROTOCOL_LOCAL:
- return "file";
- break;
- }
- return "???";
-}
-
-CategoryData*
-categorydata_new (void)
-{
- CategoryData *result;
-
- result = g_new0 (CategoryData, 1);
-#ifdef DEBUG_PACKAGE_ALLOCS
- category_allocs ++;
- if (report_all) trilobite_debug ("category_allocs increased to %d (%p)", category_allocs, result);
-#endif /* DEBUG_PACKAGE_ALLOCS */
- result->name = NULL;
- result->description = NULL;
- result->packages = NULL;
- result->depends = NULL;
- result->exclusive = FALSE;
- result->default_choice = FALSE;
- return result;
-}
-
-GList*
-categorydata_list_copy (const GList *list)
-{
- GList *result = NULL;
- const GList *ptr;
-
- for (ptr = list; ptr; ptr = g_list_next (ptr)) {
- result = g_list_prepend (result, categorydata_copy ((CategoryData*)(ptr->data)));
- }
- result = g_list_reverse (result);
-
- return result;
-}
-
-CategoryData*
-categorydata_copy (const CategoryData *cat)
-{
- CategoryData *result;
- GList *ptr;
-
- result = categorydata_new ();
-
- result->name = g_strdup (cat->name);
- result->description = g_strdup (cat->description);
- result->packages = packagedata_list_copy (cat->packages, TRUE);
-
- for (ptr = cat->depends; ptr; ptr = g_list_next (ptr)) {
- result->depends = g_list_prepend (result->depends,
- g_strdup ((char*)ptr->data));
- }
- result->depends = g_list_reverse (result->depends);
-
- return result;
-}
-
-void
-categorydata_destroy_foreach (CategoryData *cd, gpointer ununsed)
-{
-#ifdef DEBUG_PACKAGE_ALLOCS
- category_allocs --;
- if (report_all) trilobite_debug ("category_allocs decreased to %d (%p) %s", category_allocs, cd, cd ? cd->name: "?");
-#endif /* DEBUG_PACKAGE_ALLOCS */
-
- g_return_if_fail (cd != NULL);
- if (cd->packages) {
- g_list_foreach (cd->packages, (GFunc)gtk_object_unref, NULL);
- } else trilobite_debug ("EMPTY");
- g_list_free (cd->packages);
- cd->packages = NULL;
- if (g_list_length (cd->depends)) {
- g_list_foreach (cd->depends, (GFunc)g_free, NULL);
- }
- g_list_free (cd->depends);
- cd->depends = NULL;
- g_free (cd->name);
- cd->name = NULL;
- g_free (cd->description);
- cd->description = NULL;
-}
-
-void
-categorydata_destroy (CategoryData *cd)
-{
- categorydata_destroy_foreach (cd, NULL);
-}
-
-void
-categorydata_list_destroy (GList *list)
-{
- if (g_list_length (list)) {
- g_list_foreach (list, (GFunc) categorydata_destroy_foreach, NULL);
- }
- g_list_free (list);
-}
-
-GList*
-categorylist_flatten_to_packagelist (GList *categories)
-{
- GList* packages = NULL;
- GList* category_iterator;
-
- for (category_iterator = categories; category_iterator; category_iterator = g_list_next (category_iterator)) {
- CategoryData *cat = (CategoryData*)category_iterator->data;
- if (packages) {
- packages = g_list_concat (packages, g_list_copy (cat->packages));
- } else {
- packages = g_list_copy (cat->packages);
- }
- }
-
-
- return packages;
-}
-
-/*************************************************************************************************/
-
-/**********************************************************************************
- GTK+ crap for PackageData objects
- **********************************************************************************/
-
-static void
-packagedependency_finalize (GtkObject *obj)
-{
- PackageDependency *packdep = PACKAGEDEPENDENCY (obj);
-
-#ifdef DEBUG_PACKAGE_ALLOCS
- packagedependency_allocs --;
- if (report_all) {
- if (packdep) {
- trilobite_debug ("packagedependency_allocs decreased to %d (%p) %s %s",
- packagedependency_allocs,
- packdep,
- packdep->package ? packdep->package->name : "(package=null)",
- packdep->version);
- } else {
- trilobite_debug ("packagedepencey_allocs decreased to %d (%p) ??",
- packagedependency_allocs,
- packdep);
- }
- }
-#endif /* DEBUG_PACKAGE_ALLOCS */
-
- g_return_if_fail (packdep != NULL);
-
-}
-
-static void
-packagedependency_class_initialize (PackageDependencyClass *klass)
-{
- GtkObjectClass *object_class;
-
- packagedependency_parent_class = gtk_type_class (gtk_object_get_type ());
-
- object_class = (GtkObjectClass*)klass;
- object_class->finalize = packagedependency_finalize;
-
- klass->finalize = packagedependency_finalize;
-}
-
-static void
-packagedependency_initialize (PackageDependency *packdep) {
- g_assert (packdep!=NULL);
- g_assert (IS_PACKAGEDEPENDENCY (packdep));
-
-
-#ifdef DEBUG_PACKAGE_ALLOCS
- packagedependency_allocs ++;
- if (report_all) trilobite_debug ("packagedependency_allocs increased to %d (%p)",
- packagedependency_allocs, packdep);
- if (!at_exit_registered) {
- atexit (&at_exit_package_data_info);
- at_exit_registered = TRUE;
- }
-#endif /* DEBUG_PACKAGE_ALLOCS */
-
- packdep->package = NULL;
- packdep->version = NULL;
- packdep->sense = 0;
-}
-
-GtkType
-packagedependency_get_type (void)
-{
- static GtkType object_type = 0;
-
- /* First time it's called ? */
- if (!object_type)
- {
- static const GtkTypeInfo object_info =
- {
- "PackageDependency",
- sizeof (PackageDependency),
- sizeof (PackageDependencyClass),
- (GtkClassInitFunc) packagedependency_class_initialize,
- (GtkObjectInitFunc) packagedependency_initialize,
- /* reserved_1 */ NULL,
- /* reserved_2 */ NULL,
- (GtkClassInitFunc) NULL,
- };
-
- object_type = gtk_type_unique (gtk_object_get_type (), &object_info);
- }
-
- return object_type;
-}
-
-PackageDependency*
-packagedependency_new ()
-{
- PackageDependency *packdep;
-
- packdep = PACKAGEDEPENDENCY (gtk_object_new (TYPE_PACKAGEDEPENDENCY, NULL));
- gtk_object_ref (GTK_OBJECT (packdep));
- gtk_object_sink (GTK_OBJECT (packdep));
-
- return packdep;
-}
-
-
-PackageDependency *
-packagedependency_copy (const PackageDependency *dep, gboolean deep)
-{
- PackageDependency *newdep;
-
- g_assert (dep);
- g_assert (IS_PACKAGEDEPENDENCY (dep));
-
- newdep = packagedependency_new ();
-
- newdep->sense = dep->sense;
- newdep->version = g_strdup (dep->version);
-
- if (dep->package != NULL) {
- newdep->package = packagedata_copy (dep->package, deep);
- }
- return newdep;
-}
-
-/**********************************************************************************
- GTK+ crap for PackageData objects
- **********************************************************************************/
-
-static void
-packagedata_finalize (GtkObject *obj)
-{
- PackageData *pack = PACKAGEDATA (obj);
-
-#ifdef DEBUG_PACKAGE_ALLOCS
- package_allocs --;
- if (report_all) {
- if (pack) {
- if (pack->name) {
- trilobite_debug ("package_allocs decreased to %d (%p) %s",
- package_allocs, pack,pack->name);
- } else if (pack->provides) {
- trilobite_debug ("package_allocs decreased to %d (%p) providing %s",
- package_allocs, pack,
- (char*)pack->provides->data);
- } else {
- trilobite_debug ("package_allocs decreased to %d (%p) ?", package_allocs, pack);
- }
- } else {
- trilobite_debug ("package_allocs decreased to %d (%p) ??", package_allocs, pack);
- }
- }
- packages_allocated = g_list_remove (packages_allocated, pack);
-#endif /* DEBUG_PACKAGE_ALLOCS */
- g_return_if_fail (pack != NULL);
-
- g_free (pack->name);
- pack->name = NULL;
- g_free (pack->version);
- pack->version = NULL;
- g_free (pack->minor);
- pack->minor = NULL;
- g_free (pack->archtype);
- pack->archtype = NULL;
- g_free (pack->summary);
- pack->summary = NULL;
- g_free (pack->description);
- pack->description = NULL;
- pack->bytesize = 0;
- pack->filesize = 0;
- g_free (pack->filename);
- pack->filename = NULL;
- g_free (pack->eazel_id);
- pack->eazel_id = NULL;
- g_free (pack->suite_id);
- pack->suite_id = NULL;
- g_free (pack->remote_url);
- pack->remote_url = NULL;
- g_free (pack->install_root);
- pack->install_root = NULL;
- g_free (pack->md5);
- pack->md5 = NULL;
- g_list_foreach (pack->provides, (GFunc)g_free, NULL);
- g_list_free (pack->provides);
- pack->provides = NULL;
- g_list_foreach (pack->features, (GFunc)g_free, NULL);
- g_list_free (pack->features);
- pack->features = NULL;
-
- g_list_foreach (pack->depends, (GFunc)gtk_object_unref, NULL);
- g_list_free (pack->depends);
- pack->depends = NULL;
-
- g_list_foreach (pack->breaks, (GFunc)gtk_object_unref, NULL);
- g_list_free (pack->breaks);
- pack->breaks = NULL;
-
- g_list_foreach (pack->modifies, (GFunc)gtk_object_unref, NULL);
- g_list_free (pack->modifies);
- pack->modifies = NULL;
-
- g_list_foreach (pack->obsoletes, (GFunc)g_free, NULL);
- g_list_free (pack->obsoletes);
- pack->obsoletes = NULL;
-
- pack->epoch = 0;
-
- if (pack->packsys_struc) {
- /* FIXME: bugzilla.eazel.com 6007
- */
-#ifdef HAVE_RPM_30
- headerFree ((Header) pack->packsys_struc);
-#endif /* HAVE_RPM_30 */
- pack->packsys_struc = NULL;
- }
-
- if (packagedata_parent_class->finalize) {
- packagedata_parent_class->finalize (obj);
- }
-}
-
-static void
-packagedata_class_initialize (PackageDataClass *klass)
-{
- GtkObjectClass *object_class;
-
- packagedata_parent_class = gtk_type_class (gtk_object_get_type ());
-
- object_class = (GtkObjectClass*)klass;
- object_class->finalize = packagedata_finalize;
-
- klass->finalize = packagedata_finalize;
-}
-
-static void
-packagedata_initialize (PackageData *package) {
- g_assert (package!=NULL);
- g_assert (IS_PACKAGEDATA (package));
-
-
-#ifdef DEBUG_PACKAGE_ALLOCS
- package_allocs ++;
- package_total_allocs ++;
- if (package_allocs > package_max) { package_max = package_allocs; }
- if (report_all) trilobite_debug ("package_allocs increased to %d (%p)", package_allocs, package);
- if (!at_exit_registered) {
- atexit (&at_exit_package_data_info);
- at_exit_registered = TRUE;
- }
- packages_allocated = g_list_prepend (packages_allocated, package);
-#endif /* DEBUG_PACKAGE_ALLOCS */
-
- package->name = NULL;
- package->version = NULL;
- package->minor = NULL;
- package->archtype = NULL;
- package->source_package = FALSE;
- package->summary = NULL;
- package->description = NULL;
- package->bytesize = 0;
- package->filesize = 0;
- package->distribution = trilobite_get_distribution ();
- package->filename = NULL;
- package->eazel_id = NULL;
- package->suite_id = NULL;
- package->remote_url = NULL;
- package->conflicts_checked = FALSE;
- package->install_root = NULL;
- package->provides = NULL;
- package->breaks = NULL;
- package->modifies = NULL;
- package->depends = NULL;
- package->status = PACKAGE_UNKNOWN_STATUS;
- package->modify_status = PACKAGE_MOD_UNTOUCHED;
- package->md5 = NULL;
- package->packsys_struc = NULL;
- package->features = NULL;
- package->fillflag = PACKAGE_FILL_INVALID;
- package->obsoletes = NULL;
- package->epoch = 0;
-}
-
-GtkType
-packagedata_get_type (void)
-{
- static GtkType object_type = 0;
-
- /* First time it's called ? */
- if (!object_type)
- {
- static const GtkTypeInfo object_info =
- {
- "PackageData",
- sizeof (PackageData),
- sizeof (PackageDataClass),
- (GtkClassInitFunc) packagedata_class_initialize,
- (GtkObjectInitFunc) packagedata_initialize,
- /* reserved_1 */ NULL,
- /* reserved_2 */ NULL,
- (GtkClassInitFunc) NULL,
- };
-
- object_type = gtk_type_unique (gtk_object_get_type (), &object_info);
- }
-
- return object_type;
-}
-
-PackageData*
-packagedata_new ()
-{
- PackageData *package;
-
- package = PACKAGEDATA (gtk_object_new (TYPE_PACKAGEDATA, NULL));
- gtk_object_ref (GTK_OBJECT (package));
- gtk_object_sink (GTK_OBJECT (package));
-
- return package;
-}
-
-/**********************************************************************************/
-
-GList *
-packagedata_list_copy (const GList *list, gboolean deep)
-{
- const GList *ptr;
- GList *result = NULL;
-
- for (ptr = list; ptr; ptr = g_list_next (ptr)) {
- result = g_list_prepend (result,
- packagedata_copy (PACKAGEDATA(ptr->data), deep));
- }
- result = g_list_reverse (result);
- return result;
-}
-
-static GList *
-packagedata_deplist_copy (const GList *list, gboolean deep)
-{
- const GList *ptr;
- GList *result = NULL;
-
- for (ptr = list; ptr; ptr = g_list_next (ptr)) {
- result = g_list_prepend (result, packagedependency_copy ((PackageDependency *)(ptr->data), deep));
- }
- result = g_list_reverse (result);
-
- return result;
-}
-
-PackageData*
-packagedata_copy (const PackageData *pack, gboolean deep)
-{
- PackageData *result;
- const GList *ptr;
-
- g_assert (pack);
-
- result = packagedata_new ();
-
- result->name = g_strdup (pack->name);
- result->version = g_strdup (pack->version);
- result->minor = g_strdup (pack->minor);
- result->archtype = g_strdup (pack->archtype);
- result->summary = g_strdup (pack->summary);
- result->description = g_strdup (pack->description);
- result->filename = g_strdup (pack->filename);
- result->remote_url = g_strdup (pack->remote_url);
- result->install_root = g_strdup (pack->install_root);
- result->eazel_id = g_strdup (pack->eazel_id);
- result->suite_id = g_strdup (pack->suite_id);
- result->md5 = g_strdup (pack->md5);
-
- result->toplevel = pack->toplevel;
- result->status = pack->status;
- result->modify_status = pack->modify_status;
- result->source_package = pack->source_package;
- result->conflicts_checked = pack->conflicts_checked;
-
- result->distribution = pack->distribution;
- result->bytesize = pack->bytesize;
- result->filesize = pack->filesize;
- result->md5 = g_strdup (pack->md5);
-
- for (ptr = pack->obsoletes; ptr; ptr = g_list_next (ptr)) {
- result->obsoletes = g_list_prepend (result->obsoletes, g_strdup ((char*)ptr->data));
- }
- result->epoch = pack->epoch;
-
- if (deep) {
- result->depends = packagedata_deplist_copy (pack->depends, TRUE);
- result->modifies = packagedata_list_copy (pack->modifies, TRUE);
-
- /* Sloppy, just ref and copy the pointer rather then copying the
- object */
- g_list_foreach (pack->breaks, (GFunc)gtk_object_ref, NULL);
- result->breaks = g_list_copy (pack->breaks);
-
- for (ptr = pack->provides; ptr; ptr = g_list_next (ptr)) {
- result->provides = g_list_prepend (result->provides, g_strdup (ptr->data));
- }
- result->provides = g_list_reverse (result->provides);
- for (ptr = pack->features; ptr; ptr = g_list_next (ptr)) {
- result->features = g_list_prepend (result->features, g_strdup (ptr->data));
- }
- result->features = g_list_reverse (result->features);
- } /* No need to null if !deep, as packagedata_new does that */
-
- return result;
-}
-
-#define COPY_STRING(field) \
- if (full_package->field != NULL) { \
- g_free (package->field); \
- package->field = g_strdup (full_package->field); \
- }
-
-
-/* fill in a package struct with info from another one:
- * flags tells what fields to skip.
- */
-void
-packagedata_fill_in_missing (PackageData *package, const PackageData *full_package, int fill_flags)
-{
- const GList *ptr;
-
- g_assert (package != NULL);
- g_assert (full_package != NULL);
-
- COPY_STRING (name);
- COPY_STRING (version);
- COPY_STRING (minor);
- COPY_STRING (archtype);
- package->bytesize = full_package->bytesize;
- package->filesize = full_package->filesize;
- package->distribution = full_package->distribution;
- COPY_STRING (filename);
- COPY_STRING (eazel_id);
- COPY_STRING (suite_id);
- COPY_STRING (remote_url);
- COPY_STRING (md5);
-
- if (full_package->obsoletes != NULL) {
- g_list_foreach (package->obsoletes, (GFunc)g_free, NULL);
- g_list_free (package->obsoletes);
- package->obsoletes = NULL;
-
- for (ptr = full_package->obsoletes; ptr; ptr = g_list_next (ptr)) {
- package->obsoletes = g_list_prepend (package->obsoletes, g_strdup ((char*)ptr->data));
- }
- }
-
- package->epoch = full_package->epoch;
-
- if (! (fill_flags & PACKAGE_FILL_NO_TEXT)) {
- COPY_STRING (summary);
- COPY_STRING (description);
- }
- if (! (fill_flags & PACKAGE_FILL_NO_PROVIDES)) {
- if (package->provides != NULL) {
- g_list_foreach (package->provides, (GFunc)g_free, NULL);
- g_list_free (package->provides);
- }
- package->provides = NULL;
- for (ptr = full_package->provides; ptr; ptr = g_list_next (ptr)) {
- package->provides = g_list_prepend (package->provides, g_strdup (ptr->data));
- }
- package->provides = g_list_reverse (package->provides);
-
- if (package->features != NULL) {
- g_list_foreach (package->features, (GFunc)g_free, NULL);
- g_list_free (package->features);
- }
- package->features = NULL;
- for (ptr = full_package->features; ptr; ptr = g_list_next (ptr)) {
- package->features = g_list_prepend (package->features, g_strdup (ptr->data));
- }
- package->features = g_list_reverse (package->features);
- }
- if (! (fill_flags & PACKAGE_FILL_NO_DEPENDENCIES)) {
- g_list_foreach (package->depends, (GFunc)gtk_object_unref, NULL);
- package->depends = NULL;
-
- package->depends = packagedata_deplist_copy (full_package->depends, TRUE);
- }
- package->fillflag = fill_flags;
-}
-
-void
-packagedata_remove_soft_dep (PackageData *remove,
- PackageData *from)
-{
- g_assert (remove);
- g_assert (from);
-
- trilobite_debug ("removing %s from %s's deps", remove->name, from->name);
- gtk_object_unref (GTK_OBJECT (remove));
-}
-
-const char*
-rpmfilename_from_packagedata (const PackageData *pack)
-{
- static char *filename = NULL;
-
- g_free (filename);
- if (pack->filename) {
- filename = g_strdup (pack->filename);
- } else {
- if (pack->version && pack->minor && pack->archtype) {
- filename = g_strdup_printf ("%s-%s-%s.%s.rpm",
- pack->name,
- pack->version,
- pack->minor,
- pack->archtype);
- } else if (pack->version && pack->archtype) {
- filename = g_strdup_printf ("%s-%s.%s.rpm",
- pack->name,
- pack->version,
- pack->archtype);
- } else if (pack->archtype) {
- filename = g_strdup_printf ("%s.%s.rpm",
- pack->name,
- pack->archtype);
- } else {
- filename = g_strdup (pack->name);
- }
- }
-
- return filename;
-}
-
-const char*
-rpmname_from_packagedata (const PackageData *pack)
-{
- static char *name = NULL;
-
- g_free (name);
-
- if (pack->version && pack->minor) {
- name = g_strdup_printf ("%s-%s-%s",
- pack->name,
- pack->version,
- pack->minor);
- } else if (pack->version) {
- name = g_strdup_printf ("%s-%s",
- pack->name,
- pack->version);
- } else {
- name = g_strdup (pack->name);
- }
-
- return name;
-}
-
-char*
-packagedata_get_readable_name (const PackageData *pack)
-{
- char *result = NULL;
- if (pack==NULL) {
- result = NULL;
- } else if ((pack->name != NULL) && (pack->version != NULL)) {
- /* This is a hack to shorten EazelSourceSnapshot names
- into the build date/time */
- if (pack->version && pack->minor &&
- strstr (pack->version, ".200") != NULL) {
- char *month[] = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug",
- "Sep", "Oct", "Nov", "Dec"};
- char *temp, *temp2;
- int mo, da, ho, mi;
- /* this crap is too long to display ! */
- temp = g_strdup (pack->version);
- temp2 = strstr (temp, ".200");
- temp2 += strlen (".200x");
- sscanf (temp2, "%2d%2d%2d%2d", &mo, &da, &ho, &mi);
- result = g_strdup_printf ("%s of %d %s, %02d:%02d",
- pack->name,
- da, month[mo-1], ho, mi);
- g_free (temp);
- } else {
- result = g_strdup_printf ("%s v%s", pack->name, pack->version);
- }
- } else if (pack->name != NULL) {
- result = g_strdup_printf ("%s", pack->name);
- } else if (pack->eazel_id != NULL) {
- result = g_strdup_printf ("Eazel Package #%s", pack->eazel_id);
- } else if (pack->suite_id != NULL) {
- result = g_strdup_printf ("Eazel Suite #%s", pack->suite_id);
- } else if (pack->features && pack->features->data) {
- result = g_strdup_printf ("file %s", (char*)(pack->features->data));
- } else {
- /* what the--?! WHO ARE YOU! */
- result = g_strdup ("another package");
- }
-
- return result;
-}
-
-char*
-packagedata_get_name (const PackageData *pack)
-{
- char *result = NULL;
- if (pack->name && pack->version && pack->minor) {
- result = g_strdup_printf ("%s-%s-%s", pack->name, pack->version, pack->minor);
- } else if (pack->name && pack->version) {
- result = g_strdup_printf ("%s-%s", pack->name, pack->version);
- } else if (pack->name) {
- result = g_strdup (pack->name);
- }
- return result;
-}
-
-int
-packagedata_hash_equal (PackageData *a,
- PackageData *b)
-{
- g_assert (a!=NULL);
- g_assert (a->name!=NULL);
- g_assert (b!=NULL);
- g_assert (b->name!=NULL);
-
- return strcmp (a->name, b->name);
-}
-
-
-const char*
-packagedata_status_enum_to_str (PackageSystemStatus st)
-{
- static char *result=NULL;
- g_free (result);
-
- switch (st) {
- case PACKAGE_UNKNOWN_STATUS:
- result = g_strdup ("UNKNOWN_STATUS");
- break;
- case PACKAGE_SOURCE_NOT_SUPPORTED:
- result = g_strdup ("SOURCE_NOT_SUPPORTED");
- break;
- case PACKAGE_DEPENDENCY_FAIL:
- result = g_strdup ("DEPENDENCY_FAIL");
- break;
- case PACKAGE_FILE_CONFLICT:
- result = g_strdup ("FILE_CONFLICT");
- break;
- case PACKAGE_BREAKS_DEPENDENCY:
- result = g_strdup ("BREAKS_DEPENDENCY");
- break;
- case PACKAGE_INVALID:
- result = g_strdup ("INVALID");
- break;
- case PACKAGE_CANNOT_OPEN:
- result = g_strdup ("CANNOT_OPEN");
- break;
- case PACKAGE_PARTLY_RESOLVED:
- result = g_strdup ("PARTLY_RESOLVED");
- break;
- case PACKAGE_RESOLVED:
- result = g_strdup ("RESOLVED");
- break;
- case PACKAGE_CANCELLED:
- result = g_strdup ("CANCELLED");
- break;
- case PACKAGE_ALREADY_INSTALLED:
- result = g_strdup ("ALREADY_INSTALLED");
- break;
- case PACKAGE_CIRCULAR_DEPENDENCY:
- result = g_strdup ("CIRCULAR_DEPENDENCY");
- break;
- case PACKAGE_PACKSYS_FAILURE:
- result = g_strdup ("PACKSYS_FAILURE");
- break;
- default:
- g_assert_not_reached ();
- }
- return result;
-}
-
-PackageSystemStatus
-packagedata_status_str_to_enum (const char *st)
-{
- PackageSystemStatus result;
-
- g_return_val_if_fail (st!=NULL, PACKAGE_UNKNOWN_STATUS);
-
- if (strcmp (st, "UNKNOWN_STATUS")==0) { result = PACKAGE_UNKNOWN_STATUS; }
- else if (strcmp (st, "SOURCE_NOT_SUPPORTED")==0) { result = PACKAGE_SOURCE_NOT_SUPPORTED; }
- else if (strcmp (st, "DEPENDENCY_FAIL")==0) { result = PACKAGE_DEPENDENCY_FAIL; }
- else if (strcmp (st, "FILE_CONFLICT")==0) { result = PACKAGE_FILE_CONFLICT; }
- else if (strcmp (st, "BREAKS_DEPENDENCY")==0) { result = PACKAGE_BREAKS_DEPENDENCY; }
- else if (strcmp (st, "INVALID")==0) { result = PACKAGE_INVALID; }
- else if (strcmp (st, "CANNOT_OPEN")==0) { result = PACKAGE_CANNOT_OPEN; }
- else if (strcmp (st, "PARTLY_RESOLVED")==0) { result = PACKAGE_PARTLY_RESOLVED; }
- else if (strcmp (st, "RESOLVED")==0) { result = PACKAGE_RESOLVED; }
- else if (strcmp (st, "CANCELLED")==0) { result = PACKAGE_CANCELLED; }
- else if (strcmp (st, "ALREADY_INSTALLED")==0) { result = PACKAGE_ALREADY_INSTALLED; }
- else if (strcmp (st, "CIRCULAR_DEPENDENCY")==0) { result = PACKAGE_CIRCULAR_DEPENDENCY; }
- else if (strcmp (st, "PACKSYS_FAILURE")==0) { result = PACKAGE_PACKSYS_FAILURE; }
- else { g_assert_not_reached (); result = PACKAGE_UNKNOWN_STATUS; };
-
- return result;
-}
-
-const char*
-packagedata_modstatus_enum_to_str (PackageSystemStatus st)
-{
- static char *result=NULL;
- g_free (result);
-
- switch (st) {
- case PACKAGE_MOD_UPGRADED:
- result = g_strdup ("UPGRADED");
- break;
- case PACKAGE_MOD_DOWNGRADED:
- result = g_strdup ("DOWNGRADED");
- break;
- case PACKAGE_MOD_INSTALLED:
- result = g_strdup ("INSTALLED");
- break;
- case PACKAGE_MOD_UNINSTALLED:
- result = g_strdup ("UNINSTALLED");
- break;
- case PACKAGE_MOD_UNTOUCHED:
- default:
- result = g_strdup ("UNTOUCHED");
- break;
- }
- return result;
-}
-
-PackageSystemStatus
-packagedata_modstatus_str_to_enum (const char *st)
-{
- PackageSystemStatus result;
-
- g_return_val_if_fail (st!=NULL, PACKAGE_MOD_UNTOUCHED);
-
- if (strcmp (st, "INSTALLED")==0) { result = PACKAGE_MOD_INSTALLED; }
- else if (strcmp (st, "UNTOUCHED")==0) { result = PACKAGE_MOD_UNTOUCHED; }
- else if (strcmp (st, "UNINSTALLED")==0) { result = PACKAGE_MOD_UNINSTALLED; }
- else if (strcmp (st, "UPGRADED")==0) { result = PACKAGE_MOD_UPGRADED; }
- else if (strcmp (st, "DOWNGRADED")==0) { result = PACKAGE_MOD_DOWNGRADED; }
- else {
- result = PACKAGE_MOD_UNTOUCHED;
- }
-
- return result;
-}
-
-static void
-packagedata_add_pack_to (GList **list, GtkObject *b) {
- gtk_object_ref (b);
- (*list) = g_list_prepend (*list, b);
-}
-
-void
-packagedata_add_to_breaks (PackageData *pack, PackageBreaks *b)
-{
- g_assert (pack);
- g_assert (b);
- packagedata_add_pack_to (&pack->breaks, GTK_OBJECT (b));
-}
-
-void
-packagedata_add_pack_to_depends (PackageData *pack, PackageDependency *b)
-{
- g_assert (pack);
- g_assert (b);
- pack->depends = g_list_prepend (pack->depends, b);
-}
-
-void
-packagedata_add_pack_to_modifies (PackageData *pack, PackageData *b)
-{
- g_assert (pack);
- g_assert (b);
- g_assert (pack != b);
- packagedata_add_pack_to (&pack->modifies, GTK_OBJECT (b));
-}
-
-static void
-flatten_packagedata_dependency_tree_helper (GList *packagedeps,
- GList **result)
-{
- GList *iterator;
-
- for (iterator = packagedeps; iterator; iterator = g_list_next (iterator)) {
- PackageDependency *dep = PACKAGEDEPENDENCY (iterator->data);
- PackageData *pack = dep->package;
- if (g_list_find (*result, pack)==NULL) {
- (*result) = g_list_prepend (*result, pack);
- flatten_packagedata_dependency_tree_helper (pack->depends, result);
- }
- }
-}
-
-GList*
-flatten_packagedata_dependency_tree (GList *packages)
-{
- GList *result = NULL;
- GList *iterator;
-
- /* I first add the toplevel, since I can then get away with only checking
- for dupes in the helper */
- for (iterator = packages; iterator; iterator = g_list_next (iterator)) {
- PackageData *pack = NULL;
-
- if (IS_PACKAGEDATA (iterator->data)) {
- pack = PACKAGEDATA (iterator->data);
- } else if (IS_PACKAGEDEPENDENCY (iterator->data)) {
- pack = PACKAGEDEPENDENCY (iterator->data)->package;
- } else {
- g_assert_not_reached ();
- }
-
- /* Don't add suites */
- if (!packagedata_is_suite (pack)) {
- result = g_list_prepend (result, pack);
- }
- }
- for (iterator = packages; iterator; iterator = g_list_next (iterator)) {
- PackageData *pack = NULL;
-
- if (IS_PACKAGEDATA (iterator->data)) {
- pack = PACKAGEDATA (iterator->data);
- } else if (IS_PACKAGEDEPENDENCY (iterator->data)) {
- pack = PACKAGEDEPENDENCY (iterator->data)->package;
- } else {
- g_assert_not_reached ();
- }
-
- if (pack->depends) {
- flatten_packagedata_dependency_tree_helper (pack->depends, &result);
- }
- }
-
- return result;
-}
-
-/*
- O(mn) complexity.
- */
-void
-packagedata_list_prune (GList **input,
- GList *remove_list,
- gboolean destroy,
- gboolean deep)
-{
- GList *in_it=NULL, *rm_it=NULL;
-
- for (rm_it = remove_list; rm_it; rm_it = g_list_next (rm_it)) {
- PackageData *rm = (PackageData*)rm_it->data;
- PackageData *in = NULL;
-
- for (in_it = *input; in_it; in_it = g_list_next (in_it)) {
- in = (PackageData*)in_it->data;
- if (eazel_install_package_name_compare (in, rm->name)==0) {
- break;
- }
- }
- if (in_it && in) {
- (*input) = g_list_remove (*input, in);
- if (destroy) {
- gtk_object_unref (GTK_OBJECT (in));
- }
- }
- }
-}
-
-gboolean
-packagedata_is_suite (PackageData *package)
-{
- gboolean result = FALSE;
-
- g_assert (package);
- g_assert (IS_PACKAGEDATA (package));
-
- if (package->suite_id) {
- if (strncmp (package->suite_id, "S:", 2)==0) {
- result = TRUE;
- }
- }
-
- return result;
-}
-
-PackageRequirement*
-packagerequirement_new (PackageData *pack,
- PackageData *req)
-{
- PackageRequirement *result;
- result = g_new0 (PackageRequirement, 1);
- result->package = pack;
- result->required = req;
- return result;
-}
-
-/* The funky compare functions */
-
-
-static int
-eazel_install_package_provides_basename_compare (char *a,
- char *b)
-{
- return strcmp (g_basename (a), b);
-}
-
-int
-eazel_install_package_provides_compare (PackageData *pack,
- char *name)
-{
- GList *ptr = NULL;
- ptr = g_list_find_custom (pack->provides,
- (gpointer)name,
- (GCompareFunc)eazel_install_package_provides_basename_compare);
- if (ptr) {
- return 0;
- }
- return -1;
-}
-
-int
-eazel_install_package_feature_compare (PackageData *pack,
- char *feature)
-{
- GList *ptr = NULL;
- ptr = g_list_find_custom (pack->features,
- (gpointer)feature,
- (GCompareFunc)eazel_install_package_provides_basename_compare);
- if (ptr) {
- return 0;
- }
- return -1;
-}
-
-int
-eazel_install_package_name_compare (PackageData *pack,
- char *name)
-{
- if (pack->name == NULL) {
- return -1;
- }
- return strcmp (pack->name, name);
-}
-
-int
-eazel_install_package_id_compare (PackageData *pack,
- char *id)
-{
- if (pack->eazel_id == NULL) {
- return -1;
- }
- return strcmp (pack->eazel_id, id);
-}
-
-/* This does a slow and painful comparison of all the major fields */
-int
-eazel_install_package_compare (PackageData *pack,
- PackageData *other)
-{
- int result = 0;
-
- char *a, *b;
- a = packagedata_get_readable_name (pack);
- b = packagedata_get_readable_name (other);
-
- /* For the field sets, if they both exists, compare them,
- if one has it and the other doesn't, not equal */
- if (pack->name && other->name) {
- int tmp_result = strcmp (pack->name, other->name);
- if (tmp_result) {
- result = tmp_result;
- }
- } else if (pack->name || other->name) {
- result = 1;
- }
- if (pack->version && other->version) {
- int tmp_result = strcmp (pack->version, other->version);
- if (tmp_result) {
- result = tmp_result;
- }
- } else if (pack->version || other->version) {
- result = 1;
- }
- if (pack->minor && other->minor) {
- int tmp_result = strcmp (pack->minor, other->minor);
- if (tmp_result) {
- result = tmp_result;
- }
- } else if (pack->minor || other->minor) {
- result = 1;
- }
-
- return result;
-}
-
-/* Compare function used while creating the PackageRequirements in
- eazel_install_do_dependency_check.
- It checks for equality on the package names, if one doens't have a name,
- it checks for the same 1st element in ->provides, if one doens't have
- a provides list, they're not the same */
-int
-eazel_install_requirement_dep_compare (PackageRequirement *req,
- PackageData *pack)
-{
- if (pack->name && req->required->name) {
- return strcmp (req->required->name, pack->name);
- } else if (pack->provides && req->required->provides) {
- return strcmp ((char*)pack->provides->data, (char*)req->required->provides->data);
- } else {
- return -1;
- }
-}
-
-/* Given a package name, checks to see if theres a requirement already for this */
-int
-eazel_install_requirement_dep_name_compare (PackageRequirement *req,
- const char *name)
-{
- g_assert (req->required);
- g_assert (name);
- if (req->required->name) {
- return strcmp (req->required->name, name);
- } else if (req->required->provides) {
- return strcmp ((char*)(req->required->provides->data), name);
- } else {
- return -1;
- }
-}
-
-
-int
-eazel_install_package_version_compare (PackageData *pack,
- char *version)
-{
- return strcmp (pack->version, version);
-}
-
-int
-eazel_install_package_other_version_compare (PackageData *pack,
- PackageData *other)
-{
- if (pack->name && other->name) {
- if (strcmp (pack->name, other->name)==0) {
- if (pack->version && other->version) {
- if (strcmp (pack->version, other->version)) {
- return 0;
- } else {
- return 1;
- }
- } else {
- return -11;
- }
- } else {
- return 1;
- }
- }
- return -1;
-}
-
-int
-eazel_install_package_matches_versioning (PackageData *a,
- const char *version,
- const char *minor,
- EazelSoftCatSense sense)
-{
- int version_result = 0, minor_result = 0;
-
- g_assert (!((version==NULL) && minor));
-
- if (version) {
- if (sense & EAZEL_SOFTCAT_SENSE_EQ) {
- if (strcmp (a->version, version)==0) {
- version_result = 1;
- }
- }
- if ((version_result==0) && (sense & EAZEL_SOFTCAT_SENSE_GT)) {
- if (sense & EAZEL_SOFTCAT_SENSE_EQ) {
- if (strcmp (a->version, version)>=0) {
- version_result = 1;
- }
- } else {
- if (strcmp (a->version, version)>0) {
- version_result = 1;
- }
- }
- }
- if ((version_result==0) && (sense & EAZEL_SOFTCAT_SENSE_LT)) {
- if (sense & EAZEL_SOFTCAT_SENSE_EQ) {
- if (strcmp (a->version, version)<=0) {
- version_result = 1;
- }
- } else {
- if (strcmp (a->version, version)<0) {
- version_result = 1;
- }
- }
- }
- } else {
- version_result = 1;
- }
-
- if (minor) {
- if (sense & EAZEL_SOFTCAT_SENSE_EQ) {
- if (strcmp (a->minor, minor)==0) {
- minor_result = 1;
- }
- }
- if ((minor_result==0) && (sense & EAZEL_SOFTCAT_SENSE_GT)) {
- if (version_result) {
- minor_result = 1;
- }
- }
- if ((minor_result==0) && (sense & EAZEL_SOFTCAT_SENSE_LT)) {
- if (version_result) {
- minor_result = 1;
- }
- }
- } else {
- minor_result = 1;
- }
-
-/*
- if (sense & EAZEL_SOFTCAT_SENSE_EQ) {
- if (version && minor) {
- if (strcmp (a->minor, minor)==0 &&
- strcmp (a->version, version)==0) {
- result = 1;
- }
- } else if (version && !minor) {
- if (strcmp (a->version, version)==0) {
- result = 1;
- }
- } else if (!version && minor) {
- if (strcmp (a->minor, minor)==0) {
- result = 1;
- }
- } else if (!version && !minor) {
- result = 1;
- }
- }
- if ((result==0) && (sense & EAZEL_SOFTCAT_SENSE_GT)) {
- if (version && minor) {
- if (strcmp (a->minor, minor)>0 &&
- strcmp (a->version, version)>0) {
- result = 1;
- }
- } else if (version && !minor) {
- if (strcmp (a->version, version)>0) {
- result = 1;
- }
- } else if (!version && minor) {
- if (strcmp (a->minor, minor)>0) {
- result = 1;
- }
- } else if (!version && !minor) {
- result = 1;
- }
- }
- if ((result==0) && (sense & EAZEL_SOFTCAT_SENSE_LT)) {
- if (version && minor) {
- if (strcmp (a->minor, minor)<0 &&
- strcmp (a->version, version)<0) {
- result = 1;
- }
- } else if (version && !minor) {
- if (strcmp (a->version, version)<0) {
- result = 1;
- }
- } else if (!version && minor) {
- if (strcmp (a->minor, minor)<0) {
- result = 1;
- }
- } else if (!version && !minor) {
- result = 1;
- }
- }
- return result;
-*/
- return version_result && minor_result;
-}
-
-/* The evil marshal func */
-
-typedef void (*GtkSignal_NONE__POINTER_INT_INT_INT_INT_INT_INT) (GtkObject * object,
- gpointer arg1,
- gint arg2,
- gint arg3,
- gint arg4,
- gint arg5,
- gint arg6,
- gint arg7,
- gpointer user_data);
-void
-eazel_install_gtk_marshal_NONE__POINTER_INT_INT_INT_INT_INT_INT (GtkObject * object,
- GtkSignalFunc func,
- gpointer func_data, GtkArg * args)
-{
- GtkSignal_NONE__POINTER_INT_INT_INT_INT_INT_INT rfunc;
- rfunc = (GtkSignal_NONE__POINTER_INT_INT_INT_INT_INT_INT) func;
- (*rfunc) (object,
- GTK_VALUE_POINTER (args[0]),
- GTK_VALUE_INT (args[1]), GTK_VALUE_INT (args[2]),
- GTK_VALUE_INT (args[3]), GTK_VALUE_INT (args[4]),
- GTK_VALUE_INT (args[5]), GTK_VALUE_INT (args[6]),func_data);
-}
-
-typedef gboolean (*GtkSignal_BOOL__ENUM_POINTER_INT_INT) (GtkObject * object,
- gint arg1,
- gpointer arg2,
- gint arg3,
- gint arg4,
- gpointer user_data);
-void
-eazel_install_gtk_marshal_BOOL__ENUM_POINTER_INT_INT (GtkObject * object,
- GtkSignalFunc func,
- gpointer func_data, GtkArg * args)
-{
- GtkSignal_BOOL__ENUM_POINTER_INT_INT rfunc;
- gboolean *return_val;
- return_val = GTK_RETLOC_BOOL (args[4]);
- rfunc = (GtkSignal_BOOL__ENUM_POINTER_INT_INT) func;
- *return_val = (*rfunc) (object,
- GTK_VALUE_ENUM (args[0]),
- GTK_VALUE_POINTER (args[1]),
- GTK_VALUE_INT (args[2]),
- GTK_VALUE_INT (args[3]),
- func_data);
-}
-
-typedef gboolean (*GtkSignal_BOOL__ENUM_POINTER) (GtkObject * object,
- gint arg1,
- gpointer arg2,
- gpointer user_data);
-void
-eazel_install_gtk_marshal_BOOL__ENUM_POINTER (GtkObject * object,
- GtkSignalFunc func,
- gpointer func_data, GtkArg * args)
-{
- GtkSignal_BOOL__ENUM_POINTER rfunc;
- gboolean *return_val;
- return_val = GTK_RETLOC_BOOL (args[2]);
- rfunc = (GtkSignal_BOOL__ENUM_POINTER) func;
- *return_val = (*rfunc) (object,
- GTK_VALUE_ENUM (args[0]),
- GTK_VALUE_POINTER (args[1]),
- func_data);
-}
-
-
-/* useful debugging tool: dump out a concise package tree, with dep/modifies chains shown */
-
-static void packagedata_dump_tree_int (GString *out, PackageData *pd, gchar *indent, gchar *indent_type,
- int indent_level, gboolean show_deps, GList **seen);
-
-static void
-packagedata_dump_tree_helper (GString *out,
- gchar *indent,
- gchar indent_type,
- int indent_level,
- GList *iterator,
- GList *next_list,
- GList **seen)
-{
- PackageData *pack;
- char *indent2, *indent3;
- gchar *extra_space = NULL;
- int i;
- gboolean more;
-
- if (IS_PACKAGEDATA (iterator->data)) {
- pack = PACKAGEDATA (iterator->data);
- } else if (IS_PACKAGEBREAKS (iterator->data)) {
- PackageBreaks *breakage = PACKAGEBREAKS (iterator->data);
- pack = packagebreaks_get_package (breakage);
- } else {
- PackageDependency *dep = PACKAGEDEPENDENCY (iterator->data);
- pack = dep->package;
- }
-
- if (indent_level > 0) {
- extra_space = g_new0 (char, indent_level+1);
- for (i = 0; i < indent_level; i++) {
- extra_space[i] = ' ';
- }
- extra_space[indent_level] = '\0';
- }
-
- if (iterator->next || next_list) {
- more = TRUE;
- } else {
- more = FALSE;
- }
-
- if (g_list_find (*seen, iterator) == NULL) {
- indent2 = g_strdup_printf ("%s%s%s", indent, extra_space ? extra_space : "",
- more ? "|" : "");
- indent3 = g_strdup_printf ("%s-%c- ",
- more ? "" : "\\",
- indent_type);
- packagedata_dump_tree_int (out, pack, indent2, indent3, more ? 4 : 5,
- (indent_type == 'b' ? FALSE : TRUE), seen);
- g_free (indent2);
- g_free (indent3);
- (*seen) = g_list_prepend (*seen, iterator);
- }
- g_free (extra_space);
-}
-
-static void
-packagedata_dump_tree_int (GString *out,
- PackageData *pd,
- gchar *indent,
- gchar *indent_type,
- int indent_level,
- gboolean show_deps,
- GList **seen)
-{
- char *readable_name;
- GList *iterator;
- char fillstr[20];
-
- if (pd->fillflag == PACKAGE_FILL_INVALID) {
- strcpy (fillstr, "unfilled");
- } else {
- strcpy (fillstr, "fill:");
- /* usually we don't care about this */
- if (! (pd->fillflag & PACKAGE_FILL_NO_TEXT)) {
- strcat (fillstr, "T");
- }
- if (! (pd->fillflag & PACKAGE_FILL_NO_PROVIDES)) {
- strcat (fillstr, "P");
- }
- if (! (pd->fillflag & PACKAGE_FILL_NO_DEPENDENCIES)) {
- strcat (fillstr, "D");
- }
- if (! (pd->fillflag & PACKAGE_FILL_NO_DIRS_IN_PROVIDES)) {
- strcat (fillstr, "R");
- }
- if (! (pd->fillflag & PACKAGE_FILL_NO_FEATURES)) {
- strcat (fillstr, "F");
- }
- }
-
- readable_name = packagedata_get_readable_name (pd);
- g_string_sprintfa (out, "%s%s%s %s %s%s%s (%s/%s) %p\n",
- indent, indent_type, readable_name,
- fillstr,
- pd->toplevel ? "TOP " : "",
- pd->suite_id ? "suite " : "",
- pd->eazel_id ? pd->eazel_id : (pd->suite_id ? pd->suite_id : "no-id"),
- packagedata_status_enum_to_str (pd->status),
- packagedata_modstatus_enum_to_str (pd->modify_status),
- pd);
- g_free (readable_name);
-
- if (g_list_find (*seen, pd)) { return; }
- (*seen) = g_list_prepend (*seen, pd);
-
- for (iterator = pd->modifies; iterator; iterator = iterator->next) {
- packagedata_dump_tree_helper (out, indent, 'm', indent_level, iterator,
- pd->breaks ? pd->breaks : pd->depends, seen);
- }
- for (iterator = pd->breaks; iterator; iterator = iterator->next) {
- packagedata_dump_tree_helper (out, indent, 'b', indent_level, iterator, pd->depends, seen);
- }
- if (show_deps) {
- for (iterator = pd->depends; iterator; iterator = iterator->next) {
- packagedata_dump_tree_helper (out, indent, 'd', indent_level, iterator, NULL, seen);
- }
- }
-}
-
-char *
-packagedata_dump_tree (const GList *packlist, int indent_level)
-{
- GList *seen = NULL;
- GList *iter;
- GString *out;
- char *outstr;
-
- out = g_string_new ("");
- for (iter = g_list_first ((GList *)packlist); iter != NULL; iter = g_list_next (iter)) {
- packagedata_dump_tree_int (out, PACKAGEDATA (iter->data), "", "", indent_level, TRUE, &seen);
- }
- g_list_free (seen);
- outstr = out->str;
- g_string_free (out, FALSE);
- return outstr;
-}
-
-
-/* useful debugging tool: dump a packagedata struct into a string */
-
-static void
-gstr_indent (GString *out, int indent)
-{
- for ( ; indent >= 8; indent -= 8) {
- g_string_sprintfa (out, "\t");
- }
- for ( ; indent > 0; indent--) {
- g_string_sprintfa (out, " ");
- }
-}
-
-static char *packagedata_dump_int (const PackageData *package, gboolean deep, int indent);
-
-static void
-dump_package_list (GString *out, const GList *list, gboolean deep, int indent)
-{
- const GList *iter;
- char *name;
- char *tmp;
-
- if (deep) {
- g_string_sprintfa (out, "\n");
- }
- for (iter = g_list_first ((GList *)list); iter != NULL; iter = g_list_next (iter)) {
- if (deep) {
- tmp = packagedata_dump_int ((PackageData *)(iter->data), deep, indent+4);
- g_string_sprintfa (out, "%s", tmp);
- g_free (tmp);
- } else {
- name = packagedata_get_readable_name ((PackageData *)(iter->data));
- if (iter == list) {
- g_string_sprintfa (out, "%s", name);
- } else {
- g_string_sprintfa (out, ", %s", name);
- }
- g_free (name);
- }
- }
-}
-
-static void
-dump_package_deplist (GString *out, const GList *list, gboolean deep, int indent)
-{
- const GList *iter;
- PackageDependency *dep;
- char *name;
- char *tmp;
- char *sense;
-
- if (deep) {
- g_string_sprintfa (out, "\n");
- }
- for (iter = g_list_first ((GList *)list); iter != NULL; iter = g_list_next (iter)) {
- dep = (PackageDependency *)(iter->data);
- if (!deep && (iter != list)) {
- g_string_sprintfa (out, "; ");
- }
- if (deep) {
- tmp = packagedata_dump_int (dep->package, deep, indent+4);
- g_string_sprintfa (out, "%s", tmp);
- g_free (tmp);
- if (dep->version != NULL) {
- gstr_indent (out, indent+8);
- sense = eazel_softcat_sense_flags_to_string (dep->sense);
- g_string_sprintfa (out, "Solves %s %s %s\n", dep->package->name, sense,
- dep->version);
- g_free (sense);
- }
- } else {
- if (dep->version != NULL) {
- sense = eazel_softcat_sense_flags_to_string (dep->sense);
- g_string_sprintfa (out, "[dep %s %s] ", sense, dep->version);
- g_free (sense);
- }
- name = packagedata_get_readable_name (dep->package);
- g_string_sprintfa (out, "%s", name);
- g_free (name);
- }
- }
-}
-
-static void
-add_string_list (GString *out, GList *list, int indent, char *title)
-{
- GList *fit;
- for (fit = list; fit; fit = g_list_next (fit)) {
- gstr_indent (out, indent);
- g_string_sprintfa (out, "\t%s : %s\n", title, (char*)fit->data);
- }
-}
-
-static void
-dump_package_break_list (GString *out, GList *breaks, gboolean deep, int indent)
-{
- GList *iterator;
-
- for (iterator = breaks; iterator; iterator = g_list_next (iterator)) {
- PackageBreaks *breakage = PACKAGEBREAKS (iterator->data);
- char *readable_name = packagedata_get_readable_name (packagebreaks_get_package (breakage));
-
- gstr_indent (out, indent);
-
- g_string_sprintfa (out, "Breaks : %s\n", readable_name);
- if (IS_PACKAGEFEATUREMISSING (breakage)) {
- add_string_list (out,
- PACKAGEFEATUREMISSING (breakage)->features,
- indent,
- "FeatureMissing");
- } else if (IS_PACKAGEFILECONFLICT (breakage)) {
- add_string_list (out,
- PACKAGEFILECONFLICT (breakage)->files,
- indent,
- "FileConflict");
- }
-
- }
-}
-
-static char *
-packagedata_dump_int (const PackageData *package, gboolean deep, int indent)
-{
- GString *out = g_string_new ("");
- GList *iter;
- char *dist_name;
- char *outstr;
-
- dist_name = trilobite_get_distribution_name (package->distribution, TRUE, TRUE);
- gstr_indent (out, indent);
- g_string_sprintfa (out, "Package %s v%s%s%s (arch %s) for %s\n",
- (package->name != NULL) ? package->name : "(no name)",
- (package->version != NULL) ? package->version : "",
- (package->minor != NULL) ? "-" : "",
- (package->minor != NULL) ? package->minor : "",
- (package->archtype != NULL) ? package->archtype : "none",
- dist_name);
- g_free (dist_name);
-
- indent += 4;
- gstr_indent (out, indent);
- g_string_sprintfa (out, "%s/%s",
- packagedata_status_enum_to_str (package->status),
- packagedata_modstatus_enum_to_str (package->modify_status));
- if (package->eazel_id != NULL) {
- g_string_sprintfa (out, ", EID %s", package->eazel_id);
- }
- if (package->bytesize > 0) {
- g_string_sprintfa (out, ", %d bytes installed", package->bytesize);
- }
- if (package->filesize > 0) {
- g_string_sprintfa (out, ", %d bytes file", package->filesize);
- }
- if (package->toplevel) {
- g_string_sprintfa (out, ", TOPLEVEL");
- }
- if (package->source_package) {
- g_string_sprintfa (out, ", source package");
- }
- if (package->conflicts_checked) {
- g_string_sprintfa (out, ", checked");
- }
- if (package->epoch) {
- g_string_sprintfa (out, "\n");
- gstr_indent (out, indent);
- g_string_sprintfa (out, "Epoch: %d", package->epoch);
- }
- if (package->obsoletes) {
- GList *fitte;
-
- g_string_sprintfa (out, "\n");
- gstr_indent (out, indent);
- g_string_sprintfa (out, "Obsoletes: ");
- for (fitte = package->obsoletes; fitte; fitte = g_list_next (fitte)) {
- g_string_sprintfa (out, "%s ", (char*)fitte->data);
- }
- }
- g_string_sprintfa (out, "\n");
-
- if (package->filename != NULL) {
- gstr_indent (out, indent);
- g_string_sprintfa (out, "Filename: %s\n", package->filename);
- }
- if (package->remote_url != NULL) {
- gstr_indent (out, indent);
- g_string_sprintfa (out, "URL: %s\n", package->remote_url);
- }
- if (package->md5 != NULL) {
- gstr_indent (out, indent);
- g_string_sprintfa (out, "MD5: %s\n", package->md5);
- }
- if (package->install_root != NULL) {
- gstr_indent (out, indent);
- g_string_sprintfa (out, "Install root: %s\n", package->install_root);
- }
-
- if (package->summary != NULL) {
- gstr_indent (out, indent);
- g_string_sprintfa (out, "Summary: %s\n", package->summary);
- }
- if (package->description != NULL) {
- gstr_indent (out, indent);
- g_string_sprintfa (out, "Description:\n%s\n", package->description);
- }
-
- if (package->features != NULL) {
- gstr_indent (out, indent);
- g_string_sprintfa (out, "Features: ");
- for (iter = g_list_first (package->features); iter != NULL; iter = g_list_next (iter)) {
- if (iter == package->features) {
- g_string_sprintfa (out, "%s", (char *)(iter->data));
- } else {
- g_string_sprintfa (out, "; %s", (char *)(iter->data));
- }
- }
- g_string_sprintfa (out, "\n");
- }
-
- if (deep && package->provides != NULL) {
- gstr_indent (out, indent);
- g_string_sprintfa (out, "Provides:\n");
- for (iter = g_list_first (package->provides); iter != NULL; iter = g_list_next (iter)) {
- g_string_sprintfa (out, "\t\t%s\n", (char *)(iter->data));
- }
- g_string_sprintfa (out, "\n");
- }
-
- if (package->depends != NULL) {
- gstr_indent (out, indent);
- g_string_sprintfa (out, "Depends: ");
- dump_package_deplist (out, package->depends, deep, indent);
- g_string_sprintfa (out, "\n");
- }
- if (package->modifies != NULL) {
- gstr_indent (out, indent);
- g_string_sprintfa (out, "Modifies: ");
- dump_package_list (out, package->modifies, deep, indent);
- g_string_sprintfa (out, "\n");
- }
- if (package->breaks != NULL) {
- gstr_indent (out, indent);
- g_string_sprintfa (out, "Breaks: ");
- dump_package_break_list (out, package->breaks, deep, indent);
- g_string_sprintfa (out, "\n");
- }
-
- indent -= 4;
-
- outstr = out->str;
- g_string_free (out, FALSE);
- return outstr;
-}
-
-char *
-packagedata_dump (const PackageData *package, gboolean deep)
-{
- return packagedata_dump_int (package, deep, 0);
-}
-
-
-/**********************************************************************************
- GTK+ crap for PackageBreaks objects
- **********************************************************************************/
-
-static void
-packagebreaks_finalize (GtkObject *obj)
-{
- PackageBreaks *breaks = PACKAGEBREAKS (obj);
-
-#ifdef DEBUG_PACKAGE_ALLOCS
- packagebreaks_allocs --;
- if (report_all) trilobite_debug ("packagebreaks_allocs decreased to %d (%p)",
- packagebreaks_allocs, obj);
-#endif /* DEBUG_PACKAGE_ALLOCS */
-
- gtk_object_unref (GTK_OBJECT (breaks->__package));
-
- if (packagebreaks_parent_class->finalize) {
- packagebreaks_parent_class->finalize (obj);
- }
-}
-
-static void
-packagebreaks_class_initialize (PackageBreaksClass *klass)
-{
- GtkObjectClass *object_class;
-
- packagebreaks_parent_class = gtk_type_class (gtk_object_get_type ());
-
- object_class = (GtkObjectClass*)klass;
- object_class->finalize = packagebreaks_finalize;
-
- klass->finalize = packagebreaks_finalize;
-}
-
-static void
-packagebreaks_initialize (PackageBreaks *breaks)
-{
- g_assert (breaks);
- g_assert (IS_PACKAGEBREAKS (breaks));
- breaks->__package = NULL;
-
-#ifdef DEBUG_PACKAGE_ALLOCS
- packagebreaks_allocs ++;
- if (report_all) trilobite_debug ("packagebreaks_allocs increased to %d (%p)",
- packagebreaks_allocs, breaks);
-#endif /* DEBUG_PACKAGE_ALLOCS */
-}
-
-GtkType
-packagebreaks_get_type (void)
-{
- static GtkType object_type = 0;
-
- /* First time it's called ? */
- if (!object_type)
- {
- static const GtkTypeInfo object_info =
- {
- "PackageBreaks",
- sizeof (PackageBreaks),
- sizeof (PackageBreaksClass),
- (GtkClassInitFunc) packagebreaks_class_initialize,
- (GtkObjectInitFunc) packagebreaks_initialize,
- /* reserved_1 */ NULL,
- /* reserved_2 */ NULL,
- (GtkClassInitFunc) NULL,
- };
-
- object_type = gtk_type_unique (gtk_object_get_type (), &object_info);
- }
-
- return object_type;
-}
-
-PackageBreaks*
-packagebreaks_new (void)
-{
- PackageBreaks *result;
-
- result = PACKAGEBREAKS (gtk_object_new (TYPE_PACKAGEBREAKS, NULL));
- gtk_object_ref (GTK_OBJECT (result));
- gtk_object_sink (GTK_OBJECT (result));
-
- return result;
-}
-void
-packagebreaks_set_package (PackageBreaks *breaks,
- PackageData *pack)
-{
- if (breaks->__package) {
- gtk_object_unref (GTK_OBJECT (pack));
- }
- gtk_object_ref (GTK_OBJECT (pack));
- breaks->__package = pack;
-}
-
-PackageData *
-packagebreaks_get_package (PackageBreaks *breaks)
-{
- return breaks->__package;
-}
-
-/**********************************************************************************/
-
-/**********************************************************************************
- GTK+ crap for PackageFileConflict objects
- **********************************************************************************/
-
-static void
-packagefileconflict_finalize (GtkObject *obj)
-{
- PackageFileConflict *conflict = PACKAGEFILECONFLICT (obj);
- g_list_foreach (conflict->files, (GFunc)g_free, NULL);
-
- if (packagefileconflict_parent_class->finalize) {
- packagefileconflict_parent_class->finalize (obj);
- }
-}
-
-static void
-packagefileconflict_class_initialize (PackageFileConflictClass *klass)
-{
- GtkObjectClass *object_class;
-
- packagefileconflict_parent_class = gtk_type_class (packagebreaks_get_type ());
-
- object_class = (GtkObjectClass*)klass;
- object_class->finalize = packagefileconflict_finalize;
-
- klass->finalize = packagedata_finalize;
-}
-
-static void
-packagefileconflict_initialize (PackageFileConflict *fileconflict)
-{
- g_assert (fileconflict);
- g_assert (IS_PACKAGEFILECONFLICT (fileconflict));
-}
-
-GtkType
-packagefileconflict_get_type (void)
-{
- static GtkType object_type = 0;
-
- /* First time it's called ? */
- if (!object_type)
- {
- static const GtkTypeInfo object_info =
- {
- "PackageFileConflict",
- sizeof (PackageFileConflict),
- sizeof (PackageFileConflictClass),
- (GtkClassInitFunc) packagefileconflict_class_initialize,
- (GtkObjectInitFunc) packagefileconflict_initialize,
- /* reserved_1 */ NULL,
- /* reserved_2 */ NULL,
- (GtkClassInitFunc) NULL,
- };
-
- object_type = gtk_type_unique (packagebreaks_get_type (), &object_info);
- }
-
- return object_type;
-}
-
-PackageFileConflict*
-packagefileconflict_new (void)
-{
- PackageFileConflict *result;
-
- result = PACKAGEFILECONFLICT (gtk_object_new (TYPE_PACKAGEFILECONFLICT, NULL));
- gtk_object_ref (GTK_OBJECT (result));
- gtk_object_sink (GTK_OBJECT (result));
-
- return result;
-}
-
-/**********************************************************************************/
-
-/**********************************************************************************
- GTK+ crap for PackageFeatureMissing objects
- **********************************************************************************/
-
-static void
-packagefeaturemissing_finalize (GtkObject *obj)
-{
- PackageFeatureMissing *conflict = PACKAGEFEATUREMISSING (obj);
- g_list_foreach (conflict->features, (GFunc)g_free, NULL);
-
- if (packagefeaturemissing_parent_class->finalize) {
- packagefeaturemissing_parent_class->finalize (obj);
- }
-}
-
-static void
-packagefeaturemissing_class_initialize (PackageFeatureMissingClass *klass)
-{
- GtkObjectClass *object_class;
-
- packagefeaturemissing_parent_class = gtk_type_class (packagebreaks_get_type ());
-
- object_class = (GtkObjectClass*)klass;
- object_class->finalize = packagefeaturemissing_finalize;
-
- klass->finalize = packagedata_finalize;
-}
-
-static void
-packagefeaturemissing_initialize (PackageFeatureMissing *breaks)
-{
- g_assert (breaks);
- g_assert (IS_PACKAGEFEATUREMISSING (breaks));
-}
-
-GtkType
-packagefeaturemissing_get_type (void)
-{
- static GtkType object_type = 0;
-
- /* First time it's called ? */
- if (!object_type)
- {
- static const GtkTypeInfo object_info =
- {
- "PackageFeatureMissing",
- sizeof (PackageFeatureMissing),
- sizeof (PackageFeatureMissingClass),
- (GtkClassInitFunc) packagefeaturemissing_class_initialize,
- (GtkObjectInitFunc) packagefeaturemissing_initialize,
- /* reserved_1 */ NULL,
- /* reserved_2 */ NULL,
- (GtkClassInitFunc) NULL,
- };
-
- object_type = gtk_type_unique (packagebreaks_get_type (), &object_info);
- }
-
- return object_type;
-}
-
-PackageFeatureMissing*
-packagefeaturemissing_new (void)
-{
- PackageFeatureMissing *result;
-
- result = PACKAGEFEATUREMISSING (gtk_object_new (TYPE_PACKAGEFEATUREMISSING, NULL));
- gtk_object_ref (GTK_OBJECT (result));
- gtk_object_sink (GTK_OBJECT (result));
-
- return result;
-}
-
-/**********************************************************************************/
diff --git a/components/services/install/lib/eazel-package-system-types.h b/components/services/install/lib/eazel-package-system-types.h
deleted file mode 100644
index ef424f7f9..000000000
--- a/components/services/install/lib/eazel-package-system-types.h
+++ /dev/null
@@ -1,466 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Copyright (C) 2000 Eazel, Inc
- * Copyright (C) 2000 Helix Code, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: Eskil Heyn Olsen <eskil@eazel.com>
- * Robey Pointer <robey@eazel.com>
- * J Shane Culpepper <pepper@eazel.com>
- * Joe Shaw <joe@helixcode.com>
- */
-
-/* eazel-install - services command line install/update/uninstall
- * component. This program will parse the eazel-services-config.xml
- * file and install a services generated package-list.xml.
- */
-
-#ifndef EAZEL_PACKAGE_SYSTEM_TYPES_H
-#define EAZEL_PACKAGE_SYSTEM_TYPES_H
-
-#include <gtk/gtkobject.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <libtrilobite/trilobite-core-distribution.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-typedef enum _URLType URLType;
-typedef enum _PackageType PackageType;
-typedef enum _PackageFillFlags PackageFillFlags;
-typedef struct _TransferOptions TransferOptions;
-typedef struct _InstallOptions InstallOptions;
-typedef struct _CategoryData CategoryData;
-typedef enum _PackageSystemStatus PackageSystemStatus;
-
-/*
- Adding here requires editing in
- trilobite-eazel-install.idl
- eazel-install-corba-types.c
- - packagedata_from_corba_packagedatastruct
- - corba_packagedatastruct_from_packagedata
- and
- eazel-package-system-types.c
- - packagedata_status_enum_to_str
- - packagedata_status_str_to_enum
- and
- eazel-install-problem.c
- */
-enum _PackageSystemStatus {
- PACKAGE_UNKNOWN_STATUS=0,
- PACKAGE_SOURCE_NOT_SUPPORTED,
- PACKAGE_DEPENDENCY_FAIL,
- PACKAGE_FILE_CONFLICT,
- PACKAGE_BREAKS_DEPENDENCY,
- PACKAGE_INVALID,
- PACKAGE_CANNOT_OPEN,
- PACKAGE_PARTLY_RESOLVED,
- PACKAGE_ALREADY_INSTALLED,
- PACKAGE_CIRCULAR_DEPENDENCY,
- PACKAGE_RESOLVED,
- PACKAGE_CANCELLED,
- PACKAGE_PACKSYS_FAILURE
-};
-/* Methods to convert enum to/from char* val. The returned
- char* must not be freed */
-PackageSystemStatus packagedata_status_str_to_enum (const char *st);
-const char* packagedata_status_enum_to_str (PackageSystemStatus st);
-
-enum _PackageModification {
- PACKAGE_MOD_UNTOUCHED,
- PACKAGE_MOD_UPGRADED,
- PACKAGE_MOD_DOWNGRADED,
- PACKAGE_MOD_INSTALLED,
- PACKAGE_MOD_UNINSTALLED
-};
-typedef enum _PackageModification PackageModification;
-/* Methods to convert enum to/from char* val. The returned
- char* must not be freed */
-PackageSystemStatus packagedata_modstatus_str_to_enum (const char *st);
-const char* packagedata_modstatus_enum_to_str (PackageModification st);
-
-/* NOTE: if you add protocols here, modify the following places :
- idl/trilobite-eazel-install.idl
- lib/eazel-install-protocols.c (eazel_install_fill_file_fetch_table)
- lib/eazel-package-system-types.c (protocol_as_string)
- lib/eazel-install-corba.c (impl_Eazel_Install__set_protocol) (impl_Eazel_Install__get_protocol)
- */
-enum _URLType {
- PROTOCOL_LOCAL = 0,
- PROTOCOL_HTTP = 1,
- PROTOCOL_FTP = 2
-};
-const char *eazel_install_protocol_as_string (URLType protocol);
-
-enum _PackageFillFlags {
- PACKAGE_FILL_EVERYTHING = 0x0,
- PACKAGE_FILL_NO_TEXT = 0x01,
- PACKAGE_FILL_NO_PROVIDES = 0x02,
- PACKAGE_FILL_NO_DEPENDENCIES = 0x04,
- PACKAGE_FILL_NO_DIRS_IN_PROVIDES = 0x8, /* only used if PACKAGE_FILL_NO_PROVIDES is not set */
- PACKAGE_FILL_NO_FEATURES = 0x10,
- PACKAGE_FILL_MINIMAL = 0x7fff,
- PACKAGE_FILL_INVALID = 0x8000
-};
-
-/* FIXME eventually this is going away completely */
-struct _TransferOptions {
- char *username; /* The username to use in eazel-install: paths */
- char* pkg_list_storage_path; /* Remote path to package-list.xml */
- char* tmp_dir; /* Local directory to store incoming RPMs */
- char* rpmrc_file; /* Location of the rpm resource file */
-};
-void transferoptions_destroy (TransferOptions *topts);
-
-struct _InstallOptions {
- URLType protocol; /* Specifies local, ftp, or http */
- char* pkg_list; /* Local path to package-list.xml */
- char* transaction_dir; /* Local directory to store transactions */
- gboolean mode_verbose; /* print extra information */
- gboolean mode_silent; /* print all information to a logfile */
- gboolean mode_debug; /* Internal testing mode for debugging */
- gboolean mode_test; /* dry run mode */
- gboolean mode_force; /* Force the action to be performed */
- gboolean mode_depend; /* print all dependancies */
- gboolean mode_update; /* If package is already installed, update it */
- gboolean mode_uninstall; /* Uninstall the package list */
- gboolean mode_downgrade; /* Downgrade the packages to previous version*/
-};
-void installoptions_destroy (InstallOptions *iopts);
-
-struct _CategoryData {
- char* name;
- char* description;
- GList* packages;
- GList* depends; /* used only for the GUI: GList<char *> -- other category names */
- gboolean exclusive; /* no other items can be clicked if this one is */
- gboolean default_choice; /* click this one by default */
-};
-CategoryData *categorydata_new (void);
-CategoryData *categorydata_copy (const CategoryData *cat);
-GList *categorydata_list_copy (const GList *list);
-void categorydata_destroy_foreach (CategoryData *cd, gpointer ununsed);
-void categorydata_destroy (CategoryData *pd);
-void categorydata_list_destroy (GList *list);
-
-/* Returns a glist of all the packages in the categories */
-GList* categorylist_flatten_to_packagelist (GList *categories);
-
-/*************************************************************************************************/
-
-#define TYPE_PACKAGEDATA (packagedata_get_type ())
-#define PACKAGEDATA(obj) (GTK_CHECK_CAST ((obj), TYPE_PACKAGEDATA, PackageData))
-#define PACKAGEDATA_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), TYPE_PACKAGEDATA, PackageDataClass))
-#define IS_PACKAGEDATA(obj) (GTK_CHECK_TYPE ((obj), TYPE_PACKAGEDATA))
-#define IS_PACKAGEDATA_CLASS(klass)(GTK_CHECK_CLASS_TYPE ((klass), TYPE_PACKAGEDATA))
-
-typedef struct _PackageData PackageData;
-typedef struct _PackageDataClass PackageDataClass;
-
-struct _PackageDataClass {
- GtkObjectClass parent_class;
- void (*finalize) (GtkObject *obj);
-};
-
-struct _PackageData {
- GtkObject parent;
-
- char* name;
- char* version;
- char* minor;
- char* archtype;
- TrilobiteDistributionInfo distribution;
- guint32 bytesize;
- guint32 filesize;
-
- char* summary;
- char* description;
- GList* depends; /* GList<PackageDependency *> */
- GList* breaks; /* GList<PackageBreaks*> */
-
- char *filename;
- char *remote_url; /* url where we can get this rpm */
- char *md5;
- char *install_root;
-
- /* various odd ways to look up packages in softcat */
- char *eazel_id;
- char *suite_id;
-
- gboolean source_package;
- gboolean conflicts_checked; /* set to TRUE when the files provided by the package
- have been checked against already installed packages */
-
- int fillflag;
-
- /*
- toplevel = TRUE if this a package the user requested.
- It's used to ensure that a "install_failed" signal is
- only emitted for toplevel packages.
- It's set to true during the xml loading (that means
- it should be set before given to the eazel_install_ensure_deps
- */
- gboolean toplevel;
- /*
- Identifies the status of the installation
- */
- PackageSystemStatus status;
- /*
- Pointer to keep a structure for the package system
- */
- gpointer *packsys_struc;
-
- /* These are the files that the package provides
- NOTE: should not be corbafied in eazel-install-corba-types.c */
- GList *provides;
- /* This is true if provides contains directories */
- gboolean provides_has_dirs;
-
- /* List of packages that this package modifies */
- GList *modifies;
- /* how was the package modified
- Eg. the toplevel pacakge will have INSTALLED, and some stuff in "depends".
- if "modifies" has elements, these have the following meaning ;
- DOWNGRADED means that the package was replaced with an older version
- UPGRADED means that the package was replaced with a never version
- */
- PackageModification modify_status;
-
- /* if the package info was downloaded from softcat, this is a list of "features"
- * the package resolves for its parent package. for example, if this package is only
- * needed to fulfill a "/bin/sh" requirement for its parent package, the "features"
- * list will contain "/bin/sh".
- */
- GList *features;
-
- /* This identifies a package (by name) that should be deleted if installing this package */
- GList *obsoletes;
-
- /* if set, the package has an epoch, currently only set for stuff read from the local db system */
- guint32 epoch;
-};
-
-PackageData* packagedata_new (void);
-GtkType packagedata_get_type (void);
-
-PackageData* packagedata_new_from_file (const char *file);
-PackageData* packagedata_copy (const PackageData *pack, gboolean deep);
-GList *packagedata_list_copy (const GList *list, gboolean deep);
-
-void packagedata_fill_in_missing (PackageData *package, const PackageData *full_package, int fill_flags);
-
-void packagedata_remove_soft_dep (PackageData *remove, PackageData *from);
-
-const char *rpmfilename_from_packagedata (const PackageData *pack);
-const char *rpmname_from_packagedata (const PackageData *pack);
-
-/* This is now the authorative way to get a nice human-readble name
- from a given package */
-char *packagedata_get_readable_name (const PackageData *pack);
-
-/* This is now the authorative way to get a nice "real" name
- from a given package, real meanign name[-version-[release]] string */
-char *packagedata_get_name (const PackageData *pack);
-
-int packagedata_hash_equal (PackageData *a, PackageData *b);
-
-GList *flatten_packagedata_dependency_tree (GList *packages);
-
-/* all elements in "remove_list" that matches elements in "input" list
- (comparison is done via eazel_install_package_name_compare).
- If destroy is TRUE, packagedata_destroy is called on the removed
- elements. If deep is TRUE, packagedata_destroy is called with deep destruction
-*/
-void packagedata_list_prune (GList **input, GList *remove_list, gboolean destroy, gboolean deep);
-
-gboolean packagedata_is_suite (PackageData *package);
-
-/*************************************************************************************************/
-
-typedef enum {
- EAZEL_SOFTCAT_SENSE_EQ = 0x1,
- EAZEL_SOFTCAT_SENSE_GT = 0x2,
- EAZEL_SOFTCAT_SENSE_LT = 0x4,
- EAZEL_SOFTCAT_SENSE_GE = (EAZEL_SOFTCAT_SENSE_GT | EAZEL_SOFTCAT_SENSE_EQ),
- EAZEL_SOFTCAT_SENSE_ANY = (EAZEL_SOFTCAT_SENSE_GT | EAZEL_SOFTCAT_SENSE_EQ | EAZEL_SOFTCAT_SENSE_LT)
-} EazelSoftCatSense;
-
-#define TYPE_PACKAGEDEPENDENCY (packagedependency_get_type ())
-#define PACKAGEDEPENDENCY(obj) (GTK_CHECK_CAST ((obj), TYPE_PACKAGEDEPENDENCY, PackageDependency))
-#define PACKAGEDEPENDENCY_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), TYPE_PACKAGEDEPENDENCY, PackageDependencyClass))
-#define IS_PACKAGEDEPENDENCY(obj) (GTK_CHECK_TYPE ((obj), TYPE_PACKAGEDEPENDENCY))
-#define IS_PACKAGEDEPENDENCY_CLASS(klass)(GTK_CHECK_CLASS_TYPE ((klass), TYPE_PACKAGEDEPENDENCY))
-
-typedef struct _PackageDependency PackageDependency;
-typedef struct _PackageDependencyClass PackageDependencyClass;
-
-struct _PackageDependencyClass {
- GtkObjectClass parent_class;
- void (*finalize) (GtkObject *obj);
-};
-
-/* dependency list */
-struct _PackageDependency {
- GtkObject parent;
-
- PackageData *package;
- /* if this dependency fills a requirement, like "gconf >= 0.6",
- * the requirement is listed here: */
- EazelSoftCatSense sense;
- char *version;
-};
-
-PackageDependency *packagedependency_new (void);
-PackageDependency *packagedependency_copy (const PackageDependency *dep, gboolean deep);
-GtkType packagedependency_get_type (void);
-
-/*************************************************************************************************/
-
-#define TYPE_PACKAGEBREAKS (packagebreaks_get_type ())
-#define PACKAGEBREAKS(obj) (GTK_CHECK_CAST ((obj), TYPE_PACKAGEBREAKS, PackageBreaks))
-#define PACKAGEBREAKS_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), TYPE_PACKAGEBREAKS, PackageBreaksClass))
-#define IS_PACKAGEBREAKS(obj) (GTK_CHECK_TYPE ((obj), TYPE_PACKAGEBREAKS))
-#define IS_PACKAGEBREAKS_CLASS(klass)(GTK_CHECK_CLASS_TYPE ((klass), TYPE_PACKAGEBREAKS))
-
-typedef struct _PackageBreaks PackageBreaks;
-typedef struct _PackageBreaksClass PackageBreaksClass;
-
-struct _PackageBreaksClass {
- GtkObjectClass parent_class;
- void (*finalize) (GtkObject *obj);
-};
-
-struct _PackageBreaks {
- GtkObject parent;
- PackageData *__package;
-};
-
-PackageBreaks* packagebreaks_new (void);
-GtkType packagebreaks_get_type (void);
-void packagebreaks_set_package (PackageBreaks *breaks, PackageData *pack);
-PackageData *packagebreaks_get_package (PackageBreaks *breaks);
-
-#define TYPE_PACKAGEFILECONFLICT (packagefileconflict_get_type ())
-#define PACKAGEFILECONFLICT(obj) (GTK_CHECK_CAST ((obj), TYPE_PACKAGEFILECONFLICT, PackageFileConflict))
-#define PACKAGEFILECONFLICT_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), TYPE_PACKAGEFILECONFLICT, PackageFileConflictClass))
-#define IS_PACKAGEFILECONFLICT(obj) (GTK_CHECK_TYPE ((obj), TYPE_PACKAGEFILECONFLICT))
-#define IS_PACKAGEFILECONFLICT_CLASS(klass)(GTK_CHECK_CLASS_TYPE ((klass), TYPE_PACKAGEFILECONFLICT))
-
-typedef struct _PackageFileConflict PackageFileConflict;
-typedef struct _PackageFileConflictClass PackageFileConflictClass;
-
-struct _PackageFileConflictClass {
- PackageBreaksClass parent_class;
- void (*finalize) (GtkObject *obj);
-};
-
-struct _PackageFileConflict {
- PackageBreaks parent;
- GList *files;
-};
-
-PackageFileConflict* packagefileconflict_new (void);
-GtkType packagefileconflict_get_type (void);
-
-#define TYPE_PACKAGEFEATUREMISSING (packagefeaturemissing_get_type ())
-#define PACKAGEFEATUREMISSING(obj) (GTK_CHECK_CAST ((obj), TYPE_PACKAGEFEATUREMISSING, PackageFeatureMissing))
-#define PACKAGEFEATUREMISSING_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), TYPE_PACKAGEFEATUREMISSING, PackageFeatureMissingClass))
-#define IS_PACKAGEFEATUREMISSING(obj) (GTK_CHECK_TYPE ((obj), TYPE_PACKAGEFEATUREMISSING))
-#define IS_PACKAGEFEATUREMISSING_CLASS(klass)(GTK_CHECK_CLASS_TYPE ((klass), TYPE_PACKAGEFEATUREMISSING))
-
-typedef struct _PackageFeatureMissing PackageFeatureMissing;
-typedef struct _PackageFeatureMissingClass PackageFeatureMissingClass;
-
-struct _PackageFeatureMissingClass {
- PackageBreaksClass parent_class;
- void (*finalize) (GtkObject *obj);
-};
-
-struct _PackageFeatureMissing {
- PackageBreaks parent;
- GList *features;
-};
-
-#define IS_VALID_PACKAGEBREAKS(obj) (IS_PACKAGEFEATUREMISSING (obj) || IS_PACKAGEFILECONFLICT (obj))
-
-PackageFeatureMissing* packagefeaturemissing_new (void);
-GtkType packagefeaturemissing_get_type (void);
-
-
-/*************************************************************************************************/
-
-void packagedata_add_to_breaks (PackageData *pack, PackageBreaks *b);
-void packagedata_add_pack_to_breaks (PackageData *pack, PackageData *b);
-void packagedata_add_pack_to_depends (PackageData *pack, PackageDependency *b);
-void packagedata_add_pack_to_modifies (PackageData *pack, PackageData *b);
-
-/*************************************************************************************************/
-/* FIXME: deprecating eazel-install-logic.c will also deprecate this structure */
-
-typedef struct {
- PackageData *package;
- PackageData *required;
-} PackageRequirement;
-
-PackageRequirement* packagerequirement_new (PackageData *pack, PackageData *req);
-
-/* glib style ompares */
-
-int eazel_install_package_compare (PackageData *pack, PackageData *other);
-int eazel_install_package_name_compare (PackageData *pack, char *name);
-int eazel_install_package_version_compare (PackageData *pack, char *version);
-int eazel_install_package_id_compare (PackageData *pack, char *id);
-int eazel_install_package_feature_compare (PackageData *pack, char *feature);
-int eazel_install_package_provides_compare (PackageData *pack, char *name);
-
-int eazel_install_requirement_dep_name_compare (PackageRequirement *req, const char *name);
-int eazel_install_requirement_dep_compare (PackageRequirement *req, PackageData *pack);
-int eazel_install_package_other_version_compare (PackageData *pack, PackageData *other);
-
-/* Other compare functions */
-
-/* Specific compare where b is more complete then a, do not use in
- glib functions. both version and minor can be null, however, if
- version is null, minor must also be null. */
-int eazel_install_package_matches_versioning (PackageData *a, const char *version,
- const char *minor, EazelSoftCatSense);
-
-/* Evil marshal func */
-
-void eazel_install_gtk_marshal_NONE__POINTER_INT_INT_INT_INT_INT_INT (GtkObject * object,
- GtkSignalFunc func,
- gpointer func_data, GtkArg * args);
-
-void eazel_install_gtk_marshal_BOOL__ENUM_POINTER_INT_INT (GtkObject * object,
- GtkSignalFunc func,
- gpointer func_data, GtkArg * args);
-
-void eazel_install_gtk_marshal_BOOL__ENUM_POINTER (GtkObject * object,
- GtkSignalFunc func,
- gpointer func_data, GtkArg * args);
-
-char *packagedata_dump_tree (const GList *packlst, int indent_level);
-char *packagedata_dump (const PackageData *package, gboolean deep);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* EAZEL_PACKAGE_SYSTEM_TYPES_H */
diff --git a/components/services/install/lib/eazel-package-system.c b/components/services/install/lib/eazel-package-system.c
deleted file mode 100644
index 03af9b353..000000000
--- a/components/services/install/lib/eazel-package-system.c
+++ /dev/null
@@ -1,676 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: Eskil Heyn Olsen <eskil@eazel.com>
- *
- */
-
-#include <config.h>
-#include "eazel-package-system-private.h"
-
-#include <libtrilobite/trilobite-core-distribution.h>
-#include <libtrilobite/trilobite-core-utils.h>
-#include <libtrilobite/trilobite-md5-tools.h>
-#include <gtk/gtksignal.h>
-#include <gmodule.h>
-
-#undef EPS_DEBUG
-
-enum {
- START,
- END,
- PROGRESS,
- FAILED,
- LAST_SIGNAL
-};
-
-/* The signal array, used for building the signal bindings */
-static guint signals[LAST_SIGNAL] = { 0 };
-/* This is the parent class pointer */
-static GtkObjectClass *eazel_package_system_parent_class;
-
-/*****************************************/
-
-EazelPackageSystemId
-eazel_package_system_suggest_id ()
-{
- EazelPackageSystemId result = EAZEL_PACKAGE_SYSTEM_UNSUPPORTED;
- TrilobiteDistributionInfo dist = trilobite_get_distribution ();
-
- switch (dist.name) {
- case DISTRO_REDHAT:
- if (dist.version_major == 6) {
- result = EAZEL_PACKAGE_SYSTEM_RPM_3;
- } else {
- result = EAZEL_PACKAGE_SYSTEM_RPM_4;
- }
- break;
- case DISTRO_MANDRAKE:
- if (dist.version_major >= 8) {
- result = EAZEL_PACKAGE_SYSTEM_RPM_4;
- }
- else {
- result = EAZEL_PACKAGE_SYSTEM_RPM_3;
- }
- break;
- case DISTRO_YELLOWDOG:
- result = EAZEL_PACKAGE_SYSTEM_UNSUPPORTED;
- break;
- case DISTRO_TURBOLINUX:
- result = EAZEL_PACKAGE_SYSTEM_RPM_3;
- break;
- case DISTRO_COREL:
- result = EAZEL_PACKAGE_SYSTEM_DEB;
- break;
- case DISTRO_DEBIAN:
- result = EAZEL_PACKAGE_SYSTEM_DEB;
- break;
- case DISTRO_CALDERA:
- result = EAZEL_PACKAGE_SYSTEM_RPM_3;
- break;
- case DISTRO_SUSE:
- result = EAZEL_PACKAGE_SYSTEM_RPM_3;
- break;
- case DISTRO_LINUXPPC:
- result = EAZEL_PACKAGE_SYSTEM_RPM_3;
- break;
- case DISTRO_UNKNOWN:
- result = EAZEL_PACKAGE_SYSTEM_UNSUPPORTED;
- break;
- }
- return result;
-}
-
-#ifdef EAZEL_INSTALL_SLIM
-EazelPackageSystem *eazel_package_system_implementation (GList *roots);
-#endif
-
-static EazelPackageSystem*
-eazel_package_system_load_implementation (EazelPackageSystemId id, GList *roots)
-{
- EazelPackageSystem *result = NULL;
- EazelPackageSystemConstructorFunc const_func = NULL;
- GModule *module = NULL;
-
-#ifdef EAZEL_INSTALL_SLIM
- return eazel_package_system_implementation (roots);
-#endif
-
- switch (id) {
- case EAZEL_PACKAGE_SYSTEM_DEB:
- module = g_module_open ("libeazelpackagesystem-dpkg.so", G_MODULE_BIND_LAZY);
- break;
- case EAZEL_PACKAGE_SYSTEM_RPM_3:
- module = g_module_open ("libeazelpackagesystem-rpm3.so", G_MODULE_BIND_LAZY);
- break;
- case EAZEL_PACKAGE_SYSTEM_RPM_4:
- module = g_module_open ("libeazelpackagesystem-rpm4.so", G_MODULE_BIND_LAZY);
- break;
-#if 0 /* someday */
- case EAZEL_PACKAGE_SYSTEM_BUILTIN:
- module = g_module_open (NULL /* myself */, G_MODULE_BIND_LAZY);
- break;
-#endif
- default:
- trilobite_debug ("EPS: Unsupported System");
- };
-
- if (module==NULL) {
- g_warning ("gmodule: %s", g_module_error ());
- } else {
- g_module_make_resident (module);
- g_module_symbol (module, "eazel_package_system_implementation", (gpointer)&const_func);
- result = (*const_func)(roots);
- }
-
- return result;
-}
-
-static gboolean
-eazel_package_system_matches_versioning (EazelPackageSystem *package_system,
- PackageData *pack,
- const char *version,
- const char *minor,
- EazelSoftCatSense sense)
-{
- gboolean version_result = FALSE;
- gboolean minor_result = FALSE;
- int result;
-
- g_assert (!((version == NULL) && (minor != NULL)));
-
- if (version != NULL) {
- result = eazel_package_system_compare_version (package_system, pack->version, version);
- if ((sense & EAZEL_SOFTCAT_SENSE_EQ) && (result == 0)) {
- version_result = TRUE;
- }
- if ((sense & EAZEL_SOFTCAT_SENSE_GT) && (result > 0)) {
- version_result = TRUE;
- }
- if ((sense & EAZEL_SOFTCAT_SENSE_LT) && (result < 0)) {
- version_result = TRUE;
- }
- } else {
- version_result = TRUE;
- }
-
- if (minor != NULL) {
- result = eazel_package_system_compare_version (package_system, pack->minor, minor);
- if ((sense & EAZEL_SOFTCAT_SENSE_EQ) && (result == 0)) {
- minor_result = TRUE;
- }
- if ((sense & EAZEL_SOFTCAT_SENSE_GT) && (result > 0)) {
- minor_result = TRUE;
- }
- if ((sense & EAZEL_SOFTCAT_SENSE_LT) && (result < 0)) {
- minor_result = TRUE;
- }
- } else {
- minor_result = TRUE;
- }
-
- return (version_result && minor_result);
-}
-
-gboolean
-eazel_package_system_is_installed (EazelPackageSystem *package_system,
- const char *dbpath,
- const char *name,
- const char *version,
- const char *minor,
- EazelSoftCatSense version_sense)
-{
- GList *matches;
- gboolean result = FALSE;
-
-#if EPS_DEBUG
- trilobite_debug ("eazel_package_system_is_installed (..., %s, %s, %s, %d)",
- name, version, minor, version_sense);
-#endif
-
- matches = eazel_package_system_query (package_system,
- dbpath,
- (const gpointer)name,
- EAZEL_PACKAGE_SYSTEM_QUERY_MATCHES,
- PACKAGE_FILL_MINIMAL);
-
- if (matches) {
- if (version || minor) {
- GList *iterator;
-
- for (iterator = matches; iterator && !result; iterator = g_list_next (iterator)) {
- PackageData *pack = (PackageData*)iterator->data;
-
- if (eazel_package_system_matches_versioning (package_system,
- pack,
- version,
- minor,
- version_sense)) {
- result = TRUE;
-
- }
-#if EPS_DEBUG
- g_message("is_installed (%s, %s, %s, %d) == (%s-%s %d %s-%s) %s",
- name, version, minor, version_sense,
- pack->version, pack->minor,
- version_sense,
- version, minor,
- result ? "TRUE" : "FALSE");
-#endif
- }
- } else {
- result = TRUE;
- }
- g_list_foreach (matches, (GFunc)gtk_object_unref, NULL);
- }
- g_list_free (matches);
-
- return result;
-}
-
-PackageData*
-eazel_package_system_load_package (EazelPackageSystem *system,
- PackageData *in_package,
- const char *filename,
- int detail_level)
-{
- PackageData *result = NULL;
- char md5[16];
-
- EPS_SANE_VAL (system, NULL);
-
- if (system->private->load_package) {
- result = (*system->private->load_package) (system, in_package, filename, detail_level);
- if (result) {
- trilobite_md5_get_digest_from_file (filename, md5);
- result->md5 = g_strdup (trilobite_md5_get_string_from_md5_digest (md5));
- }
- }
-
- return result;
-}
-
-GList*
-eazel_package_system_query (EazelPackageSystem *system,
- const char *root,
- const gpointer key,
- EazelPackageSystemQueryEnum flag,
- int detail_level)
-{
- GList *result = NULL;
-
- EPS_SANE_VAL (system, NULL);
-
- if (system->private->query) {
- g_assert (key);
- result = (*system->private->query) (system, root, key, flag, detail_level);
- }
-
- return result;
-}
-
-static void
-eazel_package_system_fail_all_packages (EazelPackageSystem *system,
- EazelPackageSystemOperation op,
- GList *packages)
-{
- GList *iterator;
-
- for (iterator = packages; iterator; iterator = g_list_next (iterator)) {
- PackageData *p = PACKAGEDATA (iterator->data);
- eazel_package_system_emit_start (system, op, p);
- eazel_package_system_emit_failed (system, op, p);
- eazel_package_system_emit_end (system, op, p);
- }
-}
-
-void
-eazel_package_system_install (EazelPackageSystem *system,
- const char *root,
- GList* packages,
- unsigned long flags)
-{
- EPS_SANE (system);
-
- if (system->private->install) {
- /* If we're in test mode, disable FORCE just to trigger
- any potiental errors */
- if (flags & EAZEL_PACKAGE_SYSTEM_OPERATION_TEST) {
- (*system->private->install) (system, root, packages,
- flags & ~EAZEL_PACKAGE_SYSTEM_OPERATION_FORCE);
- } else {
- (*system->private->install) (system, root, packages, flags);
- }
- } else {
- eazel_package_system_fail_all_packages (system,
- EAZEL_PACKAGE_SYSTEM_OPERATION_INSTALL,
- packages);
- }
-}
-
-void
-eazel_package_system_uninstall (EazelPackageSystem *system,
- const char *root,
- GList* packages,
- unsigned long flags)
-{
- EPS_SANE (system);
-
- if (system->private->uninstall) {
- (*system->private->uninstall) (system, root, packages, flags);
- } else {
- eazel_package_system_fail_all_packages (system,
- EAZEL_PACKAGE_SYSTEM_OPERATION_UNINSTALL,
- packages);
- }
-}
-
-gboolean
-eazel_package_system_verify (EazelPackageSystem *system,
- const char *dbpath,
- GList* packages)
-{
- EPS_SANE_VAL (system, FALSE);
- if (system->private->verify) {
- return (*system->private->verify) (system, dbpath, packages);
- } else {
- eazel_package_system_fail_all_packages (system,
- EAZEL_PACKAGE_SYSTEM_OPERATION_VERIFY,
- packages);
- return FALSE;
- }
-}
-
-int
-eazel_package_system_compare_version (EazelPackageSystem *system,
- const char *a,
- const char *b)
-{
- int result;
- EPS_SANE_VAL (system, 0);
- g_assert (system->private->compare_version);
- result = (*system->private->compare_version) (system, a, b);
- return result;
-}
-
-time_t
-eazel_package_system_database_mtime (EazelPackageSystem *system)
-{
- time_t result;
- EPS_SANE_VAL (system, 0);
- if (system->private->database_mtime == NULL) {
- return 0;
- }
- result = (*system->private->database_mtime) (system);
- return result;
-}
-
-/******************************************
- The private emitter functions
-*******************************************/
-
-gboolean
-eazel_package_system_emit_start (EazelPackageSystem *system,
- EazelPackageSystemOperation op,
- const PackageData *package)
-{
- gboolean result = TRUE;
- EPS_API (system);
- gtk_signal_emit (GTK_OBJECT (system),
- signals [START],
- op,
- package,
- &result);
- return result;
-}
-
-gboolean
-eazel_package_system_emit_progress (EazelPackageSystem *system,
- EazelPackageSystemOperation op,
- const PackageData *package,
- unsigned long info[EAZEL_PACKAGE_SYSTEM_PROGRESS_LONGS])
-{
- gboolean result = TRUE;
- int infos;
- unsigned long *infoblock;
-
- EPS_API (system);
- infoblock = g_new0 (unsigned long, EAZEL_PACKAGE_SYSTEM_PROGRESS_LONGS+1);
- for (infos = 0; infos < EAZEL_PACKAGE_SYSTEM_PROGRESS_LONGS; infos++) {
- infoblock[infos] = info[infos];
- }
-
- gtk_signal_emit (GTK_OBJECT (system),
- signals [PROGRESS],
- op,
- package,
- infoblock,
- &result);
-
- g_free (infoblock);
- return result;
-}
-
-gboolean
-eazel_package_system_emit_failed (EazelPackageSystem *system,
- EazelPackageSystemOperation op,
- const PackageData *package)
-{
- gboolean result = TRUE;
- EPS_API (system);
-
- gtk_signal_emit (GTK_OBJECT (system),
- signals [FAILED],
- op,
- package,
- &result);
-
- return result;
-}
-
-gboolean
-eazel_package_system_emit_end (EazelPackageSystem *system,
- EazelPackageSystemOperation op,
- const PackageData *package)
-{
- gboolean result = TRUE;
- EPS_API (system);
-
- gtk_signal_emit (GTK_OBJECT (system),
- signals [END],
- op,
- package,
- &result);
-
- return result;
-}
-
-EazelPackageSystemDebug
-eazel_package_system_get_debug (EazelPackageSystem *system)
-{
- if (system->private) {
- return system->private->debug;
- } else {
- return 0;
- }
-}
-
-void
-eazel_package_system_set_debug (EazelPackageSystem *system,
- EazelPackageSystemDebug d)
-{
- EPS_API (system);
- system->private->debug = d;
-}
-
-/*****************************************
- GTK+ object stuff
-*****************************************/
-
-static void
-eazel_package_system_finalize (GtkObject *object)
-{
- EazelPackageSystem *system;
-
- g_return_if_fail (object != NULL);
- g_return_if_fail (EAZEL_PACKAGE_SYSTEM (object));
-
- system = EAZEL_PACKAGE_SYSTEM (object);
-
- if (GTK_OBJECT_CLASS (eazel_package_system_parent_class)->finalize) {
- GTK_OBJECT_CLASS (eazel_package_system_parent_class)->finalize (object);
- }
-}
-
-static void
-eazel_package_system_class_initialize (EazelPackageSystemClass *klass)
-{
- GtkObjectClass *object_class;
-
- object_class = (GtkObjectClass*)klass;
- object_class->finalize = eazel_package_system_finalize;
-
- eazel_package_system_parent_class = gtk_type_class (gtk_object_get_type ());
-
- signals[START] =
- gtk_signal_new ("start",
- GTK_RUN_LAST,
- object_class->type,
- GTK_SIGNAL_OFFSET (EazelPackageSystemClass, start),
- eazel_package_system_marshal_BOOL__ENUM_POINTER,
- GTK_TYPE_BOOL, 2,
- GTK_TYPE_ENUM, GTK_TYPE_POINTER);
- signals[END] =
- gtk_signal_new ("end",
- GTK_RUN_LAST,
- object_class->type,
- GTK_SIGNAL_OFFSET (EazelPackageSystemClass, end),
- eazel_package_system_marshal_BOOL__ENUM_POINTER,
- GTK_TYPE_BOOL, 2,
- GTK_TYPE_ENUM, GTK_TYPE_POINTER);
- signals[PROGRESS] =
- gtk_signal_new ("progress",
- GTK_RUN_LAST,
- object_class->type,
- GTK_SIGNAL_OFFSET (EazelPackageSystemClass, progress),
- eazel_package_system_marshal_BOOL__ENUM_POINTER_POINTER,
- GTK_TYPE_BOOL, 3,
- GTK_TYPE_ENUM, GTK_TYPE_POINTER, GTK_TYPE_POINTER);
- signals[FAILED] =
- gtk_signal_new ("failed",
- GTK_RUN_LAST,
- object_class->type,
- GTK_SIGNAL_OFFSET (EazelPackageSystemClass, failed),
- eazel_package_system_marshal_BOOL__ENUM_POINTER,
- GTK_TYPE_BOOL, 2,
- GTK_TYPE_ENUM, GTK_TYPE_POINTER);
- gtk_object_class_add_signals (object_class, signals, LAST_SIGNAL);
-
- klass->start = NULL;
- klass->progress = NULL;
- klass->failed = NULL;
- klass->end = NULL;
-}
-
-static void
-eazel_package_system_initialize (EazelPackageSystem *system) {
- g_assert (system!=NULL);
- g_assert (EAZEL_IS_PACKAGE_SYSTEM (system));
-
- system->private = g_new0 (EazelPackageSystemPrivate, 1);
- system->err = NULL;
-}
-
-GtkType
-eazel_package_system_get_type() {
- static GtkType system_type = 0;
-
- /* First time it's called ? */
- if (!system_type)
- {
- static const GtkTypeInfo system_info =
- {
- "EazelPackageSystem",
- sizeof (EazelPackageSystem),
- sizeof (EazelPackageSystemClass),
- (GtkClassInitFunc) eazel_package_system_class_initialize,
- (GtkObjectInitFunc) eazel_package_system_initialize,
- /* reserved_1 */ NULL,
- /* reserved_2 */ NULL,
- (GtkClassInitFunc) NULL,
- };
-
- system_type = gtk_type_unique (gtk_object_get_type (), &system_info);
- }
-
- return system_type;
-}
-
-/*
- This is the real constructor
-*/
-EazelPackageSystem *
-eazel_package_system_new_real ()
-{
- EazelPackageSystem *system;
-
- system = EAZEL_PACKAGE_SYSTEM (gtk_object_new (TYPE_EAZEL_PACKAGE_SYSTEM, NULL));
-
- gtk_object_ref (GTK_OBJECT (system));
- gtk_object_sink (GTK_OBJECT (system));
-
- return system;
-}
-
-/*
- This lets the user create a packagesystem with a specific
- id
-*/
-EazelPackageSystem *
-eazel_package_system_new_with_id (EazelPackageSystemId id, GList *roots)
-{
- EazelPackageSystem *result;
-
- result = eazel_package_system_load_implementation (id, roots);
-
- /* If we failed (eg. unsupported system id), return
- an empty object */
- if (result == NULL) {
- result = eazel_package_system_new_real ();
- }
-
- return result;
-}
-
-/*
- Autodetect distribution and creates
- an instance of a EazelPackageSystem with the appropriate
- type
- */
-EazelPackageSystem *
-eazel_package_system_new (GList *roots)
-{
- return eazel_package_system_new_with_id (eazel_package_system_suggest_id (), roots);
-}
-
-/* Marshal functions */
-
-typedef gboolean (*GtkSignal_BOOL__ENUM_POINTER_POINTER) (GtkObject *object,
- gint arg1,
- gpointer arg2,
- gpointer arg3,
- gpointer user_data);
-
-void eazel_package_system_marshal_BOOL__ENUM_POINTER_POINTER (GtkObject *object,
- GtkSignalFunc func,
- gpointer func_data,
- GtkArg *args)
-{
- GtkSignal_BOOL__ENUM_POINTER_POINTER rfunc;
- gboolean *result;
-
- result = GTK_RETLOC_BOOL (args[3]);
- rfunc = (GtkSignal_BOOL__ENUM_POINTER_POINTER)func;
- (*result) = (*rfunc) (object,
- GTK_VALUE_ENUM (args[0]),
- GTK_VALUE_POINTER (args[1]),
- GTK_VALUE_POINTER (args[2]),
- func_data);
-}
-
-typedef gboolean (*GtkSignal_BOOL__ENUM_POINTER) (GtkObject *object,
- gint arg1,
- gpointer arg2,
- gpointer user_data);
-
-void eazel_package_system_marshal_BOOL__ENUM_POINTER (GtkObject *object,
- GtkSignalFunc func,
- gpointer func_data,
- GtkArg *args)
-{
- GtkSignal_BOOL__ENUM_POINTER rfunc;
- gboolean *result;
-
- rfunc = (GtkSignal_BOOL__ENUM_POINTER)func;
- result = GTK_RETLOC_BOOL (args[2]);
- (*result) = (*rfunc) (object,
- GTK_VALUE_ENUM (args[0]),
- GTK_VALUE_POINTER (args[1]),
- func_data);
-}
diff --git a/components/services/install/lib/eazel-package-system.h b/components/services/install/lib/eazel-package-system.h
deleted file mode 100644
index 9e8fa31fe..000000000
--- a/components/services/install/lib/eazel-package-system.h
+++ /dev/null
@@ -1,164 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: Eskil Heyn Olsen <eskil@eazel.com>
- *
- */
-
-#ifndef EAZEL_PACKAGE_SYSTEM_PUBLIC_H
-#define EAZEL_PACKAGE_SYSTEM_PUBLIC_H
-
-#include "eazel-package-system-types.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-#define TYPE_EAZEL_PACKAGE_SYSTEM (eazel_package_system_get_type ())
-#define EAZEL_PACKAGE_SYSTEM(obj) (GTK_CHECK_CAST ((obj), TYPE_EAZEL_PACKAGE_SYSTEM, EazelPackageSystem))
-#define EAZEL_PACKAGE_SYSTEM_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), TYPE_EAZEL_PACKAGE_SYSTEM, EazelPackageSystemClass))
-#define EAZEL_IS_PACKAGE_SYSTEM(obj) (GTK_CHECK_TYPE ((obj), TYPE_EAZEL_PACKAGE_SYSTEM))
-#define EAZEL_IS_PACKAGE_SYSTEM_CLASS(klass)(GTK_CHECK_CLASS_TYPE ((klass), TYPE_EAZEL_PACKAGE_SYSTEM))
-
-typedef struct _EazelPackageSystem EazelPackageSystem;
-typedef struct _EazelPackageSystemClass EazelPackageSystemClass;
-
-/* This enum identifies the package system
- used for the object instance */
-typedef enum {
- EAZEL_PACKAGE_SYSTEM_UNSUPPORTED,
- EAZEL_PACKAGE_SYSTEM_RPM_3,
- EAZEL_PACKAGE_SYSTEM_RPM_4,
- EAZEL_PACKAGE_SYSTEM_DEB,
-} EazelPackageSystemId;
-
-typedef enum {
- EAZEL_PACKAGE_SYSTEM_QUERY_OWNS,
- EAZEL_PACKAGE_SYSTEM_QUERY_PROVIDES,
- EAZEL_PACKAGE_SYSTEM_QUERY_REQUIRES,
- EAZEL_PACKAGE_SYSTEM_QUERY_REQUIRES_FEATURE,
- EAZEL_PACKAGE_SYSTEM_QUERY_MATCHES,
- EAZEL_PACKAGE_SYSTEM_QUERY_SUBSTR
-} EazelPackageSystemQueryEnum;
-
-enum {
- EAZEL_PACKAGE_SYSTEM_OPERATION_TEST = 0x1,
- EAZEL_PACKAGE_SYSTEM_OPERATION_FORCE = 0x2,
- EAZEL_PACKAGE_SYSTEM_OPERATION_UPGRADE = 0x10,
- EAZEL_PACKAGE_SYSTEM_OPERATION_DOWNGRADE = 0x20
-};
-
-typedef enum {
- EAZEL_PACKAGE_SYSTEM_OPERATION_INSTALL,
- EAZEL_PACKAGE_SYSTEM_OPERATION_UNINSTALL,
- EAZEL_PACKAGE_SYSTEM_OPERATION_VERIFY,
-} EazelPackageSystemOperation;
-
-struct _EazelPackageSystemClass
-{
- GtkObjectClass parent_class;
- gboolean (*start)(EazelPackageSystem*,
- EazelPackageSystemOperation,
- const PackageData*,
- unsigned long*);
- gboolean (*progress)(EazelPackageSystem*,
- EazelPackageSystemOperation,
- const PackageData*,
- unsigned long*);
- gboolean (*failed)(EazelPackageSystem*,
- EazelPackageSystemOperation,
- const PackageData*);
- gboolean (*end)(EazelPackageSystem*,
- EazelPackageSystemOperation,
- const PackageData*);
-};
-
-typedef enum {
- EAZEL_PACKAGE_SYSTEM_DEBUG_SILENT = 0x0,
- EAZEL_PACKAGE_SYSTEM_DEBUG_INFO = 0x1,
- EAZEL_PACKAGE_SYSTEM_DEBUG_FAIL = 0x2,
- EAZEL_PACKAGE_SYSTEM_DEBUG_VERBOSE = 0xffff
-} EazelPackageSystemDebug;
-
-/* I hate myself for this... please, give me exceptions! */
-typedef enum {
- EazelPackageSystemError_DB_ACCESS
-} EazelPackageSystemErrorEnum;
-
-typedef struct _EazelPackageSystemError EazelPackageSystemError;
-struct _EazelPackageSystemError {
- EazelPackageSystemErrorEnum e;
- union {
- struct {
- const char *path;
- pid_t pid;
- } db_access;
- } u;
-};
-
-typedef struct _EazelPackageSystemPrivate EazelPackageSystemPrivate;
-struct _EazelPackageSystem
-{
- GtkObject parent;
- EazelPackageSystemPrivate *private;
- EazelPackageSystemError *err;
-};
-
-EazelPackageSystemId eazel_package_system_suggest_id (void);
-EazelPackageSystem *eazel_package_system_new (GList *dbpaths);
-EazelPackageSystem *eazel_package_system_new_with_id (EazelPackageSystemId, GList *dbpaths);
-GtkType eazel_package_system_get_type (void);
-
-EazelPackageSystemDebug eazel_package_system_get_debug (EazelPackageSystem *system);
-void eazel_package_system_set_debug (EazelPackageSystem *system, EazelPackageSystemDebug d);
-
-gboolean eazel_package_system_is_installed (EazelPackageSystem *package_system,
- const char *dbpath,
- const char *name,
- const char *version,
- const char *minor,
- EazelSoftCatSense version_sense);
-
-PackageData *eazel_package_system_load_package (EazelPackageSystem *package_system,
- PackageData *in_package,
- const char *filename,
- int detail_level);
-GList* eazel_package_system_query (EazelPackageSystem *package_system,
- const char *dbpath,
- const gpointer key,
- EazelPackageSystemQueryEnum flag,
- int detail_level);
-void eazel_package_system_install (EazelPackageSystem *package_system,
- const char *dbpath,
- GList* packages,
- unsigned long flags);
-void eazel_package_system_uninstall (EazelPackageSystem *package_system,
- const char *dbpath,
- GList* packages,
- unsigned long flags);
-gboolean eazel_package_system_verify (EazelPackageSystem *package_system,
- const char *dbpath,
- GList* packages);
-int eazel_package_system_compare_version (EazelPackageSystem *package_system,
- const char *a,
- const char *b);
-time_t eazel_package_system_database_mtime (EazelPackageSystem *package_system);
-
-#endif /* EAZEL_PACKAGE_SYSTEM_PUBLIC_H */
-
diff --git a/components/services/install/lib/eazel-softcat-private.h b/components/services/install/lib/eazel-softcat-private.h
deleted file mode 100644
index 5c596871e..000000000
--- a/components/services/install/lib/eazel-softcat-private.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: Eskil Heyn Olsen <eskil@eazel.com>
- *
- */
-
-#ifndef EAZEL_SOFTCAT_PRIVATE_H
-#define EAZEL_SOFTCAT_PRIVATE_H
-
-#include "eazel-softcat.h"
-
-#define SOFTCAT_DEFAULT_SERVER "services.eazel.com"
-#define SOFTCAT_DEFAULT_PORT 80
-#define SOFTCAT_DEFAULT_CGI_PATH "/catalog/find"
-
-struct _EazelSoftCatPrivate {
- char *server;
- unsigned int port;
- char *server_str;
- char *cgi_path;
- char *username; /* username on the service (can be NULL for default user) */
- gboolean use_authn; /* use SSL proxy? won't work for "slim" */
-
- /* number of times to try connecting to softcat, and delay between attempts (in usec) */
- unsigned int retries;
- unsigned int delay;
-
- /* This is used to track the server update status */
- char *db_revision;
-
- int packages_per_query;
-};
-
-#endif /* EAZEL_SOFTCAT_PRIVATE_H */
diff --git a/components/services/install/lib/eazel-softcat.c b/components/services/install/lib/eazel-softcat.c
deleted file mode 100644
index b316ecf7a..000000000
--- a/components/services/install/lib/eazel-softcat.c
+++ /dev/null
@@ -1,1178 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: Robey Pointer <robey@eazel.com>
- * Eskil Heyn Olsen <eskil@eazel.com>
- */
-
-#include <config.h>
-#include "eazel-softcat.h"
-
-#include "eazel-install-xml-package-list.h"
-#include "eazel-softcat-private.h"
-#include <eel/eel-glib-extensions.h>
-#include <libtrilobite/trilobite-core-network.h>
-#include <libtrilobite/trilobite-core-utils.h>
-
-/* used for gnome_vfs_escape_string */
-#ifndef EAZEL_INSTALL_SLIM
-#include <libgnomevfs/gnome-vfs.h>
-#endif /* EAZEL_INSTALL_SLIM */
-
-#include <string.h>
-
-/* This is the parent class pointer */
-static GtkObjectClass *eazel_softcat_parent_class;
-
-#undef EAZEL_SOFTCAT_SPAM_XML
-
-/*****************************************
- GTK+ object stuff
-*****************************************/
-
-static void
-eazel_softcat_finalize (GtkObject *object)
-{
- EazelSoftCat *softcat;
-
- g_return_if_fail (object != NULL);
- g_return_if_fail (EAZEL_SOFTCAT (object));
-
- softcat = EAZEL_SOFTCAT (object);
-
- g_free (softcat->private->server);
- softcat->private->server = NULL;
- g_free (softcat->private->server_str);
- softcat->private->server_str = NULL;
- g_free (softcat->private->cgi_path);
- softcat->private->cgi_path = NULL;
- g_free (softcat->private->username);
- softcat->private->username = NULL;
- g_free (softcat->private->db_revision);
- softcat->private->db_revision = NULL;
-
- g_free (softcat->private);
-
- if (GTK_OBJECT_CLASS (eazel_softcat_parent_class)->finalize) {
- GTK_OBJECT_CLASS (eazel_softcat_parent_class)->finalize (object);
- }
-}
-
-static void
-eazel_softcat_class_initialize (EazelSoftCatClass *klass)
-{
- GtkObjectClass *object_class;
-
- object_class = (GtkObjectClass*)klass;
- object_class->finalize = eazel_softcat_finalize;
-#if 0
- object_class->set_arg = eazel_softcat_set_arg;
-#endif
-
- eazel_softcat_parent_class = gtk_type_class (gtk_object_get_type ());
-
-#if 0
- signals[START] =
- gtk_signal_new ("start",
- GTK_RUN_LAST,
- object_class->type,
- GTK_SIGNAL_OFFSET (EazelSoftCatClass, start),
- gtk_marshal_NONE__POINTER_INT_INT,
- GTK_TYPE_NONE, 3, GTK_TYPE_POINTER, GTK_TYPE_INT, GTK_TYPE_INT);
- signals[END] =
- gtk_signal_new ("end",
- GTK_RUN_LAST,
- object_class->type,
- GTK_SIGNAL_OFFSET (EazelSoftCatClass, end),
- gtk_marshal_BOOL__POINTER_INT_INT,
- GTK_TYPE_BOOL, 3, GTK_TYPE_POINTER, GTK_TYPE_INT, GTK_TYPE_INT);
- signals[PROGRESS] =
- gtk_signal_new ("progress",
- GTK_RUN_LAST,
- object_class->type,
- GTK_SIGNAL_OFFSET (EazelSoftCatClass, progress),
- eazel_softcat_gtk_marshal_NONE__POINTER_INT_INT_INT_INT_INT_INT,
- GTK_TYPE_NONE, 7, GTK_TYPE_POINTER,
- GTK_TYPE_INT, GTK_TYPE_INT, GTK_TYPE_INT,
- GTK_TYPE_INT, GTK_TYPE_INT, GTK_TYPE_INT);
- signals[FAILED] =
- gtk_signal_new ("failed",
- GTK_RUN_LAST,
- object_class->type,
- GTK_SIGNAL_OFFSET (EazelSoftCatClass, failed),
- gtk_marshal_NONE__POINTER,
- GTK_TYPE_NONE, 1, GTK_TYPE_POINTER);
-
- gtk_object_class_add_signals (object_class, signals, LAST_SIGNAL);
-#endif
-}
-
-static void
-eazel_softcat_initialize (EazelSoftCat *softcat)
-{
- g_assert (softcat != NULL);
- g_assert (EAZEL_IS_SOFTCAT (softcat));
-
- softcat->private = g_new0 (EazelSoftCatPrivate, 1);
- softcat->private->retries = 3;
- softcat->private->delay = 100;
- softcat->private->db_revision = NULL;
- softcat->private->packages_per_query = 1;
-}
-
-GtkType
-eazel_softcat_get_type() {
- static GtkType softcat_type = 0;
-
- /* First time it's called ? */
- if (!softcat_type)
- {
- static const GtkTypeInfo softcat_info =
- {
- "EazelSoftCat",
- sizeof (EazelSoftCat),
- sizeof (EazelSoftCatClass),
- (GtkClassInitFunc) eazel_softcat_class_initialize,
- (GtkObjectInitFunc) eazel_softcat_initialize,
- /* reserved_1 */ NULL,
- /* reserved_2 */ NULL,
- (GtkClassInitFunc) NULL,
- };
-
- softcat_type = gtk_type_unique (gtk_object_get_type (), &softcat_info);
- }
-
- return softcat_type;
-}
-
-EazelSoftCat *
-eazel_softcat_new (void)
-{
- EazelSoftCat *softcat;
-
- softcat = EAZEL_SOFTCAT (gtk_object_new (TYPE_EAZEL_SOFTCAT, NULL));
- gtk_object_ref (GTK_OBJECT (softcat));
- gtk_object_sink (GTK_OBJECT (softcat));
-
- return softcat;
-}
-
-void
-eazel_softcat_unref (GtkObject *object)
-{
- g_return_if_fail (object != NULL);
- g_return_if_fail (EAZEL_SOFTCAT (object));
- gtk_object_unref (object);
-}
-
-void
-eazel_softcat_set_server (EazelSoftCat *softcat, const char *server)
-{
- char *p;
-
- g_free (softcat->private->server);
- softcat->private->server = g_strdup (server);
-
- p = strchr (softcat->private->server, ':');
- if (p != NULL) {
- softcat->private->port = atoi (p+1);
- *p = '\0';
- } else {
- softcat->private->port = SOFTCAT_DEFAULT_PORT;
- }
-
- g_free (softcat->private->server_str);
- softcat->private->server_str = g_strdup_printf ("%s:%d", softcat->private->server, softcat->private->port);
- trilobite_debug ("SOFTCAT host/port: %s", server);
-}
-
-void
-eazel_softcat_set_server_host (EazelSoftCat *softcat, const char *server)
-{
- g_free (softcat->private->server);
- softcat->private->server = g_strdup (server);
- trilobite_debug ("SOFTCAT host: %s", server);
-}
-
-void
-eazel_softcat_set_server_port (EazelSoftCat *softcat, int port)
-{
- softcat->private->port = port;
- trilobite_debug ("SOFTCAT port: %d", port);
-}
-
-const char *
-eazel_softcat_get_server (EazelSoftCat *softcat)
-{
- if (softcat->private->server_str == NULL) {
- softcat->private->server_str = g_strdup_printf ("%s:%d", SOFTCAT_DEFAULT_SERVER, SOFTCAT_DEFAULT_PORT);
- }
- return softcat->private->server_str;
-}
-
-const char *
-eazel_softcat_get_server_host (EazelSoftCat *softcat)
-{
- return softcat->private->server;
-}
-
-int
-eazel_softcat_get_server_port (EazelSoftCat *softcat)
-{
- return softcat->private->port;
-}
-
-void
-eazel_softcat_set_cgi_path (EazelSoftCat *softcat, const char *cgi_path)
-{
- g_free (softcat->private->cgi_path);
- if (cgi_path == NULL) {
- softcat->private->cgi_path = NULL;
- } else {
- softcat->private->cgi_path = g_strdup (cgi_path);
- }
-}
-
-const char *
-eazel_softcat_get_cgi_path (const EazelSoftCat *softcat)
-{
- return (softcat->private->cgi_path != NULL) ? softcat->private->cgi_path : SOFTCAT_DEFAULT_CGI_PATH;
-}
-
-void
-eazel_softcat_set_authn (EazelSoftCat *softcat, gboolean use_authn, const char *username)
-{
- g_free (softcat->private->username);
- softcat->private->use_authn = use_authn;
- if (username == NULL) {
- softcat->private->username = NULL;
- } else {
- softcat->private->username = g_strdup (username);
- }
-}
-
-void
-eazel_softcat_set_authn_flag (EazelSoftCat *softcat, gboolean use_authn)
-{
- softcat->private->use_authn = use_authn;
-}
-
-void
-eazel_softcat_set_username (EazelSoftCat *softcat, const char *username)
-{
- eazel_softcat_set_authn (softcat, softcat->private->use_authn, username);
-}
-
-gboolean
-eazel_softcat_get_authn (const EazelSoftCat *softcat, const char **username)
-{
- if (username != NULL) {
- *username = softcat->private->username;
- }
- return softcat->private->use_authn;
-}
-
-void
-eazel_softcat_set_packages_per_query (EazelSoftCat *softcat, int number)
-{
- softcat->private->packages_per_query = number;
-}
-
-void
-eazel_softcat_set_retry (EazelSoftCat *softcat, unsigned int retries, unsigned int delay_us)
-{
- if (retries == 0) {
- retries = 1;
- }
- softcat->private->retries = retries;
- softcat->private->delay = delay_us;
-}
-
-void
-eazel_softcat_reset_server_update_flag (EazelSoftCat *softcat)
-{
- g_free (softcat->private->db_revision);
- softcat->private->db_revision = NULL;
-}
-
-const char *
-eazel_softcat_error_string (EazelSoftCatError err)
-{
- /* No need to translate these strings, since this is only used
- * in test code.
- */
- switch (err) {
- case EAZEL_SOFTCAT_SUCCESS:
- return "(no error)";
- case EAZEL_SOFTCAT_ERROR_BAD_MOJO:
- return "internal error";
- case EAZEL_SOFTCAT_ERROR_SERVER_UNREACHABLE:
- return "softcat server is unreachable";
- case EAZEL_SOFTCAT_ERROR_MULTIPLE_RESPONSES:
- return "softcat server returned multiple responses to a single-package query";
- case EAZEL_SOFTCAT_ERROR_SERVER_UPDATED:
- return "softcat has been updated since last request";
- case EAZEL_SOFTCAT_ERROR_NO_SUCH_PACKAGE:
- return "no such package";
- }
- return "???";
-}
-
-
-/*****************************************
- actual real implementation stuff
-*****************************************/
-
-/* can be OR'd together for "greater than or equal" etc -- this happens often. */
-/* --- private to me. everyone else should use the real sense flags in eazel-softcat.h. */
-/* these are the numbers that the softcat server uses. */
-typedef enum {
- SOFTCAT_SENSE_FLAG_LESS = 2,
- SOFTCAT_SENSE_FLAG_GREATER = 4,
- SOFTCAT_SENSE_FLAG_EQUAL = 8
-} SoftcatSenseFlag;
-
-static char *
-sense_flags_to_softcat_flags (EazelSoftCatSense sense)
-{
- int flags = 0;
-
- if (sense & EAZEL_SOFTCAT_SENSE_EQ) {
- flags |= SOFTCAT_SENSE_FLAG_EQUAL;
- }
- if (sense & EAZEL_SOFTCAT_SENSE_GT) {
- flags |= SOFTCAT_SENSE_FLAG_GREATER;
- }
- if (sense & EAZEL_SOFTCAT_SENSE_LT) {
- flags |= SOFTCAT_SENSE_FLAG_LESS;
- }
-
- return g_strdup_printf ("%d", flags);
-}
-
-EazelSoftCatSense
-eazel_softcat_convert_sense_flags (int flags)
-{
- EazelSoftCatSense out = 0;
-
- if (flags & SOFTCAT_SENSE_FLAG_LESS) {
- out |= EAZEL_SOFTCAT_SENSE_LT;
- }
- if (flags & SOFTCAT_SENSE_FLAG_GREATER) {
- out |= EAZEL_SOFTCAT_SENSE_GT;
- }
- if (flags & SOFTCAT_SENSE_FLAG_EQUAL) {
- out |= EAZEL_SOFTCAT_SENSE_EQ;
- }
- return out;
-}
-
-char *
-eazel_softcat_sense_flags_to_string (EazelSoftCatSense flags)
-{
- char *out, *p;
-
- out = g_malloc (5);
- p = out;
- if (flags & EAZEL_SOFTCAT_SENSE_LT) {
- *p++ = '<';
- }
- if (flags & EAZEL_SOFTCAT_SENSE_GT) {
- *p++ = '>';
- }
- if (flags & EAZEL_SOFTCAT_SENSE_EQ) {
- *p++ = '=';
- }
- *p = '\0';
- return out;
-}
-
-EazelSoftCatSense
-eazel_softcat_string_to_sense_flags (const char *str)
-{
- EazelSoftCatSense out = 0;
- const char *p;
-
- for (p = str; *p != '\0'; p++) {
- switch (*p) {
- case '<':
- out |= EAZEL_SOFTCAT_SENSE_LT;
- break;
- case '>':
- out |= EAZEL_SOFTCAT_SENSE_GT;
- break;
- case '=':
- out |= EAZEL_SOFTCAT_SENSE_EQ;
- break;
- default:
- /* ignore */
- break;
- }
- }
- return out;
-}
-
-#ifdef EAZEL_INSTALL_SLIM
-/* wow, i had no idea all these chars were evil. they must be stopped! */
-static char _bad[] = {
- 1,0,1,1,1,1,1,1,0,0,0,1,1,0,0,1, /* !"#$%&'()*+,-./ */
- 0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1, /* 0123456789:;<=>? */
- 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* @ABCDEFGHIJKLMNO */
- 0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0, /* PQRSTUVWXYZ[\]^_ */
- 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* `abcdefghijklmno */
- 0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,1 /* pqrstuvwxyz{|}~del */
-};
-#define EVILCHAR(c) (((c) < 0x20) || ((c) > 0x7F) || (_bad[c-0x20]))
-
-static char *
-gnome_vfs_escape_string (const char *in)
-{
- int needs_quoting = 0;
- const char *p;
- char *quoted, *q;
-
- for (p = in; p && *p; p++) {
- if (EVILCHAR ((unsigned char)*p)) {
- needs_quoting++;
- }
- }
- if (! needs_quoting) {
- return g_strdup (in);
- }
-
- q = quoted = g_malloc (strlen (in) + (needs_quoting * 2) + 1);
- for (p = in; p && *p; p++) {
- if (EVILCHAR ((unsigned char)*p)) {
- *q++ = '%';
- *q++ = "0123456789ABCDEF"[(unsigned char)*p / 16];
- *q++ = "0123456789ABCDEF"[(unsigned char)*p % 16];
- } else {
- *q++ = *p;
- }
- }
- *q = '\0';
-
- return quoted;
-}
-#endif /* EAZEL_INSTALL_SLIM */
-
-static void
-add_to_url (GString *url, const char *cgi_string, const char *val)
-{
- char *quoted_val;
-
- g_string_append (url, cgi_string);
- if (val) {
- quoted_val = gnome_vfs_escape_string (val);
- g_string_append (url, quoted_val);
- g_free (quoted_val);
- }
-}
-
-/* make sure there are items filled in for the required fields.
- * if anything is missing, fill it with a "default", which may or may not be what you want,
- * but since you didn't bother to specify, tough cookies.
- */
-static void
-verify_softcat_fields (EazelSoftCat *softcat)
-{
- if (softcat->private->server == NULL) {
- softcat->private->server = g_strdup (SOFTCAT_DEFAULT_SERVER);
- }
- if (softcat->private->port == 0) {
- softcat->private->port = SOFTCAT_DEFAULT_PORT;
- }
- if (softcat->private->cgi_path == NULL) {
- softcat->private->cgi_path = g_strdup (SOFTCAT_DEFAULT_CGI_PATH);
- }
-}
-
-/* return a softcat query URL that would find this package: either by name, by eazel-id, or by what it features */
-static char *
-get_search_url_for_package (EazelSoftCat *softcat, GList *packages, int sense_flags)
-{
- GString *url;
- TrilobiteDistributionInfo dist;
- char *arch;
- char *dist_name;
- char *url_str;
- PackageData *package;
-
- g_assert (packages != NULL);
- package = PACKAGEDATA (packages->data);
-
- /* bail out early if there's not enough info to go with */
- if ((package->eazel_id == NULL) && (package->suite_id == NULL) && (package->name == NULL) &&
- (package->features == NULL)) {
- trilobite_debug ("softcat: no search url for completely-empty package");
- return NULL;
- }
-
- verify_softcat_fields (softcat);
- dist = trilobite_get_distribution ();
-
- url = g_string_new ("");
- if (softcat->private->use_authn) {
- if (softcat->private->username != NULL) {
- g_string_sprintfa (url, "eazel-services://%s%s", softcat->private->username,
- softcat->private->cgi_path);
- } else {
- g_string_sprintfa (url, "eazel-services:%s", softcat->private->cgi_path);
- }
- } else {
- g_string_sprintfa (url, "http://%s:%d%s",
- softcat->private->server,
- softcat->private->port,
- softcat->private->cgi_path);
- }
-
- if (package->eazel_id != NULL) {
- /* find by eazel-id! */
- arch = trilobite_get_distribution_arch ();
- add_to_url (url, "?rpm_id=", package->eazel_id);
- /* More than one package, add the remained to the url */
- if (g_list_length (packages) >= 2) {
- GList *iterator;
- for (iterator = g_list_nth (packages, 1); iterator; iterator = g_list_next (iterator)) {
- PackageData *next_package = PACKAGEDATA (iterator->data);
- add_to_url (url, "&rpm_id=", next_package->eazel_id);
- }
- }
- add_to_url (url, "&arch=", arch);
- g_free (arch);
- } else if (package->suite_id != NULL) {
- /* find by suite-id! */
- /* this devolves into several different cases. softcat cares
- * about the differences between them, but we don't.
- */
- if (package->suite_id[0] == 'P') {
- add_to_url (url, "?product_id=", package->suite_id+2);
- } else if (package->suite_id[0] == 'S') {
- add_to_url (url, "?suite_id=", package->suite_id+2);
- } else if (package->suite_id[0] == 'N') {
- add_to_url (url, "?product_name=", package->suite_id+2);
- } else if (package->suite_id[0] == 'X') {
- add_to_url (url, "?suite_name=", package->suite_id+2);
- } else {
- g_assert_not_reached ();
- }
- arch = trilobite_get_distribution_arch ();
- add_to_url (url, "&arch=", arch);
- g_free (arch);
- } else if (package->name == NULL) {
- /* find by features list! */
- g_assert ((package->features != NULL) && (g_list_length (package->features) > 0));
- arch = trilobite_get_distribution_arch ();
- add_to_url (url, "?provides=", (char *)(package->features->data));
- /* More than one package, add the remained to the url */
- if (g_list_length (packages) >= 2) {
- GList *iterator;
- for (iterator = g_list_nth (packages, 1); iterator; iterator = g_list_next (iterator)) {
- PackageData *next_package = PACKAGEDATA (iterator->data);
- add_to_url (url, "&provides=", next_package->features->data);
- }
- }
- add_to_url (url, "&arch=", arch);
- g_free (arch);
- } else {
- /* find by package name! */
- g_assert (package->name != NULL);
- add_to_url (url, "?name=", package->name);
- /* More than one package, add the remained to the url */
- if (g_list_length (packages) >= 2) {
- GList *iterator;
- for (iterator = g_list_nth (packages, 1); iterator; iterator = g_list_next (iterator)) {
- PackageData *next_package = PACKAGEDATA (iterator->data);
- add_to_url (url, "&name=", next_package->name);
- }
- }
- if (package->archtype != NULL) {
- add_to_url (url, "&arch=", package->archtype);
- }
- if (package->version != NULL) {
- add_to_url (url, "&version=", package->version);
- add_to_url (url, "&flags=", sense_flags_to_softcat_flags (sense_flags));
- }
- if (package->distribution.name != DISTRO_UNKNOWN) {
- dist = package->distribution;
- }
- }
-
- if (dist.name != DISTRO_UNKNOWN) {
- dist_name = trilobite_get_distribution_name (dist, TRUE, TRUE);
- add_to_url (url, "&distro=", dist_name);
- g_free (dist_name);
- }
- /* FIXME: should let them specify a protocol other than http, someday */
- add_to_url (url, "&protocol=", "http");
-
- url_str = url->str;
- g_string_free (url, FALSE);
- return url_str;
-}
-
-
-/* directories will end with '/' */
-/* TEMPORARY FIXME: to work around a very odd bug in softcat, throw away duplicate filenames */
-
-static void
-remove_directories_from_provides_list (PackageData *pack)
-{
- GList *iter, *next_iter;
- GList *newlist;
- char *filename;
-
- newlist = NULL;
- for (iter = g_list_first (pack->provides); iter != NULL; ) {
- filename = (char *)(iter->data);
-
- if ((filename != NULL) && (filename[0] != '\0') &&
- (filename[strlen (filename)-1] == '/')) {
- next_iter = iter->prev;
- g_free (iter->data);
- pack->provides = g_list_remove (pack->provides, iter->data);
- iter = next_iter;
- if (iter == NULL) {
- iter = g_list_first (pack->provides);
- }
- } else {
- if (g_list_find_custom (newlist, filename, (GCompareFunc)strcmp) == NULL) {
- newlist = g_list_prepend (newlist, g_strdup (filename));
- }
- iter = g_list_next (iter);
- }
- }
-
- /* replace old pack->provides with newlist */
- g_list_foreach (pack->provides, (GFunc)g_free, NULL);
- g_list_free (pack->provides);
- pack->provides = newlist;
-}
-
-/*
- This functions displays a "could not fetch" warning for the given packages
- */
-static void
-warn_about_packages_failing (EazelSoftCat *softcat,
- GList *packages)
-{
- GList *iterator;
- for (iterator = packages; iterator; iterator = g_list_next (iterator)) {
- PackageData *package = PACKAGEDATA (iterator->data);
- if (package->eazel_id != NULL) {
- g_warning ("could not fetch info about package id %s", package->eazel_id);
- } else if (package->suite_id != NULL) {
- g_warning ("could not fetch info about suite id %s", package->suite_id);
- } else if (package->name != NULL) {
- g_warning ("could not fetch info about package '%s'", package->name);
- } else if ((package->features != NULL) && (package->features->data != NULL)) {
- g_warning ("could not fetch info about package that provides feature '%s'",
- (char *)package->features->data);
- } else {
- g_warning ("could not fetch info about a MYSTERY PACKAGE!");
- }
- }
-}
-
-EazelSoftCatError
-eazel_softcat_query (EazelSoftCat *softcat, GList *packages, int sense_flags, int fill_flags, GList **result)
-{
- char *search_url;
- char *body = NULL;
- int length;
- int tries_left;
- gboolean got_happy;
- GList *result_packages = NULL;
- char *db_revision;
- int err;
-
- g_assert (result);
- g_assert (*result == NULL);
-
- db_revision = NULL;
- search_url = get_search_url_for_package (softcat, packages, sense_flags);
- if (search_url == NULL) {
- trilobite_debug ("no search url :(");
- return EAZEL_SOFTCAT_ERROR_BAD_MOJO;
- }
- trilobite_debug ("package search url: %s", search_url);
-
- eel_setenv ("GNOME_VFS_HTTP_USER_AGENT", trilobite_get_useragent_string (NULL), TRUE);
-
- for (got_happy = FALSE, tries_left = softcat->private->retries;
- !got_happy && (tries_left > 0);
- tries_left--) {
-
- got_happy = trilobite_fetch_uri (search_url, &body, &length);
-
-#ifdef EAZEL_SOFTCAT_SPAM_XML
- {
- char **strs;
- int i;
- body [length] = 0;
- strs = g_strsplit (body, "\n", 0);
- for (i = 0; strs[i] != NULL; i++) {
- trilobite_debug ("xml spam: %s", strs[i]);
- }
- g_strfreev (strs);
- }
-#endif /* EAZEL_SOFTCAT_SPAM_XML */
-
- if (got_happy) {
- got_happy = eazel_install_packagelist_parse (&result_packages, body, length, &db_revision);
- if (! got_happy) {
- /* boo. bogus xml. long live softcat! */
- trilobite_debug ("bogus xml.");
- g_free (body);
- }
- }
-
- if (! got_happy && (tries_left > 1)) {
- trilobite_debug ("retry...");
- usleep (softcat->private->delay);
- }
- }
-
- if (! got_happy) {
- warn_about_packages_failing (softcat, packages);
- g_free (search_url);
- return EAZEL_SOFTCAT_ERROR_SERVER_UNREACHABLE;
- }
-
- if ((db_revision != NULL) && (softcat->private->db_revision == NULL)) {
- softcat->private->db_revision = db_revision;
- db_revision = NULL;
- } else if (db_revision != NULL) {
- if (strcmp (softcat->private->db_revision, db_revision) != 0) {
- g_warning ("SoftCat has been updated since last request!");
- err = EAZEL_SOFTCAT_ERROR_SERVER_UPDATED;
- goto out;
- }
- }
-
- if (g_list_length (result_packages) == 0) {
- trilobite_debug ("no matches for that package.");
- err = EAZEL_SOFTCAT_ERROR_NO_SUCH_PACKAGE;
- goto out;
- }
-
- trilobite_debug ("package info ok.");
- {
- /* FIXME: forseti.eazel.com 1922
- Hack to circumvent the abovementioned bug
- Once fixed, remove this scope and replace with
- *result = result_packages;
- */
- GList *iterator;
- for (iterator = result_packages; iterator; iterator = g_list_next (iterator)) {
- PackageData *p = PACKAGEDATA (iterator->data);
- if (! (strlen (p->name)==0 &&
- strlen (p->version)==0 &&
- strlen (p->minor)==0 &&
- strlen (p->md5)==0)) {
- (*result) = g_list_prepend ((*result), p);
- } else {
- gtk_object_unref (GTK_OBJECT (p));
- }
- }
- }
-
- err = EAZEL_SOFTCAT_SUCCESS;
-
-out:
- g_free (body);
- g_free (search_url);
- g_free (db_revision);
-
- return err;
-}
-
-/* Given a partially filled packagedata object,
- check softcat, and fill it with the desired info */
-EazelSoftCatError
-eazel_softcat_get_info (EazelSoftCat *softcat, PackageData *package, int sense_flags, int fill_flags)
-{
- GList *result_packages = NULL;
- PackageData *full_package;
- GList *packages = NULL;
- EazelSoftCatError err;
-
- packages = g_list_prepend (packages, package);
- err = eazel_softcat_query (softcat, packages, sense_flags, fill_flags, &result_packages);
- g_list_free (packages);
- if (err != EAZEL_SOFTCAT_SUCCESS) {
- return err;
- }
-
- if (package->suite_id) {
- /* More than one package returned and we queried on a suite Id.
- Make deps and put into "package", remember to strip dirs in
- provides if needed */
- GList *iterator;
-
- trilobite_debug ("softcat query returned suite with %d elements",
- g_list_length (result_packages));
- for (iterator = result_packages; iterator; iterator = g_list_next (iterator)) {
- PackageData *pack = PACKAGEDATA (iterator->data);
- PackageDependency *dep = packagedependency_new ();
-
- if (fill_flags & PACKAGE_FILL_NO_DIRS_IN_PROVIDES) {
- remove_directories_from_provides_list (pack);
- }
- gtk_object_ref (GTK_OBJECT (pack));
- pack->fillflag = fill_flags;
-
- dep->package = pack;
- dep->version = g_strdup (pack->version);
-
- if (dep->version) {
- /* FIXME: should a suite be EQ or GE ? If GE, any newer version
- that's already installed will be ok, if EQ, the suites depends
- on an exact version */
- dep->sense = EAZEL_SOFTCAT_SENSE_GE;
- } else {
- dep->sense = EAZEL_SOFTCAT_SENSE_ANY;
- }
-
- packagedata_add_pack_to_depends (package, dep);
- }
- } else if (g_list_length (packages) > 1) {
- g_warning ("softcat query returned %d results!", g_list_length (result_packages));
- err = EAZEL_SOFTCAT_ERROR_MULTIPLE_RESPONSES;
- g_list_foreach (result_packages, (GFunc)gtk_object_unref, NULL);
- g_list_free (result_packages);
- return err;
- } else { /* 1 package, not a suite */
- full_package = PACKAGEDATA (result_packages->data);
- packagedata_fill_in_missing (package, full_package, fill_flags);
- if (fill_flags & PACKAGE_FILL_NO_DIRS_IN_PROVIDES) {
- remove_directories_from_provides_list (package);
- }
- }
-
- g_list_foreach (result_packages, (GFunc)gtk_object_unref, NULL);
- g_list_free (result_packages);
- return err;
-}
-
-/*
- Hold on to your brain...
-
- This takes as input a list of GList*<PackageData*> "packages", a
- pointer to a GList*<GList*> "massives" and a pointer to a
- GList*<PackageData*> "singles"
-
- It does its majick, and stuffs some lists into "massives". These
- lists are series of packages that can be queried for in one massive
- query.
-
- This can easily be extended to eg. handle feature (?provides=X)
- requests, it actually did, but I removed it as I really didn't feel
- like testing it.
-
- The rest go into "singles"
-
- Current shortcoming : it uses the distribution/archtype of the first
- package from "packages" as base requirement for all the following
- packages.
-
-*/
-
-static void
-split_by_multiple (EazelSoftCat *softcat,
- GList *packages,
- GList **massives,
- GList **singles)
-{
- GList *iterator;
- TrilobiteDistributionInfo distinfo;
- const char *arch;
- GList *names = NULL, *ids = NULL;
-
- /* Use the distribution and arch of the first pacakge as common
- demoninator. If a package differs from there, it won't
- go into any massives list (not optimal, I know) */
- distinfo = PACKAGEDATA (packages->data)->distribution;
- arch = PACKAGEDATA (packages->data)->archtype;
-
- for (iterator = packages; iterator; iterator = g_list_next (iterator)) {
- PackageData *p = PACKAGEDATA (iterator->data);
- gboolean result = TRUE;
-
- /* Is it the same architecture ? */
- if (p->archtype && arch && strcmp (p->archtype, arch)) {
- result = FALSE;
- }
-
- /* Same distribution ? */
- if (trilobite_distribution_compare (p->distribution, distinfo) != 0) {
- result = FALSE;
- }
-
- /* Does it have a version */
- if (p->version) {
- result = FALSE;
- }
-
- /* If package passed initial tests,
- add to appropriate list */
- if (result) {
- if (p->eazel_id) {
- ids = g_list_prepend (ids, p);
- } else if (p->name) {
- names = g_list_prepend (names, p);
- } else {
- /* Woops, add it to singles */
- (*singles) = g_list_prepend (*singles, p);
- }
- } else {
- (*singles) = g_list_prepend (*singles, p);
- }
-
- }
-
- /* Add lists to output massive list */
- if (ids) {
- (*massives) = g_list_prepend ((*massives), ids);
- }
- if (names) {
- (*massives) = g_list_prepend ((*massives), names);
- }
-}
-
-/* Helper for get_info
-
- If executes a query, and thereafter tries for match the resulting
- packages against ther results depending on what was set in the input
- packages.
-*/
-static EazelSoftCatError
-eazel_softcat_get_info_plural_helper (EazelSoftCat *softcat,
- GList *packages,
- GList **out, GList **error,
- int sense_flags, int fill_flags)
-{
- GList *result_packages = NULL;
- EazelSoftCatError err;
- GList *a;
-
- err = eazel_softcat_query (softcat, packages, sense_flags, fill_flags, &result_packages);
- if (err != EAZEL_SOFTCAT_SUCCESS) {
- return err;
- }
-
- /* Now lets match against input packages */
- for (a = packages; a; a = g_list_next (a)) {
- PackageData *package = PACKAGEDATA (a->data);
- GList *full_package_list = NULL;
- PackageData *full_package;
- GCompareFunc compare_func = NULL;
- char *compare_with = NULL;
-
- /* Find appropriate comparison func */
- if (package->eazel_id) {
- compare_func = (GCompareFunc)eazel_install_package_id_compare;
- compare_with = package->eazel_id;
- } else if (package->features) {
- compare_func = (GCompareFunc)eazel_install_package_feature_compare;
- compare_with = (char*)package->features->data;
- } else if (package->name) {
- compare_func = (GCompareFunc)eazel_install_package_name_compare;
- compare_with = package->name;
- }
-
- /* If found, try and find a matching package */
- if (compare_func) {
- full_package_list = g_list_find_custom (result_packages,
- (gpointer)compare_with,
- compare_func);
- }
-
- /* If match was found, fill it input, otherwise add package to error list */
- if (full_package_list == NULL) {
- (*error) = g_list_prepend (*error, package);
- } else {
- full_package = PACKAGEDATA (full_package_list->data);
- packagedata_fill_in_missing (package, full_package, fill_flags);
- if (fill_flags & PACKAGE_FILL_NO_DIRS_IN_PROVIDES) {
- remove_directories_from_provides_list (package);
- }
- (*out) = g_list_prepend (*out, package);
- }
- }
-
- g_list_foreach (result_packages, (GFunc)gtk_object_unref, NULL);
- g_list_free (result_packages);
-
- return err;
-}
-
-/* Given a partially filled packagedata object, check softcat, and
- fill it with the desired info. Output values will be in
- &GList*<PackageData*> out and &GList<PackageData*> error. Packages
- in these two lists will be pointers into the original
- GList*<PackageData*> packages argument
-
- Heres the pseudokode :
-
- pakker i error & out peger ind i input. dem i out er ok, dem i error fejlede.
-
- Create two lists, GList*<GList*> "massives" and
- GList*<PackageData*>"singles". "massives" will hold lists of
- packages with same query signature (id or name).
-
- foreach L in massives {
- foreach subL in L (subL will be the "next" packages_per_query elements in L) {
- (voodoo to maintain the lists)
- do a get_info_plural_helper (L, out, error)
- (voodoo to maintain the lists)
- }
- }
- foreach P in singles {
- get_info (P)
- }
-
- So basically this function will accept any weird combo of crackass
- packages and try and make the minimal amount of queries (depending
- on packages_per_query)
-
-*/
-
-EazelSoftCatError
-eazel_softcat_get_info_plural (EazelSoftCat *softcat,
- GList *packages,
- GList **out, GList **error,
- int sense_flags, int fill_flags)
-{
- EazelSoftCatError err = EAZEL_SOFTCAT_SUCCESS;
- GList *org_massive = NULL;
- GList *massive = NULL;
- GList *massives = NULL;
- GList *singles = NULL;
- GList *partial = NULL;
-
- split_by_multiple (softcat, packages, &massives, &singles);
-
- /* Get first list from massives */
- if (massives) {
- massive = g_list_first (massives)->data;
- org_massive = massive;
- }
-
- while (massives && massive) {
- int i;
- /* Only put softcat->private->packages_per_query into one query */
- for (i = 0; i < softcat->private->packages_per_query; i++) {
- gpointer p;
-
- /* Move head to partial */
- p = (g_list_first (massive)->data);
- partial = g_list_prepend (partial, p);
- massive = g_list_remove (massive, p);
-
- if (g_list_length (massive)==0) {
- break;
- }
- }
- /* Fire of query */
- if (eazel_softcat_get_info_plural_helper (softcat, partial,
- out, error,
- sense_flags, fill_flags) != EAZEL_SOFTCAT_SUCCESS) {
- err = EAZEL_SOFTCAT_ERROR_BAD_MOJO;
- }
- g_list_free (partial);
- partial = NULL;
-
- /* If we hit end of the massive list, step to next list */
- if (g_list_length (massive)==0) {
- /* Remove current from massives */
- massives = g_list_remove (massives, org_massive);
-
- /* Destroy current */
- g_list_free (massive);
- massive = NULL;
-
- if (g_list_length (massives) == 0) {
- /* Destroy the massives lists */
- g_list_free (massives);
- massives = NULL;
- } else {
- /* get next massive list */
- massive = g_list_first (massives)->data;
- org_massive = massive;
- }
- }
-
- }
-
- /* While there's elements in singles, get them */
- while (singles) {
- PackageData *p = PACKAGEDATA (singles->data);
- trilobite_debug ("Processing single %s", packagedata_get_readable_name (p));
- if (eazel_softcat_get_info (softcat, p, sense_flags, fill_flags) != EAZEL_SOFTCAT_SUCCESS) {
- err = EAZEL_SOFTCAT_ERROR_BAD_MOJO;
- (*error) = g_list_prepend ((*error), p);
- } else {
- (*out) = g_list_prepend ((*out), p);
- }
- singles = g_list_remove (singles, p);
- }
-
- g_list_free (singles);
-/*
- g_list_foreach (packages, (GFunc)gtk_object_unref, NULL);
- g_list_free (packages);
-*/
- return err;
-}
-
-/* Check if there's a newer version in SoftCat.
- * Returns TRUE and fills in 'newpack' if there is, returns FALSE otherwise.
- */
-gboolean
-eazel_softcat_available_update (EazelSoftCat *softcat,
- PackageData *oldpack,
- PackageData **newpack,
- int fill_flags)
-{
- PackageData *tmp_pack;
- gboolean result = TRUE;
-
- tmp_pack = packagedata_new ();
- tmp_pack->name = g_strdup (oldpack->name);
- tmp_pack->version = g_strdup (oldpack->version);
- tmp_pack->distribution = oldpack->distribution;
- tmp_pack->archtype = g_strdup (oldpack->archtype);
-
- if (eazel_softcat_get_info (softcat, tmp_pack, EAZEL_SOFTCAT_SENSE_GT, fill_flags) != EAZEL_SOFTCAT_SUCCESS) {
- result = FALSE;
- }
-
- if (newpack!=NULL && result==TRUE) {
- (*newpack) = tmp_pack;
- } else {
- gtk_object_unref (GTK_OBJECT (tmp_pack));
- /* Null in case it's givin */
- if (newpack != NULL) {
- (*newpack) = NULL;
- }
- }
-
- return result;
-}
diff --git a/components/services/install/lib/eazel-softcat.h b/components/services/install/lib/eazel-softcat.h
deleted file mode 100644
index a4ea5babb..000000000
--- a/components/services/install/lib/eazel-softcat.h
+++ /dev/null
@@ -1,127 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: Robey Pointer <robey@eazel.com>
- * Eskil Heyn Olsen <eskil@eazel.com>
- *
- */
-
-#ifndef EAZEL_SOFTCAT_PUBLIC_H
-#define EAZEL_SOFTCAT_PUBLIC_H
-
-#include "eazel-package-system-types.h"
-#include "eazel-softcat-private.h"
-
-#define TYPE_EAZEL_SOFTCAT (eazel_softcat_get_type ())
-#define EAZEL_SOFTCAT(obj) (GTK_CHECK_CAST ((obj), TYPE_EAZEL_SOFTCAT, EazelSoftCat))
-#define EAZEL_SOFTCAT_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), TYPE_EAZEL_SOFTCAT, EazelSoftCatClass))
-#define EAZEL_IS_SOFTCAT(obj) (GTK_CHECK_TYPE ((obj), TYPE_EAZEL_SOFTCAT))
-#define EAZEL_IS_SOFTCAT_CLASS(klass)(GTK_CHECK_CLASS_TYPE ((klass), TYPE_EAZEL_SOFTCAT))
-
-typedef struct _EazelSoftCat EazelSoftCat;
-typedef struct _EazelSoftCatClass EazelSoftCatClass;
-
-typedef enum {
- EAZEL_SOFTCAT_SUCCESS = 0,
- EAZEL_SOFTCAT_ERROR_BAD_MOJO,
- EAZEL_SOFTCAT_ERROR_SERVER_UNREACHABLE,
- EAZEL_SOFTCAT_ERROR_MULTIPLE_RESPONSES,
- EAZEL_SOFTCAT_ERROR_SERVER_UPDATED,
- EAZEL_SOFTCAT_ERROR_NO_SUCH_PACKAGE,
-} EazelSoftCatError;
-
-struct _EazelSoftCatClass
-{
- GtkObjectClass parent_class;
-};
-
-typedef struct _EazelSoftCatPrivate EazelSoftCatPrivate;
-
-struct _EazelSoftCat
-{
- GtkObject parent;
- EazelSoftCatPrivate *private;
-};
-
-EazelSoftCat *eazel_softcat_new (void);
-GtkType eazel_softcat_get_type (void);
-void eazel_softcat_unref (GtkObject *object);
-
-/* set and get fields */
-void eazel_softcat_set_server (EazelSoftCat *softcat, const char *server);
-const char *eazel_softcat_get_server (EazelSoftCat *softcat);
-
-void eazel_softcat_set_server_host (EazelSoftCat *softcat, const char *server);
-const char *eazel_softcat_get_server_host (EazelSoftCat *softcat);
-
-void eazel_softcat_set_server_port (EazelSoftCat *softcat, int port);
-int eazel_softcat_get_server_port (EazelSoftCat *softcat);
-
-void eazel_softcat_set_cgi_path (EazelSoftCat *softcat, const char *cgi_path);
-const char *eazel_softcat_get_cgi_path (const EazelSoftCat *softcat);
-
-void eazel_softcat_set_authn (EazelSoftCat *softcat, gboolean use_authn, const char *username);
-gboolean eazel_softcat_get_authn (const EazelSoftCat *softcat, const char **username);
-
-void eazel_softcat_set_packages_per_query (EazelSoftCat *softcat, int number);
-void eazel_softcat_set_authn_flag (EazelSoftCat *softcat, gboolean use_authn);
-void eazel_softcat_set_username (EazelSoftCat *softcat, const char *username);
-void eazel_softcat_set_retry (EazelSoftCat *softcat, unsigned int retries, unsigned int delay_us);
-void eazel_softcat_reset_server_update_flag (EazelSoftCat *softcat);
-
-EazelSoftCatSense eazel_softcat_convert_sense_flags (int flags);
-char *eazel_softcat_sense_flags_to_string (EazelSoftCatSense flags);
-EazelSoftCatSense eazel_softcat_string_to_sense_flags (const char *str);
-
-const char *eazel_softcat_error_string (EazelSoftCatError err);
-
-/* Query softcat about a package, and return a list of matching packages
- * (because there may be more than one if the package refers to a suite).
- */
-EazelSoftCatError eazel_softcat_query (EazelSoftCat *softcat,
- GList *packages,
- int sense_flags,
- int fill_flags,
- GList **result);
-
-/* Given a partially filled packagedata object,
- check softcat, and fill it with the desired info */
-EazelSoftCatError eazel_softcat_get_info (EazelSoftCat *softcat,
- PackageData *partial,
- int sense_flags,
- int fill_flags);
-
-/* Given a partially filled packagedata object,
- check softcat, and fill it with the desired info */
-EazelSoftCatError eazel_softcat_get_info_plural (EazelSoftCat *softcat,
- GList *partials,
- GList **out,
- GList **error,
- int sense_flags,
- int fill_flags);
-
-/* Check if there's a newer version in SoftCat.
- * Returns TRUE and fills in 'newpack' if there is, returns FALSE otherwise.
- */
-gboolean eazel_softcat_available_update (EazelSoftCat *softcat,
- PackageData *oldpack,
- PackageData **newpack,
- int fill_flags);
-
-#endif /* EAZEL_SOFTCAT_PUBLIC_H */
diff --git a/components/services/install/lib/libeazelinstall.h b/components/services/install/lib/libeazelinstall.h
deleted file mode 100644
index f1cb215ed..000000000
--- a/components/services/install/lib/libeazelinstall.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Copyright (C) 2000 Eazel, Inc
- * Copyright (C) 2000 Helix Code, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: Eskil Heyn Olsen <eskil@eazel.com>
- */
-
-#ifndef LIBEAZEL_INSTALL_H
-#define LIBEAZEL_INSTALL_H
-
-#include "eazel-install-corba-callback.h"
-
-#endif /* LIBEAZEL_INSTALL_H */
diff --git a/components/services/install/lib/makefile.staticlib.in b/components/services/install/lib/makefile.staticlib.in
deleted file mode 100644
index ba5c7de5d..000000000
--- a/components/services/install/lib/makefile.staticlib.in
+++ /dev/null
@@ -1,37 +0,0 @@
-OBJS=\
- eazel-install-metadata.o \
- eazel-install-protocols.o \
- eazel-install-logic2.o \
- eazel-install-xml-package-list.o \
- eazel-install-object.o \
- eazel-install-problem.o \
- eazel-softcat.o \
- eazel-package-system.o \
- eazel-package-system-types.o \
- $(PACKAGE_SYSTEM_OBJECT) \
- $(NULL)
-
-INCLUDES=\
- -I. \
- -I@top_srcdir@ \
- -I/usr/include/rpm \
- -I@top_srcdir@/components/services/trilobite \
- @GNOME_CFLAGS@ \
- @GCONF_CFLAGS@ \
- @XML_CFLAGS@ \
- @GHTTP_CFLAGS@ \
- $(NULL)
-
-LIB=libeazelinstall_minimal.a
-
-CC=gcc
-CPPFLAGS=$(INCLUDES) $(DEFINES)
-
-all: $(LIB)
-
-$(LIB): $(OBJS)
- $(AR) $(ARFLAGS) libeazelinstall_minimal.a $(OBJS)
-
-clean:
- rm -f $(OBJS)
- rm -f $(LIB)
diff --git a/components/services/install/server/.cvsignore b/components/services/install/server/.cvsignore
deleted file mode 100644
index 1f47dc458..000000000
--- a/components/services/install/server/.cvsignore
+++ /dev/null
@@ -1,11 +0,0 @@
-.deps
-.libs
-Makefile
-Makefile.in
-trilobite-eazel-install-service
-trilobite-eazel-install-stubs.c
-trilobite-eazel-install-skels.c
-trilobite-eazel-install-common.c
-trilobite-eazel-install.h
-trilobite_eazel_install_service_idl_stamp
-Trilobite_Service_install.oaf \ No newline at end of file
diff --git a/components/services/install/server/Makefile.am b/components/services/install/server/Makefile.am
deleted file mode 100644
index eeb23c456..000000000
--- a/components/services/install/server/Makefile.am
+++ /dev/null
@@ -1,71 +0,0 @@
-NULL =
-
-INCLUDES = \
- -DPREFIX=\"$(prefix)\" \
- -DG_LOG_DOMAIN=\"trilobite-eazel-install-service\" \
- -DGNOMELOCALEDIR=\""$(datadir)/locale"\" \
- -I$(top_srcdir) \
- -I$(top_builddir) \
- -I$(top_srcdir)/components/services/install/lib \
- -I$(top_srcdir)/components/services/trilobite \
- -I$(top_srcdir)/components/services/trilobite/libtrilobite \
- -I$(top_builddir)/components/services/install/lib \
- -I$(top_builddir)/components/services/trilobite \
- -I$(top_builddir)/components/services/trilobite/libtrilobite \
- $(EEL_INCLUDEDIR) \
- $(LIBRSVG_INCLUDEDIR) \
- $(GHTTP_CFLAGS) \
- $(GCONF_CFLAGS) \
- $(GNOME_CFLAGS) \
- $(VFS_CFLAGS) \
- $(GNOME_INCLUDEDIR) \
- $(OAF_CFLAGS) \
- $(XML_CFLAGS) \
- $(NULL)
-
-pixmapdir = $(datadir)/pixmaps
-pixmap_DATA = trilobite-eazel-install-service.png
-
-# make the auto-generated files depend on a installstamp file.
-# this is to ensure the individual files wait for each other before
-# proceeding which is needed in parallel makes
-
-## Binaries
-
-bin_PROGRAMS = trilobite-eazel-install-service
-
-trilobite_eazel_install_service_SOURCES = \
- main.c \
- $(NULL)
-
-# RPM_LIBS needs to come very first, because it needs a special (older) version of libdb
-trilobite_eazel_install_service_LDADD = \
- $(RPM_LIBS) \
- $(top_builddir)/components/services/install/lib/libeazelinstall.la \
- $(top_builddir)/components/services/install/lib/libeazelpackagesystem.la \
- $(top_builddir)/components/services/trilobite/libtrilobite/libtrilobite.la \
- $(top_builddir)/components/services/trilobite/libtrilobite/libtrilobite-service.la \
- $(EEL_LIBS) \
- $(LIBRSVG_LIBS) \
- $(GNOMEUI_LIBS) \
- $(VFS_LIBS) \
- $(BONOBO_LIBS) \
- $(NULL)
-
-# CORBA magic
-
-oafdir = $(datadir)/oaf
-oaf_in_files = \
- Trilobite_Service_install.oaf.in \
- $(NULL)
-oaf_DATA = $(oaf_in_files:.oaf.in=.oaf)
-
-@XML_I18N_MERGE_OAF_RULE@
-
-## Extra stuff
-
-EXTRA_DIST = \
- $(oaf_in_files) \
- $(oaf_DATA) \
- $(pixmap_DATA) \
- $(NULL)
diff --git a/components/services/install/server/Trilobite_Service_install.oaf.in b/components/services/install/server/Trilobite_Service_install.oaf.in
deleted file mode 100644
index 5055e9a60..000000000
--- a/components/services/install/server/Trilobite_Service_install.oaf.in
+++ /dev/null
@@ -1,30 +0,0 @@
-<oaf_info>
-
-<oaf_server iid="OAFIID:trilobite_eazel_install_service_factory:b423ff3f-1941-4b0d-bd45-6542f64abbfc" type="exe" location="trilobite-eazel-install-service">
- <oaf_attribute name="repo_ids" type="stringv">
- <item value="IDL:GNOME/ObjectFactory:1.0"/>
- </oaf_attribute>
- <oaf_attribute name="description" type="string" _value="Factory for the install service"/>
-</oaf_server>
-
-<oaf_server iid="OAFIID:trilobite_eazel_install_service:8ff6e815-1992-437c-9771-d932db3b4a17" type="factory" location="OAFIID:trilobite_eazel_install_service_factory:b423ff3f-1941-4b0d-bd45-6542f64abbfc">
- <oaf_attribute name="repo_ids" type="stringv">
- <item value="IDL:Bonobo/Unknown:1.0"/>
- <item value="IDL:Trilobite/Service:1.0"/>
- <item value="IDL:Trilobite/Eazel/Install:1.0"/>
- </oaf_attribute>
-
- <oaf_attribute name="trilobite:name" type="string" _value="Install"/>
- <oaf_attribute name="trilobite:version" type="string" value="0.1"/>
- <oaf_attribute name="trilobite:vendor_name" type="string" value="Eazel, inc."/>
- <oaf_attribute name="trilobite:vendor_url" type="string" value="http://www.eazel.com"/>
- <oaf_attribute name="trilobite:info_url" type="string" value="http://www.eazel.com/install/"/>
- <oaf_attribute name="trilobite:icon" type="string" value="trilobite-install-service.png"/>
- <oaf_attribute name="trilobite:uri_scheme" type="string" value="eazel-install:"/>
- <oaf_attribute name="bonobo:supported_uri_schemes" type="stringv">
- <item value="eazel-install"/>
- </oaf_attribute>
-
-</oaf_server>
-
-</oaf_info>
diff --git a/components/services/install/server/main.c b/components/services/install/server/main.c
deleted file mode 100644
index 000402d4b..000000000
--- a/components/services/install/server/main.c
+++ /dev/null
@@ -1,172 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: Eskil Heyn Olsen <eskil@eazel.com>
- *
- */
-
-#undef STOP_IN_DEBUG
-
-#include <config.h>
-#include <gnome.h>
-#include <liboaf/liboaf.h>
-#include <bonobo.h>
-#include <signal.h>
-
-#include <libtrilobite/libtrilobite-service.h>
-#include <libtrilobite/libtrilobite.h>
-
-#ifdef STOP_IN_DEBUG
-/* Also add
- $(EEL_LIBS) \
- to the LDADD line in Makefile.am
-*/
-#include <eel/eel-debug.h>
-#endif
-
-#include <trilobite-eazel-install.h>
-#include <eazel-install-public.h>
-
-#include <libgnomevfs/gnome-vfs.h>
-
-#define OAF_ID_FACTORY "OAFIID:trilobite_eazel_install_service_factory:b423ff3f-1941-4b0d-bd45-6542f64abbfc"
-#define OAF_ID "OAFIID:trilobite_eazel_install_service:8ff6e815-1992-437c-9771-d932db3b4a17"
-
-/*
- These are some generally needed objects to get CORBA connectivity
-*/
-CORBA_ORB orb;
-CORBA_Environment ev;
-
-static BonoboGenericFactory *factory;
-static int trilobites_active = 0;
-
-static void trilobite_service_factory_destroy (GtkObject *object);
-static void sig_segv_handler (int);
-
-static void
-sig_segv_handler (int roedgroed_med_floede)
-{
- g_error ("Crash: Install server hit a sigsegv");
-}
-
-static void
-trilobite_service_factory_destroy (GtkObject *object)
-{
- trilobites_active--;
-
- trilobite_debug ("destroy, eazel_install trilobites active = %d", trilobites_active);
- if (trilobites_active != 0) {
- return;
- }
-
- trilobite_debug ("Destroying factory object");
-
- bonobo_object_unref (BONOBO_OBJECT (factory));
- trilobite_main_quit ();
-}
-
-static BonoboObject*
-eazel_install_service_factory (BonoboGenericFactory *this_factory,
- const gchar *oaf_id,
- gpointer data)
-{
- TrilobiteService *trilobite;
- TrilobitePasswordQuery *trilobite_password;
-
- EazelInstall *service;
- if (strcmp (oaf_id, OAF_ID)) {
- g_warning ("Unhandled OAF id %s", oaf_id);
- return NULL;
- }
-
- trilobite = TRILOBITE_SERVICE (gtk_object_new (TRILOBITE_TYPE_SERVICE,
- "name", "Install",
- "version", "0.1",
- "vendor_name", "Eazel, inc.",
- "vendor_url", "http://www.eazel.com",
- "url", "http://www.eazel.com/",
- "icon", "file:///gnome/share/pixmaps/gnome-default-dlg.png",
- NULL));
-
- trilobite_password = TRILOBITE_PASSWORDQUERY (gtk_object_new (TRILOBITE_TYPE_PASSWORDQUERY,
- "prompt", "root",
- NULL));
-
- service = eazel_install_new_with_config ();
-
- g_assert (trilobite != NULL);
- g_assert (service != NULL);
-
- trilobites_active++;
-
- trilobite_service_add_interface (trilobite, BONOBO_OBJECT (service));
- trilobite_passwordquery_add_interface (trilobite_password, BONOBO_OBJECT (service));
-
- gtk_signal_connect (GTK_OBJECT (trilobite),
- "destroy",
- trilobite_service_factory_destroy, NULL);
-
- return BONOBO_OBJECT (trilobite);
-}
-
-int main(int argc, char *argv[]) {
-
-#ifdef ENABLE_NLS /* sadly we need this ifdef because otherwise the following get empty statement warnings */
- bindtextdomain (PACKAGE, GNOMELOCALEDIR);
- textdomain (PACKAGE);
-#endif
-
- /* Disable session manager connection */
- gnome_client_disable_master_connection ();
-
- signal (SIGSEGV, &sig_segv_handler);
-
- if (!trilobite_init ("trilobite-eazel-install-service", "0.1", "~/.nautilus/trilobite-install.log",
- NULL, argc, argv)) {
- g_error ("Could not initialise trilobite. :(");
- exit (1);
- }
- trilobite_set_debug_mode (TRUE);
-
- gnome_vfs_init ();
-
- factory = bonobo_generic_factory_new_multi (OAF_ID_FACTORY,
- eazel_install_service_factory,
- NULL);
-
- if (factory == NULL) {
- g_error ("Could not register factory");
- }
-
-#ifdef STOP_IN_DEBUG
- eel_make_warnings_and_criticals_stop_in_debugger ("GLib", NULL);
-#endif
-
- do {
- bonobo_activate ();
- trilobite_main ();
- } while (trilobites_active > 0);
-
- g_message ("EazelInstall service terminating");
-
- CORBA_exception_free (&ev);
-
- return 0;
-};
diff --git a/components/services/install/server/trilobite-eazel-install-service.png b/components/services/install/server/trilobite-eazel-install-service.png
deleted file mode 100644
index 01f611262..000000000
--- a/components/services/install/server/trilobite-eazel-install-service.png
+++ /dev/null
Binary files differ
diff --git a/components/services/inventory-view/.cvsignore b/components/services/inventory-view/.cvsignore
deleted file mode 100644
index 80c89340d..000000000
--- a/components/services/inventory-view/.cvsignore
+++ /dev/null
@@ -1,6 +0,0 @@
-Makefile
-Makefile.in
-.deps
-.libs
-Nautilus_View_inventory.oaf
-nautilus-inventory-view
diff --git a/components/services/inventory-view/Makefile.am b/components/services/inventory-view/Makefile.am
deleted file mode 100644
index 1b305f671..000000000
--- a/components/services/inventory-view/Makefile.am
+++ /dev/null
@@ -1,50 +0,0 @@
-include $(top_srcdir)/Makefile.shared
-
-INCLUDES = \
- -DPREFIX=\"$(prefix)\" \
- -DG_LOG_DOMAIN=\"Nautilus-Inventory\" \
- -DDATADIR=\"$(datadir)\" \
- -DICON_DIR=\"$(datadir)/pixmaps/nautilus\" \
- -I$(top_srcdir) \
- -I$(top_builddir) \
- -I$(top_srcdir)/components/services/inventory \
- -I$(top_builddir)/components/services/inventory \
- -I$(top_srcdir)/components/services/nautilus-dependent-shared \
- $(EEL_INCLUDEDIR) \
- $(LIBRSVG_INCLUDEDIR) \
- $(GNOMEUI_CFLAGS) \
- $(BONOBO_CFLAGS) \
- $(OAF_CFLAGS)
-
-oafdir = $(datadir)/oaf
-oaf_in_files = Nautilus_View_inventory.oaf.in
-oaf_DATA = $(oaf_in_files:.oaf.in=.oaf)
-
-@XML_I18N_MERGE_OAF_RULE@
-
-bin_PROGRAMS = \
- nautilus-inventory-view
-
-nautilus_inventory_view_SOURCES = \
- nautilus-inventory-view.h \
- nautilus-inventory-view.c \
- nautilus-inventory-view-private.h \
- nautilus-inventory-enable-page.h \
- nautilus-inventory-enable-page.c \
- nautilus-inventory-disable-page.h \
- nautilus-inventory-disable-page.c \
- main.c
-
-nautilus_inventory_view_LDADD = \
- $(top_builddir)/libnautilus/libnautilus.la \
- $(top_builddir)/components/services/inventory/libtrilobite-inventory-service.la \
- $(top_builddir)/components/services/nautilus-dependent-shared/libnautilusdepshared.a \
- $(EEL_LIBS) \
- $(LIBRSVG_LIBS) \
- $(GNOMEUI_LIBS) \
- $(BONOBO_LIBS) \
- $(GCONF_LIBS) \
- $(VFS_LIBS) \
- $(OAF_LIBS)
-
-EXTRA_DIST = $(oaf_in_files) $(oaf_DATA)
diff --git a/components/services/inventory-view/Nautilus_View_inventory.oaf.in b/components/services/inventory-view/Nautilus_View_inventory.oaf.in
deleted file mode 100644
index 08c49755e..000000000
--- a/components/services/inventory-view/Nautilus_View_inventory.oaf.in
+++ /dev/null
@@ -1,27 +0,0 @@
-<oaf_info>
-
-<oaf_server iid="OAFIID:nautilus_inventory_view_factory:abf7f064-bcd0-4ac5-93a2-35d5a676e7cc" type="exe" location="nautilus-inventory-view">
- <oaf_attribute name="repo_ids" type="stringv">
- <item value="IDL:GNOME/ObjectFactory:1.0"/>
- </oaf_attribute>
- <oaf_attribute name="name" type="string" _value="Nautilus Inventory view factory"/>
- <oaf_attribute name="description" type="string" _value="Nautilus System Inventory component's component's factory"/>
-</oaf_server>
-
-<oaf_server iid="OAFIID:nautilus_inventory_view:c6f2baf8-f563-4b84-8b02-81fb355d3fb5" type="factory" location="OAFIID:nautilus_inventory_view_factory:abf7f064-bcd0-4ac5-93a2-35d5a676e7cc">
- <oaf_attribute name="repo_ids" type="stringv">
- <item value="IDL:Bonobo/Unknown:1.0"/>
- <item value="IDL:Bonobo/Control:1.0"/>
- <item value="IDL:Nautilus/View:1.0"/>
- </oaf_attribute>
- <oaf_attribute name="name" type="string" _value="Nautilus Inventory view"/>
- <oaf_attribute name="description" type="string" _value="System inventory view component"/>
- <oaf_attribute name="bonobo:supported_uri_schemes" type="stringv">
- <item value="eazel-inventory"/>
- </oaf_attribute>
- <oaf_attribute name="nautilus:view_as_name" type="string" _value="System Inventory"/>
- <oaf_attribute name="nautilus:view_as_label" type="string" _value="View as System Inventory"/>
- <oaf_attribute name="nautilus:viewer_label" type="string" _value="System Inventory Viewer"/>
-</oaf_server>
-
-</oaf_info>
diff --git a/components/services/inventory-view/main.c b/components/services/inventory-view/main.c
deleted file mode 100644
index 170f61899..000000000
--- a/components/services/inventory-view/main.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Maciej Stachowiak <mjs@eazel.com>
- */
-
-/* main.c - Main function and object activation function for inventory
- * view component.
- */
-
-#include <config.h>
-#include "nautilus-inventory-view.h"
-#include <libnautilus/nautilus-view-standard-main.h>
-
-#define FACTORY_IID "OAFIID:nautilus_inventory_view_factory:abf7f064-bcd0-4ac5-93a2-35d5a676e7cc"
-#define VIEW_IID "OAFIID:nautilus_inventory_view:c6f2baf8-f563-4b84-8b02-81fb355d3fb5"
-#define EXECUTABLE_NAME "nautilus-inventory-view"
-#define GET_TYPE_FUNCTION nautilus_inventory_view_get_type
-
-int
-main (int argc, char *argv[])
-{
- return nautilus_view_standard_main (EXECUTABLE_NAME, VERSION,
- argc, argv,
- FACTORY_IID, VIEW_IID,
- nautilus_view_create_from_get_type_function,
- GET_TYPE_FUNCTION);
-}
-
diff --git a/components/services/inventory-view/nautilus-inventory-config-page.c b/components/services/inventory-view/nautilus-inventory-config-page.c
deleted file mode 100644
index 798724983..000000000
--- a/components/services/inventory-view/nautilus-inventory-config-page.c
+++ /dev/null
@@ -1,190 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Maciej Stachowiak <mjs@eazel.com>
- */
-
-/* nautilus-inventory-config-page.h -
- */
-
-#include <config.h>
-#include "nautilus-inventory-config-page.h"
-#include <gtk/gtklabel.h>
-#include <gtk/gtkhbox.h>
-#include <gtk/gtkbutton.h>
-#include <gtk/gtkentry.h>
-#include <gtk/gtksignal.h>
-#include <gtk/gtkcheckbutton.h>
-#include <eel/eel-gtk-macros.h>
-#include <libnautilus/nautilus-view.h>
-#include <eazel-inventory-service-interface.h>
-
-#define SERVICE_IID "OAFIID:trilobite_inventory_service:eaae1152-1551-43d5-a764-52274131a9d5"
-
-struct NautilusInventoryConfigPageDetails {
- GtkWidget *machine_entry;
- GtkWidget *warn_check_button;
- NautilusView *view;
- Trilobite_Eazel_Inventory inventory_service;
-};
-
-static void nautilus_inventory_config_page_initialize_class (NautilusInventoryConfigPageClass *klass);
-static void nautilus_inventory_config_page_initialize (NautilusInventoryConfigPage *file);
-static void nautilus_inventory_config_page_destroy (GtkObject *object);
-
-EEL_DEFINE_CLASS_BOILERPLATE (NautilusInventoryConfigPage, nautilus_inventory_config_page, GTK_TYPE_VBOX)
-
-static void
-nautilus_inventory_config_page_initialize_class (NautilusInventoryConfigPageClass *klass)
-{
- GtkObjectClass *object_class;
-
- object_class = GTK_OBJECT_CLASS (klass);
-
- object_class->destroy = nautilus_inventory_config_page_destroy;
-}
-
-static void
-next_button_callback (GtkWidget *button,
- NautilusInventoryConfigPage *config_page)
-{
- CORBA_Environment ev;
- g_print ("clicked next.\n");
-
- CORBA_exception_init (&ev);
-
- Trilobite_Eazel_Inventory__set_machine_name (config_page->details->inventory_service,
- gtk_entry_get_text
- (GTK_ENTRY (config_page->details->machine_entry)), &ev);
-
- Trilobite_Eazel_Inventory__set_warn_before_upload (config_page->details->inventory_service,
- gtk_toggle_button_get_active
- (GTK_TOGGLE_BUTTON (config_page->details->warn_check_button)), &ev);
-
-
- Trilobite_Eazel_Inventory__set_enabled (config_page->details->inventory_service,
- CORBA_TRUE, &ev);
-
-
- Trilobite_Eazel_Inventory_upload (config_page->details->inventory_service, &ev);
-
- CORBA_exception_free (&ev);
-
- nautilus_view_open_location_in_this_window (config_page->details->view, "eazel-services:/inventory");
-}
-
-static void
-nautilus_inventory_config_page_initialize (NautilusInventoryConfigPage *config_page)
-{
- GtkWidget *label;
- GtkWidget *button;
- GtkWidget *hbox;
- BonoboObjectClient *object;
- char *initial_machine_name;
- gboolean initial_warn;
-
- CORBA_Environment ev;
-
- CORBA_exception_init (&ev);
-
- config_page->details = g_new0 (NautilusInventoryConfigPageDetails, 1);
-
- object = bonobo_object_activate (SERVICE_IID, 0);
-
- config_page->details->inventory_service = bonobo_object_query_interface
- (BONOBO_OBJECT (object), "IDL:Trilobite/Eazel/Inventory:1.0");
-
- bonobo_object_unref (BONOBO_OBJECT (object));
-
- label = gtk_label_new (_("Eazel Inventory Configuration"));
- gtk_widget_show (label);
- gtk_box_pack_start (GTK_BOX (config_page), label, FALSE, FALSE, 0);
-
- label = gtk_label_new (_("blah blah blah"));
- gtk_widget_show (label);
- gtk_box_pack_start (GTK_BOX (config_page), label, FALSE, FALSE, 0);
-
- hbox = gtk_hbox_new (FALSE, 0);
- gtk_widget_show (hbox);
- gtk_box_pack_start (GTK_BOX (config_page), hbox, FALSE, FALSE, 0);
-
- label = gtk_label_new (_("Machine Name:"));
- gtk_widget_show (label);
- gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
-
- config_page->details->machine_entry = gtk_entry_new ();
- initial_machine_name = Trilobite_Eazel_Inventory__get_machine_name
- (config_page->details->inventory_service, &ev);
-
- g_print ("initial machine name = `%s'\n", initial_machine_name);
-
- if ( (initial_machine_name == NULL) || (initial_machine_name[0] == '\n') ) {
- /* the user has never specified a name for this machine */
- g_print ("no name selected yet\n");
-
- /* TODO: perhaps guess an intial machine name based on host
- * name...
- */
-
- } else {
- gtk_entry_set_text (GTK_ENTRY(config_page->details->machine_entry),
- initial_machine_name);
- }
-
- gtk_widget_show (config_page->details->machine_entry);
- gtk_box_pack_start (GTK_BOX (hbox), config_page->details->machine_entry, FALSE, FALSE, 0);
-
- config_page->details->warn_check_button = gtk_check_button_new_with_label (_("Warn me before upload"));
- initial_warn = Trilobite_Eazel_Inventory__get_warn_before_upload
- (config_page->details->inventory_service, &ev);
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (config_page->details->warn_check_button), initial_warn);
- gtk_widget_show (config_page->details->warn_check_button);
- gtk_box_pack_start (GTK_BOX (config_page), config_page->details->warn_check_button, FALSE, FALSE, 0);
-
- button = gtk_button_new_with_label (_("Next"));
- gtk_widget_show (button);
- gtk_box_pack_start (GTK_BOX (config_page), button, FALSE, FALSE, 0);
- gtk_signal_connect (GTK_OBJECT (button), "clicked", next_button_callback, config_page);
-
-}
-
-
-GtkWidget *
-nautilus_inventory_config_page_new (NautilusView *view)
-{
- NautilusInventoryConfigPage *config_page;
-
- config_page = NAUTILUS_INVENTORY_CONFIG_PAGE (gtk_widget_new (nautilus_inventory_config_page_get_type (), NULL));
-
- config_page->details->view = view;
-
- return GTK_WIDGET (config_page);
-}
-
-
-static void
-nautilus_inventory_config_page_destroy (GtkObject *object)
-{
- NautilusInventoryConfigPage *page = NAUTILUS_INVENTORY_CONFIG_PAGE (object);
-
- g_free (page->details);
-
- EEL_CALL_PARENT (GTK_OBJECT_CLASS, destroy, (object));
-}
diff --git a/components/services/inventory-view/nautilus-inventory-disable-page.c b/components/services/inventory-view/nautilus-inventory-disable-page.c
deleted file mode 100644
index 157c73d45..000000000
--- a/components/services/inventory-view/nautilus-inventory-disable-page.c
+++ /dev/null
@@ -1,161 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: Maciej Stachowiak <mjs@eazel.com>
- * Ian McKellar <ian@eazel.com>
- */
-
-/* nautilus-inventory-disable-page.h -
- */
-
-#include <config.h>
-
-#include "nautilus-inventory-disable-page.h"
-#include "eazel-services-header.h"
-#include "eazel-services-extensions.h"
-#include "nautilus-inventory-view-private.h"
-
-#include <gtk/gtklabel.h>
-#include <gtk/gtkprogressbar.h>
-#include <gtk/gtk.h>
-#include <gnome.h>
-#include <eel/eel-gtk-macros.h>
-#include <eel/eel-label.h>
-#include <eel/eel-background.h>
-#include <libnautilus/nautilus-view.h>
-#include <eazel-inventory.h>
-
-struct NautilusInventoryDisablePageDetails {
- EazelInventory *inventory;
- NautilusInventoryView *view;
-};
-
-static void nautilus_inventory_disable_page_initialize_class (NautilusInventoryDisablePageClass *klass);
-static void nautilus_inventory_disable_page_initialize (NautilusInventoryDisablePage *file);
-static void nautilus_inventory_disable_page_destroy (GtkObject *object);
-
-EEL_DEFINE_CLASS_BOILERPLATE (NautilusInventoryDisablePage, nautilus_inventory_disable_page, GTK_TYPE_EVENT_BOX)
-
-static void
-nautilus_inventory_disable_page_initialize_class (NautilusInventoryDisablePageClass *klass)
-{
- GtkObjectClass *object_class;
-
- object_class = GTK_OBJECT_CLASS (klass);
-
- object_class->destroy = nautilus_inventory_disable_page_destroy;
-}
-
-static gint /*GtkFunction*/
-disable_inventory_callback (gpointer data)
-{
- NautilusInventoryDisablePage *disable_page = NAUTILUS_INVENTORY_DISABLE_PAGE (data);
-
- g_return_val_if_fail (disable_page != NULL, FALSE);
-
- eazel_inventory_set_enabled (disable_page->details->inventory, FALSE);
-
- nautilus_view_open_location_in_this_window (NAUTILUS_VIEW (disable_page->details->view),
- disable_page->details->view->details->next_uri);
-
- /* Unref the ref that was added when the callback was scheduled */
- gtk_object_unref (GTK_OBJECT (disable_page));
-
- return FALSE;
-}
-
-static void
-nautilus_inventory_disable_page_initialize (NautilusInventoryDisablePage *disable_page)
-{
- EelBackground *background;
- GtkWidget *header;
- GtkWidget *vbox;
- GtkWidget *label;
-
- vbox = gtk_vbox_new (FALSE, 0);
- gtk_widget_show (vbox);
- gtk_container_add (GTK_CONTAINER (disable_page), vbox);
-
- background = eel_get_widget_background (GTK_WIDGET (disable_page));
- eel_background_set_color (background, EAZEL_SERVICES_BACKGROUND_COLOR_SPEC);
-
- disable_page->details = g_new0 (NautilusInventoryDisablePageDetails, 1);
-
- disable_page->details->inventory = eazel_inventory_get ();
-
- header = eazel_services_header_title_new (_("Disabling Inventory..."));
- gtk_widget_show (header);
- gtk_box_pack_start (GTK_BOX (vbox), header, FALSE, FALSE, 0);
-
- label = eazel_services_label_new (_("Please wait while we disable Eazel Inventory..."),
- 0,
- 0.5,
- 0.5,
- 0,
- 0,
- EEL_RGB_COLOR_BLACK,
- EEL_RGB_COLOR_WHITE,
- NULL,
- 4, /*relative size*/
- TRUE);
-
- gtk_widget_show (label);
- gtk_box_pack_start (GTK_BOX (vbox), label, TRUE, TRUE, 0);
-}
-
-
-GtkWidget *
-nautilus_inventory_disable_page_new (NautilusInventoryView *view)
-{
- NautilusInventoryDisablePage *disable_page;
-
- disable_page = NAUTILUS_INVENTORY_DISABLE_PAGE (gtk_widget_new (nautilus_inventory_disable_page_get_type (), NULL));
-
- disable_page->details->view = view;
-
- return GTK_WIDGET (disable_page);
-}
-
-static void
-nautilus_inventory_disable_page_destroy (GtkObject *object)
-{
- NautilusInventoryDisablePage *page;
- CORBA_Environment ev;
-
- page = NAUTILUS_INVENTORY_DISABLE_PAGE (object);
- CORBA_exception_init (&ev);
-
- if (page->details->inventory != CORBA_OBJECT_NIL) {
- gtk_object_unref (GTK_OBJECT (page->details->inventory));
- }
- g_free (page->details);
-
- EEL_CALL_PARENT (GTK_OBJECT_CLASS, destroy, (object));
-}
-
-void
-nautilus_inventory_disable_page_run (NautilusInventoryDisablePage *disable_page)
-{
- /* Pause for impact */
- /* This ref is released in the callback function */
- gtk_object_ref (GTK_OBJECT (disable_page));
- gtk_timeout_add (3 * 1000, disable_inventory_callback, disable_page);
-}
-
diff --git a/components/services/inventory-view/nautilus-inventory-disable-page.h b/components/services/inventory-view/nautilus-inventory-disable-page.h
deleted file mode 100644
index e471b7258..000000000
--- a/components/services/inventory-view/nautilus-inventory-disable-page.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Maciej Stachowiak <mjs@eazel.com>
- */
-
-/* nautilus-inventory-disable-page.h -
- */
-
-#ifndef NAUTILUS_INVENTORY_DISABLE_PAGE_H
-#define NAUTILUS_INVENTORY_DISABLE_PAGE_H
-#include "nautilus-inventory-view.h"
-
-#include <gtk/gtkeventbox.h>
-#include <libnautilus/nautilus-view.h>
-
-#define NAUTILUS_TYPE_INVENTORY_DISABLE_PAGE (nautilus_inventory_disable_page_get_type ())
-#define NAUTILUS_INVENTORY_DISABLE_PAGE(obj) (GTK_CHECK_CAST ((obj), NAUTILUS_TYPE_INVENTORY_DISABLE_PAGE, NautilusInventoryDisablePage))
-#define NAUTILUS_INVENTORY_DISABLE_PAGE_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), NAUTILUS_TYPE_INVENTORY_DISABLE_PAGE, NautilusInventoryDisablePageClass))
-#define NAUTILUS_IS_INVENTORY_DISABLE_PAGE(obj) (GTK_CHECK_TYPE ((obj), NAUTILUS_TYPE_INVENTORY_DISABLE_PAGE))
-#define NAUTILUS_IS_INVENTORY_DISABLE_PAGE_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), NAUTILUS_TYPE_INVENTORY_DISABLE_PAGE))
-
-typedef struct NautilusInventoryDisablePage NautilusInventoryDisablePage;
-typedef struct NautilusInventoryDisablePageClass NautilusInventoryDisablePageClass;
-typedef struct NautilusInventoryDisablePageDetails NautilusInventoryDisablePageDetails;
-
-struct NautilusInventoryDisablePage {
- GtkEventBox base;
- NautilusInventoryDisablePageDetails *details;
- NautilusView *nautilus_view;
-};
-
-struct NautilusInventoryDisablePageClass {
- GtkEventBoxClass base;
-};
-
-GtkType nautilus_inventory_disable_page_get_type (void);
-
-GtkWidget *nautilus_inventory_disable_page_new (NautilusInventoryView *view);
-
-void nautilus_inventory_disable_page_run (NautilusInventoryDisablePage *disable_page);
-
-
-#endif /* NAUTILUS_INVENTORY_DISABLE_PAGE_H */
-
diff --git a/components/services/inventory-view/nautilus-inventory-enable-page.c b/components/services/inventory-view/nautilus-inventory-enable-page.c
deleted file mode 100644
index dd4abc6f9..000000000
--- a/components/services/inventory-view/nautilus-inventory-enable-page.c
+++ /dev/null
@@ -1,265 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Maciej Stachowiak <mjs@eazel.com>
- */
-
-/* nautilus-inventory-enable-page.h -
- */
-
-#include <config.h>
-
-#include "nautilus-inventory-enable-page.h"
-#include "nautilus-inventory-view-private.h"
-#include "eazel-services-header.h"
-#include "eazel-services-extensions.h"
-
-#include <gnome.h>
-#include <gtk/gtkprogressbar.h>
-#include <eel/eel-gtk-macros.h>
-#include <eel/eel-label.h>
-#include <libnautilus/nautilus-view.h>
-#include <eazel-inventory.h>
-#include <eel/eel-background.h>
-
-
-#undef DEBUG_MESSAGES
-
-#ifdef DEBUG_MESSAGES
-#define DEBUG_MSG(x) g_print x
-#else
-#define DEBUG_MSG(x)
-#endif
-
-struct NautilusInventoryEnablePageDetails {
- EazelInventory * inventory;
- GtkWidget * progress_bar;
- GtkWidget * label;
- NautilusInventoryView * view;
- guint timeout_id;
- gboolean timeout_added;
-};
-
-static void nautilus_inventory_enable_page_initialize_class (NautilusInventoryEnablePageClass *klass);
-static void nautilus_inventory_enable_page_initialize (NautilusInventoryEnablePage *file);
-static void nautilus_inventory_enable_page_destroy (GtkObject *object);
-
-EEL_DEFINE_CLASS_BOILERPLATE (NautilusInventoryEnablePage, nautilus_inventory_enable_page, GTK_TYPE_EVENT_BOX)
-
-static void
-nautilus_inventory_enable_page_initialize_class (NautilusInventoryEnablePageClass *klass)
-{
- GtkObjectClass *object_class;
-
- object_class = GTK_OBJECT_CLASS (klass);
-
- object_class->destroy = nautilus_inventory_enable_page_destroy;
-}
-
-static int /*GtkFunction*/
-callback_progress_update (gpointer data)
-{
- NautilusInventoryEnablePage *enable_page;
-
- enable_page = NAUTILUS_INVENTORY_ENABLE_PAGE (data);
-
- g_return_val_if_fail (enable_page != NULL, 0);
-
- DEBUG_MSG (("%s: updating...\n", __FUNCTION__));
-
- /* I guess the progress bar only cares that the new value is different */
- /* (note that this won't collapse to 0, because 0.75 and 0.25 can be represented w/o rounding) */
- gtk_progress_set_value (GTK_PROGRESS (enable_page->details->progress_bar),
- 1.0 - gtk_progress_get_value (GTK_PROGRESS (enable_page->details->progress_bar)));
-
- return TRUE;
-}
-
-static void
-nautilus_inventory_enable_page_initialize (NautilusInventoryEnablePage *enable_page)
-{
- GtkWidget *header;
- GtkWidget *vbox_top;
- GtkWidget *align_outer;
- GtkWidget *align_progress;
- GtkWidget *aligned_box;
-
- enable_page->details = g_new0 (NautilusInventoryEnablePageDetails, 1);
-
- align_outer = gtk_alignment_new (0.5, 0.5, 1.0, 0.0);
- align_progress = gtk_alignment_new (0.5, 0.5, 0.20, 1.0);
- aligned_box = gtk_vbox_new (FALSE, 20);
- vbox_top = gtk_vbox_new (FALSE, 0);
-
- gtk_container_add (GTK_CONTAINER (enable_page), vbox_top);
-
- eel_background_set_color (eel_get_widget_background (GTK_WIDGET (enable_page)),
- EAZEL_SERVICES_BACKGROUND_COLOR_SPEC);
-
- header = eazel_services_header_title_new (_("Uploading your System Inventory..."));
- gtk_box_pack_start (GTK_BOX (vbox_top), header, FALSE, FALSE, 0);
-
- gtk_box_pack_start (GTK_BOX (vbox_top), align_outer, TRUE, TRUE, 0);
-
- gtk_container_add (GTK_CONTAINER (align_outer), aligned_box);
-
- enable_page->details->progress_bar = gtk_progress_bar_new ();
- gtk_progress_set_activity_mode (GTK_PROGRESS (enable_page->details->progress_bar), TRUE);
- gtk_progress_set_value (GTK_PROGRESS (enable_page->details->progress_bar), 0.75);
-
- enable_page->details->label = eazel_services_label_new (_("Please wait while we upload your System Inventory..."),
- 0,
- 0.5,
- 0.5,
- 0,
- 0,
- EEL_RGB_COLOR_BLACK,
- EEL_RGB_COLOR_WHITE,
- NULL,
- 4, /*relative size*/
- TRUE);
-
- gtk_box_pack_start (GTK_BOX (aligned_box), enable_page->details->label, FALSE, FALSE, 0);
-
- gtk_container_add (GTK_CONTAINER (align_progress), enable_page->details->progress_bar);
-
- gtk_box_pack_start (GTK_BOX (aligned_box), align_progress, FALSE, FALSE, 0);
-
- gtk_widget_show_all (GTK_WIDGET (enable_page));
-}
-
-
-GtkWidget *
-nautilus_inventory_enable_page_new (NautilusInventoryView *view)
-{
- NautilusInventoryEnablePage *enable_page;
-
- enable_page = NAUTILUS_INVENTORY_ENABLE_PAGE (gtk_widget_new (nautilus_inventory_enable_page_get_type (), NULL));
-
- enable_page->details->view = view;
-
- return GTK_WIDGET (enable_page);
-}
-
-static int /*GtkFunction*/
-callback_timeout_error_navigate (gpointer data)
-{
- NautilusInventoryEnablePage *enable_page;
-
- enable_page = NAUTILUS_INVENTORY_ENABLE_PAGE (data);
-
- g_return_val_if_fail (enable_page != NULL, FALSE);
-
- DEBUG_MSG (("%s: navigating to '%s'\n", __FUNCTION__, "eazel:"));
-
- nautilus_view_open_location_in_this_window (NAUTILUS_VIEW (enable_page->details->view),
- "eazel:");
-
- /* This ref was added when callback was schedule */
- gtk_object_unref (GTK_OBJECT (enable_page));
-
- return FALSE;
-}
-
-static void /*EazelInventoryDoneCallback*/
-callback_eazel_inventory (EazelInventory *inventory,
- gboolean succeeded,
- gpointer data)
-{
- NautilusInventoryEnablePage *enable_page;
-
- enable_page = NAUTILUS_INVENTORY_ENABLE_PAGE (data);
-
- g_return_if_fail (enable_page != NULL);
-
- DEBUG_MSG (("%s: inventory upload complete: %s\n", __FUNCTION__, succeeded ? "SUCCESS" : "FAILURE"));
-
- if (!GTK_OBJECT_DESTROYED (enable_page)) {
- gtk_timeout_remove (enable_page->details->timeout_id);
- enable_page->details->timeout_id = 0;
- enable_page->details->timeout_added = FALSE;
- }
-
- if (succeeded) {
- DEBUG_MSG (("%s: navigating to '%s'\n", __FUNCTION__, enable_page->details->view->details->next_uri));
-
- nautilus_view_open_location_in_this_window (NAUTILUS_VIEW (enable_page->details->view),
- enable_page->details->view->details->next_uri);
- } else {
- eel_label_set_wrap (EEL_LABEL (enable_page->details->label), TRUE);
- eel_label_set_justify (EEL_LABEL (enable_page->details->label), GTK_JUSTIFY_CENTER);
-
- eel_label_set_text (EEL_LABEL (enable_page->details->label), _("I'm sorry, an error prevented your System Inventory from being uploaded\n"));
- /* Pause for impact */
- /* This ref is released in the callback function */
- gtk_object_ref (GTK_OBJECT (enable_page));
- gtk_timeout_add (3 * 1000, callback_timeout_error_navigate, enable_page);
- }
-
- /* release the ref that was added when the callback was scheduled */
- gtk_object_unref (GTK_OBJECT (enable_page));
-}
-
-
-void
-nautilus_inventory_enable_page_run (NautilusInventoryEnablePage *enable_page)
-{
- CORBA_Environment ev;
- CORBA_exception_init (&ev);
-
- enable_page->details->inventory = eazel_inventory_get ();
-
- DEBUG_MSG (("%s: starting inventory upload\n", __FUNCTION__));
-
- eazel_inventory_set_enabled (enable_page->details->inventory,
- TRUE);
-
- /* Released in callback */
- gtk_object_ref (GTK_OBJECT (enable_page));
-
- eazel_inventory_upload (enable_page->details->inventory,
- callback_eazel_inventory,
- enable_page);
-
- enable_page->details->timeout_id = gtk_timeout_add (80, callback_progress_update, enable_page);
- enable_page->details->timeout_added = TRUE;
-}
-
-static void
-nautilus_inventory_enable_page_destroy (GtkObject *object)
-{
- NautilusInventoryEnablePage *enable_page;
- CORBA_Environment ev;
-
- enable_page = NAUTILUS_INVENTORY_ENABLE_PAGE (object);
- CORBA_exception_init (&ev);
-
- if (enable_page->details->timeout_added) {
- gtk_timeout_remove (enable_page->details->timeout_id);
- }
-
- if (enable_page->details->inventory != CORBA_OBJECT_NIL) {
- gtk_object_unref (GTK_OBJECT (enable_page->details->inventory));
- }
- g_free (enable_page->details);
-
- EEL_CALL_PARENT (GTK_OBJECT_CLASS, destroy, (object));
-}
-
diff --git a/components/services/inventory-view/nautilus-inventory-enable-page.h b/components/services/inventory-view/nautilus-inventory-enable-page.h
deleted file mode 100644
index f9c2d06d8..000000000
--- a/components/services/inventory-view/nautilus-inventory-enable-page.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Maciej Stachowiak <mjs@eazel.com>
- */
-
-/* nautilus-inventory-enable-page.h -
- */
-
-#ifndef NAUTILUS_INVENTORY_ENABLE_PAGE_H
-#define NAUTILUS_INVENTORY_ENABLE_PAGE_H
-
-#include <gtk/gtkeventbox.h>
-#include <libnautilus/nautilus-view.h>
-#include "nautilus-inventory-view.h"
-
-#define NAUTILUS_TYPE_INVENTORY_ENABLE_PAGE (nautilus_inventory_enable_page_get_type ())
-#define NAUTILUS_INVENTORY_ENABLE_PAGE(obj) (GTK_CHECK_CAST ((obj), NAUTILUS_TYPE_INVENTORY_ENABLE_PAGE, NautilusInventoryEnablePage))
-#define NAUTILUS_INVENTORY_ENABLE_PAGE_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), NAUTILUS_TYPE_INVENTORY_ENABLE_PAGE, NautilusInventoryEnablePageClass))
-#define NAUTILUS_IS_INVENTORY_ENABLE_PAGE(obj) (GTK_CHECK_TYPE ((obj), NAUTILUS_TYPE_INVENTORY_ENABLE_PAGE))
-#define NAUTILUS_IS_INVENTORY_ENABLE_PAGE_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), NAUTILUS_TYPE_INVENTORY_ENABLE_PAGE))
-
-typedef struct NautilusInventoryEnablePage NautilusInventoryEnablePage;
-typedef struct NautilusInventoryEnablePageClass NautilusInventoryEnablePageClass;
-typedef struct NautilusInventoryEnablePageDetails NautilusInventoryEnablePageDetails;
-
-struct NautilusInventoryEnablePage {
- GtkEventBox base;
- NautilusInventoryEnablePageDetails *details;
-};
-
-struct NautilusInventoryEnablePageClass {
- GtkEventBoxClass base;
-};
-
-GtkType nautilus_inventory_enable_page_get_type (void);
-
-GtkWidget *nautilus_inventory_enable_page_new (NautilusInventoryView *view);
-
-void nautilus_inventory_enable_page_run (NautilusInventoryEnablePage *enable_page);
-
-
-#endif /* NAUTILUS_INVENTORY_ENABLE_PAGE_H */
-
diff --git a/components/services/inventory-view/nautilus-inventory-view-private.h b/components/services/inventory-view/nautilus-inventory-view-private.h
deleted file mode 100644
index e38e073bb..000000000
--- a/components/services/inventory-view/nautilus-inventory-view-private.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- */
-
-#ifndef NAUTILUS_INVENTORY_VIEW_PRIVATE_H
-#define NAUTILUS_INVENTORY_VIEW_PRIVATE_H
-
-#include "nautilus-inventory-view.h"
-
-struct NautilusInventoryViewDetails {
- GtkWidget * notebook;
- GtkWidget * enable_page;
- GtkWidget * disable_page;
- char * next_uri;
-};
-
-
-#endif /* NAUTILUS_INVENTORY_VIEW_PRIVATE_H */
-
diff --git a/components/services/inventory-view/nautilus-inventory-view.c b/components/services/inventory-view/nautilus-inventory-view.c
deleted file mode 100644
index 1b1bd2b7d..000000000
--- a/components/services/inventory-view/nautilus-inventory-view.c
+++ /dev/null
@@ -1,185 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Maciej Stachowiak <mjs@eazel.com>
- */
-
-/* nautilus-inventory-view.c - system inventory view
- component. */
-
-#include <config.h>
-#include "nautilus-inventory-view-private.h"
-
-#include "nautilus-inventory-enable-page.h"
-#include "nautilus-inventory-disable-page.h"
-
-#include "eazel-services-extensions.h"
-
-#include <eel/eel-gtk-macros.h>
-#include <eel/eel-background.h>
-#include <eel/eel-string.h>
-#include <libgnomevfs/gnome-vfs.h>
-#include <libnautilus/nautilus-bonobo-ui.h>
-#include <bonobo/bonobo-control.h>
-#include <libgnome/gnome-i18n.h>
-#include <libgnomeui/gnome-stock.h>
-#include <gdk-pixbuf/gdk-pixbuf.h>
-#include <gtk/gtknotebook.h>
-#include <gtk/gtksignal.h>
-
-#undef DEBUG_MESSAGES
-
-#ifdef DEBUG_MESSAGES
-#define DEBUG_MSG(x) g_print x
-#else
-#define DEBUG_MSG(x)
-#endif
-
-static void nautilus_inventory_view_initialize_class (NautilusInventoryViewClass *klass);
-static void nautilus_inventory_view_initialize (NautilusInventoryView *view);
-static void nautilus_inventory_view_destroy (GtkObject *object);
-static void inventory_load_location_callback (NautilusView *nautilus_view,
- const char *location,
- gpointer user_data);
-
-
-EEL_DEFINE_CLASS_BOILERPLATE (NautilusInventoryView,
- nautilus_inventory_view,
- NAUTILUS_TYPE_VIEW)
-
-
-static void
-nautilus_inventory_view_initialize_class (NautilusInventoryViewClass *klass)
-{
- GtkObjectClass *object_class;
-
- g_assert (NAUTILUS_IS_INVENTORY_VIEW_CLASS (klass));
-
- object_class = GTK_OBJECT_CLASS (klass);
-
- object_class->destroy = nautilus_inventory_view_destroy;
-}
-
-static void
-nautilus_inventory_view_initialize (NautilusInventoryView *view)
-{
- g_assert (NAUTILUS_IS_INVENTORY_VIEW (view));
-
- view->details = g_new0 (NautilusInventoryViewDetails, 1);
-
- view->details->notebook = gtk_notebook_new ();
- gtk_notebook_set_show_border (GTK_NOTEBOOK (view->details->notebook), FALSE);
- gtk_notebook_set_show_tabs (GTK_NOTEBOOK (view->details->notebook), FALSE);
-
- view->details->enable_page = nautilus_inventory_enable_page_new (view);
- view->details->disable_page = nautilus_inventory_disable_page_new (view);
-
- gtk_notebook_append_page (GTK_NOTEBOOK (view->details->notebook),
- view->details->enable_page,
- gtk_label_new (""));
- gtk_notebook_append_page (GTK_NOTEBOOK (view->details->notebook),
- view->details->disable_page,
- gtk_label_new (""));
-
- gtk_widget_show_all (view->details->notebook);
-
- nautilus_view_construct (NAUTILUS_VIEW (view),
- view->details->notebook);
-
- gtk_signal_connect (GTK_OBJECT (view),
- "load_location",
- inventory_load_location_callback,
- NULL);
-}
-
-static void
-nautilus_inventory_view_destroy (GtkObject *object)
-{
- NautilusInventoryView *view;
-
- view = NAUTILUS_INVENTORY_VIEW (object);
-
- g_free (view->details);
-
- EEL_CALL_PARENT (GTK_OBJECT_CLASS, destroy, (object));
-}
-
-
-static char *
-get_finish_uri (const char *uri, const char *default_finish_uri)
-{
- char *query_portion;
- char *ret;
-
- query_portion = strchr (uri, '?');
-
- if (query_portion != NULL) {
- ret = gnome_vfs_unescape_string (query_portion + 1, NULL);
- } else {
- ret = NULL;
- }
-
- if (ret == NULL) {
- ret = g_strdup (default_finish_uri);
- }
-
- return ret;
-}
-
-
-static void
-inventory_load_location_callback (NautilusView *nautilus_view,
- const char *location,
- gpointer user_data)
-{
- NautilusInventoryView *view;
-
- g_assert (NAUTILUS_IS_VIEW (nautilus_view));
- g_assert (location != NULL);
-
- view = NAUTILUS_INVENTORY_VIEW (nautilus_view);
-
- nautilus_view_report_load_underway (nautilus_view);
-
- DEBUG_MSG (("%s: load_location '%s'\n", __FUNCTION__, location));
-
- if (eel_istr_has_prefix (location, "eazel-inventory:enable")) {
- view->details->next_uri = get_finish_uri (location, "eazel:");
-
- DEBUG_MSG (("%s: enabling, next_uri is '%s'\n", __FUNCTION__, view->details->next_uri));
-
- gtk_notebook_set_page (GTK_NOTEBOOK (view->details->notebook), 0);
- nautilus_view_report_load_complete (nautilus_view);
- nautilus_inventory_enable_page_run (
- NAUTILUS_INVENTORY_ENABLE_PAGE (view->details->enable_page));
- } else if (eel_istr_has_prefix (location, "eazel-inventory:disable")) {
- view->details->next_uri = get_finish_uri (location, "eazel:");
-
- DEBUG_MSG (("%s: disabling, next_uri is '%s'\n", __FUNCTION__, view->details->next_uri));
-
- gtk_notebook_set_page (GTK_NOTEBOOK (view->details->notebook), 1);
- nautilus_view_report_load_complete (nautilus_view);
- nautilus_inventory_disable_page_run (
- NAUTILUS_INVENTORY_DISABLE_PAGE (view->details->disable_page));
- } else {
- DEBUG_MSG (("%s: invalid uri '%s'\n", __FUNCTION__, location));
- nautilus_view_report_load_failed (nautilus_view);
- }
-}
diff --git a/components/services/inventory-view/nautilus-inventory-view.h b/components/services/inventory-view/nautilus-inventory-view.h
deleted file mode 100644
index 278e1230d..000000000
--- a/components/services/inventory-view/nautilus-inventory-view.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Maciej Stachowiak <mjs@eazel.com>
- */
-
-/* nautilus-inventory-view.h -
- */
-
-#ifndef NAUTILUS_INVENTORY_VIEW_H
-#define NAUTILUS_INVENTORY_VIEW_H
-
-#include <gtk/gtklabel.h>
-#include <libnautilus/nautilus-view.h>
-
-#define NAUTILUS_TYPE_INVENTORY_VIEW (nautilus_inventory_view_get_type ())
-#define NAUTILUS_INVENTORY_VIEW(obj) (GTK_CHECK_CAST ((obj), NAUTILUS_TYPE_INVENTORY_VIEW, NautilusInventoryView))
-#define NAUTILUS_INVENTORY_VIEW_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), NAUTILUS_TYPE_INVENTORY_VIEW, NautilusInventoryViewClass))
-#define NAUTILUS_IS_INVENTORY_VIEW(obj) (GTK_CHECK_TYPE ((obj), NAUTILUS_TYPE_INVENTORY_VIEW))
-#define NAUTILUS_IS_INVENTORY_VIEW_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), NAUTILUS_TYPE_INVENTORY_VIEW))
-
-typedef struct NautilusInventoryViewDetails NautilusInventoryViewDetails;
-
-typedef struct {
- NautilusView parent;
- NautilusInventoryViewDetails *details;
-} NautilusInventoryView;
-
-typedef struct {
- NautilusViewClass parent;
-} NautilusInventoryViewClass;
-
-/* GtkObject support */
-GtkType nautilus_inventory_view_get_type (void);
-
-#endif /* NAUTILUS_INVENTORY_VIEW_H */
diff --git a/components/services/inventory/.cvsignore b/components/services/inventory/.cvsignore
deleted file mode 100644
index 012655e1b..000000000
--- a/components/services/inventory/.cvsignore
+++ /dev/null
@@ -1,16 +0,0 @@
-.deps
-.libs
-*.lo
-Makefile
-Makefile.in
-Trilobite_Service_inventory.oaf
-eazel-inventory-client
-eazel-inventory-service-interface.h
-eazel-inventory-service-interface.idl
-eazel-inventory-service-interface-common.c
-eazel-inventory-service-interface-skels.c
-eazel-inventory-service-interface-stubs.c
-idl_stamp
-libtrilobite-inventory-service.la
-trilobite-inventory-service
-
diff --git a/components/services/inventory/Makefile.am b/components/services/inventory/Makefile.am
deleted file mode 100644
index 5bd22b35a..000000000
--- a/components/services/inventory/Makefile.am
+++ /dev/null
@@ -1,117 +0,0 @@
-NULL =
-
-bin_PROGRAMS = trilobite-inventory-service eazel-inventory-client
-
-
-lib_LTLIBRARIES = libtrilobite-inventory-service.la
-
-INCLUDES = \
- -DPREFIX=\"$(prefix)\" \
- -DG_LOG_DOMAIN=\"trilobite-inventory-service\" \
- -DGNOMELOCALEDIR=\""$(datadir)/locale"\" \
- -I$(top_srcdir) \
- -I$(top_builddir) \
- -I$(top_srcdir)/components/services/install/lib \
- -I$(top_builddir)/components/services/install/lib \
- -I$(top_srcdir)/components/services/trilobite \
- -I$(top_builddir)/components/services/trilobite \
- -I$(top_srcdir)/components/services/trilobite/libtrilobite \
- -I$(top_builddir)/components/services/trilobite/libtrilobite \
- $(EEL_INCLUDEDIR) \
- $(LIBRSVG_INCLUDEDIR) \
- $(GCONF_CFLAGS) \
- $(GNOME_CFLAGS) \
- $(GNOME_INCLUDEDIR) \
- $(OAF_CFLAGS) \
- $(XML_CFLAGS) \
- $(AMMONITE_CFLAGS) \
- $(GHTTP_CFLAGS) \
- $(NULL)
-
-trilobite_inventory_service_SOURCES = \
- eazel-inventory-service.h \
- eazel-inventory-service.c \
- eazel-inventory-utils.h \
- eazel-inventory-utils.c \
- eazel-inventory-collect-hardware.h \
- eazel-inventory-collect-hardware.c \
- eazel-inventory-collect-software.h \
- eazel-inventory-collect-software.c \
- main.c \
- $(NULL)
-
-trilobite_inventory_service_LDADD = \
- $(RPM_LIBS) \
- libtrilobite-inventory-service.la \
- $(top_builddir)/components/services/install/lib/libeazelinstall.la \
- $(top_builddir)/components/services/install/lib/libeazelpackagesystem.la \
- $(top_builddir)/components/services/trilobite/libtrilobite/libtrilobite.la \
- $(top_builddir)/components/services/trilobite/libtrilobite/libtrilobite-service.la \
- $(top_builddir)/libnautilus/libnautilus.la \
- $(EEL_LIBS) \
- $(LIBRSVG_LIBS) \
- $(BONOBO_LIBS) \
- $(AMMONITE_LIBS) \
- $(GHTTP_LIBS) \
- $(NULL)
-
-eazel_inventory_client_SOURCES = \
- eazel-inventory-client.c \
- $(NULL)
-
-eazel_inventory_client_LDADD = \
- libtrilobite-inventory-service.la \
- $(top_builddir)/components/services/trilobite/libtrilobite/libtrilobite.la \
- $(top_builddir)/components/services/trilobite/libtrilobite/libtrilobite-service.la \
- $(EEL_LIBS) \
- $(LIBRSVG_LIBS) \
- $(BONOBO_LIBS) \
- $(NULL)
-
-
-
-## CORBA magic
-
-CORBA_GENERATED = \
- eazel-inventory-service-interface.h \
- eazel-inventory-service-interface-common.c \
- eazel-inventory-service-interface-skels.c \
- eazel-inventory-service-interface-stubs.c \
- $(NULL)
-
-$(CORBA_GENERATED): idl_stamp
-
-IDL = eazel-inventory-service-interface.idl
-
-idl_stamp: $(IDL)
- $(ORBIT_IDL) $(IDL_CFLAGS) $(IDL)
- touch idl_stamp
-
-CLEANFILES += $(CORBA_GENERATED) idl_stamp
-
-trilobiteincludedir = $(includedir)/trilobite
-
-trilobiteinclude_HEADERS = \
- eazel-inventory-service-interface.h \
- $(NULL)
-
-libtrilobite_inventory_service_la_SOURCES = \
- $(CORBA_GENERATED) \
- eazel-inventory.c \
- eazel-inventory.h \
- eazel-inventory-upload-callback.c \
- eazel-inventory-upload-callback.h \
- $(NULL)
-
-
-oafdir = $(datadir)/oaf
-oaf_in_files = Trilobite_Service_inventory.oaf.in
-oaf_DATA = $(oaf_in_files:.oaf.in=.oaf)
-
-@XML_I18N_MERGE_OAF_RULE@
-
-EXTRA_DIST = \
- $(oaf_in_files) \
- $(oaf_DATA) \
- $(IDL) \
- $(NULL)
diff --git a/components/services/inventory/Trilobite_Service_inventory.oaf.in b/components/services/inventory/Trilobite_Service_inventory.oaf.in
deleted file mode 100644
index bc6fb996f..000000000
--- a/components/services/inventory/Trilobite_Service_inventory.oaf.in
+++ /dev/null
@@ -1,30 +0,0 @@
-<oaf_info>
-
-<oaf_server iid="OAFIID:trilobite_inventory_service_factory:ddc067a1-45e1-41ae-925a-bb6ecdaf3047" type="exe" location="trilobite-inventory-service">
- <oaf_attribute name="repo_ids" type="stringv">
- <item value="IDL:GNOME/ObjectFactory:1.0"/>
- </oaf_attribute>
- <oaf_attribute name="description" type="string" _value="Factory for the inventory service"/>
-</oaf_server>
-
-<oaf_server iid="OAFIID:trilobite_inventory_service:eaae1152-1551-43d5-a764-52274131a9d5" type="factory" location="OAFIID:trilobite_inventory_service_factory:ddc067a1-45e1-41ae-925a-bb6ecdaf3047">
- <oaf_attribute name="repo_ids" type="stringv">
- <item value="IDL:Bonobo/Unknown:1.0"/>
- <item value="IDL:Trilobite/Service:1.0"/>
- <item value="IDL:Trilobite/Eazel/Inventory:1.0"/>
- </oaf_attribute>
-
- <oaf_attribute name="trilobite:name" type="string" _value="Inventory"/>
- <oaf_attribute name="trilobite:version" type="string" value="0.1"/>
- <oaf_attribute name="trilobite:vendor_name" type="string" value="Eazel, Inc."/>
- <oaf_attribute name="trilobite:vendor_url" type="string" value="http://www.eazel.com"/>
- <oaf_attribute name="trilobite:info_url" type="string" value="http://www.eazel.com/inventory/info"/>
- <oaf_attribute name="trilobite:icon" type="string" value="gnome-default-dlg.png"/>
- <oaf_attribute name="trilobite:uri_scheme" type="string" value="eazel-inventory:"/>
- <oaf_attribute name="bonobo:supported_uri_schemes" type="stringv">
- <item value="eazel-sample:"/>
- </oaf_attribute>
-
-</oaf_server>
-
-</oaf_info>
diff --git a/components/services/inventory/eazel-inventory-client.c b/components/services/inventory/eazel-inventory-client.c
deleted file mode 100644
index fed67a898..000000000
--- a/components/services/inventory/eazel-inventory-client.c
+++ /dev/null
@@ -1,138 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: Eskil Heyn Olsen <eskil@eazel.com>
- *
- */
-
-#include <config.h>
-#include <gnome.h>
-#include <liboaf/liboaf.h>
-#include <bonobo.h>
-
-#include <libtrilobite/libtrilobite.h>
-#include <libtrilobite/libtrilobite-service.h>
-
-#include <unistd.h>
-
-#include "eazel-inventory.h"
-
-#define SERVICE_IID "OAFIID:trilobite_inventory_service:eaae1152-1551-43d5-a764-52274131a9d5"
-
-
-CORBA_Environment ev;
-CORBA_ORB orb;
-
-
-static const char *
-gboolean_to_yes_or_no (gboolean bool)
-{
- return bool ? "YES" : "NO";
-}
-
-static void
-callback (EazelInventory *inventory,
- gboolean succeeded,
- gpointer callback_data)
-{
- puts (succeeded ? "Upload succeeded" : "Upload failed");
- gtk_main_quit ();
-}
-
-int
-main (int argc,
- char *argv[])
-{
- EazelInventory *inventory_service;
- gboolean enable = FALSE;
- gboolean disable = FALSE;
- gboolean info = FALSE;
- gboolean upload = FALSE;
-
- struct poptOption options[] = {
-#ifndef NAUTILUS_OMIT_SELF_CHECK
- { "enable", 'e', POPT_ARG_NONE, &enable, 0, N_("Enable inventory upload."), NULL },
-#endif
- { "disable", 'd', POPT_ARG_NONE, &disable, 0, N_("Disable inventory upload."), NULL },
- { "info", 'i', POPT_ARG_NONE, &info, 0, N_("Display information about current inventory settings."), NULL },
- { "upload", 'u', POPT_ARG_NONE, &upload, 0, N_("Upload inventory now, if not up to date."), NULL },
- /* FIXME bugzilla.eazel.com 5510: These OAF options don't get translated for some reason. */
- { NULL, '\0', 0, NULL, 0, NULL, NULL }
- };
-
- gtk_init (&argc, &argv);
-
- if (enable && disable) {
- g_error ("Cannot both enable and disable inventory.");
- exit (1);
- }
-
- if (!trilobite_init ("eazel-inventory-client", "0.1", NULL, options, argc, argv)) {
- g_error ("Could not initialize trilobite.");
- exit (1);
- }
-
- CORBA_exception_init (&ev);
-
-
- /* Disable session manager connection */
- gnome_client_disable_master_connection ();
-
-
- bonobo_activate ();
-
- inventory_service = eazel_inventory_get ();
-
- if (enable) {
- eazel_inventory_set_enabled (inventory_service, TRUE);
- }
-
- if (disable) {
- eazel_inventory_set_enabled (inventory_service, CORBA_FALSE);
- }
-
- if (upload) {
- eazel_inventory_upload (inventory_service,
- callback,
- NULL);
- gtk_main ();
- }
-
- if (info) {
- printf ("Inventory upload enabled: %s\n", gboolean_to_yes_or_no
- (eazel_inventory_get_enabled (inventory_service)));
- printf ("Machine ID: %s\n",
- eazel_inventory_get_machine_id (inventory_service));
- /* Last upload date? */
- }
-
- gtk_object_unref (GTK_OBJECT (inventory_service));
-
- /* And free the exception structure */
- CORBA_exception_free (&ev);
-
- return 0;
-};
-
-
-
-
-
-
-
diff --git a/components/services/inventory/eazel-inventory-collect-hardware.c b/components/services/inventory/eazel-inventory-collect-hardware.c
deleted file mode 100644
index 9458654b5..000000000
--- a/components/services/inventory/eazel-inventory-collect-hardware.c
+++ /dev/null
@@ -1,525 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-
-/* Nautilus
- * Copyright (C) 2001 Eazel, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * Authors: Ian McKellar <ian@eazel.com>
- * J Shane Culpepper <pepper@eazel.com>
- *
- * The code responsible for the client inventory manipulation.
- *
- */
-
-#include <config.h>
-
-#include "eazel-inventory-collect-hardware.h"
-
-#include <eel/eel-string.h>
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include <glib.h>
-#include <string.h>
-#include <gnome-xml/tree.h>
-
-#define PCI_DEVICES_FILE "/proc/bus/pci/devices"
-
-#define IDE_BUS_MAX 8
-#define IDE_BUS_FILE "/proc/ide/ide%d/channel"
-#define IDE_DRIVE_MIN 'a'
-#define IDE_DRIVE_MAX 'z' /* FIXME: is this right? */
-#define IDE_DRIVE_DIR "/proc/ide/ide%d/hd%c/"
-#define IDE_DRIVE_MEDIA IDE_DRIVE_DIR "media"
-#define IDE_DRIVE_CACHE IDE_DRIVE_DIR "cache"
-#define IDE_DRIVE_CAPACITY IDE_DRIVE_DIR "capacity"
-#define IDE_DRIVE_MODEL IDE_DRIVE_DIR "model"
-
-#define USB_DEVICES_FILE "/proc/bus/usb/devices"
-
-#define SCSI_DEVICES_FILE "/proc/scsi/devices"
-#define SCSI_DEVICE_START "Host: scsi%d Channel: %2d Id: %2d Lun: %2d"
-#define SCSI_DEVICE_START_COUNT 4
-#define SCSI_VENDOR_STRING " Vendor: "
-#define SCSI_MODEL_STRING "Model: "
-#define SCSI_REV_STRING "Rev: "
-
-#define SCSI_TYPE_STRING " Type: "
-
-#define MAX_LINE_LEN 4095 /* i386 page - 1 */
-
-static void
-add_device_property (xmlNodePtr device_node, const char *key,
- const char *value) {
- xmlNodePtr property;
-
- property = xmlNewChild (device_node, NULL, "PROPERTY", value);
- xmlSetProp (property, "NAME", key);
-}
-
-/* collect information about devices on the PCI bus */
-static xmlNodePtr
-eazel_inventory_collect_pci (void) {
- FILE *pci_file;
- char bus_number[3], devfn[3], vendor[5], device[5];
- char line[MAX_LINE_LEN+1];
- xmlNodePtr bus_node, device_node;
-
- bus_node = xmlNewNode (NULL, "BUS");
- xmlSetProp (bus_node, "TYPE", "PCI");
-
- pci_file = fopen (PCI_DEVICES_FILE, "r");
-
- if (pci_file == NULL) {
- return bus_node;
- }
-
- while (!feof (pci_file) && !ferror (pci_file)) {
- fgets (line, MAX_LINE_LEN, pci_file);
-
- sscanf (line, "%2s%2s\t%4s%4s", bus_number, devfn, vendor,
- device);
-
- device_node = xmlNewChild (bus_node, NULL, "DEVICE", NULL);
- add_device_property (device_node, "Vendor-ID", vendor);
- add_device_property (device_node, "Device-ID", device);
- add_device_property (device_node, "DeviceFunction", devfn);
- add_device_property (device_node, "BusNumber", bus_number);
- }
-
- fclose (pci_file);
-
- return bus_node;
-}
-
-static void
-remove_trailing_whitespace (char *buffer)
-{
- int i;
-
- g_return_if_fail (buffer != NULL);
-
- i = strlen (buffer) - 1;
-
- while ( (i >= 0) && isspace (buffer[i])) {
- buffer[i] = '\0';
- i--;
- }
-}
-
-static char *
-ide_get_value (int bus, char drive, const char *key) {
- char *value_path;
- FILE *value_file;
- char line[MAX_LINE_LEN+1] = "";
- int i;
-
- value_path = g_strdup_printf (key, bus, drive);
- value_file = fopen (value_path, "r");
- g_free (value_path);
-
- if (value_file == NULL) {
- return NULL;
- }
-
- fgets (line, MAX_LINE_LEN, value_file);
-
- fclose (value_file);
-
- i = strlen (line);
-
- if (i == 0) {
- /* the file is empty */
- return NULL;
- }
-
- remove_trailing_whitespace (line);
-
- return g_strdup (line);
-}
-
-/* collect information about devices on the IDE bus */
-static xmlNodePtr
-eazel_inventory_collect_ide (void) {
- FILE *ide_file;
- char *bus_path;
- int bus;
- char drive;
- char *string;
- xmlNodePtr bus_node, device_node;
-
- bus_node = xmlNewNode (NULL, "BUS");
- xmlSetProp (bus_node, "TYPE", "IDE");
-
- for (bus = 0; bus < IDE_BUS_MAX; bus++) {
- bus_path = g_strdup_printf (IDE_BUS_FILE, bus);
- ide_file = fopen (bus_path, "r");
- if (ide_file) {
- fclose (ide_file); /* this file isn't important */
-
- /* Do we want to indicate which bus each drive
- * is on? Do we care? Can we imply this from the
- * device names? Find out in the next exciting
- * episode of "Trilobite and Friends".
- */
-
- for (drive = IDE_DRIVE_MIN; drive <= IDE_DRIVE_MAX;
- drive++) {
- string = ide_get_value (bus, drive,
- IDE_DRIVE_MEDIA);
-
- if (string == NULL) {
- continue;
- }
-
- device_node = xmlNewChild (bus_node, NULL,
- "DEVICE", NULL);
-
- add_device_property (device_node, "Media",
- string);
- g_free (string);
-
- string = g_strdup_printf ("hd%c", drive);
- add_device_property (device_node, "Device",
- string);
- g_free (string);
-
- string = ide_get_value (bus, drive,
- IDE_DRIVE_MODEL);
- if (string) {
- add_device_property (device_node,
- "Model", string);
- g_free (string);
- }
-
- string = ide_get_value (bus, drive,
- IDE_DRIVE_CAPACITY);
- if (string) {
- int tmp;
-
- tmp = atoi (string);
- tmp /= 2048;
-
- g_free (string);
-
- string = g_strdup_printf ("%d", tmp);
-
- add_device_property (device_node,
- "Capacity", string);
- g_free (string);
- }
-
- string = ide_get_value (bus, drive,
- IDE_DRIVE_CACHE);
- if (string) {
- add_device_property (device_node,
- "Cache", string);
- g_free (string);
- }
-
- }
- }
- g_free (bus_path);
- }
-
- return bus_node;
-}
-
-/* collect information about devices on the USB bus */
-static xmlNodePtr
-eazel_inventory_collect_usb (void) {
- FILE *usb_file;
- char line[MAX_LINE_LEN+1], *name, *value;
- char vendor[5], prodid[5], revision[6];
- xmlNodePtr bus_node, device_node;
-
- bus_node = xmlNewNode (NULL, "BUS");
- xmlSetProp (bus_node, "TYPE", "USB");
-
- usb_file = fopen (USB_DEVICES_FILE, "rt");
- if (usb_file == NULL) {
- return bus_node;
- }
-
- device_node = NULL;
-
- while (!feof (usb_file) && !ferror (usb_file)) {
- if (fgets (line, MAX_LINE_LEN, usb_file) == NULL) {
- break;
- }
- switch (line[0]) {
- case 'T':
- if (device_node) {
- xmlAddChild (bus_node, device_node);
- }
- device_node = xmlNewNode (NULL, "DEVICE");
- break;
- case 'S':
- remove_trailing_whitespace (line);
- if (strlen (line) < 5) {
- break;
- }
- name = line+4;
- value = strchr (name, '=');
- if (value) {
- *value = '\0';
- value++;
- add_device_property (device_node,
- name, value);
- }
- break;
- case 'P':
- if (sscanf (line+4,
- "Vendor=%4s ProdID=%4s Rev=%5s",
- vendor, prodid, revision)
- != 3) {
- break;
- }
- add_device_property (device_node, "Vendor-ID",
- vendor);
- add_device_property (device_node, "Device-ID",
- prodid);
- add_device_property (device_node, "Revision",
- revision);
- break;
- case 'I':
- name = strstr (line+4, "Cls=");
- if (name) {
- value = name+4;
- if (strlen (value) >= 2) {
- *(value+2) = '\0';
- add_device_property
- (device_node, "Class",
- value);
- }
- }
- }
- }
- fclose (usb_file);
-
- if (device_node) {
- xmlAddChild (bus_node, device_node);
- }
-
- return bus_node;
-}
-
-/* collect information about devices on the SCSI bus */
-static xmlNodePtr
-eazel_inventory_collect_scsi (void) {
- xmlNodePtr bus_node, device_node;
- FILE *scsi_file;
- char line[MAX_LINE_LEN+1];
- char *scsi_vendor, *scsi_model, *scsi_rev, *scsi_type;
- int scsi_host, scsi_channel, scsi_id, scsi_lun;
-
- bus_node = xmlNewNode (NULL, "BUS");
- xmlSetProp (bus_node, "TYPE", "SCSI");
- device_node = NULL;
-
-
-/*
-Attached devices:
-Host: scsi0 Channel: 00 Id: 00 Lun: 00
- Vendor: SEAGATE Model: ST15150W Rev: 0023
- Type: Direct-Access ANSI SCSI revision: 02
-Host: scsi0 Channel: 00 Id: 04 Lun: 00
- Vendor: MATSHITA Model: CD-R CW-7502 Rev: 4.16
- Type: CD-ROM ANSI SCSI revision: 02
-*/
-
- scsi_file = fopen (SCSI_DEVICES_FILE, "rt");
- if (scsi_file == NULL) {
- return bus_node;
- }
-
- while (!feof (scsi_file) && !ferror (scsi_file)) {
- fgets (line, MAX_LINE_LEN, scsi_file);
- if (sscanf (line, SCSI_DEVICE_START, &scsi_host,
- &scsi_channel, &scsi_id,
- &scsi_lun) ==
- SCSI_DEVICE_START_COUNT) {
- printf ("device start\n");
- if (device_node) {
- xmlAddChild (bus_node, device_node);
- }
- device_node = xmlNewNode (NULL, "DEVICE");
- /* FIXME: do we want to upload host, channel, id and
- * lun info? */
- } else if (!strncmp (line, SCSI_VENDOR_STRING,
- strlen (SCSI_VENDOR_STRING))) {
- printf ("vendorline\n");
- scsi_vendor = line + strlen (SCSI_VENDOR_STRING);
- scsi_model = strstr (scsi_vendor, SCSI_MODEL_STRING);
- if (scsi_model) {
- *scsi_model = '\0';
- remove_trailing_whitespace (scsi_vendor);
- add_device_property (device_node, "Vendor",
- scsi_vendor);
- scsi_model += strlen (SCSI_MODEL_STRING);
- scsi_rev = strstr (scsi_model, SCSI_REV_STRING);
- if(scsi_rev) {
- *scsi_rev = '\0';
- remove_trailing_whitespace
- (scsi_model);
- add_device_property (device_node,
- "Model", scsi_model);
- scsi_rev += strlen (SCSI_REV_STRING);
- add_device_property (device_node,
- "Revision", scsi_rev);
- remove_trailing_whitespace
- (scsi_rev);
- }
- }
- } else if (!strncmp (line, SCSI_TYPE_STRING,
- strlen (SCSI_TYPE_STRING))) {
- printf ("typeline\n");
- scsi_type = line + strlen (SCSI_TYPE_STRING);
- if (strlen (scsi_type) > 20) {
- scsi_type[20] = '\0';
- }
- remove_trailing_whitespace (scsi_type);
- add_device_property (device_node, "Type", scsi_type);
- }
- }
-
- fclose (scsi_file);
-
- if (device_node) {
- xmlAddChild (bus_node, device_node);
- }
-
- return bus_node;
-}
-
-/* utility routine to extract information from a string and add it to an XML node */
-static void
-add_info (xmlNodePtr node_ptr,
- char *data,
- const char *tag,
- const char *field_name)
-{
-
- int index;
- char **info_array;
- char *field_data;
-
- field_data = NULL;
-
- /* parse the data into a string array */
- info_array = g_strsplit (data, "\n", 32);
- /* iterate through the data isolating the field */
- for (index = 0; index < 32; index++) {
- if (info_array[index] == NULL)
- break;
- if (eel_str_has_prefix (info_array[index], field_name)) {
- field_data = info_array[index] + strlen (field_name);
- field_data = strchr (field_data, ':') + 1;
- field_data = g_strchug (field_data);
- break;
- }
- }
-
- /* add the requested node if the field was found */
- if (field_data) {
- xmlNodePtr new_node;
- new_node = xmlNewChild (node_ptr, NULL, tag, NULL);
- xmlNodeSetContent (new_node, field_data);
- }
- g_strfreev (info_array);
-}
-
-
-
-/* utility routine to read a proc file into a string */
-static char*
-read_proc_info (const char *proc_filename)
-{
-
- FILE *thisFile;
- char *result;
- char buffer[MAX_LINE_LEN+1];
- char *path_name;
- GString *string_data;
-
- path_name = g_strdup_printf ("/proc/%s", proc_filename);
- string_data = g_string_new ("");
- thisFile = fopen (path_name, "r");
-
- while (fgets (buffer, MAX_LINE_LEN, thisFile) != NULL) {
- g_string_append (string_data, buffer);
- }
- fclose (thisFile);
-
- result = g_strdup (string_data->str);
- g_string_free (string_data, TRUE);
- g_free (path_name);
-
- return result;
-}
-
-
-static xmlNodePtr
-eazel_inventory_collect_memory (void) {
- xmlNodePtr this_node;
- char *temp_string;
-
- this_node = xmlNewNode (NULL, "MEMORY");
- temp_string = read_proc_info ("meminfo");
- add_info (this_node, temp_string, "MEMORYSIZE", "MemTotal");
- add_info (this_node, temp_string, "SWAPSIZE", "SwapTotal");
- g_free (temp_string);
-
- return this_node;
-}
-
-static xmlNodePtr
-eazel_inventory_collect_cpu (void) {
- xmlNodePtr cpu_node;
- char *temp_string;
-
- cpu_node = xmlNewNode (NULL, "CPU");
-
- temp_string = read_proc_info ("cpuinfo");
- add_info (cpu_node, temp_string, "TYPE", "processor");
- add_info (cpu_node, temp_string, "VENDOR", "vendor_id");
- add_info (cpu_node, temp_string, "FAMILY", "cpu family");
- add_info (cpu_node, temp_string, "MODEL", "model");
- add_info (cpu_node, temp_string, "MODELNAME", "model name");
- add_info (cpu_node, temp_string, "STEPPING", "stepping");
- add_info (cpu_node, temp_string, "SPEED", "cpu MHz");
- add_info (cpu_node, temp_string, "CACHE", "cache size");
- add_info (cpu_node, temp_string, "BOGOMIPS", "bogomips");
- add_info (cpu_node, temp_string, "FLAGS", "flags");
- g_free (temp_string);
-
- return cpu_node;
-}
-
-xmlNodePtr
-eazel_inventory_collect_hardware (void) {
- xmlNodePtr node = xmlNewNode (NULL, "HARDWARE");
-
- xmlAddChild (node, eazel_inventory_collect_cpu ());
- xmlAddChild (node, eazel_inventory_collect_memory ());
- xmlAddChild (node, eazel_inventory_collect_pci ());
- xmlAddChild (node, eazel_inventory_collect_ide ());
- xmlAddChild (node, eazel_inventory_collect_usb ());
- xmlAddChild (node, eazel_inventory_collect_scsi ());
-
- return node;
-}
diff --git a/components/services/inventory/eazel-inventory-collect-hardware.h b/components/services/inventory/eazel-inventory-collect-hardware.h
deleted file mode 100644
index 8a98ab795..000000000
--- a/components/services/inventory/eazel-inventory-collect-hardware.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-
-/* Nautilus
- * Copyright (C) 2001 Eazel, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * Authors: Ian McKellar <ian@eazel.com>
- *
- * The code responsible for the client inventory manipulation.
- *
- */
-
-#include <config.h>
-#include <gnome-xml/tree.h>
-
-
-xmlNodePtr eazel_inventory_collect_hardware (void);
-
diff --git a/components/services/inventory/eazel-inventory-collect-software.c b/components/services/inventory/eazel-inventory-collect-software.c
deleted file mode 100644
index cbea5a861..000000000
--- a/components/services/inventory/eazel-inventory-collect-software.c
+++ /dev/null
@@ -1,147 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-
-/* Nautilus
- * Copyright (C) 2000 Eazel, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * Authors: J Shane Culpepper <pepper@eazel.com>
- * Ian McKellar <ian@eazel.com>
- *
- * The code responsible for the client inventory manipulation.
- *
- */
-
-#include <config.h>
-
-#include "eazel-inventory-utils.h"
-#include "eazel-inventory-collect-software.h"
-
-#include <gdk/gdk.h>
-#include <stdio.h>
-#include <fcntl.h>
-#include <time.h>
-#include <unistd.h>
-#include <gnome.h>
-#include <gnome-xml/entities.h>
-#include <gnome-xml/parser.h>
-#include <gnome-xml/tree.h>
-
-#include <libtrilobite/trilobite-md5-tools.h>
-#include <libtrilobite/trilobite-core-distribution.h>
-
-#define DEBUG_pepper 1
-
-#define DIGEST_GCONF_PATH "/apps/eazel-trilobite/inventory-digest"
-#define DIGEST_GCONF_KEY "inventory_digest_value"
-
-/* eazel package system method to query the rpmdb for
- * all packages and return a GList of PackageData structs.
- */
-
-static GList *
-get_package_list (EazelPackageSystem *package_system)
-{
- GList *packages;
-
- packages = NULL;
-
- packages = eazel_package_system_query (package_system,
- NULL,
- "",
- EAZEL_PACKAGE_SYSTEM_QUERY_SUBSTR,
- 0);
-
- return packages;
-}
-
-/* add package data from the package database to the passed in xml document */
-static xmlNodePtr
-eazel_inventory_collect_packages (void) {
- char *package_count_str;
- xmlNodePtr packages_node;
- xmlNodePtr current_package_node;
- int package_count;
- EazelPackageSystem *package_system;
- GList *packages;
- GList *iterator;
- PackageData *package;
-
-
- /* add the PACKAGES node */
- packages_node = xmlNewNode (NULL, "PACKAGES");
-
- package_count = 0;
-
- package_system = eazel_package_system_new (NULL);
-
- packages = get_package_list (package_system);
-
- /* iterate through all of the installed packages */
-
- for (iterator = packages; iterator != NULL; iterator = g_list_next (iterator)) {
-
- package = (PackageData*) iterator->data;
-
- /* add a node for this package */
-
- current_package_node = xmlNewChild (packages_node, NULL, "PACKAGE", NULL);
- package_count += 1;
-
- xmlSetProp (current_package_node, "name", package->name);
- xmlSetProp (current_package_node, "version", package->version);
- xmlSetProp (current_package_node, "release", package->minor);
- xmlSetProp (current_package_node, "epoch", package->archtype);
-
- gtk_object_unref (GTK_OBJECT (package));
-
- }
-
- /* update the count */
-
- package_count_str = g_strdup_printf ("%d", package_count);
- xmlSetProp (packages_node, "count", package_count_str);
-
- /* clean up*/
- gtk_object_unref (GTK_OBJECT (package_system));
- g_list_free (packages);
-
- return packages_node;
-
-}
-
-xmlNodePtr
-eazel_inventory_collect_software (void) {
- TrilobiteDistributionInfo distro;
- char *distro_string;
- xmlNodePtr node;
-
- node = xmlNewNode (NULL, "SOFTWARE");
-
- distro = trilobite_get_distribution ();
- distro_string = trilobite_get_distribution_name (distro, TRUE, TRUE);
- if (!distro_string) {
- /* do we really want to pass this string? */
- distro_string = g_strdup_printf ("Unknown Distribution");
- }
- xmlNewChild (node, NULL, "DISTRIBUTION", distro_string);
- g_free (distro_string);
-
- /* add the package info */
- xmlAddChild (node, eazel_inventory_collect_packages ());
-
- return node;
-}
-
diff --git a/components/services/inventory/eazel-inventory-collect-software.h b/components/services/inventory/eazel-inventory-collect-software.h
deleted file mode 100644
index 0ef129303..000000000
--- a/components/services/inventory/eazel-inventory-collect-software.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-
-/* Nautilus
- * Copyright (C) 2000 Eazel, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * Authors: J Shane Culpepper <pepper@eazel.com>
- * Ian McKellar <ian@eazel.com>
- *
- * The code responsible for the client inventory manipulation.
- *
- */
-
-#include <gnome-xml/tree.h>
-
-xmlNodePtr eazel_inventory_collect_software (void);
diff --git a/components/services/inventory/eazel-inventory-service-interface.idl b/components/services/inventory/eazel-inventory-service-interface.idl
deleted file mode 100644
index 88b389fd9..000000000
--- a/components/services/inventory/eazel-inventory-service-interface.idl
+++ /dev/null
@@ -1,25 +0,0 @@
-/* -*- Mode: IDL; tab-width: 8; indent-tabs-mode: 8; c-basic-offset: 8 -*- */
-
-#include <Bonobo.idl>
-
-module Trilobite {
- module Eazel {
- interface InventoryUploadCallback : Bonobo::Unknown {
- /* FIXME: need to report more specific error on failure */
- oneway void done_uploading (in boolean succeeded);
- };
-
- interface Inventory : Bonobo::Unknown {
- attribute boolean enabled;
- readonly attribute string machine_id;
-
- /* Will not actually upload if inventory is
- * unchanged since last upload, or if
- * inventory is not enabled.
- */
-
- oneway void upload (in InventoryUploadCallback listener);
- };
- };
-};
-
diff --git a/components/services/inventory/eazel-inventory-service.c b/components/services/inventory/eazel-inventory-service.c
deleted file mode 100644
index 9958bf300..000000000
--- a/components/services/inventory/eazel-inventory-service.c
+++ /dev/null
@@ -1,488 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: Eskil Heyn Olsen <eskil@eazel.com>
- *
- */
-
-#include <config.h>
-#include "eazel-inventory-service.h"
-
-#include "eazel-inventory-service-interface.h"
-#include "eazel-inventory-utils.h"
-#include <bonobo.h>
-#include <eel/eel-vfs-extensions.h>
-#include <gconf/gconf-client.h>
-#include <ghttp.h>
-#include <gnome.h>
-#include <libgnomevfs/gnome-vfs.h>
-#include <liboaf/liboaf.h>
-#include <libtrilobite/libammonite.h>
-#include <libtrilobite/libtrilobite-service.h>
-#include <libtrilobite/libtrilobite.h>
-
-/* FIXME: crack */
-/*#include <libammonite/libammonite.h>*/
-
-#define DEBUG(X...) g_print("eazel-inventory-service: " X)
-
-#define KEY_GCONF_EAZEL_INVENTORY_ENABLED "/apps/eazel-trilobite/inventory/enabled"
-
-#define EAZEL_INVENTORY_UPLOAD_URI "eazel-services:/inventory/upload"
-#define EAZEL_INVENTORY_DELETE_URI "eazel-services:/inventory/delete"
-
-#define UPLOAD_POST_NAME "_inventory.xml"
-
-/* FIXME: hook gconf signals so that if the values are changed externally we contact the server... */
-
-
-/* This is the parent class pointer */
-
-static BonoboObjectClass *eazel_inventory_service_parent_class;
-
-/*****************************************
- Corba stuff
-*****************************************/
-
-static PortableServer_ServantBase__epv base_epv = { NULL, NULL, NULL };
-
-/*
- This is POA_Trilobite_Eazel_Inventory structure we will use,
- as it will let us access the EazelInventoryService object in
- the corba methods
- */
-typedef struct {
- POA_Trilobite_Eazel_Inventory poa;
- EazelInventoryService *object;
-} impl_POA_Trilobite_Eazel_Inventory;
-
-struct EazelInventoryServiceDetails {
- GConfClient *gconf_client;
-};
-
-static gboolean
-get_enabled (EazelInventoryService *service) {
- return gconf_client_get_bool (service->details->gconf_client, KEY_GCONF_EAZEL_INVENTORY_ENABLED, NULL);
- /* FIXME: handle gconf errors */
-}
-
-static CORBA_boolean
-impl_Trilobite_Eazel_Inventory__get_enabled (PortableServer_Servant servant,
- CORBA_Environment *ev)
-{
- impl_POA_Trilobite_Eazel_Inventory *service;
-
- service = (impl_POA_Trilobite_Eazel_Inventory *) servant;
- return get_enabled (service->object);
-}
-
-static gboolean
-http_post_simple (const char *uri, const char *name, const char *value) {
- ghttp_request* request;
- char *ename=NULL, *evalue=NULL, *body=NULL;
-
- request = ghttp_request_new ();
- if (!request) {
- return FALSE;
- }
-
- if (ghttp_set_uri (request, (char *)uri) != 0 ||
- ghttp_set_type (request, ghttp_type_post) != 0) {
- ghttp_close (request);
- return FALSE;
- }
- ghttp_set_header (request, http_hdr_Connection, "close");
- ghttp_set_header (request, http_hdr_User_Agent, trilobite_get_useragent_string (NULL));
- ghttp_set_header (request, http_hdr_Content_Type, "application/x-www-form-urlencoded");
-
- evalue = gnome_vfs_escape_string (value);
- if (name) {
- ename = gnome_vfs_escape_string (name);
- body = g_strconcat (ename, "=", evalue, NULL);
- g_free (ename);
- g_free (evalue);
- } else {
- body = evalue;
- }
-
- if (ghttp_set_body (request, body, strlen(body)) != 0 ||
- ghttp_prepare (request) != 0) {
- ghttp_close (request);
- return FALSE;
- }
-
- if (ghttp_process (request) != ghttp_done) {
- ghttp_close (request);
- return FALSE;
- }
-
- ghttp_close (request);
- return TRUE;
-}
-
-
-static gboolean
-http_post_simple_ammonite (const char *uri, const char *name, const char *value) {
- char *partial_url, *full_url;
- AmmoniteError error;
- gboolean result;
-
- partial_url = NULL;
- error = ammonite_http_url_for_eazel_url (uri, &partial_url);
-
- if (error != ERR_Success) {
- return FALSE;
- }
-
- full_url = g_strconcat ("http", partial_url, NULL);
-
- g_print ("debug: tranlated uri: `%s'\n", full_url);
-
- result = http_post_simple (full_url, name, value);
-
- g_free (full_url);
-
- return result;
-}
-
-static void
-impl_Trilobite_Eazel_Inventory__set_enabled (PortableServer_Servant servant,
- CORBA_boolean enabled,
- CORBA_Environment *ev)
-{
- impl_POA_Trilobite_Eazel_Inventory *service;
- char *body, *machine_name;
-
- service = (impl_POA_Trilobite_Eazel_Inventory *) servant;
-
- gconf_client_set_bool (service->object->details->gconf_client, KEY_GCONF_EAZEL_INVENTORY_ENABLED, enabled, NULL);
- /* FIXME: handle gconf errors */
-
- if (!enabled) {
- machine_name = ammonite_get_machine_id ();
- if (machine_name == NULL) {
- /* this shouldn't ever happen */
- return;
- }
-
- body = g_strdup_printf("<?xml version=\"1.0\"?><methodCall>"
- "<methodName>deleteProfile</methodName>"
- "<params><param><value><string>%s</string></value>"
- "</param></params></methodCall>", machine_name);
- g_free (machine_name);
-
- http_post_simple_ammonite (EAZEL_INVENTORY_DELETE_URI, NULL, body);
-
- g_free (body);
-
- eazel_inventory_clear_md5 ();
- }
-}
-
-
-
-
-static CORBA_char *
-impl_Trilobite_Eazel_Inventory__get_machine_id (PortableServer_Servant servant,
- CORBA_Environment *ev)
-{
- gchar *g_machine_name;
- CORBA_char *c_machine_name;
- impl_POA_Trilobite_Eazel_Inventory *service;
-
- service = (impl_POA_Trilobite_Eazel_Inventory *) servant;
-
- g_machine_name = ammonite_get_machine_id ();
-
- c_machine_name = CORBA_string_dup (g_machine_name);
-
- g_free (g_machine_name);
- return c_machine_name;
-}
-
-
-static void
-impl_Trilobite_Eazel_Inventory_upload (PortableServer_Servant servant,
- Trilobite_Eazel_InventoryUploadCallback callback,
- CORBA_Environment *caller_ev)
-{
- gboolean do_upload;
- GnomeVFSResult result;
- int file_size;
- char *file_contents;
- char *file_contents_good;
- char *path;
- CORBA_Environment ev;
- impl_POA_Trilobite_Eazel_Inventory *service;
-
- service = (impl_POA_Trilobite_Eazel_Inventory *) servant;
-
- CORBA_exception_init (&ev);
-
-
- if (!get_enabled (service->object)) {
- /* g_print ("not enabled\n"); */
- if (! CORBA_Object_is_nil (callback, &ev)) {
- Trilobite_Eazel_InventoryUploadCallback_done_uploading (callback, CORBA_FALSE, &ev);
- }
- CORBA_exception_free (&ev);
- return;
- }
-
- do_upload = eazel_gather_inventory ();
-
- if (!do_upload) {
- if (! CORBA_Object_is_nil (callback, &ev)) {
- Trilobite_Eazel_InventoryUploadCallback_done_uploading (callback, CORBA_TRUE, &ev);
- }
- CORBA_exception_free (&ev);
- return;
- }
-
- /* TODO: store new MD5 */
-
- path = eazel_inventory_local_path ();
- result = eel_read_entire_file (path, &file_size, &file_contents);
- g_free (path);
- if (result != GNOME_VFS_OK) {
- /* g_warning(_("can't open tempory file hell\n")); */
- if (! CORBA_Object_is_nil (callback, &ev)) {
- Trilobite_Eazel_InventoryUploadCallback_done_uploading (callback, CORBA_FALSE, &ev);
- }
- CORBA_exception_free (&ev);
- return;
- }
-
- file_contents_good = g_malloc (file_size+1);
- memcpy (file_contents_good, file_contents, file_size);
- file_contents_good[file_size] = '\0';
- g_free (file_contents);
- file_contents = file_contents_good;
-
- g_print("read file\n");
-
-
- if (!http_post_simple_ammonite (EAZEL_INVENTORY_UPLOAD_URI,
- UPLOAD_POST_NAME, file_contents)) {
- g_free (file_contents);
- if (! CORBA_Object_is_nil (callback, &ev)) {
- Trilobite_Eazel_InventoryUploadCallback_done_uploading (callback, CORBA_FALSE, &ev);
- }
- CORBA_exception_free (&ev);
- return;
- }
-
- g_free (file_contents);
-
- /* store the new MD5 */
- eazel_inventory_update_md5 ();
-
- if (! CORBA_Object_is_nil (callback, &ev)) {
- Trilobite_Eazel_InventoryUploadCallback_done_uploading (callback, CORBA_TRUE, &ev);
- }
-}
-
-
-/*
- This creates the epv for the object.
- Basically you just have to alloc a structure of the
- appropriate type (POA_Trilobite_Eazel_Inventory__epv in
- this case), and set the pointers for the method implementations.
- */
-POA_Trilobite_Eazel_Inventory__epv*
-eazel_inventory_service_get_epv()
-{
- POA_Trilobite_Eazel_Inventory__epv *epv;
-
- epv = g_new0 (POA_Trilobite_Eazel_Inventory__epv, 1);
-
- epv->_get_enabled = &impl_Trilobite_Eazel_Inventory__get_enabled;
- epv->_set_enabled = &impl_Trilobite_Eazel_Inventory__set_enabled;
- epv->_get_machine_id = &impl_Trilobite_Eazel_Inventory__get_machine_id;
- epv->upload = &impl_Trilobite_Eazel_Inventory_upload;
-
- return epv;
-}
-
-/*****************************************
- GTK+ object stuff
-*****************************************/
-
-/* This is the object finalize. It should clean up any
- data allocated by the object, and if possible, call
-the parent finalize */
-static void
-eazel_inventory_service_finalize (GtkObject *object)
-{
- EazelInventoryService *service;
-
- g_message ("in eazel_inventory_service_finalize");
-
- g_return_if_fail (object != NULL);
- g_return_if_fail (EAZEL_INVENTORY_SERVICE (object));
-
- service = EAZEL_INVENTORY_SERVICE (object);
-
- gtk_object_unref (GTK_OBJECT (service->details->gconf_client));
- g_free (service->details);
-
- /* Call parents destroy */
- if (GTK_OBJECT_CLASS (eazel_inventory_service_parent_class)->finalize) {
- GTK_OBJECT_CLASS (eazel_inventory_service_parent_class)->finalize (object);
- }
-
- g_message ("out eazel_inventory_service_finalize");
-}
-
-void eazel_inventory_service_unref (GtkObject *object)
-{
- g_message ("eazel_inventory_service_unref");
- g_return_if_fail (object != NULL);
- g_return_if_fail (EAZEL_INVENTORY_SERVICE (object));
- bonobo_object_unref (BONOBO_OBJECT (object));
-}
-
-static void
-eazel_inventory_service_class_initialize (EazelInventoryServiceClass *klass)
-{
- GtkObjectClass *object_class;
-
- object_class = (GtkObjectClass*)klass;
- object_class->finalize = eazel_inventory_service_finalize;
-
- eazel_inventory_service_parent_class = gtk_type_class (bonobo_object_get_type ());
-
- /* Here I get allocate and set up the vepv. This ensures that the
- servant_vepv will hold the proper bindings for the corba object for
- the eazel_inventory_service */
- klass->servant_vepv = g_new0 (POA_Trilobite_Eazel_Inventory__vepv,1);
- ((POA_Trilobite_Eazel_Inventory__vepv*)klass->servant_vepv)->_base_epv = &base_epv;
- ((POA_Trilobite_Eazel_Inventory__vepv*)klass->servant_vepv)->Bonobo_Unknown_epv = bonobo_object_get_epv ();
- ((POA_Trilobite_Eazel_Inventory__vepv*)klass->servant_vepv)->Trilobite_Eazel_Inventory_epv = eazel_inventory_service_get_epv ();
-
-}
-
-/*
- _corba_object does all the greasy corba building and whatnot.
- */
-static Trilobite_Eazel_Inventory
-eazel_inventory_service_create_corba_object (BonoboObject *service) {
- impl_POA_Trilobite_Eazel_Inventory *servant;
- CORBA_Environment ev;
-
- g_assert (service != NULL);
-
- CORBA_exception_init (&ev);
-
- /* Allocate the POA structure, using our extended version*/
- servant = (impl_POA_Trilobite_Eazel_Inventory*)g_new0 (PortableServer_Servant,1);
-
- /* Set the vepv to the vepv build in eazel_inventory_service_class_initialize */
- ((POA_Trilobite_Eazel_Inventory*) servant)->vepv = EAZEL_INVENTORY_SERVICE_CLASS ( GTK_OBJECT (service)->klass)->servant_vepv;
-
- /* Call the __init method. This is generated by the IDL compiler and
- the name of the method depends on the name of your corba object */
- POA_Trilobite_Eazel_Inventory__init (servant, &ev);
-
- /* Magic */
- ORBIT_OBJECT_KEY (((POA_Trilobite_Eazel_Inventory*)servant)->_private)->object = NULL;
-
- /* Check to see if things went well */
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_warning ("Cannot instantiate Trilobite_Eazel_Inventory corba object");
- g_free (servant);
- CORBA_exception_free (&ev);
- return CORBA_OBJECT_NIL;
- }
-
- CORBA_exception_free (&ev);
-
- /* Return the bonobo activation of the servant */
- return (Trilobite_Eazel_Inventory) bonobo_object_activate_servant (service, servant);
-}
-
-/*
- This is the EazelInventoryService instance initializer.
- Its responsibility is to create the corba object and
- build the bonobo_object structures using the corba object.
- */
-static void
-eazel_inventory_service_initialize (EazelInventoryService *service) {
- Trilobite_Eazel_Inventory corba_service;
-
- g_assert (service != NULL);
- g_assert (EAZEL_IS_INVENTORY_SERVICE (service));
-
- service->details = g_new0 (EazelInventoryServiceDetails, 1);
- service->details->gconf_client = gconf_client_get_default ();
-
- /* This builds the corba object */
- corba_service = eazel_inventory_service_create_corba_object (BONOBO_OBJECT (service));
-
- /* This sets the bonobo structures in service using the corba object */
- if (!bonobo_object_construct (BONOBO_OBJECT (service), corba_service)) {
- g_warning ("bonobo_object_construct failed");
- }
-}
-
-GtkType
-eazel_inventory_service_get_type() {
- static GtkType eazel_inventory_service_type = 0;
-
- g_message ("into eazel_inventory_service_get_type");
-
- /* First time it's called ? */
- if (!eazel_inventory_service_type)
- {
- static const GtkTypeInfo eazel_inventory_service_info =
- {
- "EazelInventroyService",
- sizeof (EazelInventoryService),
- sizeof (EazelInventoryServiceClass),
- (GtkClassInitFunc) eazel_inventory_service_class_initialize,
- (GtkObjectInitFunc) eazel_inventory_service_initialize,
- /* reserved_1 */ NULL,
- /* reserved_2 */ NULL,
- (GtkClassInitFunc) NULL,
- };
-
- /* Get a unique GtkType */
- eazel_inventory_service_type = gtk_type_unique (bonobo_object_get_type (), &eazel_inventory_service_info);
- }
-
- return eazel_inventory_service_type;
-}
-
-/*
- The _new method simply builds the service
- using gtk_object_new
-*/
-EazelInventoryService*
-eazel_inventory_service_new ()
-{
- EazelInventoryService *service;
-
- g_message ("in eazel_inventory_service_new");
-
- service = EAZEL_INVENTORY_SERVICE (gtk_object_new (EAZEL_TYPE_INVENTORY_SERVICE, NULL));
-
- return service;
-}
-
-
diff --git a/components/services/inventory/eazel-inventory-service.h b/components/services/inventory/eazel-inventory-service.h
deleted file mode 100644
index 02a458c26..000000000
--- a/components/services/inventory/eazel-inventory-service.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: Eskil Heyn Olsen <eskil@eazel.com>
- *
- */
-
-#ifndef EAZEL_INVENTORY_SERVICE_H
-#define EAZEL_INVENTORY_SERVICE_H
-
-#include <bonobo/bonobo-object.h>
-
-#include "eazel-inventory-service-interface.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-#define EAZEL_TYPE_INVENTORY_SERVICE (eazel_inventory_service_get_type ())
-#define EAZEL_INVENTORY_SERVICE(obj) (GTK_CHECK_CAST ((obj), EAZEL_TYPE_INVENTORY_SERVICE, EazelInventoryService))
-#define EAZEL_INVENTORY_SERVICE_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), EAZEL_TYPE_INVENTORY_SERVICE, EazelInventoryServiceClass))
-#define EAZEL_IS_INVENTORY_SERVICE(obj) (GTK_CHECK_TYPE ((obj), EAZEL_TYPE_INVENTORY_SERVICE))
-#define EAZEL_IS_INVENTORY_SERVICE_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), EAZEL_TYPE_INVENTORY_SERVICE)
-
-typedef struct EazelInventoryServiceDetails EazelInventoryServiceDetails;
-typedef struct EazelInventoryService EazelInventoryService;
-typedef struct EazelInventoryServiceClass EazelInventoryServiceClass;
-
-struct EazelInventoryService
-{
- BonoboObject base;
- EazelInventoryServiceDetails *details;
-};
-
-struct EazelInventoryServiceClass
-{
- BonoboObjectClass base;
-
- gpointer servant_vepv;
-};
-
-
-
-GtkType eazel_inventory_service_get_type (void);
-EazelInventoryService* eazel_inventory_service_new (void);
-POA_Trilobite_Eazel_Inventory__epv* eazel_inventory_service_get_epv (void);
-void eazel_inventory_service_unref (GtkObject *object);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* EAZEL_INVENTORY_SERVICE_H */
-
-
diff --git a/components/services/inventory/eazel-inventory-upload-callback.c b/components/services/inventory/eazel-inventory-upload-callback.c
deleted file mode 100644
index 734fe38f9..000000000
--- a/components/services/inventory/eazel-inventory-upload-callback.c
+++ /dev/null
@@ -1,207 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-
-/*
- * Copyright (C) 2001 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Maciej Stachowiak <mjs@eazel.com>
- */
-
-
-#include <config.h>
-#include "eazel-inventory-upload-callback.h"
-
-#include "eazel-inventory-service-interface.h"
-#include "eazel-inventory.h"
-
-#include <bonobo/bonobo-main.h>
-#include <gtk/gtksignal.h>
-#include <eel/eel-gtk-macros.h>
-
-struct EazelInventoryUploadCallbackDetails {
- EazelInventory *inventory;
- EazelInventoryDoneCallback callback;
- gpointer callback_data;
-};
-
-typedef struct {
- POA_Trilobite_Eazel_InventoryUploadCallback servant;
- EazelInventoryUploadCallback *bonobo_object;
-} impl_POA_Trilobite_Eazel_InventoryUploadCallback;
-
-
-
-static void
-impl_Trilobite_Eazel_InventoryUploadCallback_done_uploading (PortableServer_Servant servant,
- CORBA_boolean succeeded,
- CORBA_Environment *ev);
-
-static void
-impl_Trilobite_Eazel_InventoryUploadCallback__destroy (BonoboObject *object,
- PortableServer_Servant servant);
-
-static Trilobite_Eazel_InventoryUploadCallback
-impl_Trilobite_Eazel_InventoryUploadCallback__create (EazelInventoryUploadCallback *bonobo_object,
- CORBA_Environment *ev);
-
-
-POA_Trilobite_Eazel_InventoryUploadCallback__epv impl_Trilobite_Eazel_InventoryUploadCallback_epv =
-{
- NULL,
- &impl_Trilobite_Eazel_InventoryUploadCallback_done_uploading
-};
-
-
-static PortableServer_ServantBase__epv base_epv;
-
-static POA_Trilobite_Eazel_InventoryUploadCallback__vepv impl_Trilobite_Eazel_InventoryUploadCallback_vepv =
-{
- &base_epv,
- NULL,
- &impl_Trilobite_Eazel_InventoryUploadCallback_epv
-};
-
-
-
-static void eazel_inventory_upload_callback_initialize_class (EazelInventoryUploadCallbackClass *klass);
-static void eazel_inventory_upload_callback_initialize (EazelInventoryUploadCallback *server);
-static void eazel_inventory_upload_callback_destroy (GtkObject *object);
-
-
-EEL_DEFINE_CLASS_BOILERPLATE (EazelInventoryUploadCallback,
- eazel_inventory_upload_callback,
- BONOBO_OBJECT_TYPE)
-
-
-
-static void
-eazel_inventory_upload_callback_initialize_class (EazelInventoryUploadCallbackClass *klass)
-{
- GtkObjectClass *object_class;
-
- object_class = GTK_OBJECT_CLASS (klass);
-
- object_class->destroy = eazel_inventory_upload_callback_destroy;
-}
-
-static void
-eazel_inventory_upload_callback_initialize (EazelInventoryUploadCallback *server)
-{
- CORBA_Environment ev;
-
- CORBA_exception_init (&ev);
-
- server->details = g_new0 (EazelInventoryUploadCallbackDetails, 1);
-
- bonobo_object_construct
- (BONOBO_OBJECT (server),
- impl_Trilobite_Eazel_InventoryUploadCallback__create (server, &ev));
-
- CORBA_exception_free (&ev);
-}
-
-static void
-eazel_inventory_upload_callback_destroy (GtkObject *object)
-{
- EazelInventoryUploadCallback *callback;
-
- callback = EAZEL_INVENTORY_UPLOAD_CALLBACK (object);
- g_free (callback->details);
-
- EEL_CALL_PARENT (GTK_OBJECT_CLASS, destroy, (object));
-}
-
-
-EazelInventoryUploadCallback *
-eazel_inventory_upload_callback_new (EazelInventory *inventory,
- EazelInventoryDoneCallback callback,
- gpointer callback_data)
-{
- EazelInventoryUploadCallback *upload_callback;
-
- upload_callback = EAZEL_INVENTORY_UPLOAD_CALLBACK
- (gtk_object_new (EAZEL_TYPE_INVENTORY_UPLOAD_CALLBACK, NULL));
-
- upload_callback->details->inventory = inventory;
- upload_callback->details->callback = callback;
- upload_callback->details->callback_data = callback_data;
- gtk_object_ref (GTK_OBJECT (upload_callback));
- gtk_object_sink (GTK_OBJECT (upload_callback));
-
- return upload_callback;
-}
-
-
-
-
-
-static void
-impl_Trilobite_Eazel_InventoryUploadCallback_done_uploading (PortableServer_Servant servant,
- CORBA_boolean succeeded,
- CORBA_Environment *ev)
-{
- impl_POA_Trilobite_Eazel_InventoryUploadCallback *callback_servant;
-
- callback_servant = (impl_POA_Trilobite_Eazel_InventoryUploadCallback *) servant;
-
- (*callback_servant->bonobo_object->details->callback)
- (callback_servant->bonobo_object->details->inventory,
- succeeded,
- callback_servant->bonobo_object->details->callback_data);
-
- gtk_object_unref (GTK_OBJECT (callback_servant->bonobo_object));
-}
-
-static void
-impl_Trilobite_Eazel_InventoryUploadCallback__destroy (BonoboObject *object,
- PortableServer_Servant servant)
-{
- PortableServer_ObjectId *object_id;
- CORBA_Environment ev;
-
- CORBA_exception_init (&ev);
-
- object_id = PortableServer_POA_servant_to_id (bonobo_poa (), servant, &ev);
- PortableServer_POA_deactivate_object (bonobo_poa (), object_id, &ev);
- CORBA_free (object_id);
-
- object->servant = NULL;
-
- POA_Trilobite_Eazel_InventoryUploadCallback__fini (servant, &ev);
- g_free (servant);
-
- CORBA_exception_free (&ev);
-}
-
-static Trilobite_Eazel_InventoryUploadCallback
-impl_Trilobite_Eazel_InventoryUploadCallback__create (EazelInventoryUploadCallback *bonobo_object,
- CORBA_Environment *ev)
-{
- impl_POA_Trilobite_Eazel_InventoryUploadCallback *servant;
-
- impl_Trilobite_Eazel_InventoryUploadCallback_vepv.Bonobo_Unknown_epv = bonobo_object_get_epv ();
-
- servant = g_new0 (impl_POA_Trilobite_Eazel_InventoryUploadCallback, 1);
- servant->servant.vepv = &impl_Trilobite_Eazel_InventoryUploadCallback_vepv;
- POA_Trilobite_Eazel_InventoryUploadCallback__init ((PortableServer_Servant) servant, ev);
-
- gtk_signal_connect (GTK_OBJECT (bonobo_object), "destroy",
- GTK_SIGNAL_FUNC (impl_Trilobite_Eazel_InventoryUploadCallback__destroy), servant);
-
- servant->bonobo_object = bonobo_object;
- return bonobo_object_activate_servant (BONOBO_OBJECT (bonobo_object), servant);
-}
diff --git a/components/services/inventory/eazel-inventory-upload-callback.h b/components/services/inventory/eazel-inventory-upload-callback.h
deleted file mode 100644
index 13c5244c1..000000000
--- a/components/services/inventory/eazel-inventory-upload-callback.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-
-/*
- * Copyright (C) 2001 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Maciej Stachowiak <mjs@eazel.com>
- */
-
-#ifndef EAZEL_INVENTORY_UPLOAD_CALLBACK_H
-#define EAZEL_INVENTORY_UPLOAD_CALLBACK_H
-
-#include <bonobo/bonobo-object.h>
-
-#include "eazel-inventory.h"
-
-#define EAZEL_TYPE_INVENTORY_UPLOAD_CALLBACK (eazel_inventory_upload_callback_get_type ())
-#define EAZEL_INVENTORY_UPLOAD_CALLBACK(obj) (GTK_CHECK_CAST ((obj), EAZEL_TYPE_INVENTORY_UPLOAD_CALLBACK, EazelInventoryUploadCallback))
-#define EAZEL_INVENTORY_UPLOAD_CALLBACK_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), EAZEL_TYPE_INVENTORY_UPLOAD_CALLBACK, EazelInventoryUploadCallbackClass))
-#define EAZEL_IS_INVENTORY_UPLOAD_CALLBACK(obj) (GTK_CHECK_TYPE ((obj), EAZEL_TYPE_INVENTORY_UPLOAD_CALLBACK))
-#define EAZEL_IS_INVENTORY_UPLOAD_CALLBACK_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), EAZEL_TYPE_INVENTORY_UPLOAD_CALLBACK))
-
-typedef struct EazelInventoryUploadCallbackDetails EazelInventoryUploadCallbackDetails;
-
-typedef struct {
- BonoboObject parent;
- EazelInventoryUploadCallbackDetails *details;
-} EazelInventoryUploadCallback;
-
-typedef struct {
- BonoboObjectClass parent;
-} EazelInventoryUploadCallbackClass;
-
-/* GtkObject support */
-GtkType eazel_inventory_upload_callback_get_type (void);
-
-EazelInventoryUploadCallback *eazel_inventory_upload_callback_new (EazelInventory *inventory,
- EazelInventoryDoneCallback callback,
- gpointer callback_data);
-
-#endif /* EAZEL_INVENTORY_UPLOAD_CALLBACK_H */
diff --git a/components/services/inventory/eazel-inventory-utils.c b/components/services/inventory/eazel-inventory-utils.c
deleted file mode 100644
index e21237c2f..000000000
--- a/components/services/inventory/eazel-inventory-utils.c
+++ /dev/null
@@ -1,346 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-
-/* Nautilus
- * Copyright (C) 2000 Eazel, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * Authors: J Shane Culpepper <pepper@eazel.com>
- *
- * The code responsible for the client inventory manipulation.
- *
- */
-
-#include <config.h>
-
-#include "eazel-inventory-utils.h"
-#include "eazel-inventory-collect-hardware.h"
-#include "eazel-inventory-collect-software.h"
-
-#include <gdk/gdk.h>
-#include <stdio.h>
-#include <fcntl.h>
-#include <time.h>
-#include <unistd.h>
-#include <gnome.h>
-#include <gnome-xml/entities.h>
-#include <gnome-xml/parser.h>
-#include <gnome-xml/tree.h>
-#include <gconf/gconf.h>
-#include <gconf/gconf-engine.h>
-
-#include <libtrilobite/trilobite-md5-tools.h>
-#include <libtrilobite/trilobite-core-distribution.h>
-
-#define DEBUG_pepper 1
-
-#define DIGEST_GCONF_PATH "/apps/eazel-trilobite/inventory-digest"
-#define DIGEST_GCONF_KEY DIGEST_GCONF_PATH "/inventory_digest_value"
-#define PACKAGE_DB_MTIME_KEY DIGEST_GCONF_PATH "/package-db-mtime"
-
-static GConfEngine *conf_engine = NULL;
-
-/* called by atexit to close the gconf connection */
-static void
-eazel_inventory_gconf_done (void)
-{
- gconf_engine_unref (conf_engine);
-}
-
-
-/* make sure gconf is initialized */
-static void
-check_gconf_init (void)
-{
- GError *error = NULL;
-
- if (! gconf_is_initialized ()) {
- char *argv[] = { "trilobite", NULL };
-
- if (! gconf_init (1, argv, &error)) {
- g_assert (error != NULL);
- g_warning ("gconf init error: %s", error->message);
- g_error_free (error);
- }
- }
- if (conf_engine == NULL) {
- conf_engine = gconf_engine_get_default ();
- g_atexit (eazel_inventory_gconf_done);
- }
-}
-
-/* return the (optionally cached) software inventory */
-static xmlNodePtr
-get_software_inventory (void)
-{
- EazelPackageSystem *package_system;
- time_t previous_mtime, database_mtime;
- gboolean regenerate = TRUE;
- xmlNodePtr result = NULL;
- xmlDocPtr software_inventory_cache;
- GError *error;
- char *cache_path = g_strdup_printf
- ("%s/.nautilus/software-inventory-cache.xml",
- g_get_home_dir ());
-
- check_gconf_init ();
-
- previous_mtime = gconf_engine_get_int (conf_engine,
- PACKAGE_DB_MTIME_KEY, &error);
- package_system = eazel_package_system_new (NULL);
- database_mtime = eazel_package_system_database_mtime (package_system);
- gtk_object_unref (GTK_OBJECT (package_system));
-
- if (error == NULL || previous_mtime == 0) {
- g_print ("database mtime not set.\n");
- regenerate = TRUE;
- } else {
-
- if (database_mtime != previous_mtime) {
- g_print ("database has changed\n");
- regenerate = TRUE;
- } else {
- g_print ("database hasn't changed\n");
- regenerate = FALSE;
- }
- }
-
- gconf_engine_set_int (conf_engine,
- PACKAGE_DB_MTIME_KEY, database_mtime,
- &error);
-
- if (!regenerate) {
- g_print ("using cached software inventory\n");
- software_inventory_cache = xmlParseFile (cache_path);
- if (software_inventory_cache == NULL) {
- g_print ("couldn't load cache\n");
- regenerate = TRUE;
- } else {
- g_print ("duplicating cache\n");
- result = xmlCopyNode (software_inventory_cache->root,
- 1);
- g_print ("freeing cache\n");
- xmlFreeDoc (software_inventory_cache);
- }
- }
-
- if (regenerate) {
- g_print ("generating software inventory\n");
- result = eazel_inventory_collect_software ();
- software_inventory_cache = xmlNewDoc ("1.0");
- xmlDocSetRootElement (software_inventory_cache,
- xmlCopyNode (result, 1));
- xmlSaveFile (cache_path, software_inventory_cache);
- xmlFreeDoc (software_inventory_cache);
- }
-
- g_print ("returning result (%p)\n", result);
-
- return result;
-
-}
-
-/* create the configuration metafile and add package and hardware configuration info to it */
-static xmlDocPtr
-eazel_create_configuration_metafile (void)
-{
-
- /* create a new xml document */
- time_t current_time;
- xmlNodePtr container_node;
- char *time_string;
- char *host_name;
- xmlDocPtr configuration_metafile;
-
- configuration_metafile = xmlNewDoc ("1.0");
-
- check_gconf_init ();
- host_name = gconf_engine_get_string (conf_engine, KEY_GCONF_EAZEL_INVENTORY_MACHINE_NAME, NULL);
- if (host_name == NULL) {
- host_name = g_strdup ("");
- }
-
- container_node = xmlNewDocNode (configuration_metafile, NULL, "CONFIGURATION", NULL);
-
- configuration_metafile->root = container_node;
- time (&current_time);
- time_string = g_strdup (ctime (&current_time));
- time_string[strlen(time_string) - 1] = '\0';
- xmlSetProp (container_node, "computer", host_name);
- g_free (host_name);
-
-/* xmlSetProp (container_node, "date", time_string); */
- g_free (time_string);
-
- /* add the software info */
- xmlAddChild (container_node, get_software_inventory ());
-
- /* add the hardware info */
- /* Disable the hardware inventory for 1.0
- xmlAddChild (container_node, eazel_inventory_collect_hardware ());
- */
-
- return configuration_metafile;
-}
-
-
-/* get last digest value stored in gconf */
-static char *
-get_digest_from_gconf (const char *key)
-{
- GError *error;
- char *value;
-
- error = NULL;
- value = NULL;
-
- check_gconf_init ();
-
- value = gconf_engine_get_string (conf_engine, key, &error);
- if (error != NULL) {
- g_warning ("inventory cannot find key: '%s': %s", key, error->message);
- g_error_free (error);
- }
- return value;
-}
-
-
-/* The external function that will update the gconf digest value when
- * a successful inventory upload occurs.
- */
-
-gboolean
-update_gconf_inventory_digest (unsigned char value[16])
-{
- GError *error;
- char *full_key;
- const char *digest_string;
- gboolean return_val;
-
- return_val = TRUE;
-
- error = NULL;
-
- digest_string = trilobite_md5_get_string_from_md5_digest (value);
- check_gconf_init ();
- full_key = DIGEST_GCONF_KEY;
-
- gconf_engine_unset (conf_engine, full_key, &error);
- if (error != NULL) {
- g_warning ("Eazel Inventory: gconf could not delete key '%s' : %s",
- full_key, error->message);
- g_error_free (error);
- }
-
- gconf_engine_set_string (conf_engine, full_key, digest_string, &error);
- if (error != NULL) {
- g_warning ("inventory cannot add gconf key: '%s': %s", full_key, error->message);
- g_error_free (error);
- return_val = FALSE;
- }
-
- return return_val;
-}
-
-/* The main external api for inventory gathering. It will
- * generate the inventory.xml and check to see if the last
- * uploaded inventory is different. If the checksum differs
- * and xml file was generated successfully , the function
- * returns TRUE, otherwise FALSE.
- */
-gboolean
-eazel_gather_inventory (void)
-{
- char *inventory_file_name;
- xmlDocPtr inventory_doc;
- unsigned char md5_digest[16];
- unsigned char old_digest[16];
- char *digest_string;
- gboolean return_val;
-#ifdef DEBUG_pepper
- const char *digest_test;
-#endif
-
- return_val = FALSE;
-
- inventory_doc = eazel_create_configuration_metafile ();
- if (inventory_doc == NULL) {
- g_warning ("There was an error gathering your inventory");
- }
-
- /* save the configuration file */
- inventory_file_name = eazel_inventory_local_path();
- xmlSaveFile (inventory_file_name, inventory_doc);
- xmlFreeDoc (inventory_doc);
-
- /* generate a md5 digest of the new file and compare it to the last upload */
-
- trilobite_md5_get_digest_from_file (inventory_file_name, md5_digest);
-#ifdef DEBUG_pepper
- digest_test = trilobite_md5_get_string_from_md5_digest (md5_digest);
- g_print ("File: %s Digest: %s\n", inventory_file_name, digest_test);
-#endif
-
- digest_string = get_digest_from_gconf (DIGEST_GCONF_KEY);
- if (digest_string != NULL) {
- trilobite_md5_get_digest_from_md5_string (digest_string, old_digest);
-#ifdef DEBUG_pepper
- g_print ("Old GConf Digest value: %s\n", digest_string);
-#endif
-
- if (memcmp (old_digest, md5_digest, 16) != 0) {
- return_val = TRUE;
- }
- } else {
- return_val = TRUE;
- }
-
- g_free (inventory_file_name);
- g_free (digest_string);
-
- return return_val;
-
-}
-
-/* return the local path to store and retrieve the inventory XML from */
-gchar *eazel_inventory_local_path (void) {
- return g_strdup_printf ("%s/.nautilus/configuration.xml", g_get_home_dir ());
-}
-
-void eazel_inventory_update_md5 () {
- unsigned char md5_digest[16];
- char *inventory_file_name;
-
- inventory_file_name = eazel_inventory_local_path();
- trilobite_md5_get_digest_from_file (inventory_file_name, md5_digest);
- if (!update_gconf_inventory_digest (md5_digest)) {
- g_print ("failed to update digest\n");
- }
- g_free (inventory_file_name);
-
-}
-
-void eazel_inventory_clear_md5 () {
- GError *error = NULL;
-
- check_gconf_init ();
-
- gconf_engine_unset (conf_engine, DIGEST_GCONF_KEY, &error);
-
- if (error != NULL) {
- /* What, me worry? */
- g_error_free (error);
- }
-}
diff --git a/components/services/inventory/eazel-inventory-utils.h b/components/services/inventory/eazel-inventory-utils.h
deleted file mode 100644
index fcbf1a3a3..000000000
--- a/components/services/inventory/eazel-inventory-utils.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-
-/* Nautilus
- * Copyright (C) 2000 Eazel, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * Authors: J Shane Culpepper <pepper@eazel.com>
- * Ian McKellar <ian@eazel.com>
- *
- * This is the header file for the service inventory stuff
- *
- */
-
-#ifndef EAZEL_INVENTORY_UTILS_H
-#define EAZEL_INVENTORY_UTILS_H
-
-#include <gnome.h>
-#include "eazel-package-system.h"
-
-#define KEY_GCONF_EAZEL_INVENTORY_MACHINE_NAME "/apps/eazel-trilobite/machine_name"
-
-gboolean eazel_gather_inventory (void);
-gboolean update_gconf_inventory_digest (unsigned char value[16]);
-gchar *eazel_inventory_local_path (void);
-void eazel_inventory_update_md5 (void);
-void eazel_inventory_clear_md5 (void);
-
-#endif /* EAZEL_INVENTORY_UTILS_H */
diff --git a/components/services/inventory/eazel-inventory.c b/components/services/inventory/eazel-inventory.c
deleted file mode 100644
index bfc406b13..000000000
--- a/components/services/inventory/eazel-inventory.c
+++ /dev/null
@@ -1,177 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: 8; c-basic-offset: 8 -*- */
-
-/*
- * Copyright (C) 2001 Eazel, Inc.
- *
- * Nautilus is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * Nautilus is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-
-#include <config.h>
-#include "eazel-inventory.h"
-
-#include "eazel-inventory-upload-callback.h"
-#include "eazel-inventory-service-interface.h"
-#include <eel/eel-gtk-macros.h>
-#include <bonobo/bonobo-object-client.h>
-
-#define EAZEL_INVENTORY_IID "OAFIID:trilobite_inventory_service:eaae1152-1551-43d5-a764-52274131a9d5"
-
-struct EazelInventoryDetails {
- Trilobite_Eazel_Inventory corba_inventory;
-};
-
-
-static void eazel_inventory_initialize_class (EazelInventoryClass *klass);
-static void eazel_inventory_initialize (EazelInventory *factory);
-static void eazel_inventory_destroy (GtkObject *object);
-
-
-EEL_DEFINE_CLASS_BOILERPLATE (EazelInventory, eazel_inventory, GTK_TYPE_OBJECT)
-
-static void
-eazel_inventory_initialize_class (EazelInventoryClass *klass)
-{
- GtkObjectClass *object_class;
-
- object_class = (GtkObjectClass*) klass;
- object_class->destroy = eazel_inventory_destroy;
-}
-
-static void
-eazel_inventory_initialize (EazelInventory *factory)
-{
- BonoboObjectClient *object_client;
-
- factory->details = g_new0 (EazelInventoryDetails, 1);
-
- object_client = bonobo_object_activate (EAZEL_INVENTORY_IID, 0);
- if (object_client != NULL) {
- factory->details->corba_inventory = bonobo_object_query_interface
- (BONOBO_OBJECT (object_client), "IDL:Trilobite/Eazel/Inventory:1.0");
- bonobo_object_unref (BONOBO_OBJECT (object_client));
- }
-}
-
-
-static EazelInventory *global_eazel_inventory = NULL;
-
-static void
-eazel_inventory_destroy (GtkObject *object)
-{
- EazelInventory *inventory;
-
- inventory = EAZEL_INVENTORY (object);
-
- if (inventory->details->corba_inventory != CORBA_OBJECT_NIL) {
- bonobo_object_release_unref (inventory->details->corba_inventory, NULL);
- }
-
- g_free (inventory->details);
-
- global_eazel_inventory = NULL;
-}
-
-
-EazelInventory *
-eazel_inventory_get (void)
-{
- if (global_eazel_inventory == NULL) {
- global_eazel_inventory = EAZEL_INVENTORY
- (gtk_object_new (EAZEL_TYPE_INVENTORY, NULL));
- gtk_object_ref (GTK_OBJECT (global_eazel_inventory));
- gtk_object_sink (GTK_OBJECT (global_eazel_inventory));
- if (global_eazel_inventory->details->corba_inventory == CORBA_OBJECT_NIL) {
- gtk_object_unref (GTK_OBJECT (global_eazel_inventory));
- global_eazel_inventory = NULL;
- }
- } else {
- gtk_object_ref (GTK_OBJECT (global_eazel_inventory));
- }
-
-
-
- return global_eazel_inventory;
-}
-
-gboolean
-eazel_inventory_get_enabled (EazelInventory *inventory)
-{
- gboolean enabled;
- CORBA_Environment ev;
-
- CORBA_exception_init (&ev);
- enabled = Trilobite_Eazel_Inventory__get_enabled (inventory->details->corba_inventory,
- &ev);
- CORBA_exception_free (&ev);
-
- return enabled;
-}
-
-void
-eazel_inventory_set_enabled (EazelInventory *inventory,
- gboolean enabled)
-{
- CORBA_Environment ev;
-
- CORBA_exception_init (&ev);
- Trilobite_Eazel_Inventory__set_enabled (inventory->details->corba_inventory,
- enabled,
- &ev);
- CORBA_exception_free (&ev);
-}
-
-
-char *
-eazel_inventory_get_machine_id (EazelInventory *inventory)
-{
- CORBA_char *corba_id;
- gchar *g_id;
- CORBA_Environment ev;
-
- CORBA_exception_init (&ev);
- corba_id = Trilobite_Eazel_Inventory__get_machine_id (inventory->details->corba_inventory,
- &ev);
- CORBA_exception_free (&ev);
-
- g_id = g_strdup (corba_id);
- CORBA_free (corba_id);
-
- return g_id;
-}
-
-
-void
-eazel_inventory_upload (EazelInventory *inventory,
- EazelInventoryDoneCallback done_callback,
- gpointer callback_data)
-{
- EazelInventoryUploadCallback *callback;
- Trilobite_Eazel_InventoryUploadCallback corba_callback;
- CORBA_Environment ev;
-
- callback = eazel_inventory_upload_callback_new (inventory,
- done_callback,
- callback_data);
-
- corba_callback = bonobo_object_corba_objref (BONOBO_OBJECT (callback));
-
- CORBA_exception_init (&ev);
- Trilobite_Eazel_Inventory_upload (inventory->details->corba_inventory,
- corba_callback,
- &ev);
- CORBA_Object_release (corba_callback, &ev);
- CORBA_exception_free (&ev);
-}
diff --git a/components/services/inventory/eazel-inventory.h b/components/services/inventory/eazel-inventory.h
deleted file mode 100644
index 64977c494..000000000
--- a/components/services/inventory/eazel-inventory.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-
-/*
- * Copyright (C) 2001 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Maciej Stachowiak <mjs@eazel.com>
- */
-
-/* eazel-inventory.h - Inventory component.
- */
-
-#ifndef EAZEL_INVENTORY_H
-#define EAZEL_INVENTORY_H
-
-#include <gtk/gtkobject.h>
-
-#define EAZEL_TYPE_INVENTORY (eazel_inventory_get_type ())
-#define EAZEL_INVENTORY(obj) (GTK_CHECK_CAST ((obj), EAZEL_TYPE_INVENTORY, EazelInventory))
-#define EAZEL_INVENTORY_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), EAZEL_TYPE_INVENTORY, EazelInventoryClass))
-#define EAZEL_IS_INVENTORY(obj) (GTK_CHECK_TYPE ((obj), EAZEL_TYPE_INVENTORY))
-#define EAZEL_IS_INVENTORY_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), EAZEL_TYPE_INVENTORY))
-
-typedef struct EazelInventoryDetails EazelInventoryDetails;
-typedef struct EazelInventory EazelInventory;
-typedef struct EazelInventoryClass EazelInventoryClass;
-
-
-typedef void (*EazelInventoryDoneCallback) (EazelInventory *inventory,
- gboolean succeeded,
- gpointer callback_data);
-
-struct EazelInventory {
- GtkObject parent;
- EazelInventoryDetails *details;
-};
-
-struct EazelInventoryClass {
- GtkObjectClass parent;
-};
-
-/* GtkObject support */
-GtkType eazel_inventory_get_type (void);
-EazelInventory * eazel_inventory_get (void);
-gboolean eazel_inventory_get_enabled (EazelInventory * inventory);
-void eazel_inventory_set_enabled (EazelInventory * inventory,
- gboolean enabled);
-char * eazel_inventory_get_machine_id (EazelInventory * inventory);
-void eazel_inventory_upload (EazelInventory * inventory,
- EazelInventoryDoneCallback done_callback,
- gpointer callback_data);
-
-#endif /* EAZEL_INVENTORY_H */
diff --git a/components/services/inventory/main.c b/components/services/inventory/main.c
deleted file mode 100644
index 1d93276fb..000000000
--- a/components/services/inventory/main.c
+++ /dev/null
@@ -1,158 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: Eskil Heyn Olsen <eskil@eazel.com>
- *
- */
-
-#include <config.h>
-#include "eazel-inventory-service.h"
-
-#include <libgnome/gnome-i18n.h>
-#include <libgnomeui/gnome-init.h>
-#include <gnome.h>
-#include <libgnomevfs/gnome-vfs.h>
-#include <eel/eel-debug.h>
-#include <liboaf/liboaf.h>
-#include <bonobo.h>
-
-#include <gconf/gconf.h>
-
-#include <libtrilobite/libtrilobite.h>
-#include <libtrilobite/libtrilobite-service.h>
-
-#include <libtrilobite/libammonite.h> /* FIXME: crack */
-
-
-#define FACTORY_IID "OAFIID:trilobite_inventory_service_factory:ddc067a1-45e1-41ae-925a-bb6ecdaf3047"
-#define SERVICE_IID "OAFIID:trilobite_inventory_service:eaae1152-1551-43d5-a764-52274131a9d5"
-
-/*
- These are some generally needed objects to get CORBA connectivity
-*/
-CORBA_ORB orb;
-CORBA_Environment ev;
-
-static BonoboGenericFactory *factory;
-static int trilobites_active = 0;
-
-static void
-eazel_inventory_service_factory_destroy (GtkObject *object)
-{
- trilobites_active--;
-
- if (trilobites_active > 0) {
- return;
- }
-
- g_message ("in factory_destroy");
-
- bonobo_object_unref (BONOBO_OBJECT (factory));
-
- trilobite_main_quit ();
- g_message ("out factory_destroy");
-}
-
-static BonoboObject*
-eazel_inventory_service_factory (BonoboGenericFactory *this_factory,
- const gchar *oaf_id,
- gpointer data)
-{
- TrilobiteService *trilobite;
- EazelInventoryService *service;
-
- g_message ("in eazel_inventory_service_factory");
-
- if (strcmp (oaf_id, SERVICE_IID)) {
- return NULL;
- }
-
- trilobite = TRILOBITE_SERVICE (gtk_object_new (TRILOBITE_TYPE_SERVICE,
- "name", "Inventory",
- "version", "0.1",
- "vendor_name", "Eazel, inc.",
- "vendor_url", "http://www.eazel.com",
- "url", "http://www.eazel.com/inventory/info",
- "icon", "gnome-default-dlg.png",
- NULL));
-
- service = eazel_inventory_service_new ();
-
- trilobites_active++;
-
- trilobite_service_add_interface (trilobite, BONOBO_OBJECT (service));
-
- gtk_signal_connect (GTK_OBJECT (trilobite),
- "destroy",
- eazel_inventory_service_factory_destroy, NULL);
-
- return BONOBO_OBJECT (trilobite);
-}
-
-int
-main (int argc,
- char *argv[]) {
-
-#ifdef ENABLE_NLS /* sadly we need this ifdef because otherwise the following get empty statement warnings */
- bindtextdomain (PACKAGE, GNOMELOCALEDIR);
- textdomain (PACKAGE);
-#endif
-
- /* Disable session manager connection */
- gnome_client_disable_master_connection ();
-
- if (!trilobite_init ("trilobite-inventory-service", "0.1", "/tmp/eazel-inventory.log", NULL, argc, argv)) {
- g_error ("Could not initialize trilobite. :(");
- exit (1);
- }
- trilobite_set_debug_mode (FALSE);
-
- gnome_vfs_init ();
-
- /* FIXME: check for errors */
- if (!gconf_is_initialized ()) {
- gconf_init (argc, argv, NULL);
- }
-
- ammonite_init (bonobo_poa ());
-
- factory = bonobo_generic_factory_new_multi (FACTORY_IID,
- eazel_inventory_service_factory,
- NULL);
-
- if (factory == NULL) {
- g_error ("Could not register factory");
- }
-
- bonobo_activate();
-
- g_message ("%s ready", argv[0]);
-
- do {
- trilobite_main ();
- } while (trilobites_active > 0);
-
- g_message ("%s quitting", argv[0]);
-
- CORBA_exception_free (&ev);
-
- gnome_vfs_shutdown ();
-
- return 0;
-};
diff --git a/components/services/login/.cvsignore b/components/services/login/.cvsignore
deleted file mode 100644
index 282522db0..000000000
--- a/components/services/login/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-Makefile
-Makefile.in
diff --git a/components/services/login/Makefile.am b/components/services/login/Makefile.am
deleted file mode 100644
index c48d17697..000000000
--- a/components/services/login/Makefile.am
+++ /dev/null
@@ -1 +0,0 @@
-SUBDIRS = nautilus-view
diff --git a/components/services/login/nautilus-view/.cvsignore b/components/services/login/nautilus-view/.cvsignore
deleted file mode 100644
index da488f6fd..000000000
--- a/components/services/login/nautilus-view/.cvsignore
+++ /dev/null
@@ -1,6 +0,0 @@
-.deps
-.libs
-Makefile
-Makefile.in
-nautilus-change-password-view
-Nautilus_View_change-password.oaf
diff --git a/components/services/login/nautilus-view/Makefile.am b/components/services/login/nautilus-view/Makefile.am
deleted file mode 100644
index 1b0390592..000000000
--- a/components/services/login/nautilus-view/Makefile.am
+++ /dev/null
@@ -1,58 +0,0 @@
-NULL =
-
-INCLUDES = \
- -DPREFIX=\"$(prefix)\" \
- -DG_LOG_DOMAIN=\"trilobite-eazel-change-password\" \
- -I$(top_srcdir) \
- -I$(top_srcdir)/components/services/nautilus-dependent-shared \
- -I$(top_srcdir)/components/services/trilobite \
- -I$(top_srcdir)/components/services/trilobite/libtrilobite \
- -I$(top_builddir)/components/services/trilobite \
- -I$(top_builddir)/components/services/trilobite/libtrilobite \
- -I$(top_srcdir)/components/services/login/lib \
- -I$(top_builddir) \
- $(EEL_INCLUDEDIR) \
- $(LIBRSVG_INCLUDEDIR) \
- $(GNOMEUI_CFLAGS) \
- $(GCONF_CFLAGS) \
- -DGNOMELOCALEDIR=\""$(datadir)/locale"\" \
- $(VFS_CFLAGS) \
- $(XML_CFLAGS) \
- $(NULL)
-
-bin_PROGRAMS = \
- nautilus-change-password-view
-
-nautilus_change_password_view_SOURCES = \
- nautilus-change-password-view.h \
- nautilus-change-password-view.c \
- password-box.h \
- password-box.c \
- main.c \
- $(NULL)
-
-nautilus_change_password_view_LDADD = \
- $(top_builddir)/components/services/trilobite/libtrilobite/libtrilobite.la \
- $(top_builddir)/components/services/nautilus-dependent-shared/libnautilusdepshared.a \
- $(top_builddir)/libnautilus/libnautilus.la \
- $(EEL_LIBS) \
- $(LIBRSVG_LIBS) \
- $(BONOBO_LIBS) \
- $(GNOMEUI_LIBS) \
- $(GCONF_LIBS) \
- $(VFS_LIBS) \
- $(GHTTP_LIBS) \
- $(OAF_LIBS) \
- $(AMMONITE_LIBS) \
- $(NULL)
-
-oafdir = $(datadir)/oaf
-oaf_in_files = Nautilus_View_change-password.oaf.in
-oaf_DATA = $(oaf_in_files:.oaf.in=.oaf)
-
-@XML_I18N_MERGE_OAF_RULE@
-
-EXTRA_DIST = \
- $(oaf_DATA) \
- $(oaf_in_files) \
- $(NULL)
diff --git a/components/services/login/nautilus-view/Nautilus_View_change-password.oaf.in b/components/services/login/nautilus-view/Nautilus_View_change-password.oaf.in
deleted file mode 100644
index 4e6d96c2d..000000000
--- a/components/services/login/nautilus-view/Nautilus_View_change-password.oaf.in
+++ /dev/null
@@ -1,30 +0,0 @@
-<oaf_info>
-
-<oaf_server iid="OAFIID:nautilus_change_password_view_factory:a2839e69-53ae-47b8-b797-3e9335bacf22" type="exe" location="nautilus-change-password-view">
- <oaf_attribute name="repo_ids" type="stringv">
- <item value="IDL:GNOME/ObjectFactory:1.0"/>
- </oaf_attribute>
- <oaf_attribute name="name" type="string" _value="Nautilus Service Login View Factory"/>
- <oaf_attribute name="description" type="string" _value="Service Login View Component's Factory"/>
-</oaf_server>
-
-<oaf_server iid="OAFIID:nautilus_change_password_view:3a6345f0-d78d-4edc-9c3e-0c1be7426c44" type="factory" location="OAFIID:nautilus_change_password_view_factory:a2839e69-53ae-47b8-b797-3e9335bacf22">
- <oaf_attribute name="repo_ids" type="stringv">
- <item value="IDL:Bonobo/Unknown:1.0"/>
- <item value="IDL:Bonobo/Control:1.0"/>
- <item value="IDL:Nautilus/View:1.0"/>
- </oaf_attribute>
- <oaf_attribute name="name" type="string" _value="Eazel Change Password View"/>
- <oaf_attribute name="description" type="string" _value="Eazel Change Password view component"/>
- <oaf_attribute name="bonobo:additional_uri_schemes" type="stringv">
- <item value="eazel-pw"/>
- </oaf_attribute>
- <oaf_attribute name="bonobo:supported_mime_types" type="stringv">
- <item value="eazel-pw"/>
- </oaf_attribute>
- <oaf_attribute name="nautilus:view_as_name" type="string" _value="Change Password"/>
- <oaf_attribute name="nautilus:view_as_label" type="string" _value="View as Change Password"/>
- <oaf_attribute name="nautilus:viewer_label" type="string" _value="Change Password Viewer"/>
-</oaf_server>
-
-</oaf_info>
diff --git a/components/services/login/nautilus-view/main.c b/components/services/login/nautilus-view/main.c
deleted file mode 100644
index 24360d3c1..000000000
--- a/components/services/login/nautilus-view/main.c
+++ /dev/null
@@ -1,107 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Maciej Stachowiak <mjs@eazel.com>
- * J Shane Culpepper <pepper@eazel.com>
- */
-
-/* main.c - main function and object activation function for services
- content view component. */
-
-#include <config.h>
-#include <gnome.h>
-#include <liboaf/liboaf.h>
-#include <bonobo.h>
-#include "nautilus-change-password-view.h"
-
-static int object_count =0;
-
-static void
-change_password_object_destroyed (GtkObject *obj)
-{
- object_count--;
- if (object_count <= 0) {
- gtk_main_quit ();
- }
-}
-
-static BonoboObject*
-change_password_make_object (BonoboGenericFactory *factory,
- const char *iid,
- void *closure)
-{
-
- NautilusChangePasswordView *view;
- NautilusView *nautilus_view;
-
- if (strcmp (iid, "OAFIID:nautilus_change_password_view:3a6345f0-d78d-4edc-9c3e-0c1be7426c44")) {
- return NULL;
- }
-
- view = NAUTILUS_CHANGE_PASSWORD_VIEW (gtk_object_new (NAUTILUS_TYPE_CHANGE_PASSWORD_VIEW, NULL));
-
- object_count++;
-
- nautilus_view = nautilus_change_password_view_get_nautilus_view (view);
-
- gtk_signal_connect (GTK_OBJECT (nautilus_view), "destroy", change_password_object_destroyed, NULL);
-
- printf ("Returning new object %p\n", nautilus_view);
-
- return BONOBO_OBJECT (nautilus_view);
-}
-
-int
-main (int argc, char *argv[])
-{
- BonoboGenericFactory *factory;
- CORBA_ORB orb;
- char *registration_id;
-
-
-#ifdef ENABLE_NLS /* sadly we need this ifdef because otherwise the following get empty statement warnings */
- bindtextdomain (PACKAGE, GNOMELOCALEDIR);
- textdomain (PACKAGE);
-#endif
-
- /* Disable session manager connection */
- gnome_client_disable_master_connection ();
-
- gnomelib_register_popt_table (oaf_popt_options, oaf_get_popt_table_name ());
- orb = oaf_init (argc, argv);
-
- gnome_init ("nautilus-change-password-view", VERSION,
- argc, argv);
-
- gdk_rgb_init ();
-
- bonobo_init (orb, CORBA_OBJECT_NIL, CORBA_OBJECT_NIL);
-
- registration_id = oaf_make_registration_id ("OAFIID:nautilus_change_password_view_factory:a2839e69-53ae-47b8-b797-3e9335bacf22", getenv ("DISPLAY"));
- factory = bonobo_generic_factory_new_multi (registration_id,
- change_password_make_object,
- NULL);
- g_free (registration_id);
-
- do {
- bonobo_main ();
- } while (object_count > 0);
-
- return 0;
-}
diff --git a/components/services/login/nautilus-view/nautilus-change-password-view.c b/components/services/login/nautilus-view/nautilus-change-password-view.c
deleted file mode 100644
index 1c5ad85cc..000000000
--- a/components/services/login/nautilus-view/nautilus-change-password-view.c
+++ /dev/null
@@ -1,600 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: J Shane Culpepper <pepper@eazel.com>
- * Andy Hertzfeld <andy@eazel.com>
- * Ramiro Estrugo <ramiro@eazel.com>
- * Robey Pointer <robey@eazel.com>
- */
-
-#include <config.h>
-
-#include "nautilus-change-password-view.h"
-#include "password-box.h"
-#include "eazel-services-header.h"
-#include "eazel-services-extensions.h"
-
-#include <gnome.h>
-#include <gnome-xml/tree.h>
-#include <libgnomevfs/gnome-vfs-utils.h>
-#include <eel/eel-background.h>
-#include <eel/eel-gtk-extensions.h>
-#include <eel/eel-gtk-macros.h>
-#include <eel/eel-glib-extensions.h>
-#include <eel/eel-string.h>
-#include <eel/eel-label.h>
-#include <eel/eel-image.h>
-#include <eel/eel-gdk-extensions.h>
-#include <eel/eel-viewport.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <libtrilobite/eazelproxy.h>
-#include <libtrilobite/libammonite.h>
-#include <libtrilobite/libtrilobite.h>
-#include <liboaf/liboaf.h>
-#include <bonobo/bonobo-main.h>
-
-
-typedef enum {
- PENDING_NONE,
- PENDING_LOGIN,
-} PendingOperation;
-
-/* A NautilusContentView's private information. */
-struct _NautilusChangePasswordViewDetails {
- char *uri;
- NautilusView *nautilus_view;
- GtkWidget *viewport;
- GtkWidget *form;
- GtkWidget *form_title;
- PasswordBox *account_name;
- PasswordBox *account_old_password;
- PasswordBox *account_new_password;
- PasswordBox *account_repeat_password;
- GtkWidget *change_password_button;
- GtkWidget *maintenance_button;
- PendingOperation pending;
-
- /* for talking to the proxy (change_password/logout/pass-change) */
- EazelProxy_UserControl user_control;
- EazelProxy_AuthnCallback authn_callback;
-};
-
-#define SERVICE_SUMMARY_LOCATION "eazel:"
-#define SERVICE_HELP_LOCATION "eazel-services://anonymous/account/login/lost_pwd_form"
-
-static void nautilus_change_password_view_initialize_class (NautilusChangePasswordViewClass *klass);
-static void nautilus_change_password_view_initialize (NautilusChangePasswordView *view);
-static void nautilus_change_password_view_destroy (GtkObject *object);
-static void change_password_load_location_callback (NautilusView *nautilus_view,
- const char *location,
- NautilusChangePasswordView *view);
-static void generate_change_password_form (NautilusChangePasswordView *view);
-static void entry_changed_cb (GtkWidget *entry,
- NautilusChangePasswordView *view);
-static void change_password_button_cb (GtkWidget *button,
- NautilusChangePasswordView *view);
-static void maintenance_button_cb (GtkWidget *button,
- NautilusChangePasswordView *view);
-
-EEL_DEFINE_CLASS_BOILERPLATE (NautilusChangePasswordView, nautilus_change_password_view, GTK_TYPE_EVENT_BOX)
-
-
-static char *
-user_logged_in (NautilusChangePasswordView *view)
-{
- CORBA_Environment ev;
- EazelProxy_User *user;
- char *username;
-
- if (view->details->user_control == CORBA_OBJECT_NIL) {
- return NULL;
- }
-
- CORBA_exception_init (&ev);
- user = EazelProxy_UserControl_get_default_user (view->details->user_control, &ev);
- if (ev._major != CORBA_NO_EXCEPTION) {
- username = NULL;
- } else {
- username = g_strdup (user->user_name);
- CORBA_free (user);
- }
- CORBA_exception_free (&ev);
-
- return username;
-}
-
-/* meant to be called from a timeout */
-static gboolean
-run_away_timer (NautilusChangePasswordView *view)
-{
- nautilus_view_open_location_in_this_window (view->details->nautilus_view, SERVICE_SUMMARY_LOCATION);
- return FALSE; /* don't run this timer again */
-}
-
-static void
-generate_change_password_form (NautilusChangePasswordView *view)
-{
- GtkWidget *hbox;
- GtkWidget *vbox_buttons, *hbox_buttons;
- GtkWidget *maintenance_button;
- GtkWidget *title;
- GtkWidget *filler;
- GtkWidget *pane;
- GtkWidget *subform;
- char *username;
- EelBackground *background;
-
- /* allocate a box to hold everything */
- view->details->form = gtk_vbox_new (FALSE, 0);
- gtk_container_add (GTK_CONTAINER (view), view->details->form);
- gtk_widget_show (view->details->form);
-
- /* Setup the title */
- title = eazel_services_header_title_new (_("Please Change Your Eazel Password"));
- gtk_box_pack_start (GTK_BOX (view->details->form), title, FALSE, FALSE, 0);
- gtk_widget_show (title);
-
- /* make an opportunistic scrollbar panel for it all */
- pane = gtk_scrolled_window_new (NULL, NULL);
- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (pane), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
- view->details->viewport = eel_viewport_new (NULL, NULL);
- gtk_viewport_set_shadow_type (GTK_VIEWPORT (view->details->viewport), GTK_SHADOW_NONE);
- gtk_container_add (GTK_CONTAINER (pane), view->details->viewport);
- gtk_widget_show (view->details->viewport);
- gtk_container_add (GTK_CONTAINER (view->details->form), pane);
- gtk_widget_show (pane);
- background = eel_get_widget_background (GTK_WIDGET (view->details->viewport));
- eel_background_set_color (background, EAZEL_SERVICES_BACKGROUND_COLOR_SPEC);
-
- subform = gtk_vbox_new (FALSE, 0);
- gtk_container_add (GTK_CONTAINER (view->details->viewport), subform);
- gtk_widget_show (subform);
-
- /* add password boxes */
- view->details->account_name = password_box_new (_("User Name:"));
- gtk_widget_show (view->details->account_name->table);
- hbox = gtk_hbox_new (FALSE, 0);
- gtk_box_pack_start (GTK_BOX (hbox), view->details->account_name->table, TRUE, TRUE, 75);
- gtk_widget_show (hbox);
- gtk_box_pack_start (GTK_BOX (subform), hbox, FALSE, FALSE, 6);
-
- view->details->account_old_password = password_box_new (_("Current Password:"));
- gtk_widget_show (view->details->account_old_password->table);
- hbox = gtk_hbox_new (FALSE, 0);
- gtk_box_pack_start (GTK_BOX (hbox), view->details->account_old_password->table, TRUE, TRUE, 75);
- gtk_widget_show (hbox);
- gtk_box_pack_start (GTK_BOX (subform), hbox, FALSE, FALSE, 6);
-
- view->details->account_new_password = password_box_new (_("New Password:"));
- gtk_widget_show (view->details->account_new_password->table);
- hbox = gtk_hbox_new (FALSE, 0);
- gtk_box_pack_start (GTK_BOX (hbox), view->details->account_new_password->table, TRUE, TRUE, 75);
- gtk_widget_show (hbox);
- gtk_box_pack_start (GTK_BOX (subform), hbox, FALSE, FALSE, 6);
-
- view->details->account_repeat_password = password_box_new (_("Confirm New Password:"));
- gtk_widget_show (view->details->account_repeat_password->table);
- hbox = gtk_hbox_new (FALSE, 0);
- gtk_box_pack_start (GTK_BOX (hbox), view->details->account_repeat_password->table, TRUE, TRUE, 75);
- gtk_widget_show (hbox);
- gtk_box_pack_start (GTK_BOX (subform), hbox, FALSE, FALSE, 6);
-
- /* set up text entries */
- username = user_logged_in (view);
- if (username != NULL) {
- gtk_entry_set_text (GTK_ENTRY (view->details->account_name->entry), username);
- gtk_entry_set_editable (GTK_ENTRY (view->details->account_name->entry), FALSE);
- gtk_widget_set_sensitive (view->details->account_name->entry, FALSE);
- g_free (username);
- }
-
- gtk_entry_set_visibility (GTK_ENTRY (view->details->account_old_password->entry), FALSE);
- gtk_entry_set_visibility (GTK_ENTRY (view->details->account_new_password->entry), FALSE);
- gtk_entry_set_visibility (GTK_ENTRY (view->details->account_repeat_password->entry), FALSE);
-
- /* attach a changed signal to the 2 entry fields,
- * so we can enable the button when something is typed into both fields */
- gtk_signal_connect (GTK_OBJECT (view->details->account_name->entry),
- "changed", GTK_SIGNAL_FUNC (entry_changed_cb), view);
- gtk_signal_connect (GTK_OBJECT (view->details->account_old_password->entry),
- "changed", GTK_SIGNAL_FUNC (entry_changed_cb), view);
- gtk_signal_connect (GTK_OBJECT (view->details->account_new_password->entry),
- "changed", GTK_SIGNAL_FUNC (entry_changed_cb), view);
- gtk_signal_connect (GTK_OBJECT (view->details->account_repeat_password->entry),
- "changed", GTK_SIGNAL_FUNC (entry_changed_cb), view);
-
- /* allocate the command buttons - first the change_password button */
- view->details->change_password_button = gtk_button_new_with_label (_("Change my password"));
- gtk_signal_connect (GTK_OBJECT (view->details->change_password_button), "clicked",
- GTK_SIGNAL_FUNC (change_password_button_cb), view);
- gtk_widget_set_sensitive (view->details->change_password_button, FALSE);
- gtk_widget_show (view->details->change_password_button);
-
- /* now allocate the account maintenance button */
- maintenance_button = gtk_button_new_with_label (_("I need assistance"));
- gtk_signal_connect (GTK_OBJECT (maintenance_button), "clicked",
- GTK_SIGNAL_FUNC (maintenance_button_cb), view);
- gtk_widget_show (maintenance_button);
-
- vbox_buttons = gtk_vbox_new (TRUE, 0);
- gtk_box_pack_start (GTK_BOX (vbox_buttons), view->details->change_password_button, FALSE, FALSE, 4);
- gtk_box_pack_start (GTK_BOX (vbox_buttons), maintenance_button, FALSE, FALSE, 4);
- gtk_widget_show (vbox_buttons);
-
- hbox_buttons = gtk_hbox_new (FALSE, 0);
- filler = gtk_label_new ("");
- gtk_widget_show (filler);
- gtk_box_pack_start (GTK_BOX (hbox_buttons), filler, TRUE, TRUE, 0);
- gtk_box_pack_start (GTK_BOX (hbox_buttons), vbox_buttons, FALSE, FALSE, 75);
- gtk_widget_show (hbox_buttons);
-
- gtk_box_pack_start (GTK_BOX (subform), hbox_buttons, FALSE, FALSE, 0);
-}
-
-/* callback to enable/disable the change_password button when something is typed in the field */
-static void
-entry_changed_cb (GtkWidget *entry, NautilusChangePasswordView *view)
-{
- char *user_name;
- char *old_password;
- char *new_password;
- char *repeat_password;
- gboolean button_enabled;
-
- user_name = gtk_entry_get_text (GTK_ENTRY (view->details->account_name->entry));
- old_password = gtk_entry_get_text (GTK_ENTRY (view->details->account_old_password->entry));
- new_password = gtk_entry_get_text (GTK_ENTRY (view->details->account_new_password->entry));
- repeat_password = gtk_entry_get_text (GTK_ENTRY (view->details->account_repeat_password->entry));
-
- button_enabled = user_name && strlen (user_name) && old_password && strlen (old_password) &&
- new_password && strlen (new_password) && repeat_password && strlen (repeat_password) &&
- (view->details->pending == PENDING_NONE);
- gtk_widget_set_sensitive (view->details->change_password_button, button_enabled);
-}
-
-
-static void
-authn_succeeded (const EazelProxy_User *user, gpointer state, CORBA_Environment *ev)
-{
- NautilusChangePasswordView *view;
- GtkWidget *dialog;
- GtkWidget *toplevel;
- char *text;
-
- view = NAUTILUS_CHANGE_PASSWORD_VIEW (state);
- g_assert (view->details->pending == PENDING_LOGIN);
-
- view->details->pending = PENDING_NONE;
- trilobite_debug ("ChangePassword succeeeded!");
-
- password_box_show_error (view->details->account_old_password, FALSE);
- password_box_show_error (view->details->account_new_password, FALSE);
- password_box_show_error (view->details->account_repeat_password, FALSE);
-
- ammonite_auth_callback_wrapper_free (bonobo_poa (), view->details->authn_callback);
- bonobo_object_unref (BONOBO_OBJECT (view->details->nautilus_view));
-
- text = _("Your password has been changed!");
- toplevel = gtk_widget_get_toplevel (view->details->form);
- if (GTK_IS_WINDOW (toplevel)) {
- dialog = gnome_ok_dialog_parented (text, GTK_WINDOW (toplevel));
- } else {
- dialog = gnome_ok_dialog (text);
- }
- gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
- gnome_dialog_run_and_close (GNOME_DIALOG (dialog));
-
- gtk_timeout_add (0, (GtkFunction)run_away_timer, view);
-}
-
-static void
-authn_failed (const EazelProxy_User *user, const EazelProxy_AuthnFailInfo *info, gpointer state,
- CORBA_Environment *ev)
-{
- NautilusChangePasswordView *view;
- gboolean current_bad = FALSE;
- gboolean new_bad = FALSE;
- char *text = NULL;
-
- view = NAUTILUS_CHANGE_PASSWORD_VIEW (state);
- g_assert (view->details->pending == PENDING_LOGIN);
-
- view->details->pending = PENDING_NONE;
- gtk_widget_set_sensitive (view->details->change_password_button, TRUE);
-
- switch (info->code) {
- case EAZELPROXY_PASSWORD_CHANGE_BAD_ORIGINAL:
- current_bad = TRUE;
- text = _("I'm sorry, but that password\nis incorrect. Please try again.");
- break;
- case EAZELPROXY_PASSWORD_CHANGE_TOO_SHORT:
- new_bad = TRUE;
- text = _("I'm sorry, but your new password\nmust be at least six (6) characters long.\nPlease try another one.");
- break;
- case EAZELPROXY_PASSWORD_CHANGE_TOO_LONG:
- /* shouldn't happen */
- new_bad = TRUE;
- text = _("I'm sorry, but your new password\ncan't be ridiculously long.\nPlease try another one.");
- break;
- case EAZELPROXY_PASSWORD_CHANGE_BAD_MATCH:
- /* shouldn't happen */
- new_bad = TRUE;
- text = "foo";
- break;
- case EAZELPROXY_PASSWORD_CHANGE_TOO_BLAND:
- new_bad = TRUE;
- text = _("I'm sorry, but your new password must\ncontain letters along with at least one\nnumber or symbol. Please try another one.");
- break;
- default:
- current_bad = TRUE;
- text = _("I'm sorry, but I hit an unexpected\nerror. Please try again, with\ndifferent passwords.");
- break;
- }
-
- if (current_bad) {
- password_box_set_error_text (view->details->account_old_password, text);
- password_box_show_error (view->details->account_old_password, TRUE);
- password_box_show_error (view->details->account_new_password, FALSE);
- password_box_show_error (view->details->account_repeat_password, FALSE);
- } else if (new_bad) {
- password_box_set_error_text (view->details->account_new_password, text);
- password_box_show_error (view->details->account_old_password, FALSE);
- password_box_show_error (view->details->account_new_password, TRUE);
- password_box_show_error (view->details->account_repeat_password, FALSE);
- } else {
- password_box_show_error (view->details->account_old_password, FALSE);
- password_box_show_error (view->details->account_new_password, FALSE);
- password_box_show_error (view->details->account_repeat_password, FALSE);
- }
-
- if (current_bad) {
- gtk_entry_set_text (GTK_ENTRY (view->details->account_old_password->entry), "");
- gtk_widget_grab_focus (view->details->account_old_password->entry);
- } else {
- gtk_entry_set_text (GTK_ENTRY (view->details->account_old_password->entry),
- gtk_entry_get_text (GTK_ENTRY (view->details->account_old_password->entry)));
- gtk_widget_grab_focus (view->details->account_new_password->entry);
- }
- gtk_entry_set_text (GTK_ENTRY (view->details->account_new_password->entry), "");
- gtk_entry_set_text (GTK_ENTRY (view->details->account_repeat_password->entry), "");
-
- trilobite_debug ("ChangePassword failed: code = %ld, result = '%s'", (long)info->code, info->http_result);
-
- ammonite_auth_callback_wrapper_free (bonobo_poa (), view->details->authn_callback);
- bonobo_object_unref (BONOBO_OBJECT (view->details->nautilus_view));
-
- if (info->code == EAZELPROXY_AUTHN_FAIL_SERVER) {
- /* not sure what to do here. apparently there's no way to start over. */
- nautilus_view_open_location_in_this_window
- (view->details->nautilus_view, SERVICE_SUMMARY_LOCATION);
- }
-}
-
-
-static void
-start_change_password (NautilusChangePasswordView *view, const char *username, const char *password, const char *new_password)
-{
- EazelProxy_AuthnInfo *authinfo;
- CORBA_Environment ev;
- CORBA_char *corba_new_password;
- char *text;
-
- AmmoniteAuthCallbackWrapperFuncs callback = {
- authn_succeeded,
- authn_failed
- };
-
- CORBA_exception_init (&ev);
- g_assert (view->details->pending == PENDING_NONE);
-
- if (view->details->user_control == CORBA_OBJECT_NIL) {
- /* can't do anything. */
- return;
- }
-
- view->details->authn_callback = ammonite_auth_callback_wrapper_new (bonobo_poa (), &callback, view);
- authinfo = EazelProxy_AuthnInfo__alloc ();
- authinfo->username = CORBA_string_dup (username);
- authinfo->password = CORBA_string_dup (password);
- authinfo->services_redirect_uri = CORBA_string_dup ("");
- authinfo->services_login_path = CORBA_string_dup ("");
-
- /* ref myself until the callback returns */
- bonobo_object_ref (BONOBO_OBJECT (view->details->nautilus_view));
-
- view->details->pending = PENDING_LOGIN;
- corba_new_password = CORBA_string_dup (new_password);
- EazelProxy_UserControl_set_new_user_password (view->details->user_control, authinfo, corba_new_password,
- view->details->authn_callback, &ev);
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_warning ("Exception during EazelProxy change_password: %s", CORBA_exception_id (&ev));
- view->details->pending = PENDING_NONE;
- bonobo_object_unref (BONOBO_OBJECT (view->details->nautilus_view));
-
- text = _("I'm sorry, but I got an unexpected\nerror. Please try again.");
- password_box_set_error_text (view->details->account_old_password, text);
- password_box_show_error (view->details->account_old_password, TRUE);
- password_box_show_error (view->details->account_new_password, FALSE);
- password_box_show_error (view->details->account_repeat_password, FALSE);
- gtk_widget_grab_focus (view->details->account_old_password->entry);
-
- gtk_entry_set_text (GTK_ENTRY (view->details->account_old_password->entry), "");
- gtk_entry_set_text (GTK_ENTRY (view->details->account_new_password->entry), "");
- gtk_entry_set_text (GTK_ENTRY (view->details->account_repeat_password->entry), "");
- gtk_widget_set_sensitive (view->details->change_password_button, FALSE);
- }
-
- CORBA_exception_free (&ev);
-}
-
-
-/* callback to handle the change_password button. Right now only dumps a simple feedback message. */
-static void
-change_password_button_cb (GtkWidget *button, NautilusChangePasswordView *view)
-{
- char *user_name;
- char *old_password;
- char *new_password;
- char *repeat_password;
- char *text;
-
- user_name = gtk_entry_get_text (GTK_ENTRY (view->details->account_name->entry));
- old_password = gtk_entry_get_text (GTK_ENTRY (view->details->account_old_password->entry));
- new_password = gtk_entry_get_text (GTK_ENTRY (view->details->account_new_password->entry));
- repeat_password = gtk_entry_get_text (GTK_ENTRY (view->details->account_repeat_password->entry));
-
- if (strcmp (new_password, repeat_password) != 0) {
- text = _("I'm sorry, but your new password\nwasn't typed the same way twice.\nPlease try again.");
- password_box_set_error_text (view->details->account_new_password, text);
- password_box_show_error (view->details->account_old_password, FALSE);
- password_box_show_error (view->details->account_new_password, TRUE);
- password_box_show_error (view->details->account_repeat_password, FALSE);
- gtk_widget_grab_focus (view->details->account_new_password->entry);
-
- gtk_entry_set_text (GTK_ENTRY (view->details->account_new_password->entry), "");
- gtk_entry_set_text (GTK_ENTRY (view->details->account_repeat_password->entry), "");
- gtk_widget_set_sensitive (view->details->change_password_button, FALSE);
- return;
- }
-
- gtk_widget_set_sensitive (view->details->change_password_button, FALSE);
- start_change_password (view, user_name, old_password, new_password);
-}
-
-/* callback to point account maintenance button to webpage */
-static void
-maintenance_button_cb (GtkWidget *button, NautilusChangePasswordView *view)
-{
-
- nautilus_view_open_location_in_this_window
- (view->details->nautilus_view, SERVICE_HELP_LOCATION);
-
-}
-
-/* utility routine to go to another uri */
-
-static void
-nautilus_change_password_view_initialize_class (NautilusChangePasswordViewClass *klass)
-{
-
- GtkObjectClass *object_class;
- GtkWidgetClass *widget_class;
-
- object_class = GTK_OBJECT_CLASS (klass);
- widget_class = GTK_WIDGET_CLASS (klass);
- parent_class = gtk_type_class (gtk_event_box_get_type ());
- object_class->destroy = nautilus_change_password_view_destroy;
-}
-
-static void
-nautilus_change_password_view_initialize (NautilusChangePasswordView *view)
-{
- EelBackground *background;
- CORBA_Environment ev;
-
- view->details = g_new0 (NautilusChangePasswordViewDetails, 1);
- view->details->nautilus_view = nautilus_view_new (GTK_WIDGET (view));
- view->details->pending = PENDING_NONE;
- gtk_signal_connect (GTK_OBJECT (view->details->nautilus_view),
- "load_location",
- GTK_SIGNAL_FUNC (change_password_load_location_callback),
- view);
-
- background = eel_get_widget_background (GTK_WIDGET (view));
- eel_background_set_color (background, EAZEL_SERVICES_BACKGROUND_COLOR_SPEC);
-
- CORBA_exception_init (&ev);
- view->details->user_control = (EazelProxy_UserControl) oaf_activate_from_id (IID_EAZELPROXY, 0, NULL, &ev);
- if ( CORBA_NO_EXCEPTION != ev._major ) {
- /* FIXME bugzilla.eazel.com 2740: user should be
- * warned that Ammonite may not be installed
- */
-
- g_warning ("Couldn't instantiate eazel-proxy");
- view->details->user_control = CORBA_OBJECT_NIL;
- }
- CORBA_exception_free (&ev);
-
- gtk_widget_show (GTK_WIDGET (view));
-}
-
-static void
-nautilus_change_password_view_destroy (GtkObject *object)
-{
- NautilusChangePasswordView *view;
- CORBA_Environment ev;
-
- CORBA_exception_init (&ev);
-
- view = NAUTILUS_CHANGE_PASSWORD_VIEW (object);
-
- if (view->details->uri) {
- g_free (view->details->uri);
- }
- CORBA_Object_release (view->details->user_control, &ev);
- g_free (view->details);
-
- CORBA_exception_free (&ev);
-
- EEL_CALL_PARENT (GTK_OBJECT_CLASS, destroy, (object));
-}
-
-NautilusView *
-nautilus_change_password_view_get_nautilus_view (NautilusChangePasswordView *view)
-{
-
- return view->details->nautilus_view;
-
-}
-
-void
-nautilus_change_password_view_load_uri (NautilusChangePasswordView *view,
- const char *uri)
-{
-
- /* dispose of any old uri and copy in the new one */
- g_free (view->details->uri);
- view->details->uri = g_strdup (uri);
-
- /* dispose of any old form that was installed */
- if (view->details->form != NULL) {
- gtk_widget_destroy (view->details->form);
- view->details->form = NULL;
- }
-
- generate_change_password_form (view);
-}
-
-static void
-change_password_load_location_callback (NautilusView *nautilus_view,
- const char *location,
- NautilusChangePasswordView *view)
-{
-
- g_assert (nautilus_view == view->details->nautilus_view);
-
- nautilus_view_report_load_underway (nautilus_view);
-
- nautilus_change_password_view_load_uri (view, location);
-
- nautilus_view_report_load_complete (nautilus_view);
-}
-
diff --git a/components/services/login/nautilus-view/nautilus-change-password-view.h b/components/services/login/nautilus-view/nautilus-change-password-view.h
deleted file mode 100644
index 5fefc023f..000000000
--- a/components/services/login/nautilus-view/nautilus-change-password-view.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: J Shane Culpepper
- */
-
-#ifndef NAUTILUS_CHANGE_PASSWORD_VIEW_H
-#define NAUTILUS_CHANGE_PASSWORD_VIEW_H
-
-#include <libnautilus/nautilus-view.h>
-#include <gtk/gtk.h>
-
-typedef struct _NautilusChangePasswordView NautilusChangePasswordView;
-typedef struct _NautilusChangePasswordViewClass NautilusChangePasswordViewClass;
-
-#define NAUTILUS_TYPE_CHANGE_PASSWORD_VIEW (nautilus_change_password_view_get_type ())
-#define NAUTILUS_CHANGE_PASSWORD_VIEW(obj) (GTK_CHECK_CAST ((obj), NAUTILUS_TYPE_CHANGE_PASSWORD_VIEW, NautilusChangePasswordView))
-#define NAUTILUS_CHANGE_PASSWORD_VIEW_CLASS (klass) (GTK_CHECK_CLASS_CAST ((klass), NAUTILUS_TYPE_CHANGE_PASSWORD_VIEW, NautilusChangePasswordViewClass))
-#define NAUTILUS_IS_CHANGE_PASSWORD_VIEW(obj) (GTK_CHECK_TYPE ((obj), NAUTILUS_TYPE_CHANGE_PASSWORD_VIEW))
-#define NAUTILUS_IS_CHANGE_PASSWORD_VIEW_CLASS (klass) (GTK_CHECK_CLASS_TYPE ((klass), NAUTILUS_TYPE_CHANGE_PASSWORD_VIEW))
-
-typedef struct _NautilusChangePasswordViewDetails NautilusChangePasswordViewDetails;
-
-struct _NautilusChangePasswordView {
- GtkEventBox parent;
- NautilusChangePasswordViewDetails *details;
-};
-
-struct _NautilusChangePasswordViewClass {
- GtkVBoxClass parent_class;
-};
-
-/* GtkObject support */
-GtkType nautilus_change_password_view_get_type (void);
-
-/* Component embedding support */
-NautilusView *nautilus_change_password_view_get_nautilus_view (NautilusChangePasswordView *view);
-
-/* URI handling */
-void nautilus_change_password_view_load_uri (NautilusChangePasswordView *view,
- const char *uri);
-
-#endif /* NAUTILUS_CHANGE_PASSWORD_VIEW_H */
-
diff --git a/components/services/login/nautilus-view/password-box.c b/components/services/login/nautilus-view/password-box.c
deleted file mode 100644
index d8af9ee27..000000000
--- a/components/services/login/nautilus-view/password-box.c
+++ /dev/null
@@ -1,332 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: Robey Pointer <robey@eazel.com>
- */
-
-#include <config.h>
-
-#include "password-box.h"
-#include "eazel-services-header.h"
-#include "eazel-services-extensions.h"
-
-#include <gnome.h>
-#include <eel/eel-background.h>
-#include <eel/eel-gtk-extensions.h>
-#include <eel/eel-gtk-macros.h>
-#include <eel/eel-glib-extensions.h>
-#include <eel/eel-label.h>
-#include <eel/eel-image.h>
-#include <stdio.h>
-#include <unistd.h>
-
-
-
-/* gtk rulez */
-static void
-add_padding_to_box (GtkWidget *box, int pad_x, int pad_y)
-{
- GtkWidget *filler;
-
- filler = gtk_label_new ("");
- gtk_widget_set_usize (filler, pad_x ? pad_x : 1, pad_y ? pad_y : 1);
- gtk_widget_show (filler);
- gtk_box_pack_start (GTK_BOX (box), filler, FALSE, FALSE, 0);
-}
-
-static void
-add_filler_to_box (GtkWidget *box)
-{
- GtkWidget *filler;
-
- filler = gtk_label_new ("");
- gtk_widget_show (filler);
- gtk_box_pack_start (GTK_BOX (box), filler, TRUE, TRUE, 0);
-}
-
-static gboolean
-line_expose (GtkWidget *widget, GdkEventExpose *event)
-{
- gdk_window_clear_area (widget->window, event->area.x, event->area.y, event->area.width, event->area.height);
- gdk_gc_set_clip_rectangle (widget->style->fg_gc[widget->state], &event->area);
- gdk_draw_line (widget->window, widget->style->fg_gc[widget->state],
- widget->allocation.width/2, event->area.y,
- widget->allocation.width/2, event->area.y + event->area.height);
- gdk_gc_set_clip_rectangle (widget->style->fg_gc[widget->state], NULL);
-
- return TRUE;
-}
-
-static GtkWidget *
-vertical_line_new (int width)
-{
- GtkWidget *line;
- EelBackground *background;
-
- line = gtk_drawing_area_new ();
- gtk_drawing_area_size (GTK_DRAWING_AREA (line), 1, 10);
- gtk_signal_connect (GTK_OBJECT (line), "expose_event", GTK_SIGNAL_FUNC (line_expose), NULL);
- gtk_widget_set_usize (line, width, -2);
-
- background = eel_get_widget_background (line);
- eel_background_set_color (background, EAZEL_SERVICES_BACKGROUND_COLOR_SPEC);
-
- return line;
-}
-
-static GtkWidget *
-make_empty_viewport (void)
-{
- GtkWidget *viewport;
- GtkWidget *hbox;
-
- viewport = gtk_viewport_new (NULL, NULL);
- gtk_viewport_set_shadow_type (GTK_VIEWPORT (viewport), GTK_SHADOW_NONE);
- hbox = gtk_hbox_new (FALSE, 0);
- gtk_widget_show (hbox);
- gtk_container_add (GTK_CONTAINER (viewport), hbox);
- gtk_widget_show (viewport);
- return viewport;
-}
-
-static void
-gtk_widget_set_colors (GtkWidget *widget, int foreground, int background)
-{
- EelBackground *bground;
- GtkStyle *style;
- GdkColor *color;
- char *spec;
-
- bground = eel_get_widget_background (widget);
- spec = g_strdup_printf ("#%06X", background);
- eel_background_set_color (bground, spec);
- g_free (spec);
-
- /* foreground is much harder */
- style = gtk_style_copy (widget->style);
- color = &(style->fg[GTK_STATE_NORMAL]);
- color->red = ((foreground >> 8) & 0xff00) | (foreground >> 16);
- color->green = (foreground & 0xff00) | ((foreground >> 8) & 0xff);
- color->blue = ((foreground & 0xff) << 8) | (foreground & 0xff);
- gdk_colormap_alloc_color (gtk_widget_get_colormap (widget), color, FALSE, TRUE);
- gtk_widget_set_style (widget, style);
- gtk_style_unref (style);
-}
-
-/* okay, this is confusing and annoying, but it looks nice.
- * make a 3x3 grid: in the corners, little tiny images of rounded
- * corners. on the top/bottom/left/right edges, empty viewports set
- * to a background color. in the middle, a big viewport with a
- * background color where the entire contents of the password box fits.
- */
-static GtkWidget *
-make_bubble_shell (void)
-{
- GtkWidget *table;
- GtkWidget *viewport;
- GtkWidget *image;
-
- table = gtk_table_new (3, 3, FALSE);
-
- image = eazel_services_image_new (BUBBLE_UL_FILENAME, NULL, 0);
- gtk_widget_show (image);
- gtk_table_attach (GTK_TABLE (table), image, 0, 1, 0, 1, 0, 0, 0, 0);
- image = eazel_services_image_new (BUBBLE_UR_FILENAME, NULL, 0);
- gtk_widget_show (image);
- gtk_table_attach (GTK_TABLE (table), image, 2, 3, 0, 1, 0, 0, 0, 0);
- image = eazel_services_image_new (BUBBLE_LL_FILENAME, NULL, 0);
- gtk_widget_show (image);
- gtk_table_attach (GTK_TABLE (table), image, 0, 1, 2, 3, 0, 0, 0, 0);
- image = eazel_services_image_new (BUBBLE_LR_FILENAME, NULL, 0);
- gtk_widget_show (image);
- gtk_table_attach (GTK_TABLE (table), image, 2, 3, 2, 3, 0, 0, 0, 0);
-
- viewport = make_empty_viewport ();
- gtk_table_attach (GTK_TABLE (table), viewport, 1, 2, 0, 1, GTK_EXPAND|GTK_FILL|GTK_SHRINK, 0, 0, 0);
- gtk_widget_set_usize (viewport, 0, 7);
- viewport = make_empty_viewport ();
- gtk_table_attach (GTK_TABLE (table), viewport, 1, 2, 2, 3, GTK_EXPAND|GTK_FILL|GTK_SHRINK, 0, 0, 0);
- gtk_widget_set_usize (viewport, 0, 7);
- viewport = make_empty_viewport ();
- gtk_table_attach (GTK_TABLE (table), viewport, 0, 1, 1, 2, 0, GTK_EXPAND|GTK_FILL|GTK_SHRINK, 0, 0);
- gtk_widget_set_usize (viewport, 7, 0);
- viewport = make_empty_viewport ();
- gtk_table_attach (GTK_TABLE (table), viewport, 2, 3, 1, 2, 0, GTK_EXPAND|GTK_FILL|GTK_SHRINK, 0, 0);
- gtk_widget_set_usize (viewport, 7, 0);
-
- return table;
-}
-
-static void
-change_bubble_shell_colors (GtkWidget *table, int foreground, int background)
-{
- GList *iter;
- GtkWidget *widget;
-
- for (iter = gtk_container_children (GTK_CONTAINER (table)); iter != NULL; iter = iter->next) {
- widget = (GtkWidget *)(iter->data);
- if (EEL_IS_IMAGE (widget)) {
- /* images are the little rounded corners arlo drew */
- eel_image_set_solid_background_color (EEL_IMAGE (widget), background);
- } else {
- gtk_widget_set_colors (widget, foreground, background);
- }
- }
-}
-
-void
-password_box_set_colors (PasswordBox *box, int foreground, int background)
-{
- char *text;
-
- /* if we don't hide/show during the color change, some widgets won't draw correctly [gtk rulez] */
- gtk_widget_hide (box->table);
- eel_label_set_solid_background_color (EEL_LABEL (box->label), background);
- eel_label_set_solid_background_color (EEL_LABEL (box->label_right), background);
- eel_label_set_text_color (EEL_LABEL (box->label), foreground);
- eel_label_set_text_color (EEL_LABEL (box->label_right), foreground);
- eel_image_set_solid_background_color (EEL_IMAGE (box->bong), background);
-
- /* you DON'T want to know.
- * ... doing this pokes the label enough that it'll wake up and notice its new colors.
- */
- text = g_strdup (eel_label_get_text (EEL_LABEL (box->label)));
- eel_label_set_text (EEL_LABEL (box->label), "-");
- eel_label_set_text (EEL_LABEL (box->label), text);
- g_free (text);
-
- gtk_widget_set_colors (box->line, foreground, background);
- gtk_widget_set_colors (box->viewport, foreground, background);
- change_bubble_shell_colors (box->table, foreground, background);
- gtk_widget_show (box->table);
-}
-
-GtkWidget *
-password_box_get_entry (PasswordBox *box)
-{
- return box->entry;
-}
-
-void
-password_box_set_error_text (PasswordBox *box, const char *message)
-{
- eel_label_set_text (EEL_LABEL (box->label_right), message);
-}
-
-void
-password_box_show_error (PasswordBox *box, gboolean show_it)
-{
- if (show_it) {
- password_box_set_colors (box, BUBBLE_FOREGROUND_ALERT_RGB, BUBBLE_BACKGROUND_ALERT_RGB);
- gtk_widget_show (box->hbox_right);
- } else {
- password_box_set_colors (box, BUBBLE_FOREGROUND_RGB, BUBBLE_BACKGROUND_RGB);
- gtk_widget_hide (box->hbox_right);
- }
-}
-
-PasswordBox *
-password_box_new (const char *title)
-{
- PasswordBox *box;
-
- box = g_new0 (PasswordBox, 1);
-
- /* title label for the entry box */
- box->label = eazel_services_label_new (title, 0, 0.0, 0.0, 0, 0,
- BUBBLE_FOREGROUND_RGB,
- BUBBLE_BACKGROUND_RGB,
- NULL, 0, TRUE);
- eel_label_set_text (EEL_LABEL (box->label), title);
- gtk_widget_show (box->label);
-
- /* text entry, offset to the right a bit */
- box->hbox_left = gtk_hbox_new (FALSE, 0);
- add_padding_to_box (box->hbox_left, 20, 0);
- box->entry = gtk_entry_new_with_max_length (36);
- gtk_widget_show (box->entry);
- gtk_box_pack_start (GTK_BOX (box->hbox_left), box->entry, FALSE, FALSE, 0);
- add_filler_to_box (box->hbox_left);
- gtk_widget_show (box->hbox_left);
-
- /* put them together into a left-side vbox */
- box->vbox_left = gtk_vbox_new (FALSE, 0);
- gtk_box_pack_start (GTK_BOX (box->vbox_left), box->label, FALSE, FALSE, 0);
- add_padding_to_box (box->vbox_left, 0, 10);
- gtk_box_pack_start (GTK_BOX (box->vbox_left), box->hbox_left, FALSE, FALSE, 0);
- /* add_filler_to_box (box->vbox_left); */
- gtk_widget_show (box->vbox_left);
-
- /* right-side bong */
- box->bong = eazel_services_image_new (TINY_ALERT_ICON_FILENAME, NULL, EAZEL_SERVICES_BACKGROUND_COLOR_RGB);
- gtk_widget_show (box->bong);
- box->vbox_bong = gtk_vbox_new (FALSE, 0);
- gtk_box_pack_start (GTK_BOX (box->vbox_bong), box->bong, FALSE, FALSE, 0);
- add_filler_to_box (box->vbox_bong);
- gtk_widget_show (box->vbox_bong);
-
- /* vertical dividing line */
- box->line = vertical_line_new (9);
- gtk_widget_show (box->line);
-
- /* right-side label */
- box->label_right = eazel_services_label_new (title, 0, 0.0, 0.0, 0, 0,
- BUBBLE_FOREGROUND_RGB,
- BUBBLE_BACKGROUND_RGB,
- NULL, -2, FALSE);
- eel_label_set_wrap (EEL_LABEL (box->label_right), TRUE);
- eel_label_set_justify (EEL_LABEL (box->label_right), GTK_JUSTIFY_LEFT);
- gtk_widget_show (box->label_right);
-
- /* hbox for all the right-side alert messages */
- box->hbox_right = gtk_hbox_new (FALSE, 0);
- gtk_box_pack_start (GTK_BOX (box->hbox_right), box->vbox_bong, FALSE, FALSE, 0);
- gtk_box_pack_start (GTK_BOX (box->hbox_right), box->line, FALSE, FALSE, 0);
- gtk_box_pack_start (GTK_BOX (box->hbox_right), box->label_right, FALSE, FALSE, 0);
- gtk_widget_show (box->hbox_right);
-
- /* floating in the middle of the right side */
- box->alignment = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
- gtk_container_add (GTK_CONTAINER (box->alignment), box->hbox_right);
- gtk_widget_show (box->alignment);
-
- /* and finally, the overall hbox holds them all */
- box->hbox = gtk_hbox_new (FALSE, 0);
- add_padding_to_box (box->hbox, 5, 0);
- gtk_box_pack_start (GTK_BOX (box->hbox), box->vbox_left, FALSE, FALSE, 0);
- add_padding_to_box (box->hbox, 10, 0);
- gtk_box_pack_start (GTK_BOX (box->hbox), box->alignment, TRUE, TRUE, 0);
- gtk_widget_show (box->hbox);
-
- /* ...inside a viewport, so we can set the background color */
- box->viewport = gtk_viewport_new (NULL, NULL);
- gtk_viewport_set_shadow_type (GTK_VIEWPORT (box->viewport), GTK_SHADOW_NONE);
- gtk_container_add (GTK_CONTAINER (box->viewport), box->hbox);
- gtk_widget_show (box->viewport);
-
- /* put it inside that rounded-edged box */
- box->table = make_bubble_shell ();
- gtk_table_attach (GTK_TABLE (box->table), box->viewport, 1, 2, 1, 2,
- GTK_EXPAND|GTK_FILL, GTK_EXPAND|GTK_FILL, 0, 0);
-
- password_box_show_error (box, FALSE);
-
- return box;
-}
diff --git a/components/services/login/nautilus-view/password-box.h b/components/services/login/nautilus-view/password-box.h
deleted file mode 100644
index 576db0def..000000000
--- a/components/services/login/nautilus-view/password-box.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: Robey Pointer <robey@eazel.com>
- */
-
-#ifndef _PASSWORD_BOX_H_
-#define _PASSWORD_BOX_H_
-
-#include <gnome.h>
-
-typedef struct {
- GtkWidget *hbox;
- GtkWidget *vbox_left;
- GtkWidget *hbox_left;
- GtkWidget *label;
- GtkWidget *entry;
- GtkWidget *hbox_right;
- GtkWidget *alignment;
- GtkWidget *vbox_bong;
- GtkWidget *bong;
- GtkWidget *line;
- GtkWidget *label_right;
- GtkWidget *viewport;
- GtkWidget *table;
-} PasswordBox;
-
-/* colors to use when happy */
-#define BUBBLE_BACKGROUND_RGB 0xDCDCDC
-#define BUBBLE_FOREGROUND_RGB 0x000000
-
-/* colors to use when sad */
-#define BUBBLE_BACKGROUND_ALERT_RGB 0xCC6666
-#define BUBBLE_FOREGROUND_ALERT_RGB 0xFFFFFF
-
-/* icon filenames */
-#define TINY_ALERT_ICON_FILENAME "tiny-alert.png"
-#define BUBBLE_UL_FILENAME "bubble-UL.png"
-#define BUBBLE_UR_FILENAME "bubble-UR.png"
-#define BUBBLE_LL_FILENAME "bubble-LL.png"
-#define BUBBLE_LR_FILENAME "bubble-LR.png"
-
-
-PasswordBox *password_box_new (const char *title);
-void password_box_set_colors (PasswordBox *box, int foreground, int background);
-GtkWidget *password_box_get_entry (PasswordBox *box);
-void password_box_set_error_text (PasswordBox *box, const char *message);
-void password_box_show_error (PasswordBox *box, gboolean show_it);
-
-
-#endif /* _PASSWORD_BOX_H_ */
diff --git a/components/services/nautilus-dependent-shared/.cvsignore b/components/services/nautilus-dependent-shared/.cvsignore
deleted file mode 100644
index d68a15a99..000000000
--- a/components/services/nautilus-dependent-shared/.cvsignore
+++ /dev/null
@@ -1,7 +0,0 @@
-*.lo
-.deps
-.libs
-Makefile
-Makefile.in
-libnautilusdepshared.a
-test-footer-header
diff --git a/components/services/nautilus-dependent-shared/Makefile.am b/components/services/nautilus-dependent-shared/Makefile.am
deleted file mode 100644
index 4b8bc415e..000000000
--- a/components/services/nautilus-dependent-shared/Makefile.am
+++ /dev/null
@@ -1,55 +0,0 @@
-include $(top_srcdir)/Makefile.shared
-
-SUBDIRS = icons
-
-INCLUDES = \
- -DDATADIR=\""$(datadir)"\" \
- -DPREFIX=\"$(prefix)\" \
- -DG_LOG_DOMAIN=\"eazel-service\" \
- -I$(top_srcdir) \
- -I$(top_builddir) \
- -I$(top_srcdir)/components/services/nautilus-dependent-shared \
- -I$(top_srcdir)/components/services/trilobite \
- -I$(top_builddir)/components/services/trilobite \
- -I$(top_srcdir)/components/services/trilobite/lib \
- -I$(top_builddir)/components/services/trilobite/lib \
- $(EEL_INCLUDEDIR) \
- $(LIBRSVG_INCLUDEDIR) \
- $(GNOME_CFLAGS) \
- $(GCONF_CFLAGS) \
- $(XML_CFLAGS) \
- $(NULL)
-
-noinst_LIBRARIES = libnautilusdepshared.a
-
-noinst_HEADERS =\
- eazel-services-extensions.h \
- eazel-services-footer.h \
- eazel-services-header.h \
- $(NULL)
-
-libnautilusdepshared_a_SOURCES =\
- eazel-services-extensions.c \
- eazel-services-footer.c \
- eazel-services-header.c \
- $(NULL)
-
-test_footer_header_LDADD = \
- $(top_builddir)/components/services/nautilus-dependent-shared/libnautilusdepshared.a \
- $(top_builddir)/libnautilus/libnautilus.la \
- $(EEL_LIBS) \
- $(LIBRSVG_LIBS) \
- $(BONOBO_LIBS) \
- $(OAF_LIBS) \
- $(GCONF_LIBS) \
- $(GNOMEUI_LIBS) \
- $(VFS_LIBS) \
- $(XML_LIBS) \
- $(NULL)
-
-noinst_PROGRAMS =\
- test-footer-header \
- $(NULL)
-
-test_footer_header_SOURCES = test-footer-header.c
-
diff --git a/components/services/nautilus-dependent-shared/eazel-services-extensions.c b/components/services/nautilus-dependent-shared/eazel-services-extensions.c
deleted file mode 100644
index c7c0a74cc..000000000
--- a/components/services/nautilus-dependent-shared/eazel-services-extensions.c
+++ /dev/null
@@ -1,516 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-
-/* eazel-services-extensions.c - Extensions to Nautilus and gtk widget.
-
- Copyright (C) 2000 Eazel, Inc.
-
- The Gnome Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
-
- The Gnome Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with the Gnome Library; see the file COPYING.LIB. If not,
- write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA.
-
- Authors: Ramiro Estrugo <ramiro@eazel.com>
-*/
-
-#include <config.h>
-#include "eazel-services-extensions.h"
-
-#include <eel/eel-clickable-image.h>
-#include <eel/eel-smooth-widget.h>
-#include <eel/eel-stock-dialogs.h>
-#include <eel/eel-string.h>
-#include <gconf/gconf-client.h>
-#include <gconf/gconf.h>
-#include <libgnome/gnome-defs.h>
-#include <libgnome/gnome-i18n.h>
-#include <libgnome/gnome-util.h>
-#include <time.h>
-
-static void listen_for_smooth_graphics_changes (void);
-
-GdkPixbuf *
-eazel_services_pixbuf_new (const char *name)
-{
- char *image_file_path;
- GdkPixbuf *pixbuf = NULL;
-
- g_return_val_if_fail (name != NULL, NULL);
-
- image_file_path = g_strdup_printf ("%s/%s", DATADIR "/pixmaps/nautilus", name);
-
- if (g_file_exists (image_file_path)) {
- pixbuf =gdk_pixbuf_new_from_file (image_file_path);
- }
- g_free (image_file_path);
-
- return pixbuf;
-}
-
-GtkWidget *
-eazel_services_image_new (const char *icon_name,
- const char *tile_name,
- guint32 background_color)
-{
- GtkWidget *image;
- GdkPixbuf *pixbuf = NULL;
- GdkPixbuf *tile_pixbuf = NULL;
-
- listen_for_smooth_graphics_changes ();
-
- if (icon_name) {
- pixbuf = eazel_services_pixbuf_new (icon_name);
- }
-
- if (tile_name) {
- tile_pixbuf = eazel_services_pixbuf_new (tile_name);
- }
-
- image = eel_image_new_solid (pixbuf, 0.5, 0.5, 0, 0, background_color, tile_pixbuf);
-
- eel_gdk_pixbuf_unref_if_not_null (pixbuf);
- eel_gdk_pixbuf_unref_if_not_null (tile_pixbuf);
-
- return image;
-}
-
-GtkWidget *
-eazel_services_image_new_clickable (const char *icon_name,
- const char *tile_name,
- guint32 background_color)
-{
- GtkWidget *image;
- GdkPixbuf *pixbuf = NULL;
- GdkPixbuf *tile_pixbuf = NULL;
-
- listen_for_smooth_graphics_changes ();
-
- if (icon_name) {
- pixbuf = eazel_services_pixbuf_new (icon_name);
- }
-
- if (tile_name) {
- tile_pixbuf = eazel_services_pixbuf_new (tile_name);
- }
-
- image = eel_clickable_image_new_solid (NULL,
- pixbuf,
- 0,
- 0,
- 0,
- 0.5,
- 0.5,
- 0,
- 0,
- background_color,
- tile_pixbuf);
-
- eel_gdk_pixbuf_unref_if_not_null (pixbuf);
- eel_gdk_pixbuf_unref_if_not_null (tile_pixbuf);
-
- return image;
-}
-
-GtkWidget *
-eazel_services_image_new_from_uri (const char *uri,
- const char *tile_name,
- guint32 background_color,
- int max_width,
- int max_height)
-{
- GtkWidget *image = NULL;
- GdkPixbuf *pixbuf;
- GdkPixbuf *scaled_pixbuf;
-
- g_return_val_if_fail (uri != NULL, NULL);
-
- listen_for_smooth_graphics_changes ();
-
- /* load the image - synchronously, at least at first */
- pixbuf = eel_gdk_pixbuf_load (uri);
-
- /* pin the image to the specified dimensions if necessary */
- if (pixbuf && max_width > 0 && max_height > 0) {
- scaled_pixbuf = eel_gdk_pixbuf_scale_down_to_fit (pixbuf, max_width, max_height);
- gdk_pixbuf_unref (pixbuf);
- pixbuf = scaled_pixbuf;
- }
-
- /* create the image widget then release the pixbuf*/
- image = eazel_services_image_new (NULL, tile_name, background_color);
-
- if (pixbuf != NULL) {
- eel_image_set_pixbuf (EEL_IMAGE (image), pixbuf);
- }
-
- eel_gdk_pixbuf_unref_if_not_null (pixbuf);
-
- return image;
-}
-
-
-
-GtkWidget *
-eazel_services_clickable_image_new_from_uri (const char *uri,
- const char *tile_name,
- guint32 background_color,
- int max_width,
- int max_height)
-{
- GtkWidget *image = NULL;
- GdkPixbuf *pixbuf;
- GdkPixbuf *scaled_pixbuf;
-
- g_return_val_if_fail (uri != NULL, NULL);
-
- listen_for_smooth_graphics_changes ();
-
- /* load the image - synchronously, at least at first */
- pixbuf = eel_gdk_pixbuf_load (uri);
-
- /* pin the image to the specified dimensions if necessary */
- if (pixbuf && max_width > 0 && max_height > 0) {
- scaled_pixbuf = eel_gdk_pixbuf_scale_down_to_fit (pixbuf, max_width, max_height);
- gdk_pixbuf_unref (pixbuf);
- pixbuf = scaled_pixbuf;
- }
-
- /* create the image widget then release the pixbuf*/
- image = eazel_services_image_new_clickable (NULL, tile_name, background_color);
-
- if (pixbuf != NULL) {
- eel_labeled_image_set_pixbuf (EEL_LABELED_IMAGE (image),
- pixbuf);
- }
-
- eel_gdk_pixbuf_unref_if_not_null (pixbuf);
-
- return image;
-}
-
-GtkWidget *
-eazel_services_label_new (const char *text,
- guint drop_shadow_offset,
- float xalign,
- float yalign,
- gint xpadding,
- gint ypadding,
- guint32 text_color,
- guint32 background_color,
- const char *tile_name,
- gint num_larger_sizes,
- gboolean bold)
-{
- GtkWidget *label;
- GdkPixbuf *tile_pixbuf = NULL;
-
- listen_for_smooth_graphics_changes ();
-
- if (tile_name != NULL) {
- tile_pixbuf = eazel_services_pixbuf_new (tile_name);
- }
-
- label = eel_label_new_solid (text,
- drop_shadow_offset,
- EAZEL_SERVICES_DROP_SHADOW_COLOR_RGB,
- text_color,
- xalign,
- yalign,
- xpadding,
- ypadding,
- background_color,
- tile_pixbuf);
-
-
- if (num_larger_sizes < 0) {
- eel_label_make_smaller (EEL_LABEL (label), ABS (num_larger_sizes));
- } else if (num_larger_sizes > 0) {
- eel_label_make_larger (EEL_LABEL (label), num_larger_sizes);
- }
-
- if (bold) {
- eel_label_make_bold (EEL_LABEL (label));
- }
-
- eel_gdk_pixbuf_unref_if_not_null (tile_pixbuf);
-
- return label;
-}
-
-GtkWidget *
-eazel_services_label_new_clickable (const char *text,
- guint drop_shadow_offset,
- float xalign,
- float yalign,
- gint xpadding,
- gint ypadding,
- guint32 text_color,
- guint32 background_color,
- const char *tile_name,
- gint num_larger_sizes,
- gboolean bold)
-{
- GtkWidget *label;
- GdkPixbuf *tile_pixbuf = NULL;
-
- listen_for_smooth_graphics_changes ();
-
- if (tile_name != NULL) {
- tile_pixbuf = eazel_services_pixbuf_new (tile_name);
- }
-
- label = eel_clickable_image_new_solid (text,
- NULL,
- drop_shadow_offset,
- EAZEL_SERVICES_DROP_SHADOW_COLOR_RGB,
- text_color,
- xalign,
- yalign,
- xpadding,
- ypadding,
- background_color,
- tile_pixbuf);
-
- if (num_larger_sizes < 0) {
- eel_labeled_image_make_smaller (EEL_LABELED_IMAGE (label), ABS (num_larger_sizes));
- } else if (num_larger_sizes > 0) {
- eel_labeled_image_make_larger (EEL_LABELED_IMAGE (label), num_larger_sizes);
- }
-
- if (bold) {
- eel_labeled_image_make_bold (EEL_LABELED_IMAGE (label));
- }
-
- eel_gdk_pixbuf_unref_if_not_null (tile_pixbuf);
-
- return label;
-}
-
-char *
-eazel_services_get_current_date_string (void)
-{
- time_t my_time;
- struct tm *my_localtime;
-
- my_time = time (NULL);
-
- if (my_time == -1) {
- return g_strdup (_("Unknown Date"));
- }
-
- my_localtime = localtime (&my_time);
-
- return eel_strdup_strftime (_("%A, %B %d"), my_localtime);
-}
-
-/* FIXME: It is obviously beyond words to describe how dauntingly lame
- * this cut and pasted code here is.
- * See also the USER_LEVEL macros in eazel-services-extensions.h
- */
-#define SMOOTH_GRAPHICS_KEY "/apps/nautilus/preferences/smooth_graphics_mode"
-#define USER_LEVEL_KEY "/apps/nautilus/user_level"
-
-/* Code cut-n-pasted from nautilus-gconf-extensions.c */
-static gboolean
-eazel_services_gconf_handle_error (GError **error)
-{
- char *message;
- static gboolean shown_dialog = FALSE;
-
- g_return_val_if_fail (error != NULL, FALSE);
-
- if (*error != NULL) {
- g_warning (_("GConf error:\n %s"), (*error)->message);
- if (! shown_dialog) {
- shown_dialog = TRUE;
-
- message = g_strdup_printf (_("GConf error:\n %s\n"
- "All further errors shown "
- "only on terminal"),
- (*error)->message);
- eel_show_error_dialog (message, _("GConf Error"), NULL);
- g_free (message);
- }
- g_error_free (*error);
- *error = NULL;
-
- return TRUE;
- }
-
- return FALSE;
-}
-
-static GConfClient *global_gconf_client = NULL;
-
-static void
-preferences_unref_global_gconf_client (void)
-{
- if (global_gconf_client == NULL) {
- gtk_object_unref (GTK_OBJECT (global_gconf_client));
- }
-
- global_gconf_client = NULL;
-}
-
-static GConfClient *
-preferences_get_global_gconf_client (void)
-{
- /* Initialize gconf if needed */
- if (!gconf_is_initialized ()) {
- GError *error = NULL;
- char *argv[] = { "eazel-services", NULL };
-
- if (!gconf_init (1, argv, &error)) {
-
- if (eazel_services_gconf_handle_error (&error)) {
- return NULL;
- }
- }
- }
-
- if (global_gconf_client == NULL) {
- global_gconf_client = gconf_client_get_default ();
-
- if (global_gconf_client == NULL) {
- return NULL;
- }
-
- g_atexit (preferences_unref_global_gconf_client);
-
- gconf_client_add_dir (global_gconf_client,
- "/apps/nautilus",
- GCONF_CLIENT_PRELOAD_NONE,
- NULL);
- }
-
- return global_gconf_client;
-}
-
-static gboolean
-preferences_gconf_get_boolean (const char *key)
-{
- gboolean result;
- GConfClient *client;
- GError *error = NULL;
-
- g_return_val_if_fail (key != NULL, FALSE);
-
- client = preferences_get_global_gconf_client ();
- g_return_val_if_fail (client != NULL, FALSE);
-
- result = gconf_client_get_bool (client, key, &error);
-
- if (eazel_services_gconf_handle_error (&error)) {
- result = FALSE;
- }
-
- return result;
-}
-
-static char *
-preferences_gconf_get_string (const char *key)
-{
- char *result;
- GConfClient *client;
- GError *error = NULL;
-
- g_return_val_if_fail (key != NULL, NULL);
-
- client = preferences_get_global_gconf_client ();
- g_return_val_if_fail (client != NULL, NULL);
-
- result = gconf_client_get_string (client, key, &error);
-
- if (eazel_services_gconf_handle_error (&error)) {
- result = g_strdup ("");
- }
-
- return result;
-}
-
-static void
-smooth_graphics_changed_notice (GConfClient *client,
- guint connection_id,
- GConfEntry *entry,
- gpointer notice_data)
-{
- g_return_if_fail (entry != NULL);
- g_return_if_fail (entry->key != NULL);
-
- eel_smooth_widget_global_set_is_smooth (preferences_gconf_get_boolean (SMOOTH_GRAPHICS_KEY));
-}
-
-static void
-listen_for_smooth_graphics_changes (void)
-{
- static gboolean notification_installed = FALSE;
- GConfClient *client;
- GError *error;
-
- if (notification_installed) {
- return;
- }
-
- if (!gconf_is_initialized ()) {
- char *argv[] = { "eazel-services", NULL };
- error = NULL;
-
- if (!gconf_init (1, argv, &error)) {
- if (eazel_services_gconf_handle_error (&error)) {
- return;
- }
- }
- }
-
- client = preferences_get_global_gconf_client ();
- g_return_if_fail (client != NULL);
-
- gconf_client_notify_add (client,
- SMOOTH_GRAPHICS_KEY,
- smooth_graphics_changed_notice,
- NULL,
- NULL,
- &error);
-
- if (eazel_services_gconf_handle_error (&error)) {
- return;
- }
-
- notification_installed = TRUE;
-
- eel_smooth_widget_global_set_is_smooth (preferences_gconf_get_boolean (SMOOTH_GRAPHICS_KEY));
-}
-
-#define DEFAULT_USER_LEVEL EAZEL_USER_LEVEL_INTERMEDIATE
-
-int
-eazel_services_get_user_level (void)
-{
- char *user_level;
- int result;
-
- user_level = preferences_gconf_get_string (USER_LEVEL_KEY);
-
- if (eel_str_is_equal (user_level, "advanced")) {
- result = EAZEL_USER_LEVEL_ADVANCED;
- } else if (eel_str_is_equal (user_level, "intermediate")) {
- result = EAZEL_USER_LEVEL_INTERMEDIATE;
- } else if (eel_str_is_equal (user_level, "novice")) {
- result = EAZEL_USER_LEVEL_NOVICE;
- } else {
- result = DEFAULT_USER_LEVEL;
- }
-
- g_free (user_level);
-
- return result;
-}
diff --git a/components/services/nautilus-dependent-shared/eazel-services-extensions.h b/components/services/nautilus-dependent-shared/eazel-services-extensions.h
deleted file mode 100644
index 945511eab..000000000
--- a/components/services/nautilus-dependent-shared/eazel-services-extensions.h
+++ /dev/null
@@ -1,116 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-
-/* eazel-services-extensions.h - Extensions to Nautilus and gtk widget.
-
- Copyright (C) 2000 Eazel, Inc.
-
- The Gnome Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
-
- The Gnome Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with the Gnome Library; see the file COPYING.LIB. If not,
- write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA.
-
- Authors: Ramiro Estrugo <ramiro@eazel.com>
-*/
-
-#ifndef EAZEL_SERVICES_EXTENSIONS_H
-#define EAZEL_SERVICES_EXTENSIONS_H
-
-#include <libgnome/gnome-defs.h>
-#include <eel/eel-gdk-extensions.h>
-#include <eel/eel-gdk-pixbuf-extensions.h>
-#include <eel/eel-glib-extensions.h>
-#include <eel/eel-gtk-extensions.h>
-
-#define EAZEL_SERVICES_BACKGROUND_COLOR_SPEC "white"
-#define EAZEL_SERVICES_BACKGROUND_COLOR_RGB EEL_RGB_COLOR_WHITE
-#define EAZEL_SERVICES_DROP_SHADOW_COLOR_RGB EEL_RGB_COLOR_BLACK
-#define EAZEL_SERVICES_TITLE_TEXT_COLOR_RGB EEL_RGB_COLOR_WHITE
-#define EAZEL_SERVICES_BODY_TEXT_COLOR_RGB EEL_RGB_COLOR_BLACK
-
-#define EAZEL_SERVICES_HEADER_TITLE_FILL_ICON "eazel-logo-left-side-repeat.png"
-#define EAZEL_SERVICES_HEADER_TITLE_LOGO_ICON "eazel-logo-right-side-logo.png"
-
-#define EAZEL_SERVICES_NORMAL_FILL "summary-service-normal-fill.png"
-#define EAZEL_SERVICES_NORMAL_LEFT_BUMPER "summary-service-normal-left-bumper.png"
-#define EAZEL_SERVICES_NORMAL_RIGHT_BUMPER "summary-service-normal-right-bumper.png"
-
-#define EAZEL_SERVICES_PRELIGHT_FILL "summary-service-prelight-fill.png"
-#define EAZEL_SERVICES_PRELIGHT_LEFT_BUMPER "summary-service-prelight-left-bumper.png"
-#define EAZEL_SERVICES_PRELIGHT_RIGHT_BUMPER "summary-service-prelight-right-bumper.png"
-
-#define EAZEL_SERVICES_REMAINDER_LEFT_BUMPER "summary-service-remainder-left-bumper.png"
-#define EAZEL_SERVICES_REMAINDER_FILL "summary-service-remainder-fill.png"
-#define EAZEL_SERVICES_REMAINDER_RIGHT_BUMPER "summary-service-remainder-right-bumper.png"
-
-#define EAZEL_SERVICES_HEADER_MIDDLE_FILL_ICON "eazel-services-header-middle-fill.png"
-
-#define EAZEL_SERVICES_HEADER_TEXT_SIZE_REL 4
-
-#define EAZEL_USER_LEVEL_NOVICE 0
-#define EAZEL_USER_LEVEL_INTERMEDIATE 1
-#define EAZEL_USER_LEVEL_ADVANCED 2
-
-/*
- * The xalign, yalign, xpadding, and ypadding attribures work
- * exactly as they do with GtkMisc.
- */
-
-BEGIN_GNOME_DECLS
-
-GdkPixbuf *eazel_services_pixbuf_new (const char *name);
-GtkWidget *eazel_services_image_new (const char *icon_name,
- const char *tile_name,
- guint32 background_color);
-GtkWidget *eazel_services_image_new_clickable (const char *icon_name,
- const char *tile_name,
- guint32 background_color);
-GtkWidget *eazel_services_image_new_from_uri (const char *uri,
- const char *tile_name,
- guint32 background_color,
- int max_width,
- int max_height);
-GtkWidget *eazel_services_clickable_image_new_from_uri (const char *uri,
- const char *tile_name,
- guint32 background_color,
- int max_width,
- int max_height);
-GtkWidget *eazel_services_label_new (const char *text,
- guint drop_shadow_offset,
- float xalign,
- float yalign,
- gint xpadding,
- gint ypadding,
- guint32 text_color,
- guint32 background_color,
- const char *tile_name,
- gint num_larger_sizes,
- gboolean bold);
-GtkWidget *eazel_services_label_new_clickable (const char *text,
- guint drop_shadow_offset,
- float xalign,
- float yalign,
- gint xpadding,
- gint ypadding,
- guint32 text_color,
- guint32 background_color,
- const char *tile_name,
- gint num_larger_sizes,
- gboolean bold);
-char *eazel_services_get_current_date_string (void);
-int eazel_services_get_user_level (void);
-
-END_GNOME_DECLS
-
-#endif /* EAZEL_SERVICES_EXTENSIONS_H */
-
-
diff --git a/components/services/nautilus-dependent-shared/eazel-services-footer.c b/components/services/nautilus-dependent-shared/eazel-services-footer.c
deleted file mode 100644
index 8e614a18d..000000000
--- a/components/services/nautilus-dependent-shared/eazel-services-footer.c
+++ /dev/null
@@ -1,370 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-
-/* eazel-services-footer.c - A footer widget for services views.
-
- Copyright (C) 2000 Eazel, Inc.
-
- The Gnome Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
-
- The Gnome Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with the Gnome Library; see the file COPYING.LIB. If not,
- write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA.
-
- Authors: Ramiro Estrugo <ramiro@eazel.com>
-*/
-
-#include <config.h>
-
-#include "eazel-services-footer.h"
-#include "eazel-services-extensions.h"
-
-#include <eel/eel-gtk-macros.h>
-#include <eel/eel-image.h>
-#include <eel/eel-label.h>
-#include <eel/eel-clickable-image.h>
-
-#include <gtk/gtksignal.h>
-#include <gtk/gtkeventbox.h>
-
-#define FOOTER_TEXT_SIZE (-3)
-
-struct _EazelServicesFooterDetails
-{
- GtkWidget *date;
- GdkPixbuf *item_prelight_tile;
- GdkPixbuf *item_tile;
- GdkPixbuf *left_bumper_tile_pixbuf;
- GdkPixbuf *left_bumper_tile_prelight_pixbuf;
- GdkPixbuf *right_bumper_tile_pixbuf;
- GdkPixbuf *right_bumper_prelight_tile_pixbuf;
-};
-
-/* Signals */
-typedef enum
-{
- ITEM_CLICKED,
- LAST_SIGNAL
-} FooterSignal;
-
-/* Signals */
-static guint footer_signals[LAST_SIGNAL] = { 0 };
-
-/* GtkObjectClass methods */
-static void eazel_services_footer_initialize_class (EazelServicesFooterClass *klass);
-static void eazel_services_footer_initialize (EazelServicesFooter *footer);
-static void footer_destroy (GtkObject *object);
-
-EEL_DEFINE_CLASS_BOILERPLATE (EazelServicesFooter, eazel_services_footer, GTK_TYPE_HBOX)
-
-/* EazelServicesFooterClass methods */
-static void
-eazel_services_footer_initialize_class (EazelServicesFooterClass *footer_class)
-{
- GtkObjectClass *object_class;
-
- object_class = GTK_OBJECT_CLASS (footer_class);
-
- /* GtkObjectClass */
- object_class->destroy = footer_destroy;
-
- /* Signals */
- footer_signals[ITEM_CLICKED] = gtk_signal_new ("item_clicked",
- GTK_RUN_LAST,
- object_class->type,
- 0,
- gtk_marshal_NONE__INT,
- GTK_TYPE_NONE,
- 1,
- GTK_TYPE_INT);
-
- gtk_object_class_add_signals (object_class, footer_signals, LAST_SIGNAL);
-}
-
-static void
-eazel_services_footer_initialize (EazelServicesFooter *footer)
-{
- footer->details = g_new0 (EazelServicesFooterDetails, 1);
-
- footer->details->item_tile = eazel_services_pixbuf_new (EAZEL_SERVICES_NORMAL_FILL);
- footer->details->item_prelight_tile = eazel_services_pixbuf_new (EAZEL_SERVICES_PRELIGHT_FILL);
- footer->details->left_bumper_tile_pixbuf = eazel_services_pixbuf_new (EAZEL_SERVICES_NORMAL_LEFT_BUMPER);
- footer->details->left_bumper_tile_prelight_pixbuf = eazel_services_pixbuf_new (EAZEL_SERVICES_PRELIGHT_LEFT_BUMPER);
- footer->details->right_bumper_tile_pixbuf = eazel_services_pixbuf_new (EAZEL_SERVICES_NORMAL_RIGHT_BUMPER);
- footer->details->right_bumper_prelight_tile_pixbuf = eazel_services_pixbuf_new (EAZEL_SERVICES_PRELIGHT_RIGHT_BUMPER);
-}
-
-/* GtkObjectClass methods */
-static void
-footer_destroy (GtkObject *object)
-{
- EazelServicesFooter *footer;
-
- g_return_if_fail (EAZEL_SERVICES_IS_FOOTER (object));
-
- footer = EAZEL_SERVICES_FOOTER (object);
-
- eel_gdk_pixbuf_unref_if_not_null (footer->details->item_tile);
- eel_gdk_pixbuf_unref_if_not_null (footer->details->item_prelight_tile);
- eel_gdk_pixbuf_unref_if_not_null (footer->details->left_bumper_tile_pixbuf);
- eel_gdk_pixbuf_unref_if_not_null (footer->details->left_bumper_tile_prelight_pixbuf);
- eel_gdk_pixbuf_unref_if_not_null (footer->details->right_bumper_tile_pixbuf);
- eel_gdk_pixbuf_unref_if_not_null (footer->details->right_bumper_prelight_tile_pixbuf);
-
- g_free (footer->details);
-
- /* Chain destroy */
- EEL_CALL_PARENT (GTK_OBJECT_CLASS, destroy, (object));
-}
-
-static void
-footer_item_clicked_callback (GtkWidget *widget,
- gpointer callback_data)
-{
- g_return_if_fail (EEL_IS_CLICKABLE_IMAGE (widget));
- g_return_if_fail (EAZEL_SERVICES_IS_FOOTER (callback_data));
-
- gtk_signal_emit (GTK_OBJECT (callback_data),
- footer_signals[ITEM_CLICKED],
- GPOINTER_TO_INT (gtk_object_get_data (GTK_OBJECT (widget), "index")));
-}
-
-static void
-footer_item_enter_callback (GtkWidget *widget,
- gpointer callback_data)
-{
- EazelServicesFooter *footer;
- EelLabeledImage *label;
- EelLabeledImage *left_bumper;
- EelLabeledImage *right_bumper;
-
- g_return_if_fail (EEL_IS_LABELED_IMAGE (widget));
- g_return_if_fail (EAZEL_SERVICES_IS_FOOTER (callback_data));
- g_return_if_fail (EEL_IS_LABELED_IMAGE (gtk_object_get_data (GTK_OBJECT (widget), "left-bumper")));
- g_return_if_fail (EEL_IS_LABELED_IMAGE (widget));
- g_return_if_fail (EEL_IS_LABELED_IMAGE (gtk_object_get_data (GTK_OBJECT (widget), "right-bumper")));
-
- footer = EAZEL_SERVICES_FOOTER (callback_data);
-
- left_bumper = EEL_LABELED_IMAGE (gtk_object_get_data (GTK_OBJECT (widget), "left-bumper"));
- label = EEL_LABELED_IMAGE (widget);
- right_bumper = EEL_LABELED_IMAGE (gtk_object_get_data (GTK_OBJECT (widget), "right-bumper"));
-
- eel_labeled_image_set_tile_pixbuf (label, footer->details->item_prelight_tile);
- eel_labeled_image_set_pixbuf (left_bumper, footer->details->left_bumper_tile_prelight_pixbuf);
- eel_labeled_image_set_pixbuf (right_bumper, footer->details->right_bumper_prelight_tile_pixbuf);
-}
-
-static void
-footer_item_leave_callback (GtkWidget *widget,
- gpointer callback_data)
-{
- EazelServicesFooter *footer;
- EelLabeledImage *label;
- EelLabeledImage *left_bumper;
- EelLabeledImage *right_bumper;
-
- g_return_if_fail (EEL_IS_LABELED_IMAGE (widget));
- g_return_if_fail (EAZEL_SERVICES_IS_FOOTER (callback_data));
- g_return_if_fail (EEL_IS_LABELED_IMAGE (gtk_object_get_data (GTK_OBJECT (widget), "left-bumper")));
- g_return_if_fail (EEL_IS_LABELED_IMAGE (widget));
- g_return_if_fail (EEL_IS_LABELED_IMAGE (gtk_object_get_data (GTK_OBJECT (widget), "right-bumper")));
-
- footer = EAZEL_SERVICES_FOOTER (callback_data);
-
- left_bumper = EEL_LABELED_IMAGE (gtk_object_get_data (GTK_OBJECT (widget), "left-bumper"));
- label = EEL_LABELED_IMAGE (widget);
- right_bumper = EEL_LABELED_IMAGE (gtk_object_get_data (GTK_OBJECT (widget), "right-bumper"));
-
- eel_labeled_image_set_tile_pixbuf (label, footer->details->item_tile);
- eel_labeled_image_set_pixbuf (left_bumper, footer->details->left_bumper_tile_pixbuf);
- eel_labeled_image_set_pixbuf (right_bumper, footer->details->right_bumper_tile_pixbuf);
-}
-
-static GtkWidget *
-footer_item_new (EazelServicesFooter *footer,
- const char *text,
- int index,
- gboolean has_left_bumper,
- gboolean has_right_bumper)
-{
- GtkWidget *hbox;
- GtkWidget *event_box;
- GtkWidget *left;
- GtkWidget *label;
- GtkWidget *right;
-
- g_return_val_if_fail (EAZEL_SERVICES_IS_FOOTER (footer), NULL);
- g_return_val_if_fail (text != NULL, NULL);
- g_return_val_if_fail (text[0] != '\0', NULL);
-
- event_box = gtk_event_box_new ();
- hbox = gtk_hbox_new (FALSE, 0);
- gtk_container_add (GTK_CONTAINER (event_box), hbox);
-
- if (has_left_bumper) {
- left = eazel_services_image_new_clickable (NULL, NULL, EAZEL_SERVICES_BACKGROUND_COLOR_RGB);
- eel_labeled_image_set_fill (EEL_LABELED_IMAGE (left), TRUE);
- }
- else {
- left = eazel_services_image_new_clickable (NULL, NULL, EAZEL_SERVICES_BACKGROUND_COLOR_RGB);
- eel_labeled_image_set_fill (EEL_LABELED_IMAGE (left), TRUE);
- }
-
- label = eazel_services_label_new_clickable (text,
- 1,
- 0.1,
- 0.3,
- 2,
- 0,
- EAZEL_SERVICES_TITLE_TEXT_COLOR_RGB,
- EAZEL_SERVICES_BACKGROUND_COLOR_RGB,
- NULL,
- FOOTER_TEXT_SIZE,
- TRUE);
-
- eel_labeled_image_set_fill (EEL_LABELED_IMAGE (label), TRUE);
-
- if (has_right_bumper) {
- right = eazel_services_image_new_clickable (NULL, NULL, EAZEL_SERVICES_BACKGROUND_COLOR_RGB);
- eel_labeled_image_set_fill (EEL_LABELED_IMAGE (right), TRUE);
- }
- else {
- right = eazel_services_image_new_clickable (NULL, NULL, EAZEL_SERVICES_BACKGROUND_COLOR_RGB);
- eel_labeled_image_set_fill (EEL_LABELED_IMAGE (right), TRUE);
- }
-
-
- gtk_object_set_data (GTK_OBJECT (left), "index", GINT_TO_POINTER (index));
- gtk_object_set_data (GTK_OBJECT (label), "index", GINT_TO_POINTER (index));
- gtk_object_set_data (GTK_OBJECT (right), "index", GINT_TO_POINTER (index));
-
- gtk_object_set_data (GTK_OBJECT (label), "left-bumper", left);
- gtk_object_set_data (GTK_OBJECT (label), "right-bumper", right);
-
- gtk_signal_connect (GTK_OBJECT (left), "clicked", GTK_SIGNAL_FUNC (footer_item_clicked_callback), footer);
- gtk_signal_connect (GTK_OBJECT (label), "clicked", GTK_SIGNAL_FUNC (footer_item_clicked_callback), footer);
- gtk_signal_connect (GTK_OBJECT (right), "clicked", GTK_SIGNAL_FUNC (footer_item_clicked_callback), footer);
-
- gtk_signal_connect (GTK_OBJECT (label), "enter", GTK_SIGNAL_FUNC (footer_item_enter_callback), footer);
- gtk_signal_connect (GTK_OBJECT (label), "leave", GTK_SIGNAL_FUNC (footer_item_leave_callback), footer);
-
- footer_item_leave_callback (label, footer);
-
- gtk_box_pack_start (GTK_BOX (hbox), left, FALSE, FALSE, 0);
- gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
- gtk_box_pack_start (GTK_BOX (hbox), right, FALSE, FALSE, 0);
-
- gtk_widget_show_all (hbox);
-
- return event_box;
-}
-
-static GtkWidget *
-footer_remainder_new (void)
-{
- GtkWidget *hbox;
- GtkWidget *left;
- GtkWidget *fill;
- GtkWidget *right;
-
- hbox = gtk_hbox_new (FALSE, 0);
-
- left = eazel_services_image_new (EAZEL_SERVICES_REMAINDER_LEFT_BUMPER, NULL, EAZEL_SERVICES_BACKGROUND_COLOR_RGB);
- fill = eazel_services_image_new (NULL, EAZEL_SERVICES_REMAINDER_FILL, EAZEL_SERVICES_BACKGROUND_COLOR_RGB);
- right = eazel_services_image_new (EAZEL_SERVICES_REMAINDER_RIGHT_BUMPER, NULL, EAZEL_SERVICES_BACKGROUND_COLOR_RGB);
-
- gtk_box_pack_start (GTK_BOX (hbox), left, FALSE, FALSE, 0);
- gtk_box_pack_start (GTK_BOX (hbox), fill, TRUE, TRUE, 0);
- gtk_box_pack_start (GTK_BOX (hbox), right, FALSE, FALSE, 0);
-
- gtk_widget_show (left);
- gtk_widget_show (fill);
- gtk_widget_show (right);
-
- return hbox;
-}
-
-/* EazelServicesFooter public methods */
-GtkWidget *
-eazel_services_footer_new (void)
-{
- EazelServicesFooter *footer;
-
- footer = EAZEL_SERVICES_FOOTER (gtk_widget_new (eazel_services_footer_get_type (), NULL));
-
- return GTK_WIDGET (footer);
-}
-
-void
-eazel_services_footer_update (EazelServicesFooter *footer,
- const char *items[],
- guint num_items)
-{
- GtkWidget *remainder;
- guint i;
- char *date_string;
-
- g_return_if_fail (EAZEL_SERVICES_IS_FOOTER (footer));
- g_return_if_fail (items != NULL);
- g_return_if_fail (num_items > 0);
-
- gtk_container_foreach (GTK_CONTAINER (footer),
- (GtkCallback) gtk_widget_destroy,
- NULL);
-
- for (i = 0; i < num_items; i++) {
- GtkWidget *item;
-
- item = footer_item_new (footer, items[i], i, i > 0, i < (num_items - 1));
-
- gtk_box_pack_start (GTK_BOX (footer), item, FALSE, FALSE, 0);
- gtk_widget_show (item);
- }
-
- remainder = footer_remainder_new ();
- gtk_box_pack_start (GTK_BOX (footer), remainder, TRUE, TRUE, 0);
-
- date_string = eazel_services_get_current_date_string ();
-
- footer->details->date = eazel_services_label_new (date_string,
- 1,
- 0.1,
- 0.3,
- 5,
- 0,
- EAZEL_SERVICES_TITLE_TEXT_COLOR_RGB,
- EAZEL_SERVICES_BACKGROUND_COLOR_RGB,
- EAZEL_SERVICES_NORMAL_FILL,
- FOOTER_TEXT_SIZE,
- TRUE);
-
- g_free (date_string);
-
- gtk_widget_show (remainder);
- gtk_widget_show (footer->details->date);
-
- gtk_box_pack_start (GTK_BOX (footer), footer->details->date, FALSE, FALSE, 0);
-}
-
-void
-eazel_services_footer_set_date (EazelServicesFooter *footer,
- const char *date)
-{
-
- g_return_if_fail (EAZEL_SERVICES_IS_FOOTER (footer));
- g_return_if_fail (date != NULL);
- g_return_if_fail (date[0] != '\0');
-
- g_return_if_fail (EEL_IS_LABEL (footer->details->date));
-
- eel_label_set_text (EEL_LABEL (footer->details->date), date);
-}
diff --git a/components/services/nautilus-dependent-shared/eazel-services-footer.h b/components/services/nautilus-dependent-shared/eazel-services-footer.h
deleted file mode 100644
index d689d671f..000000000
--- a/components/services/nautilus-dependent-shared/eazel-services-footer.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-
-/* eazel-services-footer.h - A footer widget for services views.
-
- Copyright (C) 2000 Eazel, Inc.
-
- The Gnome Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
-
- The Gnome Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with the Gnome Library; see the file COPYING.LIB. If not,
- write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA.
-
- Authors: Ramiro Estrugo <ramiro@eazel.com>
-*/
-
-#ifndef EAZEL_SERVICES_FOOTER_H
-#define EAZEL_SERVICES_FOOTER_H
-
-#include <gtk/gtkhbox.h>
-#include <libgnome/gnome-defs.h>
-
-BEGIN_GNOME_DECLS
-
-#define EAZEL_SERVICES_TYPE_FOOTER (eazel_services_footer_get_type ())
-#define EAZEL_SERVICES_FOOTER(obj) (GTK_CHECK_CAST ((obj), EAZEL_SERVICES_TYPE_FOOTER, EazelServicesFooter))
-#define EAZEL_SERVICES_FOOTER_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), EAZEL_SERVICES_TYPE_FOOTER, EazelServicesFooterClass))
-#define EAZEL_SERVICES_IS_FOOTER(obj) (GTK_CHECK_TYPE ((obj), EAZEL_SERVICES_TYPE_FOOTER))
-#define EAZEL_SERVICES_IS_FOOTER_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), EAZEL_SERVICES_TYPE_FOOTER))
-
-typedef struct _EazelServicesFooter EazelServicesFooter;
-typedef struct _EazelServicesFooterClass EazelServicesFooterClass;
-typedef struct _EazelServicesFooterDetails EazelServicesFooterDetails;
-
-struct _EazelServicesFooter
-{
- /* Super Class */
- GtkHBox hbox;
-
- /* Private stuff */
- EazelServicesFooterDetails *details;
-};
-
-struct _EazelServicesFooterClass
-{
- /* Super Class */
- GtkHBoxClass hbox_class;
-};
-
-GtkType eazel_services_footer_get_type (void);
-GtkWidget* eazel_services_footer_new (void);
-void eazel_services_footer_update (EazelServicesFooter *footer,
- const char *items[],
- guint num_items);
-void eazel_services_footer_set_date (EazelServicesFooter *footer,
- const char *date);
-
-END_GNOME_DECLS
-
-#endif /* EAZEL_SERVICES_FOOTER_H */
-
-
diff --git a/components/services/nautilus-dependent-shared/eazel-services-header.c b/components/services/nautilus-dependent-shared/eazel-services-header.c
deleted file mode 100644
index 4b78562bb..000000000
--- a/components/services/nautilus-dependent-shared/eazel-services-header.c
+++ /dev/null
@@ -1,204 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-
-/* eazel-services-header.c - A header widget for services views.
-
- Copyright (C) 2000 Eazel, Inc.
-
- The Gnome Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
-
- The Gnome Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with the Gnome Library; see the file COPYING.LIB. If not,
- write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA.
-
- Authors: Ramiro Estrugo <ramiro@eazel.com>
-*/
-
-#include <config.h>
-
-#include "eazel-services-header.h"
-#include "eazel-services-extensions.h"
-
-#include <eel/eel-gtk-macros.h>
-#include <eel/eel-image.h>
-#include <eel/eel-label.h>
-
-#include <gtk/gtksignal.h>
-#include <gtk/gtkeventbox.h>
-
-struct _EazelServicesHeaderDetails
-{
- GtkWidget *left_text;
- GtkWidget *right_text;
-};
-
-/* GtkObjectClass methods */
-static void eazel_services_header_initialize_class (EazelServicesHeaderClass *klass);
-static void eazel_services_header_initialize (EazelServicesHeader *header);
-static void header_destroy (GtkObject *object);
-
-EEL_DEFINE_CLASS_BOILERPLATE (EazelServicesHeader, eazel_services_header, GTK_TYPE_HBOX)
-
-/* EazelServicesHeaderClass methods */
-static void
-eazel_services_header_initialize_class (EazelServicesHeaderClass *header_class)
-{
- GtkObjectClass *object_class;
-
- object_class = GTK_OBJECT_CLASS (header_class);
-
- /* GtkObjectClass */
- object_class->destroy = header_destroy;
-}
-
-static void
-eazel_services_header_initialize (EazelServicesHeader *item)
-{
- item->details = g_new0 (EazelServicesHeaderDetails, 1);
-}
-
-/* GtkObjectClass methods */
-static void
-header_destroy (GtkObject *object)
-{
- EazelServicesHeader *header;
-
- g_return_if_fail (EAZEL_SERVICES_IS_HEADER (object));
-
- header = EAZEL_SERVICES_HEADER (object);
-
- g_free (header->details);
-
- /* Chain destroy */
- EEL_CALL_PARENT (GTK_OBJECT_CLASS, destroy, (object));
-}
-
-/* EazelServicesHeader public methods */
-GtkWidget *
-eazel_services_header_title_new (const char *left_text)
-{
- EazelServicesHeader *header;
- GtkWidget *fill;
- GtkWidget *logo;
-
- header = EAZEL_SERVICES_HEADER (gtk_widget_new (eazel_services_header_get_type (), NULL));
-
- header->details->left_text = eazel_services_label_new (left_text,
- 1,
- 0.1,
- 0.1,
- 10,
- 0,
- EAZEL_SERVICES_TITLE_TEXT_COLOR_RGB,
- EAZEL_SERVICES_BACKGROUND_COLOR_RGB,
- EAZEL_SERVICES_HEADER_TITLE_FILL_ICON,
- EAZEL_SERVICES_HEADER_TEXT_SIZE_REL,
- TRUE);
-
- gtk_box_pack_start (GTK_BOX (header), header->details->left_text, FALSE, FALSE, 0);
- gtk_widget_show (header->details->left_text);
-
- fill = eazel_services_image_new (NULL,
- EAZEL_SERVICES_HEADER_TITLE_FILL_ICON,
- EAZEL_SERVICES_BACKGROUND_COLOR_RGB);
-
- gtk_box_pack_start (GTK_BOX (header), fill, TRUE, TRUE, 0);
- gtk_widget_show (fill);
-
- logo = eazel_services_image_new (EAZEL_SERVICES_HEADER_TITLE_LOGO_ICON,
- NULL,
- EAZEL_SERVICES_BACKGROUND_COLOR_RGB);
- gtk_box_pack_end (GTK_BOX (header), logo, FALSE, FALSE, 0);
- gtk_widget_show (logo);
-
- return GTK_WIDGET (header);
-}
-
-GtkWidget *
-eazel_services_header_middle_new (const char *left_text,
- const char *right_text)
-{
- EazelServicesHeader *header;
- GtkWidget *fill;
-
- header = EAZEL_SERVICES_HEADER (gtk_widget_new (eazel_services_header_get_type (), NULL));
-
- header->details->left_text =
- eazel_services_label_new (left_text,
- 0,
- 0.1,
- 0.3,
- 10,
- 0,
- EAZEL_SERVICES_TITLE_TEXT_COLOR_RGB,
- EAZEL_SERVICES_BACKGROUND_COLOR_RGB,
- EAZEL_SERVICES_HEADER_MIDDLE_FILL_ICON,
- 0,
- TRUE);
-
- eel_label_set_tile_height (EEL_LABEL (header->details->left_text),
- EEL_SMOOTH_TILE_EXTENT_ONE_STEP);
-
- gtk_box_pack_start (GTK_BOX (header), header->details->left_text, FALSE, FALSE, 0);
- gtk_widget_show (header->details->left_text);
-
- fill = eazel_services_image_new (NULL,
- EAZEL_SERVICES_HEADER_MIDDLE_FILL_ICON,
- EAZEL_SERVICES_BACKGROUND_COLOR_RGB);
- eel_image_set_tile_height (EEL_IMAGE (fill),
- EEL_SMOOTH_TILE_EXTENT_ONE_STEP);
-
- gtk_box_pack_start (GTK_BOX (header), fill, TRUE, TRUE, 0);
- gtk_widget_show (fill);
-
- header->details->right_text =
- eazel_services_label_new (right_text,
- 0,
- 0.1,
- 0.3,
- 76,
- 0,
- EAZEL_SERVICES_TITLE_TEXT_COLOR_RGB,
- EAZEL_SERVICES_BACKGROUND_COLOR_RGB,
- EAZEL_SERVICES_HEADER_MIDDLE_FILL_ICON,
- -2,
- TRUE);
-
- eel_label_set_tile_height (EEL_LABEL (header->details->right_text),
- EEL_SMOOTH_TILE_EXTENT_ONE_STEP);
-
- gtk_box_pack_start (GTK_BOX (header), header->details->right_text, FALSE, FALSE, 0);
- gtk_widget_show (header->details->right_text);
-
- return GTK_WIDGET (header);
-}
-
-void
-eazel_services_header_set_left_text (EazelServicesHeader *header,
- const char *text)
-{
- g_return_if_fail (EAZEL_SERVICES_IS_HEADER (header));
- g_return_if_fail (text != NULL);
- g_return_if_fail (EEL_IS_LABEL (header->details->left_text));
-
- eel_label_set_text (EEL_LABEL (header->details->left_text), text);
-}
-
-void
-eazel_services_header_set_right_text (EazelServicesHeader *header,
- const char *text)
-{
- g_return_if_fail (EAZEL_SERVICES_IS_HEADER (header));
- g_return_if_fail (text != NULL);
- g_return_if_fail (EEL_IS_LABEL (header->details->right_text));
-
- eel_label_set_text (EEL_LABEL (header->details->right_text), text);
-}
diff --git a/components/services/nautilus-dependent-shared/eazel-services-header.h b/components/services/nautilus-dependent-shared/eazel-services-header.h
deleted file mode 100644
index 623d90d6a..000000000
--- a/components/services/nautilus-dependent-shared/eazel-services-header.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-
-/* eazel-services-header.h - A header widget for services views.
-
- Copyright (C) 2000 Eazel, Inc.
-
- The Gnome Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
-
- The Gnome Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with the Gnome Library; see the file COPYING.LIB. If not,
- write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA.
-
- Authors: Ramiro Estrugo <ramiro@eazel.com>
-*/
-
-#ifndef EAZEL_SERVICES_HEADER_H
-#define EAZEL_SERVICES_HEADER_H
-
-#include <gtk/gtkhbox.h>
-#include <libgnome/gnome-defs.h>
-
-BEGIN_GNOME_DECLS
-
-#define EAZEL_SERVICES_TYPE_HEADER (eazel_services_header_get_type ())
-#define EAZEL_SERVICES_HEADER(obj) (GTK_CHECK_CAST ((obj), EAZEL_SERVICES_TYPE_HEADER, EazelServicesHeader))
-#define EAZEL_SERVICES_HEADER_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), EAZEL_SERVICES_TYPE_HEADER, EazelServicesHeaderClass))
-#define EAZEL_SERVICES_IS_HEADER(obj) (GTK_CHECK_TYPE ((obj), EAZEL_SERVICES_TYPE_HEADER))
-#define EAZEL_SERVICES_IS_HEADER_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), EAZEL_SERVICES_TYPE_HEADER))
-
-typedef struct _EazelServicesHeader EazelServicesHeader;
-typedef struct _EazelServicesHeaderClass EazelServicesHeaderClass;
-typedef struct _EazelServicesHeaderDetails EazelServicesHeaderDetails;
-
-struct _EazelServicesHeader
-{
- /* Super Class */
- GtkHBox hbox;
-
- /* Private stuff */
- EazelServicesHeaderDetails *details;
-};
-
-struct _EazelServicesHeaderClass
-{
- /* Super Class */
- GtkHBoxClass hbox_class;
-};
-
-GtkType eazel_services_header_get_type (void);
-GtkWidget* eazel_services_header_title_new (const char *left_text);
-GtkWidget* eazel_services_header_middle_new (const char *left_text,
- const char *right_text);
-void eazel_services_header_set_left_text (EazelServicesHeader *header,
- const char *text);
-void eazel_services_header_set_right_text (EazelServicesHeader *header,
- const char *text);
-
-END_GNOME_DECLS
-
-#endif /* EAZEL_SERVICES_HEADER_H */
-
-
diff --git a/components/services/nautilus-dependent-shared/icons/.cvsignore b/components/services/nautilus-dependent-shared/icons/.cvsignore
deleted file mode 100644
index 282522db0..000000000
--- a/components/services/nautilus-dependent-shared/icons/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-Makefile
-Makefile.in
diff --git a/components/services/nautilus-dependent-shared/icons/Makefile.am b/components/services/nautilus-dependent-shared/icons/Makefile.am
deleted file mode 100644
index d987c7c6b..000000000
--- a/components/services/nautilus-dependent-shared/icons/Makefile.am
+++ /dev/null
@@ -1,33 +0,0 @@
-NULL =
-
-icondir = $(datadir)/pixmaps/nautilus
-
-icon_DATA =\
- config-gather.png \
- eazel-logo-left-side-repeat.png \
- eazel-logo-right-side-logo.png \
- eazel-services-header-middle-fill.png \
- eazel-services-logo-tile.png \
- inventory-service-icon.png \
- register.png \
- service-summary-large-grey-section.png \
- service-summary-large-teal-section.png \
- service-summary-logo-bottom.png \
- service-summary-short-grey-section.png \
- service-watch.png \
- services-warning.png \
- softcat-service-icon.png \
- summary-service-normal-fill.png \
- summary-service-normal-left-bumper.png \
- summary-service-normal-right-bumper.png \
- summary-service-prelight-fill.png \
- summary-service-prelight-left-bumper.png \
- summary-service-prelight-right-bumper.png \
- summary-service-remainder-fill.png \
- summary-service-remainder-left-bumper.png \
- summary-service-remainder-right-bumper.png \
- time-sync-service-icon.png \
- vault-service-icon.png \
- $(NULL)
-
-EXTRA_DIST = $(icon_DATA)
diff --git a/components/services/nautilus-dependent-shared/icons/config-gather.png b/components/services/nautilus-dependent-shared/icons/config-gather.png
deleted file mode 100644
index 0791294b5..000000000
--- a/components/services/nautilus-dependent-shared/icons/config-gather.png
+++ /dev/null
Binary files differ
diff --git a/components/services/nautilus-dependent-shared/icons/eazel-logo-left-side-repeat.png b/components/services/nautilus-dependent-shared/icons/eazel-logo-left-side-repeat.png
deleted file mode 100644
index 635075a27..000000000
--- a/components/services/nautilus-dependent-shared/icons/eazel-logo-left-side-repeat.png
+++ /dev/null
Binary files differ
diff --git a/components/services/nautilus-dependent-shared/icons/eazel-logo-right-side-logo.png b/components/services/nautilus-dependent-shared/icons/eazel-logo-right-side-logo.png
deleted file mode 100644
index ae78c446a..000000000
--- a/components/services/nautilus-dependent-shared/icons/eazel-logo-right-side-logo.png
+++ /dev/null
Binary files differ
diff --git a/components/services/nautilus-dependent-shared/icons/eazel-services-header-middle-fill.png b/components/services/nautilus-dependent-shared/icons/eazel-services-header-middle-fill.png
deleted file mode 100644
index f76f74eb9..000000000
--- a/components/services/nautilus-dependent-shared/icons/eazel-services-header-middle-fill.png
+++ /dev/null
Binary files differ
diff --git a/components/services/nautilus-dependent-shared/icons/eazel-services-logo-tile.png b/components/services/nautilus-dependent-shared/icons/eazel-services-logo-tile.png
deleted file mode 100644
index aa39b8fe6..000000000
--- a/components/services/nautilus-dependent-shared/icons/eazel-services-logo-tile.png
+++ /dev/null
Binary files differ
diff --git a/components/services/nautilus-dependent-shared/icons/inventory-service-icon.png b/components/services/nautilus-dependent-shared/icons/inventory-service-icon.png
deleted file mode 100644
index edde4b820..000000000
--- a/components/services/nautilus-dependent-shared/icons/inventory-service-icon.png
+++ /dev/null
Binary files differ
diff --git a/components/services/nautilus-dependent-shared/icons/register.png b/components/services/nautilus-dependent-shared/icons/register.png
deleted file mode 100644
index bd56b4d2f..000000000
--- a/components/services/nautilus-dependent-shared/icons/register.png
+++ /dev/null
Binary files differ
diff --git a/components/services/nautilus-dependent-shared/icons/service-summary-large-grey-section.png b/components/services/nautilus-dependent-shared/icons/service-summary-large-grey-section.png
deleted file mode 100644
index 64846be36..000000000
--- a/components/services/nautilus-dependent-shared/icons/service-summary-large-grey-section.png
+++ /dev/null
Binary files differ
diff --git a/components/services/nautilus-dependent-shared/icons/service-summary-large-teal-section.png b/components/services/nautilus-dependent-shared/icons/service-summary-large-teal-section.png
deleted file mode 100644
index f58582645..000000000
--- a/components/services/nautilus-dependent-shared/icons/service-summary-large-teal-section.png
+++ /dev/null
Binary files differ
diff --git a/components/services/nautilus-dependent-shared/icons/service-summary-logo-bottom.png b/components/services/nautilus-dependent-shared/icons/service-summary-logo-bottom.png
deleted file mode 100644
index 3cf0ed4bd..000000000
--- a/components/services/nautilus-dependent-shared/icons/service-summary-logo-bottom.png
+++ /dev/null
Binary files differ
diff --git a/components/services/nautilus-dependent-shared/icons/service-summary-short-grey-section.png b/components/services/nautilus-dependent-shared/icons/service-summary-short-grey-section.png
deleted file mode 100644
index 258b366b2..000000000
--- a/components/services/nautilus-dependent-shared/icons/service-summary-short-grey-section.png
+++ /dev/null
Binary files differ
diff --git a/components/services/nautilus-dependent-shared/icons/service-watch.png b/components/services/nautilus-dependent-shared/icons/service-watch.png
deleted file mode 100644
index fb9ef8885..000000000
--- a/components/services/nautilus-dependent-shared/icons/service-watch.png
+++ /dev/null
Binary files differ
diff --git a/components/services/nautilus-dependent-shared/icons/services-warning.png b/components/services/nautilus-dependent-shared/icons/services-warning.png
deleted file mode 100644
index abea9dde4..000000000
--- a/components/services/nautilus-dependent-shared/icons/services-warning.png
+++ /dev/null
Binary files differ
diff --git a/components/services/nautilus-dependent-shared/icons/softcat-service-icon.png b/components/services/nautilus-dependent-shared/icons/softcat-service-icon.png
deleted file mode 100644
index b5e3da0a0..000000000
--- a/components/services/nautilus-dependent-shared/icons/softcat-service-icon.png
+++ /dev/null
Binary files differ
diff --git a/components/services/nautilus-dependent-shared/icons/summary-service-normal-fill.png b/components/services/nautilus-dependent-shared/icons/summary-service-normal-fill.png
deleted file mode 100644
index 9e56c4550..000000000
--- a/components/services/nautilus-dependent-shared/icons/summary-service-normal-fill.png
+++ /dev/null
Binary files differ
diff --git a/components/services/nautilus-dependent-shared/icons/summary-service-normal-left-bumper.png b/components/services/nautilus-dependent-shared/icons/summary-service-normal-left-bumper.png
deleted file mode 100644
index 7cde6fbf6..000000000
--- a/components/services/nautilus-dependent-shared/icons/summary-service-normal-left-bumper.png
+++ /dev/null
Binary files differ
diff --git a/components/services/nautilus-dependent-shared/icons/summary-service-normal-right-bumper.png b/components/services/nautilus-dependent-shared/icons/summary-service-normal-right-bumper.png
deleted file mode 100644
index 457980b20..000000000
--- a/components/services/nautilus-dependent-shared/icons/summary-service-normal-right-bumper.png
+++ /dev/null
Binary files differ
diff --git a/components/services/nautilus-dependent-shared/icons/summary-service-prelight-fill.png b/components/services/nautilus-dependent-shared/icons/summary-service-prelight-fill.png
deleted file mode 100644
index cac12a497..000000000
--- a/components/services/nautilus-dependent-shared/icons/summary-service-prelight-fill.png
+++ /dev/null
Binary files differ
diff --git a/components/services/nautilus-dependent-shared/icons/summary-service-prelight-left-bumper.png b/components/services/nautilus-dependent-shared/icons/summary-service-prelight-left-bumper.png
deleted file mode 100644
index b0271a31b..000000000
--- a/components/services/nautilus-dependent-shared/icons/summary-service-prelight-left-bumper.png
+++ /dev/null
Binary files differ
diff --git a/components/services/nautilus-dependent-shared/icons/summary-service-prelight-right-bumper.png b/components/services/nautilus-dependent-shared/icons/summary-service-prelight-right-bumper.png
deleted file mode 100644
index 2bb9ba926..000000000
--- a/components/services/nautilus-dependent-shared/icons/summary-service-prelight-right-bumper.png
+++ /dev/null
Binary files differ
diff --git a/components/services/nautilus-dependent-shared/icons/summary-service-remainder-fill.png b/components/services/nautilus-dependent-shared/icons/summary-service-remainder-fill.png
deleted file mode 100644
index c7a66e559..000000000
--- a/components/services/nautilus-dependent-shared/icons/summary-service-remainder-fill.png
+++ /dev/null
Binary files differ
diff --git a/components/services/nautilus-dependent-shared/icons/summary-service-remainder-left-bumper.png b/components/services/nautilus-dependent-shared/icons/summary-service-remainder-left-bumper.png
deleted file mode 100644
index e86b3f269..000000000
--- a/components/services/nautilus-dependent-shared/icons/summary-service-remainder-left-bumper.png
+++ /dev/null
Binary files differ
diff --git a/components/services/nautilus-dependent-shared/icons/summary-service-remainder-right-bumper.png b/components/services/nautilus-dependent-shared/icons/summary-service-remainder-right-bumper.png
deleted file mode 100644
index 3e9b0e97c..000000000
--- a/components/services/nautilus-dependent-shared/icons/summary-service-remainder-right-bumper.png
+++ /dev/null
Binary files differ
diff --git a/components/services/nautilus-dependent-shared/icons/time-sync-service-icon.png b/components/services/nautilus-dependent-shared/icons/time-sync-service-icon.png
deleted file mode 100644
index 94cda9121..000000000
--- a/components/services/nautilus-dependent-shared/icons/time-sync-service-icon.png
+++ /dev/null
Binary files differ
diff --git a/components/services/nautilus-dependent-shared/icons/vault-service-icon.png b/components/services/nautilus-dependent-shared/icons/vault-service-icon.png
deleted file mode 100644
index 237150f4a..000000000
--- a/components/services/nautilus-dependent-shared/icons/vault-service-icon.png
+++ /dev/null
Binary files differ
diff --git a/components/services/nautilus-dependent-shared/test-footer-header.c b/components/services/nautilus-dependent-shared/test-footer-header.c
deleted file mode 100644
index 862b07b4e..000000000
--- a/components/services/nautilus-dependent-shared/test-footer-header.c
+++ /dev/null
@@ -1,98 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-
-/* test-footer-header.c - Test for footer/header widgetry.
-
- Copyright (C) 2000 Eazel, Inc.
-
- The Gnome Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
-
- The Gnome Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with the Gnome Library; see the file COPYING.LIB. If not,
- write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA.
-
- Authors: Ramiro Estrugo <ramiro@eazel.com>
-*/
-
-#include <config.h>
-
-#include <gtk/gtk.h>
-#include "eazel-services-extensions.h"
-#include "eazel-services-footer.h"
-#include "eazel-services-header.h"
-
-static void
-delete_event (GtkWidget *widget, GdkEvent *event, gpointer callback_data)
-{
- gtk_main_quit ();
-}
-
-static const char *footer_items[] =
-{
- "Register",
- "Login",
- "Terms of Use",
- "Privacy Statement"
-};
-
-static void
-footer_item_clicked_callback (GtkWidget *widget, int index, gpointer callback_data)
-{
- g_print ("footer_item_clicked_callback(%d)\n", index);
-}
-
-int
-main (int argc, char* argv[])
-{
- GtkWidget *window;
- GtkWidget *vbox;
- GtkWidget *header;
- GtkWidget *footer;
- GtkWidget *content;
- GtkWidget *middle;
-
- gtk_init (&argc, &argv);
- gdk_rgb_init ();
-
- window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- eel_gtk_widget_set_background_color (window, EAZEL_SERVICES_BACKGROUND_COLOR_SPEC);
- gtk_signal_connect (GTK_OBJECT (window), "delete_event", GTK_SIGNAL_FUNC (delete_event), NULL);
- gtk_window_set_title (GTK_WINDOW (window), "Nautilus Wrapped Label Test");
- gtk_window_set_policy (GTK_WINDOW (window), TRUE, TRUE, FALSE);
- gtk_container_set_border_width (GTK_CONTAINER (window), 10);
- gtk_widget_set_usize (window, 640, 480);
-
- vbox = gtk_vbox_new (FALSE, 0);
- gtk_container_add (GTK_CONTAINER (window), vbox);
-
- header = eazel_services_header_title_new ("Welcome back, Arlo!");
- content = gtk_vbox_new (FALSE, 0);
-
- middle = eazel_services_header_middle_new ("Left", "Right");
- gtk_box_pack_start (GTK_BOX (content), middle, FALSE, FALSE, 0);
-
- footer = eazel_services_footer_new ();
- gtk_signal_connect (GTK_OBJECT (footer), "item_clicked", GTK_SIGNAL_FUNC (footer_item_clicked_callback), NULL);
-
- eazel_services_footer_update (EAZEL_SERVICES_FOOTER (footer),
- footer_items,
- EEL_N_ELEMENTS (footer_items));
-
- gtk_box_pack_start (GTK_BOX (vbox), header, FALSE, FALSE, 0);
- gtk_box_pack_start (GTK_BOX (vbox), content, TRUE, TRUE, 0);
- gtk_box_pack_end (GTK_BOX (vbox), footer, FALSE, FALSE, 0);
-
- gtk_widget_show_all (window);
-
- gtk_main ();
-
- return 0;
-}
diff --git a/components/services/summary/.cvsignore b/components/services/summary/.cvsignore
deleted file mode 100644
index bfcf5f908..000000000
--- a/components/services/summary/.cvsignore
+++ /dev/null
@@ -1,6 +0,0 @@
-.deps
-.libs
-Makefile
-Makefile.in
-nautilus-summary-view
-Nautilus_View_services-summary.oaf
diff --git a/components/services/summary/Makefile.am b/components/services/summary/Makefile.am
deleted file mode 100644
index 8c81e3d33..000000000
--- a/components/services/summary/Makefile.am
+++ /dev/null
@@ -1,77 +0,0 @@
-include $(top_srcdir)/Makefile.shared
-
-if BUILD_RPM_COMPONENTS
-INVENTORY_LIBS=$(top_builddir)/components/services/inventory/libtrilobite-inventory-service.la
-else
-INVENTORY_LIBS=
-endif
-
-SUBDIRS = icons
-
-INCLUDES = \
- -DPREFIX=\"$(prefix)\" \
- -DG_LOG_DOMAIN=\"trilobite-eazel-summary\" \
- -DDATADIR=\"$(datadir)\" \
- -I$(top_srcdir) \
- -I$(top_srcdir)/components/services/nautilus-dependent-shared \
- -I$(top_srcdir)/components/services/trilobite \
- -I$(top_builddir) \
- $(EEL_INCLUDEDIR) \
- $(LIBRSVG_INCLUDEDIR) \
- $(GNOMEUI_CFLAGS) \
- $(GCONF_CFLAGS) \
- -DGNOMELOCALEDIR=\""$(datadir)/locale"\" \
- $(VFS_CFLAGS) \
- $(XML_CFLAGS) \
- $(NULL)
-
-uidir = $(datadir)/gnome/ui
-ui_DATA = nautilus-summary-view-ui.xml
-
-bin_PROGRAMS = \
- nautilus-summary-view
-
-nautilus_summary_view_SOURCES = \
- eazel-summary-shared.c \
- eazel-summary-shared.h \
- main.c \
- nautilus-summary-callbacks.c \
- nautilus-summary-callbacks.h \
- nautilus-summary-dialogs.c \
- nautilus-summary-dialogs.h \
- nautilus-summary-footer.c \
- nautilus-summary-footer.h \
- nautilus-summary-menu-items.c \
- nautilus-summary-menu-items.h \
- nautilus-summary-view-private.h \
- nautilus-summary-view.c \
- nautilus-summary-view.h \
- nautilus-tabs.c \
- nautilus-tabs.h \
- $(NULL)
-
-nautilus_summary_view_LDADD = \
- $(top_builddir)/components/services/trilobite/libtrilobite/libtrilobite.la \
- $(top_builddir)/components/services/nautilus-dependent-shared/libnautilusdepshared.a \
- $(INVENTORY_LIBS) \
- $(top_builddir)/libnautilus/libnautilus.la \
- $(EEL_LIBS) \
- $(LIBRSVG_LIBS) \
- $(BONOBO_LIBS) \
- $(GNOMEUI_LIBS) \
- $(GCONF_LIBS) \
- $(VFS_LIBS) \
- $(GHTTP_LIBS) \
- $(OAF_LIBS) \
- $(AMMONITE_LIBS) \
- $(NULL)
-
-oafdir = $(datadir)/oaf
-oaf_in_files = \
- Nautilus_View_services-summary.oaf.in \
- $(NULL)
-oaf_DATA = $(oaf_in_files:.oaf.in=.oaf)
-
-@XML_I18N_MERGE_OAF_RULE@
-
-EXTRA_DIST = $(oaf_in_files) $(oaf_DATA) $(ui_DATA)
diff --git a/components/services/summary/Nautilus_View_services-summary.oaf.in b/components/services/summary/Nautilus_View_services-summary.oaf.in
deleted file mode 100644
index 48e03e604..000000000
--- a/components/services/summary/Nautilus_View_services-summary.oaf.in
+++ /dev/null
@@ -1,27 +0,0 @@
-<oaf_info>
-
-<oaf_server iid="OAFIID:nautilus_summary_view_factory:1b0b1018-e0ca-4f14-8d23-7a134486ab30" type="exe" location="nautilus-summary-view">
- <oaf_attribute name="repo_ids" type="stringv">
- <item value="IDL:GNOME/ObjectFactory:1.0"/>
- </oaf_attribute>
- <oaf_attribute name="name" type="string" _value="Nautilus Service Summary View Factory"/>
- <oaf_attribute name="description" type="string" _value="Service Summary View Component's Factory"/>
-</oaf_server>
-
-<oaf_server iid="OAFIID:nautilus_summary_view:92811b0e-beb2-49db-858c-19a0dc8517e5" type="factory" location="OAFIID:nautilus_summary_view_factory:1b0b1018-e0ca-4f14-8d23-7a134486ab30">
- <oaf_attribute name="repo_ids" type="stringv">
- <item value="IDL:Bonobo/Unknown:1.0"/>
- <item value="IDL:Bonobo/Control:1.0"/>
- <item value="IDL:Nautilus/View:1.0"/>
- </oaf_attribute>
- <oaf_attribute name="name" type="string" _value="Nautilus Summary View"/>
- <oaf_attribute name="description" type="string" _value="Service Summary view component"/>
- <oaf_attribute name="bonobo:supported_uri_schemes" type="stringv">
- <item value="eazel"/>
- </oaf_attribute>
- <oaf_attribute name="nautilus:view_as_name" type="string" _value="Summary"/>
- <oaf_attribute name="nautilus:view_as_label" type="string" _value="View as Summary"/>
- <oaf_attribute name="nautilus:viewer_label" type="string" _value="Summary Viewer"/>
-</oaf_server>
-
-</oaf_info>
diff --git a/components/services/summary/eazel-summary-shared.c b/components/services/summary/eazel-summary-shared.c
deleted file mode 100644
index c28d9f0cf..000000000
--- a/components/services/summary/eazel-summary-shared.c
+++ /dev/null
@@ -1,384 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: J Shane Culpepper <pepper@eazel.com>
- */
-
-#include <config.h>
-
-#include "eazel-summary-shared.h"
-
-#include <ctype.h>
-#include <eel/eel-vfs-extensions.h>
-#include <glib.h>
-#include <gnome-xml/parser.h>
-#include <gnome-xml/tree.h>
-#include <gnome.h>
-#include <libtrilobite/libtrilobite.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-
-static GList * build_services_glist_from_xml (xmlNodePtr node);
-static GList * build_eazel_news_glist_from_xml (xmlNodePtr node);
-static GList * build_update_news_glist_from_xml (xmlNodePtr node);
-static SummaryData * summary_data_new (void);
-static ServicesData * services_data_new (void);
-static EazelNewsData * eazel_news_data_new (void);
-static UpdateNewsData * update_news_data_new (void);
-static ServicesData * parse_service (xmlNodePtr node);
-static EazelNewsData * parse_eazel_news_item (xmlNodePtr node);
-static UpdateNewsData * parse_update_news_item (xmlNodePtr node);
-
-
-static SummaryData *
-summary_data_new ()
-{
- SummaryData *return_value;
- return_value = g_new0 (SummaryData, 1);
-
- return_value->services_list = NULL;
- return_value->eazel_news_list = NULL;
- return_value->update_news_list = NULL;
-
- return return_value;
-
-} /* end summary_data_new */
-
-static ServicesData *
-services_data_new ()
-{
- ServicesData *return_value;
- return_value = g_new0 (ServicesData, 1);
-
- return_value->name = NULL;
- return_value->icon = NULL;
- return_value->button_label = NULL;
- return_value->description_header = NULL;
- return_value->description = NULL;
- return_value->enabled = TRUE;
-
- return return_value;
-
-} /* end services_data_new */
-
-static EazelNewsData *
-eazel_news_data_new ()
-{
- EazelNewsData *return_value;
- return_value = g_new0 (EazelNewsData, 1);
-
- return_value->name = NULL;
- return_value->icon = NULL;
- return_value->date = NULL;
- return_value->message = NULL;
-
- return return_value;
-
-} /* end eazel_news_data_new */
-
-static UpdateNewsData *
-update_news_data_new ()
-{
- UpdateNewsData *return_value;
- return_value = g_new0 (UpdateNewsData, 1);
-
- return_value->name = NULL;
- return_value->version = NULL;
- return_value->priority = NULL;
- return_value->description = NULL;
- return_value->icon = NULL;
- return_value->button_label = NULL;
- return_value->uri = NULL;
- return_value->softcat_uri = NULL;
-
- return return_value;
-
-} /* end update_news_data_new */
-
-static ServicesData *
-parse_service (xmlNodePtr node)
-{
- ServicesData *return_value;
- char *tempbuf;
-
- return_value = services_data_new ();
-
- return_value->name = g_strdup (trilobite_xml_get_string (node, "NAME"));
-
- if (return_value->name == NULL) {
- g_free (return_value);
- return NULL;
- }
-
- return_value->icon = g_strdup (trilobite_xml_get_string (node, "ICON"));
- return_value->button_label = g_strdup (trilobite_xml_get_string (node, "BUTTON_LABEL"));
- return_value->uri = g_strdup (trilobite_xml_get_string (node, "URI"));
- return_value->description_header = g_strdup (trilobite_xml_get_string (node, "DESCRIPTION_HEADER"));
- return_value->description = g_strdup (trilobite_xml_get_string (node, "DESCRIPTION"));
- tempbuf = g_strdup (trilobite_xml_get_string (node, "ENABLED"));
- if (tempbuf != NULL && (tempbuf[0] == 'T' || tempbuf[0] == 't')) {
- return_value->enabled = TRUE;
- } else if (tempbuf != NULL && (tempbuf[0] == 'F' || tempbuf[0] == 'f')) {
- return_value->enabled = FALSE;
- } else {
- return_value->enabled = FALSE;
- }
-
- return return_value;
-
-} /* end parse_service */
-
-static EazelNewsData *
-parse_eazel_news_item (xmlNodePtr node)
-{
- EazelNewsData *return_value;
- return_value = eazel_news_data_new ();
-
- return_value->name = g_strdup (trilobite_xml_get_string (node, "NAME"));
-
- if (return_value->name == NULL) {
- g_free (return_value);
- return NULL;
- }
-
- return_value->icon = g_strdup (trilobite_xml_get_string (node, "ICON"));
- return_value->date = g_strdup (trilobite_xml_get_string (node, "DATE"));
- return_value->message = g_strdup (trilobite_xml_get_string (node, "MESSAGE"));
-
- return return_value;
-
-} /* end parse_eazel_news_item */
-
-static UpdateNewsData *
-parse_update_news_item (xmlNodePtr node)
-{
- UpdateNewsData *return_value;
- return_value = update_news_data_new ();
-
- return_value->name = g_strdup (trilobite_xml_get_string (node, "NAME"));
-
- if (return_value->name == NULL) {
- g_free (return_value);
- return NULL;
- }
-
- return_value->version = g_strdup (trilobite_xml_get_string (node, "VERSION"));
- return_value->priority = g_strdup (trilobite_xml_get_string (node, "PRIORITY"));
- return_value->description = g_strdup (trilobite_xml_get_string (node, "DESCRIPTION"));
- return_value->icon = g_strdup (trilobite_xml_get_string (node, "ICON"));
- return_value->button_label = g_strdup (trilobite_xml_get_string (node, "BUTTON_LABEL"));
- return_value->uri = g_strdup (trilobite_xml_get_string (node, "URI"));
- return_value->softcat_uri = g_strdup (trilobite_xml_get_string (node, "SOFTCAT_URI"));
-
- return return_value;
-
-} /* end parse_update_news_item */
-
-static GList *
-build_services_glist_from_xml (xmlNodePtr node)
-{
- GList *return_value;
- xmlNodePtr service;
- ServicesData *sdata;
-
- return_value = NULL;
- service = node->xmlChildrenNode;
- if (service == NULL) {
- return NULL;
- }
-
- while (service != NULL) {
- sdata = parse_service (service);
- if (sdata != NULL) {
- return_value = g_list_append (return_value, sdata);
- }
- service = service->next;
- }
-
- return return_value;
-
-} /* end build_services_glist_from_xml */
-
-static GList *
-build_eazel_news_glist_from_xml (xmlNodePtr node)
-{
- GList *return_value;
- xmlNodePtr news_item;
- EazelNewsData *ndata;
-
- return_value = NULL;
- news_item = node->xmlChildrenNode;
- if (news_item == NULL) {
- return NULL;
- }
-
- while (news_item) {
- ndata = parse_eazel_news_item (news_item);
- if (ndata != NULL) {
- return_value = g_list_append (return_value, ndata);
- }
- news_item = news_item->next;
- }
-
- return return_value;
-} /* end build_eazel_news_glist_from_xml */
-
-static GList *
-build_update_news_glist_from_xml (xmlNodePtr node)
-{
- GList *return_value;
- xmlNodePtr news_item;
- UpdateNewsData *ndata;
-
- return_value = NULL;
- news_item = node->xmlChildrenNode;
- if (news_item == NULL) {
- return NULL;
- }
-
- while (news_item) {
- ndata = parse_update_news_item (news_item);
- if (ndata != NULL) {
- return_value = g_list_append (return_value, ndata);
- }
- news_item = news_item->next;
- }
-
- return return_value;
-
-} /* end build_update_news_glist_from_xml */
-
-
-
-
-static SummaryData *
-eazel_summary_data_parse_xml (char *body,
- int length)
-{
- SummaryData *return_value;
- xmlDocPtr doc;
- xmlNodePtr base;
- xmlNodePtr child;
-
- /* <rant> libxml will have a temper tantrum if there is whitespace before the
- * * first tag. so we must babysit it.
- * */
- while ((length > 0) && isspace (*body)) {
- body++, length--;
- }
-
- body[length] = '\0';
-
- doc = xmlParseMemory (body, length);
- if (doc == NULL) {
- return NULL;
- }
-
- base = doc->root;
-
- if (base == NULL ||
- g_strcasecmp (base->name, "SUMMARY_DATA") != 0) {
- xmlFreeDoc (doc);
- return NULL;
- }
-
- return_value = summary_data_new ();
-
- child = base->xmlChildrenNode;
-
- if (child == NULL) {
- xmlFreeDoc (doc);
- return NULL;
- }
-
- while (child) {
- if (g_strcasecmp (child->name, "SERVICES") == 0) {
- return_value->services_list = build_services_glist_from_xml (child);
- }
- if (g_strcasecmp (child->name, "EAZEL_NEWS") == 0) {
- return_value->eazel_news_list = build_eazel_news_glist_from_xml (child);
- }
- if (g_strcasecmp (child->name, "UPDATE_NEWS") == 0) {
- return_value->update_news_list = build_update_news_glist_from_xml (child);
- }
- child = child->next;
- }
-
- return return_value;
-}
-
-
-struct EazelSummaryFetchHandle {
- EelReadFileHandle *handle;
- EazelSummaryFetchCallback callback;
- gpointer callback_data;
-};
-
-
-
-static void
-summary_data_fetch_callback (GnomeVFSResult result,
- GnomeVFSFileSize file_size,
- char *file_contents,
- gpointer callback_data)
-{
- EazelSummaryFetchHandle *handle;
- SummaryData *summary_data;
-
- summary_data = NULL;
- handle = callback_data;
-
- if (result == GNOME_VFS_OK) {
- summary_data = eazel_summary_data_parse_xml (file_contents,
- file_size);
- }
-
- (*handle->callback) (result, summary_data, handle->callback_data);
- g_free (handle);
- g_free (file_contents);
-}
-
-
-EazelSummaryFetchHandle *
-eazel_summary_fetch_data_async (const char *uri,
- EazelSummaryFetchCallback callback,
- gpointer callback_data)
-{
- EazelSummaryFetchHandle *handle;
-
- handle = g_new0 (EazelSummaryFetchHandle, 1);
-
- handle->callback = callback;
- handle->callback_data = callback_data;
-
- handle->handle = eel_read_entire_file_async (uri, summary_data_fetch_callback, handle);
-
- return handle;
-}
-
-
-void
-eazel_summary_fetch_data_cancel (EazelSummaryFetchHandle *handle)
-{
- eel_read_file_cancel (handle->handle);
- g_free (handle);
-}
-
diff --git a/components/services/summary/eazel-summary-shared.h b/components/services/summary/eazel-summary-shared.h
deleted file mode 100644
index 93ec67ce6..000000000
--- a/components/services/summary/eazel-summary-shared.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: J Shane Culpepper
- */
-
-#ifndef EAZEL_SUMMARY_SHARED_H
-#define EAZEL_SUAMMRY_SHARED_H
-
-#include <libgnomevfs/gnome-vfs-types.h>
-#include <glib.h>
-
-typedef struct _ServicesData ServicesData;
-typedef struct _EazelNewsData EazelNewsData;
-typedef struct _UpdateNewsData UpdateNewsData;
-typedef struct _SummaryData SummaryData;
-
-struct _ServicesData {
- char *name;
- char *icon;
- char *button_label;
- char *uri;
- char *description_header;
- char *description;
- gboolean enabled;
-};
-
-struct _EazelNewsData {
- char *name;
- char *icon;
- char *date;
- char *message;
-};
-
-struct _UpdateNewsData {
- char *name;
- char *version;
- char *priority;
- char *description;
- char *icon;
- char *button_label;
- char *uri;
- char *softcat_uri;
-};
-
-struct _SummaryData {
- GList *services_list;
- GList *eazel_news_list;
- GList *update_news_list;
-};
-
-
-typedef void (* EazelSummaryFetchCallback) (GnomeVFSResult result,
- SummaryData *summary_data,
- gpointer callback_data);
-
-typedef struct EazelSummaryFetchHandle EazelSummaryFetchHandle;
-
-EazelSummaryFetchHandle *eazel_summary_fetch_data_async (const char *uri,
- EazelSummaryFetchCallback callback,
- gpointer callback_data);
-
-void eazel_summary_fetch_data_cancel (EazelSummaryFetchHandle *handle);
-
-
-#endif /* EAZEL_SUMMARY_SHARED_H */
diff --git a/components/services/summary/icons/.cvsignore b/components/services/summary/icons/.cvsignore
deleted file mode 100644
index 282522db0..000000000
--- a/components/services/summary/icons/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-Makefile
-Makefile.in
diff --git a/components/services/summary/icons/Makefile.am b/components/services/summary/icons/Makefile.am
deleted file mode 100644
index 7ab4d2c21..000000000
--- a/components/services/summary/icons/Makefile.am
+++ /dev/null
@@ -1,22 +0,0 @@
-NULL=
-
-graytabdir = $(datadir)/pixmaps/nautilus/gray_tab_pieces
-
-graytab_DATA = \
- active-fill.png \
- active-inactive-bridge.png \
- active-left-bumper.png \
- active-prelight-bridge.png \
- active-right-bumper.png \
- fill-background.png \
- inactive-active-bridge.png \
- inactive-fill.png \
- inactive-left-bumper.png \
- inactive-right-bumper.png \
- prelight-active-bridge.png \
- prelight-fill.png \
- prelight-left-bumper.png \
- prelight-right-bumper.png \
- $(NULL)
-
-EXTRA_DIST = $(graytab_DATA)
diff --git a/components/services/summary/icons/active-fill.png b/components/services/summary/icons/active-fill.png
deleted file mode 100644
index ac9eb69e0..000000000
--- a/components/services/summary/icons/active-fill.png
+++ /dev/null
Binary files differ
diff --git a/components/services/summary/icons/active-inactive-bridge.png b/components/services/summary/icons/active-inactive-bridge.png
deleted file mode 100644
index ff59ce82e..000000000
--- a/components/services/summary/icons/active-inactive-bridge.png
+++ /dev/null
Binary files differ
diff --git a/components/services/summary/icons/active-left-bumper.png b/components/services/summary/icons/active-left-bumper.png
deleted file mode 100644
index 6415636e1..000000000
--- a/components/services/summary/icons/active-left-bumper.png
+++ /dev/null
Binary files differ
diff --git a/components/services/summary/icons/active-prelight-bridge.png b/components/services/summary/icons/active-prelight-bridge.png
deleted file mode 100644
index bbc44617a..000000000
--- a/components/services/summary/icons/active-prelight-bridge.png
+++ /dev/null
Binary files differ
diff --git a/components/services/summary/icons/active-right-bumper.png b/components/services/summary/icons/active-right-bumper.png
deleted file mode 100644
index 2d3243c0d..000000000
--- a/components/services/summary/icons/active-right-bumper.png
+++ /dev/null
Binary files differ
diff --git a/components/services/summary/icons/fill-background.png b/components/services/summary/icons/fill-background.png
deleted file mode 100644
index b9efe3c36..000000000
--- a/components/services/summary/icons/fill-background.png
+++ /dev/null
Binary files differ
diff --git a/components/services/summary/icons/inactive-active-bridge.png b/components/services/summary/icons/inactive-active-bridge.png
deleted file mode 100644
index daf841544..000000000
--- a/components/services/summary/icons/inactive-active-bridge.png
+++ /dev/null
Binary files differ
diff --git a/components/services/summary/icons/inactive-fill.png b/components/services/summary/icons/inactive-fill.png
deleted file mode 100644
index 3922d04a4..000000000
--- a/components/services/summary/icons/inactive-fill.png
+++ /dev/null
Binary files differ
diff --git a/components/services/summary/icons/inactive-left-bumper.png b/components/services/summary/icons/inactive-left-bumper.png
deleted file mode 100644
index 5a72fecec..000000000
--- a/components/services/summary/icons/inactive-left-bumper.png
+++ /dev/null
Binary files differ
diff --git a/components/services/summary/icons/inactive-right-bumper.png b/components/services/summary/icons/inactive-right-bumper.png
deleted file mode 100644
index 561efe6ba..000000000
--- a/components/services/summary/icons/inactive-right-bumper.png
+++ /dev/null
Binary files differ
diff --git a/components/services/summary/icons/prelight-active-bridge.png b/components/services/summary/icons/prelight-active-bridge.png
deleted file mode 100644
index f3d54954c..000000000
--- a/components/services/summary/icons/prelight-active-bridge.png
+++ /dev/null
Binary files differ
diff --git a/components/services/summary/icons/prelight-fill.png b/components/services/summary/icons/prelight-fill.png
deleted file mode 100644
index 46a9412c8..000000000
--- a/components/services/summary/icons/prelight-fill.png
+++ /dev/null
Binary files differ
diff --git a/components/services/summary/icons/prelight-left-bumper.png b/components/services/summary/icons/prelight-left-bumper.png
deleted file mode 100644
index 7f35cf75c..000000000
--- a/components/services/summary/icons/prelight-left-bumper.png
+++ /dev/null
Binary files differ
diff --git a/components/services/summary/icons/prelight-right-bumper.png b/components/services/summary/icons/prelight-right-bumper.png
deleted file mode 100644
index e87c6bf4a..000000000
--- a/components/services/summary/icons/prelight-right-bumper.png
+++ /dev/null
Binary files differ
diff --git a/components/services/summary/main.c b/components/services/summary/main.c
deleted file mode 100644
index ab3aeafb2..000000000
--- a/components/services/summary/main.c
+++ /dev/null
@@ -1,130 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Maciej Stachowiak <mjs@eazel.com>
- * J Shane Culpepper <pepper@eazel.com>
- */
-
-/* main.c - main function and object activation function for services
- content view component. */
-
-#include <config.h>
-
-#include "nautilus-summary-view.h"
-#include <bonobo.h>
-#include <eel/eel-glib-extensions.h>
-#include <gconf/gconf.h>
-#include <gnome.h>
-#include <libgnomevfs/gnome-vfs-init.h>
-#include <liboaf/liboaf.h>
-#include <libtrilobite/libammonite.h>
-#include <libtrilobite/trilobite-core-messaging.h>
-#include <libtrilobite/trilobite-core-utils.h>
-
-static int object_count =0;
-
-static void
-summary_object_destroyed (GtkObject *obj)
-{
- object_count--;
- if (object_count <= 0) {
- gtk_main_quit ();
- }
-}
-
-static BonoboObject*
-summary_make_object (BonoboGenericFactory *factory,
- const char *iid,
- void *closure)
-{
-
- NautilusSummaryView* view;
- NautilusView* nautilus_view;
-
- if (strcmp (iid, "OAFIID:nautilus_summary_view:92811b0e-beb2-49db-858c-19a0dc8517e5")) {
- return NULL;
- }
-
- view = NAUTILUS_SUMMARY_VIEW (gtk_object_new (NAUTILUS_TYPE_SUMMARY_VIEW, NULL));
-
- object_count++;
-
- nautilus_view = nautilus_summary_view_get_nautilus_view (view);
-
- gtk_signal_connect (GTK_OBJECT (nautilus_view), "destroy", summary_object_destroyed, NULL);
-
- printf ("Returning new object %p\n", nautilus_view);
-
- return BONOBO_OBJECT (nautilus_view);
-}
-
-int
-main (int argc, char *argv[])
-{
-
- BonoboGenericFactory *factory;
- CORBA_ORB orb;
- char *registration_id;
-
-#ifdef ENABLE_NLS /* sadly we need this ifdef because otherwise the following get empty statement warnings */
- bindtextdomain (PACKAGE, GNOMELOCALEDIR);
- textdomain (PACKAGE);
-#endif
-
- /* Disable session manager connection */
- gnome_client_disable_master_connection ();
-
- gnomelib_register_popt_table (oaf_popt_options, oaf_get_popt_table_name ());
- orb = oaf_init (argc, argv);
-
- gnome_init ("nautilus-summary-view", VERSION,
- argc, argv);
- gdk_rgb_init ();
-
- eel_setenv ("GNOME_VFS_HTTP_USER_AGENT", trilobite_get_useragent_string (NULL), 1);
- g_thread_init (NULL);
- gnome_vfs_init ();
-
- bonobo_init (orb, CORBA_OBJECT_NIL, CORBA_OBJECT_NIL);
-
- gconf_init (argc, argv, NULL);
-
- ammonite_init (bonobo_poa());
-
- trilobite_set_log_handler (NULL, G_LOG_DOMAIN);
-
- registration_id = oaf_make_registration_id ("OAFIID:nautilus_summary_view_factory:1b0b1018-e0ca-4f14-8d23-7a134486ab30", getenv ("DISPLAY"));
-
- factory = bonobo_generic_factory_new_multi (registration_id,
- summary_make_object,
- NULL);
-
- g_free (registration_id);
-
- do {
- bonobo_main ();
- } while (object_count > 0);
-
- /* Let the factory go. */
- bonobo_object_unref (BONOBO_OBJECT (factory));
-
- gnome_vfs_shutdown ();
-
- return 0;
-}
diff --git a/components/services/summary/nautilus-summary-callbacks.c b/components/services/summary/nautilus-summary-callbacks.c
deleted file mode 100644
index 18bbf048c..000000000
--- a/components/services/summary/nautilus-summary-callbacks.c
+++ /dev/null
@@ -1,317 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: J Shane Culpepper <pepper@eazel.com>
- */
-
-#include <config.h>
-#include "nautilus-summary-callbacks.h"
-
-#include "eazel-summary-shared.h"
-#include "nautilus-summary-dialogs.h"
-#include "nautilus-summary-menu-items.h"
-#include "nautilus-summary-view-private.h"
-#include <bonobo/bonobo-main.h>
-#include <eel/eel-caption-table.h>
-#include <libgnomeui/gnome-stock.h>
-#include <liboaf/liboaf.h>
-#include <libtrilobite/eazelproxy.h>
-#include <libtrilobite/libammonite.h>
-#include <libtrilobite/trilobite-redirect.h>
-#include <orb/orbit.h>
-#include <stdio.h>
-#include <unistd.h>
-
-#define notDEBUG_PEPPER 1
-
-static void authn_cb_succeeded (const EazelProxy_User *user,
- gpointer state,
- CORBA_Environment *ev);
-static void authn_cb_failed (const EazelProxy_User *user,
- const EazelProxy_AuthnFailInfo *info,
- gpointer state,
- CORBA_Environment *ev);
-
-
-/* Be careful not to invoke another HTTP request; this call is
- * invoked from a two-way CORBA call from ammonite
- */
-static void
-authn_cb_succeeded (const EazelProxy_User *user, gpointer state, CORBA_Environment *ev)
-{
- NautilusSummaryView *view;
- gint timeout;
-
- view = NAUTILUS_SUMMARY_VIEW (state);
-
- g_assert (Pending_Login == view->details->pending_operation);
-
- view->details->pending_operation = Pending_None;
-
- timeout = gtk_timeout_add (0, logged_in_callback, view);
-
- bonobo_object_unref (BONOBO_OBJECT (view->details->nautilus_view));
-}
-
-/* Be careful not to invoke another HTTP request; this call is
- * invoked from a two-way CORBA call from ammonite
- */
-static void
-authn_cb_failed (const EazelProxy_User *user, const EazelProxy_AuthnFailInfo *info, gpointer state, CORBA_Environment *ev)
-{
- NautilusSummaryView *view;
-
- view = NAUTILUS_SUMMARY_VIEW (state);
-
- g_assert (Pending_Login == view->details->pending_operation);
-
- view->details->pending_operation = Pending_None;
-
- view->details->logged_in = FALSE;
-
- update_menu_items (view, FALSE);
-
- if (info && ( info->code == EAZELPROXY_AUTHN_FAIL_NETWORK
- || info->code == EAZELPROXY_AUTHN_FAIL_SERVER)) {
- nautilus_summary_show_login_failure_dialog (view, _("Sorry, network problems are preventing you from connecting to Eazel Services."));
- view->details->attempt_number = 0;
- view->details->current_attempt = initial;
- } else if (info && ( info->code == EAZELPROXY_AUTHN_FAIL_USER_NOT_ACTIVATED)) {
- /* FIXME we really should use the services alert icon here, eh? */
- nautilus_summary_show_login_failure_dialog (view, _("Your Eazel Services account has not yet been activated. "
- "You can't log into Eazel Services until you activate your account.\n\n"
- "Please check your email for activation instructions."));
- view->details->attempt_number = 0;
- view->details->current_attempt = initial;
- } else if (info && ( info->code == EAZELPROXY_AUTHN_FAIL_USER_DISABLED)) {
- /* FIXME we really should use the services alert icon here, eh? */
- nautilus_summary_show_login_failure_dialog (view, _("Your Eazel Service User Account has been temporarily disabled.\n\n"
- "Please try again in a few minutes, or contact Eazel support if this problem continues."));
- view->details->attempt_number = 0;
- view->details->current_attempt = initial;
- } else {
- /* Most likely error: bad username or password */
-
- view->details->attempt_number++;
-
- /* FIXME it would be best to display an error dialog
- * explaining the problem and offering at least an "I forgot
- * my password" button (and possibly a "Register" button as well)
- * In any vase, the dialog that's here is insufficient
- */
-
-#if 0
- if (view->details->attempt_number > 0 && view->details->attempt_number < 5) {
-#endif
- view->details->current_attempt = retry;
- nautilus_summary_show_login_dialog (view);
-#if 0
- } else {
- nautilus_summary_login_failure_dialog (view, _("We're sorry, but your name and password are still not recognized."));
- view->details->attempt_number = 0;
- view->details->current_attempt = initial;
- }
-#endif
- }
-
- bonobo_object_unref (BONOBO_OBJECT (view->details->nautilus_view));
-}
-
-/* callback to handle the login button. Right now only does a simple redirect. */
-void
-login_button_cb (GtkWidget *button, NautilusSummaryView *view)
-{
- char *user_name;
- char *password;
- EazelProxy_AuthnInfo *authinfo;
- CORBA_Environment ev;
-
- AmmoniteAuthCallbackWrapperFuncs cb_funcs = {
- authn_cb_succeeded, authn_cb_failed
- };
-
- CORBA_exception_init (&ev);
-
- g_assert (Pending_None == view->details->pending_operation);
-
- /* FIXME this doesn't actually handle the case when user_control is NIL
- * very well. No callback is generated, so no user feedback is generated
- * and the summary view is left in an illegal state
- */
-
- if (CORBA_OBJECT_NIL != view->details->user_control) {
- view->details->authn_callback = ammonite_auth_callback_wrapper_new (bonobo_poa(), &cb_funcs, view);
-
- user_name = eel_caption_table_get_entry_text (EEL_CAPTION_TABLE (view->details->caption_table), 0);
- password = eel_caption_table_get_entry_text (EEL_CAPTION_TABLE (view->details->caption_table), 1);
-
- authinfo = EazelProxy_AuthnInfo__alloc ();
- authinfo->username = CORBA_string_dup (user_name);
- authinfo->password = CORBA_string_dup (password);
- user_name = NULL;
- password = NULL;
-
- authinfo->services_redirect_uri = CORBA_string_dup ("");
- authinfo->services_login_path = CORBA_string_dup ("");
-
- /* Ref myself until the callback returns */
- bonobo_object_ref (BONOBO_OBJECT (view->details->nautilus_view));
-
- view->details->pending_operation = Pending_Login;
-
- EazelProxy_UserControl_authenticate_user (
- view->details->user_control,
- authinfo, TRUE,
- view->details->authn_callback, &ev
- );
-
- if (CORBA_NO_EXCEPTION != ev._major) {
- g_warning ("Exception during EazelProxy login");
- /* FIXME bugzilla.eazel.com 2745: cleanup after fail here */
- }
-
-
- }
-
- CORBA_exception_free (&ev);
-}
-
-/* callback to handle the logout button. Right now only does a simple redirect. */
-void
-logout_button_cb (GtkWidget *button, NautilusSummaryView *view)
-{
- CORBA_Environment ev;
- EazelProxy_UserList *users;
- CORBA_unsigned_long i;
- gint timeout;
- CORBA_exception_init (&ev);
-
- if (CORBA_OBJECT_NIL != view->details->user_control) {
- /* Get list of currently active users */
-
- users = EazelProxy_UserControl_get_active_users (
- view->details->user_control, &ev
- );
-
- if (CORBA_NO_EXCEPTION != ev._major) {
- g_message ("Exception while logging out user");
- return;
- }
-
- /* Log out the current default user */
- for (i = 0; i < users->_length ; i++) {
- EazelProxy_User *cur;
-
- cur = users->_buffer + i;
-
- if (cur->is_default) {
- g_message ("Logging out user '%s'", cur->user_name);
- EazelProxy_UserControl_logout_user (
- view->details->user_control,
- cur->proxy_port, &ev
- );
- break;
- }
- }
-
- CORBA_free (users);
- }
-
- timeout = gtk_timeout_add (0, logged_out_callback, view);
-
- CORBA_exception_free (&ev);
-}
-
-gint
-logged_in_callback (gpointer raw)
-{
- NautilusSummaryView *view;
-
- view = NAUTILUS_SUMMARY_VIEW (raw);
- view->details->logged_in = TRUE;
-
- update_menu_items (view, TRUE);
- nautilus_view_open_location_in_this_window
- (view->details->nautilus_view, "eazel:");
-
- return (FALSE);
-}
-
-
-gint
-logged_out_callback (gpointer raw)
-{
- NautilusSummaryView *view;
-
- view = NAUTILUS_SUMMARY_VIEW (raw);
- view->details->logged_in = FALSE;
-
- update_menu_items (view, FALSE);
- nautilus_view_open_location_in_this_window
- (view->details->nautilus_view, "eazel:");
-
- return (FALSE);
-}
-
-/* callback to handle the maintenance button. Right now only does a simple redirect. */
-void
-preferences_button_cb (GtkWidget *button, NautilusSummaryView *view)
-{
- char *url;
- url = NULL;
-
- url = trilobite_redirect_lookup (PREFERENCES_KEY);
- if (!url) {
- g_error ("Failed to load Registration url!");
- }
-
- nautilus_view_open_location_in_this_window
- (view->details->nautilus_view, url);
- g_free (url);
-
-}
-
-/* callback to handle the forgotten password button. */
-void
-forgot_password_button_cb (GtkWidget *button, NautilusSummaryView *view)
-{
-
- nautilus_view_open_location_in_this_window
- (view->details->nautilus_view, SUMMARY_CHANGE_PWD_FORM);
-
-}
-
-/* callback to handle the register button. Right now only does a simple redirect. */
-void
-register_button_cb (GtkWidget *button, NautilusSummaryView *view)
-{
- char *url;
- url = NULL;
-
- url = trilobite_redirect_lookup (REGISTER_KEY);
- if (!url) {
- g_error ("Failed to load Registration url!");
- }
-
- nautilus_view_open_location_in_this_window
- (view->details->nautilus_view, url);
- g_free (url);
-
-}
diff --git a/components/services/summary/nautilus-summary-callbacks.h b/components/services/summary/nautilus-summary-callbacks.h
deleted file mode 100644
index e6abf6dff..000000000
--- a/components/services/summary/nautilus-summary-callbacks.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: J Shane Culpepper
- */
-
-#ifndef NAUTILUS_SUMMARY_CALLBACKS_H
-#define NAUTILUS_SUMMARY_CALLBACKS_H
-
-#include <gtk/gtkwidget.h>
-#include "nautilus-summary-view.h"
-
-void login_button_cb (GtkWidget *button,
- NautilusSummaryView *view);
-void preferences_button_cb (GtkWidget *button,
- NautilusSummaryView *view);
-void logout_button_cb (GtkWidget *button,
- NautilusSummaryView *view);
-void register_button_cb (GtkWidget *button,
- NautilusSummaryView *view);
-void forgot_password_button_cb (GtkWidget *button,
- NautilusSummaryView *view);
-gint logged_in_callback (gpointer raw);
-gint logged_out_callback (gpointer raw);
-
-#endif /* NAUTILUS_SUMMARY_CALLBACKS_H */
-
diff --git a/components/services/summary/nautilus-summary-dialogs.c b/components/services/summary/nautilus-summary-dialogs.c
deleted file mode 100644
index be31b011d..000000000
--- a/components/services/summary/nautilus-summary-dialogs.c
+++ /dev/null
@@ -1,300 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: J Shane Culpepper <pepper@eazel.com>
- */
-
-#include <config.h>
-
-#include <eel/eel-caption-table.h>
-#include <eel/eel-stock-dialogs.h>
-#include <eel/eel-background.h>
-#include <eel/eel-string.h>
-#include <eel/eel-gnome-extensions.h>
-#include <eel/eel-image.h>
-
-#include <libgnomeui/gnome-stock.h>
-#include <stdio.h>
-#include <unistd.h>
-
-#include <orb/orbit.h>
-#include <liboaf/liboaf.h>
-#include <libtrilobite/trilobite-redirect.h>
-#include <libtrilobite/eazelproxy.h>
-#include <libtrilobite/libammonite.h>
-
-#include "nautilus-summary-view.h"
-#include "eazel-services-extensions.h"
-#include "eazel-summary-shared.h"
-#include "eazel-services-extensions.h"
-#include "nautilus-summary-callbacks.h"
-#include "nautilus-summary-dialogs.h"
-#include "nautilus-summary-view-private.h"
-
-#define notDEBUG_PEPPER 1
-
-
-static void error_dialog_cancel_cb (GtkWidget *button,
- NautilusSummaryView *view);
-static GtkWindow *get_window_from_summary_view (NautilusSummaryView *view);
-static void set_dialog_parent (NautilusSummaryView *view,
- GnomeDialog *dialog);
-static void name_or_password_field_activated (GtkWidget *caption_table,
- int active_entry,
- gpointer user_data);
-
-void
-nautilus_summary_show_login_failure_dialog (NautilusSummaryView *view,
- const char *message)
-{
- eel_show_error_dialog (message,
- _("Eazel Service Login Error"),
- get_window_from_summary_view (view));
-}
-
-void
-nautilus_summary_show_error_dialog (NautilusSummaryView *view,
- const char *message)
-{
- GnomeDialog *dialog;
-
- dialog = eel_show_error_dialog (message,
- _("Service Error"),
- get_window_from_summary_view (view));
- gtk_signal_connect (GTK_OBJECT (dialog),
- "destroy",
- error_dialog_cancel_cb,
- view);
-}
-
-void
-nautilus_summary_show_login_dialog (NautilusSummaryView *view)
-{
- GnomeDialog *dialog;
- GtkWidget *hbox;
- GtkWidget *image;
- GtkWidget *message;
- GtkWidget *caption_hbox;
- char *message_text;
- char *image_name;
- char *button_text;
-
- dialog = NULL;
- image = NULL;
-
- if (view->details->attempt_number == 0) {
- button_text = g_strdup (_("Register Now"));
- } else {
- button_text = g_strdup (_("Help"));
- }
-
- /* if the dialog is still open, then close it and open a new one */
- if (view->details->login_dialog != NULL) {
- gnome_dialog_close (GNOME_DIALOG (view->details->login_dialog));
- view->details->login_dialog = NULL;
- }
-
- dialog = GNOME_DIALOG (gnome_dialog_new (_("Services Login"), button_text,
- GNOME_STOCK_BUTTON_OK, GNOME_STOCK_BUTTON_CANCEL, NULL));
-
- /* TODO: replace all reference to dialog in this code with view->details->login_dialog */
- view->details->login_dialog = dialog;
-
- gtk_signal_connect (GTK_OBJECT (dialog), "destroy", GTK_SIGNAL_FUNC (gtk_widget_destroyed),
- &view->details->login_dialog);
- gtk_container_set_border_width (GTK_CONTAINER (dialog), GNOME_PAD);
- gtk_window_set_policy (GTK_WINDOW (dialog), FALSE, FALSE, FALSE);
-
- view->details->caption_table = eel_caption_table_new (LOGIN_DIALOG_ROW_COUNT);
- gtk_widget_show (view->details->caption_table);
-
- eel_caption_table_set_row_info (EEL_CAPTION_TABLE (view->details->caption_table),
- LOGIN_DIALOG_NAME_ROW,
- _("Username:"),
- "",
- TRUE,
- FALSE);
-
- eel_caption_table_set_row_info (EEL_CAPTION_TABLE (view->details->caption_table),
- LOGIN_DIALOG_PASSWORD_ROW,
- _("Password:"),
- "",
- FALSE,
- FALSE);
-
- switch (view->details->current_attempt) {
- case initial:
- image_name = "big_services_icon.png";
- message_text = _("Please log in to Eazel Services");
- break;
- case retry:
- image_name = "serv_dialog_alert.png";
- message_text = _("Your user name or password were not correct. Please try again.");
- break;
- default:
- g_assert_not_reached();
- image_name = "big_services_icon.png";
- message_text = _("Please log in to Eazel Services");
- break;
- }
-
- image = eazel_services_image_new (image_name, NULL, 0);
- eel_image_set_background_mode (EEL_IMAGE (image), EEL_SMOOTH_BACKGROUND_GTK);
-
- hbox = gtk_hbox_new (FALSE, 5);
- gtk_widget_show (hbox);
-
- if (image) {
- gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0);
- gtk_widget_show (image);
- }
-
- gtk_box_set_spacing (GTK_BOX (dialog->vbox), 4);
-
- message = gtk_label_new (message_text);
- gtk_label_set_justify (GTK_LABEL (message), GTK_JUSTIFY_LEFT);
- gtk_label_set_line_wrap (GTK_LABEL (message), TRUE);
- eel_gtk_label_make_bold (GTK_LABEL (message));
- gtk_widget_show (message);
-
- /* right justify the caption table box */
- caption_hbox = gtk_hbox_new (FALSE, 0);
- gtk_widget_show (caption_hbox);
- gtk_box_pack_end (GTK_BOX (caption_hbox), view->details->caption_table, FALSE, FALSE, 0);
-
- gtk_box_pack_start (GTK_BOX (hbox), message, FALSE, FALSE, 0);
- gtk_box_pack_start (GTK_BOX (dialog->vbox), hbox, TRUE, TRUE, 0);
- gtk_box_pack_start (GTK_BOX (dialog->vbox), caption_hbox, FALSE, FALSE, 0);
-
- gtk_container_set_border_width (GTK_CONTAINER (view->details->caption_table), 4);
-
- gtk_widget_show (dialog->vbox);
-
- gnome_dialog_set_close (dialog, TRUE);
- set_dialog_parent (view, dialog);
-
- gnome_dialog_set_default (dialog, LOGIN_DIALOG_OK_BUTTON_INDEX);
- gtk_signal_connect (GTK_OBJECT (view->details->caption_table), "activate",
- name_or_password_field_activated,
- eel_gnome_dialog_get_button_by_index (dialog, LOGIN_DIALOG_OK_BUTTON_INDEX));
- eel_caption_table_entry_grab_focus (EEL_CAPTION_TABLE (view->details->caption_table), LOGIN_DIALOG_NAME_ROW);
-
- if (view->details->attempt_number == 0) {
- gnome_dialog_button_connect (dialog, LOGIN_DIALOG_REGISTER_BUTTON_INDEX, GTK_SIGNAL_FUNC (register_button_cb), view);
- } else {
- gnome_dialog_button_connect (dialog, LOGIN_DIALOG_REGISTER_BUTTON_INDEX, GTK_SIGNAL_FUNC (forgot_password_button_cb), view);
- }
-
- gnome_dialog_button_connect (dialog, LOGIN_DIALOG_OK_BUTTON_INDEX, GTK_SIGNAL_FUNC (login_button_cb), view);
-
- gnome_dialog_set_close (dialog, TRUE);
- gtk_widget_show (GTK_WIDGET (dialog));
-}
-
-void
-widget_set_eel_background_color (GtkWidget *widget, const char *color)
-{
- EelBackground *background;
-
- g_return_if_fail (GTK_IS_WIDGET (widget));
- g_return_if_fail (color != NULL);
-
- background = eel_get_widget_background (widget);
-
- eel_background_reset (background);
- eel_background_set_color (background, color);
-
-}
-
-/* callback to handle cancel error_dialog button. */
-static void
-error_dialog_cancel_cb (GtkWidget *button,
- NautilusSummaryView *view)
-{
- nautilus_view_go_back (view->details->nautilus_view);
-}
-
-static GtkWindow *
-get_window_from_summary_view (NautilusSummaryView *view)
-{
- GtkWidget *parent_window;
-
- g_assert (NAUTILUS_IS_SUMMARY_VIEW (view));
-
- parent_window = gtk_widget_get_ancestor (GTK_WIDGET (view), GTK_TYPE_WINDOW);
- if (parent_window == NULL) {
- return NULL;
- }
-
- return GTK_WINDOW (parent_window);
-}
-
-static void
-set_dialog_parent (NautilusSummaryView *view, GnomeDialog *dialog)
-{
- GtkWindow *parent;
-
- g_assert (NAUTILUS_IS_SUMMARY_VIEW (view));
- g_assert (GNOME_IS_DIALOG (dialog));
-
- parent = get_window_from_summary_view (view);
- if (parent != NULL && gnome_preferences_get_dialog_centered ()) {
- /* User wants us to center over parent */
-
- /* FIXME: this is cut and pasted from gnome-dialog.h,
- * because calling gnome_dialog_set_parent would make
- * the dialog transient for the summary view's plug
- * widget, not the top level window, thus making it
- * not get focus.
- */
- gint x, y, w, h, dialog_x, dialog_y;
-
- if (!GTK_WIDGET_VISIBLE (parent)) return; /* Can't get its
- size/pos */
-
- /* Throw out other positioning */
- gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_NONE);
-
- gdk_window_get_origin (GTK_WIDGET (parent)->window, &x, &y);
- gdk_window_get_size (GTK_WIDGET (parent)->window, &w, &h);
-
- /* The problem here is we don't know how big the dialog is.
- So "centered" isn't really true. We'll go with
- "kind of more or less on top" */
-
- dialog_x = x + w/4;
- dialog_y = y + h/4;
-
- gtk_widget_set_uposition (GTK_WIDGET (dialog), dialog_x, dialog_y);
- }
-}
-
-static void
-name_or_password_field_activated (GtkWidget *caption_table, int active_entry, gpointer user_data)
-{
- g_assert (EEL_IS_CAPTION_TABLE (caption_table));
- g_assert (GTK_IS_BUTTON (user_data));
-
- /* auto-click "OK" button when password activated (via Enter key) */
- if (active_entry == LOGIN_DIALOG_OK_BUTTON_INDEX) {
- eel_gtk_button_auto_click (GTK_BUTTON (user_data));
- }
-}
-
diff --git a/components/services/summary/nautilus-summary-dialogs.h b/components/services/summary/nautilus-summary-dialogs.h
deleted file mode 100644
index 7987c289d..000000000
--- a/components/services/summary/nautilus-summary-dialogs.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: J Shane Culpepper
- */
-
-#ifndef NAUTILUS_SUMMARY_DIALOGS_H
-#define NAUTILUS_SUMMARY_DIALOGS_H
-
-void nautilus_summary_show_login_failure_dialog (NautilusSummaryView *view,
- const char *message);
-
-void nautilus_summary_show_error_dialog (NautilusSummaryView *view,
- const char *message);
-void nautilus_summary_show_login_dialog (NautilusSummaryView *view);
-void widget_set_eel_background_color (GtkWidget *widget,
- const char *color);
-
-#endif /* NAUTILUS_SUMMARY_DIALOGS_H */
-
diff --git a/components/services/summary/nautilus-summary-footer.c b/components/services/summary/nautilus-summary-footer.c
deleted file mode 100644
index f64acf21d..000000000
--- a/components/services/summary/nautilus-summary-footer.c
+++ /dev/null
@@ -1,101 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: J Shane Culpepper <pepper@eazel.com>
- */
-
-#include <config.h>
-#include "eazel-services-footer.h"
-
-#include "eazel-services-extensions.h"
-#include "eazel-services-footer.h"
-#include "eazel-services-header.h"
-#include "eazel-summary-shared.h"
-#include "nautilus-summary-callbacks.h"
-#include "nautilus-summary-dialogs.h"
-#include "nautilus-summary-footer.h"
-#include "nautilus-summary-view-private.h"
-#include "nautilus-summary-view.h"
-#include <bonobo/bonobo-control.h>
-#include <bonobo/bonobo-main.h>
-#include <eel/eel-background.h>
-#include <eel/eel-caption-table.h>
-#include <eel/eel-gdk-extensions.h>
-#include <eel/eel-glib-extensions.h>
-#include <eel/eel-gnome-extensions.h>
-#include <eel/eel-gtk-extensions.h>
-#include <eel/eel-gtk-macros.h>
-#include <eel/eel-stock-dialogs.h>
-#include <eel/eel-string.h>
-#include <libgnomeui/gnome-stock.h>
-#include <libgnomevfs/gnome-vfs-utils.h>
-#include <liboaf/liboaf.h>
-#include <libtrilobite/eazelproxy.h>
-#include <libtrilobite/libammonite.h>
-#include <libtrilobite/trilobite-redirect.h>
-#include <orb/orbit.h>
-#include <stdio.h>
-#include <unistd.h>
-
-#define notDEBUG_TEST 1
-#define notDEBUG_PEPPER 1
-
-
-void
-footer_item_clicked_callback (GtkWidget *widget, int index, gpointer callback_data)
-{
- NautilusSummaryView *view;
-
- g_return_if_fail (NAUTILUS_IS_SUMMARY_VIEW (callback_data));
- g_return_if_fail (index >= FOOTER_REGISTER_OR_PREFERENCES);
- g_return_if_fail (index <= FOOTER_PRIVACY_STATEMENT);
-
- view = NAUTILUS_SUMMARY_VIEW (callback_data);
-
- switch (index) {
- case FOOTER_REGISTER_OR_PREFERENCES:
- if (!view->details->logged_in) {
- register_button_cb (NULL, view);
- } else {
- preferences_button_cb (NULL, view);
- }
- break;
-
- case FOOTER_LOGIN_OR_LOGOUT:
- if (!view->details->logged_in) {
- nautilus_summary_show_login_dialog (view);
- } else {
- logout_button_cb (NULL, view);
- }
- break;
-
- case FOOTER_TERMS_OF_USER:
- nautilus_view_open_location_in_this_window (view->details->nautilus_view, SUMMARY_TERMS_OF_USE_URI);
- break;
-
- case FOOTER_PRIVACY_STATEMENT:
- nautilus_view_open_location_in_this_window (view->details->nautilus_view, SUMMARY_PRIVACY_STATEMENT_URI);
- break;
-
- default:
- g_assert_not_reached ();
- break;
- }
-}
diff --git a/components/services/summary/nautilus-summary-footer.h b/components/services/summary/nautilus-summary-footer.h
deleted file mode 100644
index 6980c14bb..000000000
--- a/components/services/summary/nautilus-summary-footer.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: J Shane Culpepper
- */
-
-#ifndef NAUTILUS_SUMMARY_FOOTER_H
-#define NAUTILUS_SUMMARY_FOOTER_H
-
-void footer_item_clicked_callback (GtkWidget *widget,
- int index,
- gpointer callback_data);
-
-#endif /* NAUTILUS_SUMMARY_FOOTER_H */
-
diff --git a/components/services/summary/nautilus-summary-menu-items.c b/components/services/summary/nautilus-summary-menu-items.c
deleted file mode 100644
index 1be544926..000000000
--- a/components/services/summary/nautilus-summary-menu-items.c
+++ /dev/null
@@ -1,186 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: J Shane Culpepper <pepper@eazel.com>
- */
-
-#include <config.h>
-#include "nautilus-summary-menu-items.h"
-
-#include "eazel-services-extensions.h"
-#include "eazel-services-footer.h"
-#include "eazel-services-header.h"
-#include "eazel-summary-shared.h"
-#include "nautilus-summary-callbacks.h"
-#include "nautilus-summary-dialogs.h"
-#include "nautilus-summary-view-private.h"
-#include <bonobo/bonobo-main.h>
-#include <eel/eel-background.h>
-#include <eel/eel-caption-table.h>
-#include <eel/eel-gdk-extensions.h>
-#include <eel/eel-glib-extensions.h>
-#include <eel/eel-gnome-extensions.h>
-#include <eel/eel-gtk-extensions.h>
-#include <eel/eel-gtk-macros.h>
-#include <eel/eel-stock-dialogs.h>
-#include <eel/eel-string.h>
-#include <gnome-xml/tree.h>
-#include <libgnomeui/gnome-stock.h>
-#include <libgnomevfs/gnome-vfs-utils.h>
-#include <liboaf/liboaf.h>
-#include <libtrilobite/eazelproxy.h>
-#include <libtrilobite/libammonite.h>
-#include <libtrilobite/trilobite-redirect.h>
-#include <orb/orbit.h>
-#include <stdio.h>
-#include <unistd.h>
-
-#define notDEBUG_PEPPER 1
-
-static void bonobo_register_callback (BonoboUIComponent *ui,
- gpointer user_data,
- const char *verb);
-static void bonobo_login_callback (BonoboUIComponent *ui,
- gpointer user_data,
- const char *verb);
-static void bonobo_logout_callback (BonoboUIComponent *ui,
- gpointer user_data,
- const char *verb);
-static void bonobo_preferences_callback (BonoboUIComponent *ui,
- gpointer user_data,
- const char *verb);
-
-/* A tiny bit of code cut-n-pasted from nautilus-bonobo-extensions.h */
-static void
-ui_component_set_hidden (BonoboUIComponent *ui,
- const char *path,
- gboolean hidden)
-{
- g_return_if_fail (BONOBO_IS_UI_COMPONENT (ui));
- bonobo_ui_component_set_prop (ui, path,
- "hidden",
- hidden ? "1" : "0",
- NULL);
-}
-
-/* update the visibility of the menu items according to the login state */
-void
-update_menu_items (NautilusSummaryView *view, gboolean logged_in)
-{
- BonoboUIComponent *ui;
-
- ui = bonobo_control_get_ui_component
- (nautilus_view_get_bonobo_control
- (view->details->nautilus_view));
-
- ui_component_set_hidden (ui,
- "/commands/Register",
- logged_in);
-
- ui_component_set_hidden (ui,
- "/commands/Login",
- logged_in);
-
- ui_component_set_hidden (ui,
- "/commands/Preferences",
- !logged_in);
-
- ui_component_set_hidden (ui,
- "/commands/Logout",
- !logged_in);
-}
-
-/* this routine is invoked when the view is activated to merge in our menu items */
-void
-merge_bonobo_menu_items (BonoboControl *control, gboolean state, gpointer user_data)
-{
- NautilusSummaryView *view;
- BonoboUIVerb verbs [] = {
- BONOBO_UI_VERB ("Register", bonobo_register_callback),
- BONOBO_UI_VERB ("Login", bonobo_login_callback),
- BONOBO_UI_VERB ("Logout", bonobo_logout_callback),
- BONOBO_UI_VERB ("Preferences", bonobo_preferences_callback),
- BONOBO_UI_VERB_END
- };
-
- g_assert (BONOBO_IS_CONTROL (control));
-
- view = NAUTILUS_SUMMARY_VIEW (user_data);
-
- if (state) {
- gboolean logged_in;
- char * user_name;
-
- nautilus_view_set_up_ui (view->details->nautilus_view,
- DATADIR,
- "nautilus-summary-view-ui.xml",
- "nautilus-summary-view");
-
- bonobo_ui_component_add_verb_list_with_data
- (bonobo_control_get_ui_component (control), verbs, view);
-
- user_name = ammonite_get_default_user_username ();
- logged_in = (NULL != user_name);
- update_menu_items (view, logged_in);
- g_free (user_name);
- }
-
- /* Note that we do nothing if state is FALSE. Nautilus content
- * views are never explicitly deactivated
- */
-}
-
-/* here are the callbacks to handle bonobo menu items */
-static void
-bonobo_register_callback (BonoboUIComponent *ui, gpointer user_data, const char *verb)
-{
- NautilusSummaryView *view;
-
- view = NAUTILUS_SUMMARY_VIEW (user_data);
- register_button_cb (NULL, view);
-}
-
-static void
-bonobo_login_callback (BonoboUIComponent *ui, gpointer user_data, const char *verb)
-{
- NautilusSummaryView *view;
-
- view = NAUTILUS_SUMMARY_VIEW (user_data);
- nautilus_summary_show_login_dialog (view);
-}
-
-static void
-bonobo_logout_callback (BonoboUIComponent *ui, gpointer user_data, const char *verb)
-{
- NautilusSummaryView *view;
-
- view = NAUTILUS_SUMMARY_VIEW (user_data);
- logout_button_cb (NULL, view);
-}
-
-static void
-bonobo_preferences_callback (BonoboUIComponent *ui, gpointer user_data, const char *verb)
-{
- NautilusSummaryView *view;
-
- view = NAUTILUS_SUMMARY_VIEW (user_data);
- preferences_button_cb (NULL, view);
-}
-
diff --git a/components/services/summary/nautilus-summary-menu-items.h b/components/services/summary/nautilus-summary-menu-items.h
deleted file mode 100644
index 5bb627044..000000000
--- a/components/services/summary/nautilus-summary-menu-items.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: J Shane Culpepper
- */
-
-#ifndef NAUTILUS_SUMMARY_MENU_ITEMS_H
-#define NAUTILUS_SUMMARY_MENU_ITEMS_H
-
-#include <bonobo/bonobo-control.h>
-#include "nautilus-summary-view.h"
-
-void merge_bonobo_menu_items (BonoboControl *control,
- gboolean state,
- gpointer user_data);
-void update_menu_items (NautilusSummaryView *view,
- gboolean logged_in);
-
-#endif /* NAUTILUS_SUMMARY_MENU_ITEMS_H */
-
diff --git a/components/services/summary/nautilus-summary-view-private.h b/components/services/summary/nautilus-summary-view-private.h
deleted file mode 100644
index f1ca7dfa4..000000000
--- a/components/services/summary/nautilus-summary-view-private.h
+++ /dev/null
@@ -1,124 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: J Shane Culpepper
- */
-
-#ifndef NAUTILUS_SUMMARY_VIEW_PRIVATE_H
-#define NAUTILUS_SUMMARY_VIEW_PRIVATE_H
-
-#include <libtrilobite/libammonite.h>
-
-#include <libtrilobite/trilobite-redirect.h>
-
-#include <gnome.h>
-
-#define DEFAULT_SUMMARY_BACKGROUND_COLOR_SPEC "rgb:FFFF/FFFF/FFFF"
-#define DEFAULT_SUMMARY_BACKGROUND_COLOR_RGB EEL_RGB_COLOR_WHITE
-#define DEFAULT_SUMMARY_TEXT_COLOR_RGB EEL_RGB_COLOR_BLACK
-
-#define URL_REDIRECT_TABLE_HOME "eazel-services://anonymous/services/urls"
-#define URL_REDIRECT_TABLE_HOME_2 "eazel-services:/services/urls"
-#define SUMMARY_CONFIG_XML "eazel-services://anonymous/services"
-#define SUMMARY_CONFIG_XML_2 "eazel-services:/services"
-
-#define SUMMARY_TERMS_OF_USE_URI "eazel-services://anonymous/aboutus/terms_of_use"
-#define SUMMARY_PRIVACY_STATEMENT_URI "eazel-services://anonymous/aboutus/privacy"
-#define SUMMARY_CHANGE_PWD_FORM "eazel-services://anonymous/account/login/lost_pwd_form"
-
-#define SUMMARY_XML_KEY "eazel_summary_xml"
-#define URL_REDIRECT_TABLE "eazel_url_table_xml"
-#define REGISTER_KEY "eazel_service_register"
-#define PREFERENCES_KEY "eazel_service_account_maintenance"
-
-#define MAX_IMAGE_WIDTH 50
-#define MAX_IMAGE_HEIGHT 50
-
-#define FOOTER_REGISTER_OR_PREFERENCES 0
-#define FOOTER_LOGIN_OR_LOGOUT 1
-#define FOOTER_TERMS_OF_USER 2
-#define FOOTER_PRIVACY_STATEMENT 3
-
-
-enum {
- LOGIN_DIALOG_NAME_ROW,
- LOGIN_DIALOG_PASSWORD_ROW,
- LOGIN_DIALOG_ROW_COUNT
-};
-
-enum {
- LOGIN_DIALOG_REGISTER_BUTTON_INDEX,
- LOGIN_DIALOG_OK_BUTTON_INDEX,
- LOGIN_DIALOG_CANCEL_BUTTON
-};
-
-typedef enum {
- Pending_None,
- Pending_Login,
-} SummaryPendingOperationType;
-
-typedef enum {
- initial,
- retry,
- fail,
-} SummaryLoginAttemptType;
-
-
-/* A NautilusContentView's private information. */
-struct _NautilusSummaryViewDetails {
- char *uri;
- NautilusView *nautilus_view;
- SummaryData *xml_data;
-
- /* Parent form and title */
- GtkWidget *form;
- GtkWidget *header;
- GtkWidget *news_pane;
- GtkWidget *news_item_vbox;
- GtkWidget *services_list_pane;
- GtkWidget *services_list_vbox;
- GtkWidget *featured_downloads_pane;
- GtkWidget *featured_downloads_vbox;
- GtkWidget *footer;
-
- /* Login State */
- char *user_name;
- volatile gboolean logged_in;
- GtkWidget *caption_table;
- SummaryLoginAttemptType current_attempt;
- int attempt_number;
-
- /* EazelProxy -- for logging in/logging out */
- EazelProxy_UserControl user_control;
- SummaryPendingOperationType pending_operation;
- EazelProxy_AuthnCallback authn_callback;
-
- /* Login Dialog */
- GnomeDialog *login_dialog;
-
- /* Async XML fetch handles */
- TrilobiteRedirectFetchHandle *redirect_fetch_handle;
- EazelSummaryFetchHandle *summary_fetch_handle;
-};
-
-
-#endif /* NAUTILUS_SUMMARY_VIEW_PRIVATE_H */
-
-
-
diff --git a/components/services/summary/nautilus-summary-view-ui.xml b/components/services/summary/nautilus-summary-view-ui.xml
deleted file mode 100644
index 6c9e0f5b9..000000000
--- a/components/services/summary/nautilus-summary-view-ui.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<Root>
-<menu>
- <placeholder name="Services Placeholder">
- <submenu name="Services">
- <placeholder name="Service Items">
- <menuitem name="Register"
- _label="_Register for Eazel Services"
- _tip="Go to the Eazel Services Registration Form"
- verb="Register"/>
- <menuitem name="Login"
- _label="_Log in to Eazel Services"
- _tip="Show the log-in dialog box"
- verb="Login"/>
- <menuitem name="Preferences"
- _label="Service _Preferences"
- _tip="Configure your service preferences"
- verb="Preferences"/>
- <menuitem name="Logout"
- _label="_Log out from Eazel Services"
- _tip="Log out from Eazel Services"
- verb="Logout"/>
- </placeholder>
- </submenu>
- </placeholder>
-</menu>
-</Root>
diff --git a/components/services/summary/nautilus-summary-view.c b/components/services/summary/nautilus-summary-view.c
deleted file mode 100644
index 4c5314875..000000000
--- a/components/services/summary/nautilus-summary-view.c
+++ /dev/null
@@ -1,1047 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: J Shane Culpepper <pepper@eazel.com>
- */
-
-#include <config.h>
-#include "nautilus-summary-view.h"
-
-#include "eazel-services-extensions.h"
-#include "eazel-services-footer.h"
-#include "eazel-services-header.h"
-#include "eazel-summary-shared.h"
-#include "nautilus-summary-callbacks.h"
-#include "nautilus-summary-dialogs.h"
-#include "nautilus-summary-footer.h"
-#include "nautilus-summary-menu-items.h"
-#include "nautilus-summary-view-private.h"
-#include "nautilus-tabs.h"
-#include <bonobo/bonobo-control.h>
-#include <eel/eel-background.h>
-#include <eel/eel-clickable-image.h>
-#include <eel/eel-gdk-extensions.h>
-#include <eel/eel-glib-extensions.h>
-#include <eel/eel-gnome-extensions.h>
-#include <eel/eel-gtk-extensions.h>
-#include <eel/eel-gtk-macros.h>
-#include <eel/eel-label.h>
-#include <eel/eel-stock-dialogs.h>
-#include <eel/eel-string.h>
-#include <eel/eel-viewport.h>
-#include <gnome.h>
-#include <gtk/gtkalignment.h>
-#include <libgnomeui/gnome-stock.h>
-#include <liboaf/liboaf.h>
-#include <libtrilobite/eazelproxy.h>
-#include <libtrilobite/libammonite.h>
-#include <libtrilobite/trilobite-redirect.h>
-#include <stdio.h>
-#include <unistd.h>
-#ifdef HAVE_RPM
-#include "../inventory/eazel-inventory.h"
-#endif
-
-#define notDEBUG_TEST 1
-#define notDEBUG_PEPPER 1
-
-#ifdef DEBUG_TEST
- #undef URL_REDIRECT_TABLE_HOME
- #define URL_REDIRECT_TABLE_HOME "http://localhost/redirects.xml"
-#endif
-
-
-#define NAUTILUS_COMMAND_SPECIFIER "command:"
-
-#define SUMMARY_TEXT_HEADER_SIZE_REL (0)
-#define SUMMARY_TEXT_BODY_SIZE_REL (-2)
-
-typedef struct ServicesButtonCallbackData ServicesButtonCallbackData;
-
-struct ServicesButtonCallbackData {
- NautilusView *view;
- char *uri;
-};
-
-static void nautilus_summary_view_initialize_class (NautilusSummaryViewClass *klass);
-static void nautilus_summary_view_initialize (NautilusSummaryView *view);
-static void nautilus_summary_view_destroy (GtkObject *object);
-static void summary_load_location_callback (NautilusView *nautilus_view,
- const char *location,
- NautilusSummaryView *view);
-static void summary_stop_loading_callback (NautilusView *nautilus_view,
- NautilusSummaryView *view);
-static GtkWidget * generate_eazel_news_entry_row (NautilusSummaryView *view,
- void *data);
-static GtkWidget * generate_service_entry_row (NautilusSummaryView *view,
- void *data);
-static GtkWidget * generate_update_news_entry_row (NautilusSummaryView *view,
- void *data);
-static void summary_view_button_callback (GtkWidget *button,
- ServicesButtonCallbackData *cbdata);
-static void cancel_load_in_progress (NautilusSummaryView *view);
-
-
-EEL_DEFINE_CLASS_BOILERPLATE (NautilusSummaryView, nautilus_summary_view, GTK_TYPE_EVENT_BOX)
-
-
-static const char goto_button_label[] = N_("Go There");
-#define GOTO_BUTTON_LABEL _(goto_button_label)
-
-static const char softcat_goto_button_label[] = N_("More Info");
-#define SOFTCAT_GOTO_BUTTON_LABEL _(softcat_goto_button_label)
-
-static const char install_goto_button_label[] = N_("Install");
-#define INSTALL_GOTO_BUTTON_LABEL _(install_goto_button_label)
-
-
-
-
-static const char *footer_online_items[] =
-{
- N_("Account Preferences"),
- N_("Logout"),
- N_("Terms of Use"),
- N_("Privacy Statement")
-};
-
-static const char *footer_offline_items[] =
-{
- N_("Register"),
- N_("Login"),
- N_("Terms of Use"),
- N_("Privacy Statement")
-};
-
-
-static char **
-localize_items (const char **items,
- int nitems)
-{
- int i;
- char **retval;
-
- retval = g_new0 (char *, nitems);
-
- for (i = 0; i < nitems; i++) {
- retval[i] = gettext (items[i]);
- }
-
- return retval;
-}
-
-
-static void
-update_header (NautilusSummaryView *view)
-{
- char *text;
- if (view->details->logged_in) {
- g_free (view->details->user_name);
- view->details->user_name = ammonite_get_default_user_username ();
- text = g_strdup_printf (_("Eazel Services - Welcome, %s!"), view->details->user_name);
- eazel_services_header_set_left_text (EAZEL_SERVICES_HEADER (view->details->header), text);
- g_free (text);
- } else {
- eazel_services_header_set_left_text (EAZEL_SERVICES_HEADER (view->details->header),
- _("Eazel Services - You are not logged in"));
- }
-}
-
-static void
-create_header (NautilusSummaryView *view)
-{
- view->details->header = eazel_services_header_title_new (_("Connecting to Eazel Services..."));
-}
-
-
-static void
-update_footer (NautilusSummaryView *view)
-{
- char **localized_items;
- int size;
-
- if (view->details->logged_in) {
- size = EEL_N_ELEMENTS (footer_online_items);
- localized_items = localize_items (footer_online_items, size);
- } else {
- size = EEL_N_ELEMENTS (footer_offline_items);
- localized_items = localize_items (footer_offline_items, size);
- }
-
- eazel_services_footer_update (EAZEL_SERVICES_FOOTER (view->details->footer),
- (const char **) localized_items,
- size);
- g_free (localized_items);
-}
-
-static void
-create_footer (NautilusSummaryView *view)
-{
- view->details->footer = eazel_services_footer_new ();
-
- gtk_signal_connect (GTK_OBJECT (view->details->footer), "item_clicked",
- GTK_SIGNAL_FUNC (footer_item_clicked_callback), view);
-
- update_footer (view);
-}
-
-
-static void
-services_button_callback_data_free (ServicesButtonCallbackData *cbdata)
-{
- g_free (cbdata->uri);
- g_free (cbdata);
-}
-
-
-static void
-summary_view_button_callback (GtkWidget *button,
- ServicesButtonCallbackData *cbdata)
-{
- const char *command;
-
- if (eel_istr_has_prefix (cbdata->uri, NAUTILUS_COMMAND_SPECIFIER)) {
- command = cbdata->uri + strlen (NAUTILUS_COMMAND_SPECIFIER);
- eel_gnome_shell_execute (command);
- } else {
- nautilus_view_open_location_in_this_window (cbdata->view, cbdata->uri);
- }
-}
-
-static void
-goto_uri_on_clicked (GtkWidget *widget,
- NautilusView *view,
- const char *uri)
-{
- ServicesButtonCallbackData *cbdata;
-
- cbdata = g_new0 (ServicesButtonCallbackData, 1);
- cbdata->view = view;
- cbdata->uri = g_strdup (uri);
-
- gtk_signal_connect_full (GTK_OBJECT (widget), "clicked",
- GTK_SIGNAL_FUNC (summary_view_button_callback), NULL,
- cbdata, (GtkDestroyNotify) services_button_callback_data_free,
- FALSE, FALSE);
-}
-
-static GtkWidget *
-summary_view_button_new (char *label_text,
- NautilusView *view,
- const char *uri)
-{
- GtkWidget *button;
- GtkWidget *label;
-
- button = gtk_button_new ();
- /* FIXME: hardcoded width! */
- gtk_widget_set_usize (button, 80, -1);
-
- label = gtk_label_new (label_text);
- gtk_widget_show (label);
- gtk_container_add (GTK_CONTAINER (button), label);
-
- goto_uri_on_clicked (button, view, uri);
-
- return button;
-}
-
-static GtkWidget *
-summary_view_link_image_new (NautilusSummaryView *view,
- const char *image_uri,
- const char *click_uri)
-{
- GtkWidget *image;
-
- image = eazel_services_clickable_image_new_from_uri (image_uri,
- NULL,
- DEFAULT_SUMMARY_BACKGROUND_COLOR_RGB,
- MAX_IMAGE_WIDTH, MAX_IMAGE_HEIGHT);
- eel_clickable_image_set_prelight (EEL_CLICKABLE_IMAGE (image), TRUE);
-
- goto_uri_on_clicked (image, view->details->nautilus_view, click_uri);
-
- return image;
-}
-
-
-static GtkWidget *
-summary_view_item_label_new (char *label_text,
- int relative_font_size,
- gboolean bold)
-{
- GtkWidget *label;
-
- label = eazel_services_label_new (label_text,
- 0, 0.5, 0.5, 0, 0,
- DEFAULT_SUMMARY_TEXT_COLOR_RGB,
- DEFAULT_SUMMARY_BACKGROUND_COLOR_RGB,
- NULL,
- relative_font_size,
- bold);
- eel_label_set_wrap (EEL_LABEL (label), TRUE);
- eel_label_set_justify (EEL_LABEL (label), GTK_JUSTIFY_LEFT);
- gtk_misc_set_alignment (GTK_MISC (label), 0, 0);
- eel_label_set_adjust_wrap_on_resize (EEL_LABEL (label), TRUE);
-
- return label;
-}
-
-
-static GtkWidget *
-summary_view_item_large_header_label_new (char *label_text)
-{
- return summary_view_item_label_new (label_text,
- SUMMARY_TEXT_HEADER_SIZE_REL,
- TRUE);
-}
-
-static GtkWidget *
-summary_view_item_header_label_new (char *label_text)
-{
- return summary_view_item_label_new (label_text,
- SUMMARY_TEXT_BODY_SIZE_REL,
- TRUE);
-}
-
-static GtkWidget *
-summary_view_item_body_label_new (char *label_text)
-{
- return summary_view_item_label_new (label_text,
- SUMMARY_TEXT_BODY_SIZE_REL,
- FALSE);
-}
-
-static void
-append_hseparator_to_vbox (GtkWidget *vbox)
-{
- GtkWidget *separator;
-
- separator = gtk_hseparator_new ();
- gtk_widget_show (separator);
- gtk_box_pack_start (GTK_BOX (vbox),
- separator, FALSE, FALSE, 4);
-
-}
-
-
-
-
-static GtkWidget *
-generate_eazel_news_entry_row (NautilusSummaryView *view,
- void *data)
-{
- GtkWidget *news_row;
- GtkWidget *item_vbox;
- GtkWidget *icon_box;
- GtkWidget *icon;
- GtkWidget *date_label;
- GtkWidget *news_item_label;
- EazelNewsData *news_node;
-
- news_node = data;
- news_row = gtk_hbox_new (FALSE, 0);
-
- /* Generate first box with icon */
- icon_box = gtk_vbox_new (FALSE, 0);
- gtk_widget_show (icon_box);
- gtk_box_pack_start (GTK_BOX (news_row), icon_box, FALSE, FALSE, 7);
-
- icon = eazel_services_image_new_from_uri (news_node->icon,
- NULL,
- DEFAULT_SUMMARY_BACKGROUND_COLOR_RGB,
- MAX_IMAGE_WIDTH, MAX_IMAGE_HEIGHT);
- /* gtk_widget_show (icon); */
- gtk_box_pack_start (GTK_BOX (icon_box), icon, FALSE, FALSE, 2);
-
- /* generate second box with bold type date and the actual contents */
- item_vbox = gtk_vbox_new (FALSE, 0);
- gtk_widget_show (item_vbox);
- gtk_box_pack_start (GTK_BOX (news_row), item_vbox, TRUE, TRUE, 2);
-
- /* Date */
- date_label = summary_view_item_header_label_new (news_node->date);
- /* gtk_widget_show (date_label); */
-
- gtk_box_pack_start (GTK_BOX (item_vbox), date_label, FALSE, FALSE, 2);
-
- /* Message */
- news_item_label = summary_view_item_body_label_new (news_node->message);
- gtk_widget_show (news_item_label);
- gtk_box_pack_start (GTK_BOX (item_vbox), news_item_label, TRUE, TRUE, 2);
-
- return news_row;
-}
-
-
-typedef GtkWidget * (*SummaryViewItemCreateFunction) (NautilusSummaryView *view,
- void *data);
-
-static void
-summary_view_update_pane (NautilusSummaryView *view,
- GtkWidget *vbox,
- GList *data,
- SummaryViewItemCreateFunction item_create)
-{
- GtkWidget *item;
- GList *node;
- gboolean added_one;
-
- /* clear existing news. */
- gtk_container_foreach (GTK_CONTAINER (vbox),
- (GtkCallback) gtk_widget_destroy, NULL);
-
- /* build the eazel news table from the xml file */
- added_one = FALSE;
-
- for (node = data; node != NULL; node = node->next) {
- item = (*item_create) (view, node->data);
-
- if (item != NULL) {
- gtk_widget_show (item);
-
- if (added_one) {
- append_hseparator_to_vbox (vbox);
- }
-
- gtk_box_pack_start (GTK_BOX (vbox),
- GTK_WIDGET (item),
- FALSE, FALSE, added_one ? 0 : 7);
-
- added_one = TRUE;
- }
- }
-}
-
-static GtkWidget *
-summary_view_create_pane (NautilusSummaryView *view,
- GtkWidget **vbox)
-{
- GtkWidget *pane;
- GtkWidget *viewport;
-
- pane = gtk_scrolled_window_new (NULL, NULL);
- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (pane),
- GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
-
- viewport = eel_viewport_new (NULL, NULL);
- eel_viewport_set_constrain_width (EEL_VIEWPORT (viewport), TRUE);
- widget_set_eel_background_color (viewport, DEFAULT_SUMMARY_BACKGROUND_COLOR_SPEC);
-
- gtk_viewport_set_shadow_type (GTK_VIEWPORT (viewport), GTK_SHADOW_NONE);
- gtk_widget_show (viewport);
- gtk_container_add (GTK_CONTAINER (pane), viewport);
-
- /* create the parent update news box and a table to hold the labels and text entries */
- *vbox = gtk_vbox_new (FALSE, 0);
- gtk_widget_show (*vbox);
- gtk_container_add (GTK_CONTAINER (viewport), *vbox);
-
- return pane;
-}
-
-
-static void
-update_news_pane (NautilusSummaryView *view)
-{
- summary_view_update_pane (view,
- view->details->news_item_vbox,
- view->details->xml_data->eazel_news_list,
- generate_eazel_news_entry_row);
-
- /* FIXME: leak */
- g_list_free (view->details->xml_data->eazel_news_list);
-}
-
-
-static void
-create_news_pane (NautilusSummaryView *view)
-{
- view->details->news_pane = summary_view_create_pane
- (view, &view->details->news_item_vbox);
-}
-
-static gboolean
-program_uri_for_nonexistent_program (const char *uri)
-{
- return eel_istr_has_prefix (uri, NAUTILUS_COMMAND_SPECIFIER) &&
- !gnome_is_program_in_path (uri + strlen (NAUTILUS_COMMAND_SPECIFIER));
-}
-
-static GtkWidget *
-generate_service_entry_row (NautilusSummaryView *view,
- void *data)
-{
- GtkWidget *services_row;
- GtkWidget *icon_box;
- GtkWidget *icon;
- GtkWidget *service_name;
- GtkWidget *service_description;
- GtkWidget *description_vbox;
- GtkWidget *button_vbox;
- GtkWidget *button_hbox;
- GtkWidget *button;
- ServicesData *services_node;
-
- services_node = data;
-
- if (program_uri_for_nonexistent_program (services_node->uri)) {
- return NULL;
- }
-
- services_row = gtk_hbox_new (FALSE, 0);
-
- /* Generate first box with service icon */
- icon_box = gtk_vbox_new (FALSE, 4);
- gtk_box_pack_start (GTK_BOX (services_row), icon_box, FALSE, FALSE, 7);
-
- gtk_widget_show (icon_box);
-
- icon = summary_view_link_image_new (view,
- services_node->icon,
- services_node->uri);
- gtk_widget_show (icon);
- gtk_box_pack_start (GTK_BOX (icon_box), icon, FALSE, FALSE, 3);
-
- /* insert a few pixels of space here */
-
- /* Generate second box with service title and summary */
- description_vbox = gtk_vbox_new (FALSE, 0);
- gtk_widget_show (description_vbox);
- gtk_box_pack_start (GTK_BOX (services_row), description_vbox, TRUE, TRUE, 0);
-
- /* Header */
- service_name = summary_view_item_header_label_new (services_node->description_header);
- gtk_widget_show (service_name);
- gtk_box_pack_start (GTK_BOX (description_vbox), service_name, FALSE, FALSE, 2);
-
- /* Body */
- service_description = summary_view_item_body_label_new (services_node->description);
- gtk_widget_show (service_description);
- gtk_box_pack_start (GTK_BOX (description_vbox), service_description, FALSE, FALSE, 2);
-
- /* Add the redirect button to the third box */
- button_vbox = gtk_vbox_new (TRUE, 0);
- gtk_widget_show (button_vbox);
- gtk_box_pack_end (GTK_BOX (services_row), button_vbox, FALSE, FALSE, 7);
-
- button_hbox = gtk_hbox_new (FALSE, 0);
- gtk_widget_show (button_hbox);
- gtk_box_pack_start (GTK_BOX (button_vbox), button_hbox, FALSE, FALSE, 2);
-
- button = summary_view_button_new (GOTO_BUTTON_LABEL,
- view->details->nautilus_view,
- services_node->uri);
- gtk_widget_show (button);
- gtk_box_pack_end (GTK_BOX (button_hbox), button, FALSE, FALSE, 0);
-
-
- /* FIXME: respect enabled field */
-
- return services_row;
-}
-
-
-static void
-update_services_list_pane (NautilusSummaryView *view)
-{
- summary_view_update_pane (view,
- view->details->services_list_vbox,
- view->details->xml_data->services_list,
- generate_service_entry_row);
-
- /* FIXME: leak */
- g_list_free (view->details->xml_data->services_list);
-}
-
-static void
-create_services_list_pane (NautilusSummaryView *view)
-{
- view->details->services_list_pane = summary_view_create_pane
- (view, &view->details->services_list_vbox);
-}
-
-
-static GtkWidget *
-generate_update_news_entry_row (NautilusSummaryView *view,
- void *data)
-{
- GtkWidget *update_row;
- GtkWidget *icon_box;
- GtkWidget *icon;
- GtkWidget *description_vbox;
- GtkWidget *name_label;
- GtkWidget *description_label;
- GtkWidget *version_label;
- GtkWidget *button_vbox;
- GtkWidget *more_info_button_hbox;
- GtkWidget *more_info_button;
- GtkWidget *install_button_hbox;
- GtkWidget *install_button;
- char *version_text;
- UpdateNewsData *update_node;
-
- update_node = data;
- update_row = gtk_hbox_new (FALSE, 0);
-
- /* Generate first box with icon */
- icon_box = gtk_vbox_new (FALSE, 4);
- gtk_widget_show (icon_box);
- gtk_box_pack_start (GTK_BOX (update_row), icon_box, FALSE, FALSE, 0);
-
- icon = summary_view_link_image_new (view,
- update_node->icon,
- update_node->softcat_uri);
- gtk_widget_show (icon);
- gtk_box_pack_start (GTK_BOX (icon_box), icon, FALSE, FALSE, 0);
-
- /* Generate second box with update title, summary, and version */
- description_vbox = gtk_vbox_new (FALSE, 0);
- gtk_widget_show (description_vbox);
- gtk_box_pack_start (GTK_BOX (update_row), description_vbox, TRUE, TRUE, 0);
-
- /* Header */
-
- name_label = summary_view_item_large_header_label_new (update_node->name);
- gtk_widget_show (name_label);
- gtk_box_pack_start (GTK_BOX (description_vbox), name_label, FALSE, FALSE, 4);
-
- /* Body */
-
- description_label = summary_view_item_body_label_new (update_node->description);
- gtk_widget_show (description_label);
- gtk_box_pack_start (GTK_BOX (description_vbox), description_label, FALSE, FALSE, 4);
-
- /* Version */
-
- if (update_node->version != NULL) {
- version_text = g_strdup_printf (_("Version: %s"), update_node->version);
- } else {
- version_text = g_strdup ("");
- }
- version_label = summary_view_item_header_label_new (version_text);
- gtk_widget_show (version_label);
- gtk_box_pack_start (GTK_BOX (description_vbox), version_label, FALSE, FALSE, 0);
- g_free (version_text);
-
- /* Add the redirect button and softcat button to the third box */
- button_vbox = gtk_vbox_new (FALSE, 0);
- gtk_widget_show (button_vbox);
- gtk_box_pack_end (GTK_BOX (update_row), button_vbox, FALSE, FALSE, 0);
-
- more_info_button_hbox = gtk_hbox_new (TRUE, 0);
- gtk_widget_show (more_info_button_hbox);
- gtk_box_pack_start (GTK_BOX (button_vbox), more_info_button_hbox, FALSE, FALSE, 4);
-
-
- more_info_button = summary_view_button_new (SOFTCAT_GOTO_BUTTON_LABEL,
- view->details->nautilus_view,
- update_node->softcat_uri);
- gtk_widget_show (more_info_button);
- gtk_box_pack_start (GTK_BOX (more_info_button_hbox), more_info_button, FALSE, FALSE, 4);
-
-
- install_button_hbox = gtk_hbox_new (TRUE, 0);
- gtk_widget_show (install_button_hbox);
- gtk_box_pack_start (GTK_BOX (button_vbox), install_button_hbox, FALSE, FALSE, 4);
-
- install_button = summary_view_button_new (INSTALL_GOTO_BUTTON_LABEL,
- view->details->nautilus_view,
- update_node->uri);
- gtk_widget_show (install_button);
- gtk_box_pack_start (GTK_BOX (install_button_hbox), install_button, FALSE, FALSE, 4);
-
- return update_row;
-}
-
-static void
-update_featured_downloads_pane (NautilusSummaryView *view)
-{
- summary_view_update_pane (view,
- view->details->featured_downloads_vbox,
- view->details->xml_data->update_news_list,
- generate_update_news_entry_row);
-
- /* FIXME: leak */
- g_list_free (view->details->xml_data->update_news_list);
-}
-
-
-static void
-create_featured_downloads_pane (NautilusSummaryView *view)
-{
- view->details->featured_downloads_pane = summary_view_create_pane
- (view, &view->details->featured_downloads_vbox);
-}
-
-
-static void
-update_summary_form (NautilusSummaryView *view,
- SummaryData *xml_data)
-{
- view->details->xml_data = xml_data;
-
- update_header (view);
- update_news_pane (view);
- update_services_list_pane (view);
- update_featured_downloads_pane (view);
- update_footer (view);
-}
-
-
-static void
-create_summary_form (NautilusSummaryView *view)
-{
- GtkWidget *notebook_tabs;
-
- /* allocate the parent box to hold everything */
- view->details->form = gtk_vbox_new (FALSE, 0);
- gtk_container_add (GTK_CONTAINER (view), view->details->form);
-
- create_header (view);
- gtk_box_pack_start (GTK_BOX (view->details->form), view->details->header, FALSE, FALSE, 0);
- gtk_widget_show (view->details->header);
-
- /* Create the News pane */
- create_news_pane (view);
- gtk_box_pack_start (GTK_BOX (view->details->form), view->details->news_pane, FALSE, FALSE, 0);
- gtk_widget_show (view->details->news_pane);
-
- /* Header for Services pane */
- notebook_tabs = nautilus_tabs_new ();
- nautilus_tabs_add_tab (NAUTILUS_TABS (notebook_tabs), _("Services"), 0);
- gtk_widget_show (notebook_tabs);
- gtk_box_pack_start (GTK_BOX (view->details->form), notebook_tabs, FALSE, FALSE, 0);
-
- /* Create the Services pane */
- create_services_list_pane (view);
- gtk_widget_show (view->details->services_list_pane);
- gtk_box_pack_start (GTK_BOX (view->details->form), view->details->services_list_pane, TRUE, TRUE, 0);
-
- /* Header for Featured Downloads pane */
- notebook_tabs = nautilus_tabs_new ();
- nautilus_tabs_add_tab (NAUTILUS_TABS (notebook_tabs), _("Featured Downloads"), 0);
-#if 0
- gtk_widget_show (notebook_tabs);
-#endif
- gtk_box_pack_start (GTK_BOX (view->details->form), notebook_tabs, FALSE, FALSE, 0);
-
- /* Create the Featured Downloads pane */
- create_featured_downloads_pane (view);
-#if 0
- gtk_widget_show (view->details->featured_downloads_pane);
-#endif
- gtk_box_pack_start (GTK_BOX (view->details->form), view->details->featured_downloads_pane, TRUE, TRUE, 0);
-
- create_footer (view);
- gtk_widget_show (view->details->footer);
- gtk_box_pack_start (GTK_BOX (view->details->form),
- view->details->footer,
- FALSE, FALSE, 0);
-
-
- /* Finally, show the form that hold everything */
- gtk_widget_show (view->details->form);
-}
-
-
-
-static void
-nautilus_summary_view_initialize_class (NautilusSummaryViewClass *klass)
-{
-
- GtkObjectClass *object_class;
- GtkWidgetClass *widget_class;
-
- object_class = GTK_OBJECT_CLASS (klass);
- widget_class = GTK_WIDGET_CLASS (klass);
- parent_class = gtk_type_class (gtk_event_box_get_type ());
- object_class->destroy = nautilus_summary_view_destroy;
-}
-
-static void
-nautilus_summary_view_initialize (NautilusSummaryView *view)
-{
- CORBA_Environment ev;
-
- CORBA_exception_init (&ev);
-
- view->details = g_new0 (NautilusSummaryViewDetails, 1);
- view->details->nautilus_view = nautilus_view_new (GTK_WIDGET (view));
- gtk_signal_connect (GTK_OBJECT (view->details->nautilus_view),
- "load_location",
- GTK_SIGNAL_FUNC (summary_load_location_callback),
- view);
-
- gtk_signal_connect (GTK_OBJECT (view->details->nautilus_view),
- "stop_loading",
- GTK_SIGNAL_FUNC (summary_stop_loading_callback),
- view);
-
-
- view->details->user_control = ammonite_get_user_control ();
-
- if (CORBA_NO_EXCEPTION != ev._major) {
- /* FIXME bugzilla.eazel.com 2740: user should be warned that Ammonite may not be installed */
- g_warning ("Couldn't instantiate eazel-proxy\n");
- view->details->user_control = CORBA_OBJECT_NIL;
- }
-
- /* get notified when we are activated so we can merge in our menu items */
- gtk_signal_connect (GTK_OBJECT (nautilus_view_get_bonobo_control
- (view->details->nautilus_view)),
- "activate",
- merge_bonobo_menu_items,
- view);
-
- create_summary_form (view);
-
- gtk_widget_show (GTK_WIDGET (view));
-
- CORBA_exception_free (&ev);
-
-}
-
-static void
-nautilus_summary_view_destroy (GtkObject *object)
-{
-
- NautilusSummaryView *view;
- CORBA_Environment ev;
-
- CORBA_exception_init (&ev);
-
- view = NAUTILUS_SUMMARY_VIEW (object);
-
- cancel_load_in_progress (view);
-
- if (view->details->uri) {
- g_free (view->details->uri);
- }
-
- /* FIXME: what the hell, we can't assert this here */
- g_assert (Pending_None == view->details->pending_operation);
-
- g_free (view->details);
-
- EEL_CALL_PARENT (GTK_OBJECT_CLASS, destroy, (object));
-
- CORBA_exception_free (&ev);
-
-}
-
-NautilusView *
-nautilus_summary_view_get_nautilus_view (NautilusSummaryView *view)
-{
-
- return view->details->nautilus_view;
-
-}
-
-static void
-summary_fetch_callback (GnomeVFSResult result,
- SummaryData *xml_data,
- gpointer callback_data)
-{
- NautilusSummaryView *view;
-
- view = NAUTILUS_SUMMARY_VIEW (callback_data);
- view->details->summary_fetch_handle = NULL;
-
- if (result != GNOME_VFS_OK) {
- nautilus_summary_show_error_dialog
- (view, _("Unable to get services data from Eazel's server. "
- "The server might be unavailable right now, "
- "or your computer might be configured incorrectly. "
- "Please contact support@eazel.com."));
- return;
- }
-
-
- if (xml_data == NULL) {
- nautilus_summary_show_error_dialog
- (view, _("Found a problem with services data on Eazel servers. "
- "Please contact support@eazel.com."));
- return;
- }
-
- update_summary_form (view, xml_data);
-
- if (!view->details->logged_in) {
- nautilus_summary_show_login_dialog (view);
- }
-
- nautilus_view_report_load_complete (view->details->nautilus_view);
-}
-
-static void fetch_summary_data (NautilusSummaryView *view) {
- char *uri;
-
- /* Read and parse summary view XML */
-
- uri = trilobite_redirect_lookup (SUMMARY_XML_KEY);
-
- if (uri == NULL) {
- nautilus_summary_show_error_dialog
- (view, _("Information is missing from the redirect data on Eazel servers. "
- "Please contact support@eazel.com."));
- return;
- }
- view->details->summary_fetch_handle = eazel_summary_fetch_data_async
- (uri, summary_fetch_callback, view);
-
- g_free (uri);
-}
-
-#ifdef HAVE_RPM
-static void
-inventory_load_callback (EazelInventory *inventory,
- gboolean succeeded,
- gpointer callback_data)
-{
- NautilusSummaryView *view;
-
- view = NAUTILUS_SUMMARY_VIEW (callback_data);
-
- gtk_object_unref (GTK_OBJECT (inventory));
-
- fetch_summary_data (view);
-}
-#endif
-
-static void
-redirect_fetch_callback (GnomeVFSResult result,
- gboolean parsed_xml,
- gpointer callback_data)
-{
- NautilusSummaryView *view;
-#ifdef HAVE_RPM
- EazelInventory *inventory_service;
-#endif
-
- view = NAUTILUS_SUMMARY_VIEW (callback_data);
-
- view->details->redirect_fetch_handle = NULL;
-
- if (result != GNOME_VFS_OK) {
- nautilus_summary_show_error_dialog
- (view, _("Unable to connect to Eazel's server. "
- "The server might be unavailable right now, "
- "or your computer might be configured incorrectly. "
- "You could try again later."));
- return;
- }
-
-
- if (!parsed_xml) {
- nautilus_summary_show_error_dialog
- (view, _("Found a problem with redirect data on Eazel servers. "
- "Please contact support@eazel.com."));
- return;
- }
-
-
-#ifdef HAVE_RPM
- if (view->details->logged_in) {
- inventory_service = eazel_inventory_get ();
-
- if (inventory_service) {
- eazel_inventory_upload (inventory_service,
- inventory_load_callback,
- view);
-
- } else {
- nautilus_summary_show_error_dialog
- (view, _("Failed to upload system inventory."));
- fetch_summary_data (view);
- }
- } else {
- fetch_summary_data (view);
- }
-#else
- fetch_summary_data (view);
-#endif
-}
-
-
-
-
-static void
-cancel_load_in_progress (NautilusSummaryView *view)
-{
- if (view->details->redirect_fetch_handle != NULL) {
- trilobite_redirect_fetch_table_cancel (view->details->redirect_fetch_handle);
- view->details->redirect_fetch_handle = NULL;
- }
-
- if (view->details->summary_fetch_handle != NULL) {
- eazel_summary_fetch_data_cancel (view->details->summary_fetch_handle);
- view->details->summary_fetch_handle = NULL;
- }
-}
-
-void
-nautilus_summary_view_load_uri (NautilusSummaryView *view,
- const char *uri)
-{
- char *user_name;
-
- /* set up some sanity values for error control */
- view->details->attempt_number = 0;
- view->details->current_attempt = initial;
-
- g_free (view->details->uri);
- view->details->uri = g_strdup (uri);
-
- user_name = ammonite_get_default_user_username ();
- view->details->logged_in = (NULL != user_name);
- g_free (user_name);
- user_name = NULL;
-
- cancel_load_in_progress (view);
-
- view->details->redirect_fetch_handle = trilobite_redirect_fetch_table_async
- (view->details->logged_in ? URL_REDIRECT_TABLE_HOME_2 : URL_REDIRECT_TABLE_HOME,
- redirect_fetch_callback,
- view);
-}
-
-static void
-summary_load_location_callback (NautilusView *nautilus_view,
- const char *location,
- NautilusSummaryView *view)
-{
- g_assert (nautilus_view == view->details->nautilus_view);
-
- nautilus_view_report_load_underway (nautilus_view);
-
- nautilus_view_set_title (nautilus_view, _("Eazel Services"));
-
- nautilus_summary_view_load_uri (view, location);
-}
-
-
-static void
-summary_stop_loading_callback (NautilusView *nautilus_view,
- NautilusSummaryView *view)
-
-{
- cancel_load_in_progress (view);
-}
diff --git a/components/services/summary/nautilus-summary-view.h b/components/services/summary/nautilus-summary-view.h
deleted file mode 100644
index 094b92d4d..000000000
--- a/components/services/summary/nautilus-summary-view.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: J Shane Culpepper
- */
-
-#ifndef NAUTILUS_SUMMARY_VIEW_H
-#define NAUTILUS_SUMMARY_VIEW_H
-
-#include <libnautilus/nautilus-view.h>
-#include <gtk/gtk.h>
-
-typedef struct _NautilusSummaryView NautilusSummaryView;
-typedef struct _NautilusSummaryViewClass NautilusSummaryViewClass;
-
-#define NAUTILUS_TYPE_SUMMARY_VIEW (nautilus_summary_view_get_type ())
-#define NAUTILUS_SUMMARY_VIEW(obj) (GTK_CHECK_CAST ((obj), NAUTILUS_TYPE_SUMMARY_VIEW, NautilusSummaryView))
-#define NAUTILUS_SUMMARY_VIEW_CLASS (klass) (GTK_CHECK_CLASS_CAST ((klass), NAUTILUS_TYPE_SUMMARY_VIEW, NautilusSummaryViewClass))
-#define NAUTILUS_IS_SUMMARY_VIEW(obj) (GTK_CHECK_TYPE ((obj), NAUTILUS_TYPE_SUMMARY_VIEW))
-#define NAUTILUS_IS_SUMMARY_VIEW_CLASS (klass) (GTK_CHECK_CLASS_TYPE ((klass), NAUTILUS_TYPE_SUMMARY_VIEW))
-
-typedef struct _NautilusSummaryViewDetails NautilusSummaryViewDetails;
-
-struct _NautilusSummaryView {
- GtkEventBox parent;
- NautilusSummaryViewDetails *details;
-};
-
-struct _NautilusSummaryViewClass {
- GtkVBoxClass parent_class;
-};
-
-/* GtkObject support */
-GtkType nautilus_summary_view_get_type (void);
-
-/* Component embedding support */
-NautilusView *nautilus_summary_view_get_nautilus_view (NautilusSummaryView *view);
-
-/* URI handling */
-void nautilus_summary_view_load_uri (NautilusSummaryView *view,
- const char *uri);
-
-#endif /* NAUTILUS_SUMMARY_VIEW_H */
-
diff --git a/components/services/summary/nautilus-tabs.c b/components/services/summary/nautilus-tabs.c
deleted file mode 100644
index 71e142291..000000000
--- a/components/services/summary/nautilus-tabs.c
+++ /dev/null
@@ -1,926 +0,0 @@
-/* -*- mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-
-/* Nautilus
- * Copyright (C) 2000 Eazel, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * Author: Andy Hertzfeld <andy@eazel.com>
- *
- * This is the the implementation of a bit-map based tabs widget for the
- * services summary view, but it's general enough to be used elsewhere.
- *
- */
-
-#include <config.h>
-#include "nautilus-tabs.h"
-
-#include <gdk-pixbuf/gdk-pixbuf.h>
-#include <libgnome/gnome-defs.h>
-#include <libgnome/gnome-util.h>
-#include <eel/eel-gdk-extensions.h>
-#include <eel/eel-gdk-pixbuf-extensions.h>
-#include <eel/eel-glib-extensions.h>
-#include <eel/eel-gnome-extensions.h>
-#include <eel/eel-gtk-extensions.h>
-#include <eel/eel-gtk-macros.h>
-#include <eel/eel-scalable-font.h>
-#include <math.h>
-#include <stdio.h>
-#include <string.h>
-
-/* constants for the tab piece pixbuf array */
-
-#define TAB_BACKGROUND 0
-#define TAB_ACTIVE_LEFT 1
-#define TAB_ACTIVE_FILL 2
-#define TAB_ACTIVE_RIGHT 3
-
-#define TAB_INACTIVE_LEFT 4
-#define TAB_INACTIVE_FILL 5
-#define TAB_INACTIVE_RIGHT 6
-
-#define TAB_PRELIGHT_LEFT 7
-#define TAB_PRELIGHT_FILL 8
-#define TAB_PRELIGHT_RIGHT 9
-
-#define TAB_INACTIVE_ACTIVE 10
-#define TAB_ACTIVE_INACTIVE 11
-#define TAB_PRELIGHT_ACTIVE 12
-#define TAB_ACTIVE_PRELIGHT 13
-
-#define LAST_TAB_OFFSET 14
-
-/* data structures */
-
-typedef struct {
- gboolean prelit;
- gboolean selected;
- char *tab_text;
- int notebook_page;
- GdkRectangle tab_rect;
-} TabItem;
-
-struct NautilusTabsDetails {
- int tab_count;
- int total_height;
-
- GdkRectangle title_rect;
- EelScalableFont *tab_font;
- int font_size;
- int selected_tab;
-
- GdkPixbuf *tab_piece_images[LAST_TAB_OFFSET];
- int tab_height;
- int tab_left_offset;
-
- GList *tab_items;
-};
-
-/* constants */
-#define TAB_RIGHT_MARGIN 4
-
-/* signals */
-enum {
- TAB_SELECTED,
- LAST_SIGNAL
-};
-static guint signals[LAST_SIGNAL];
-
-/* headers */
-
-static void nautilus_tabs_initialize_class (NautilusTabsClass *klass);
-static void nautilus_tabs_initialize (NautilusTabs *pixmap);
-static void nautilus_tabs_draw (GtkWidget *widget,
- GdkRectangle *box);
-static int nautilus_tabs_expose (GtkWidget *widget,
- GdkEventExpose *event);
-static void nautilus_tabs_destroy (GtkObject *object);
-static void nautilus_tabs_size_request (GtkWidget *widget,
- GtkRequisition *requisition);
-static int nautilus_tabs_hit_test (NautilusTabs *tabs,
- int x,
- int y);
-static void nautilus_tabs_load_tab_pieces (NautilusTabs *tabs,
- const char *tab_piece_directory);
-static gboolean nautilus_tabs_motion_event (GtkWidget *tabs,
- GdkEventMotion *event);
-static gboolean nautilus_tabs_press_event (GtkWidget *widget,
- GdkEventButton *event);
-static gboolean nautilus_tabs_leave_event (GtkWidget *tabs_widget,
- GdkEventCrossing *event);
-static void nautilus_tabs_prelight_tab (NautilusTabs *tabs,
- int which_tab);
-static void nautilus_tabs_select_tab (NautilusTabs *tabs,
- int which_tab);
-static void nautilus_tabs_unload_tab_pieces (NautilusTabs *tabs);
-static void draw_all_tabs (NautilusTabs *tabs);
-static TabItem* tab_item_find_by_name (NautilusTabs *tabs,
- const char *name);
-
-EEL_DEFINE_CLASS_BOILERPLATE (NautilusTabs, nautilus_tabs, GTK_TYPE_DRAWING_AREA)
-
-static void
-nautilus_tabs_initialize_class (NautilusTabsClass *class)
-{
- GtkObjectClass *object_class;
- GtkWidgetClass *widget_class;
-
- object_class = (GtkObjectClass *) class;
- widget_class = (GtkWidgetClass *) class;
-
- object_class->destroy = nautilus_tabs_destroy;
- widget_class->draw = nautilus_tabs_draw;
- widget_class->expose_event = nautilus_tabs_expose;
- widget_class->size_request = nautilus_tabs_size_request;
- widget_class->button_press_event = nautilus_tabs_press_event;
- widget_class->leave_notify_event = nautilus_tabs_leave_event;
- widget_class->motion_notify_event = nautilus_tabs_motion_event;
-
- /* add the "tab selected" signal */
- signals[TAB_SELECTED] = gtk_signal_new
- ("tab_selected",
- GTK_RUN_LAST,
- object_class->type,
- GTK_SIGNAL_OFFSET (NautilusTabsClass,
- tab_selected),
- gtk_marshal_NONE__INT,
- GTK_TYPE_NONE, 1, GTK_TYPE_INT);
-
- gtk_object_class_add_signals (object_class, signals, LAST_SIGNAL);
-}
-
-
-/* initialize a newly allocated tabs object */
-static void
-nautilus_tabs_initialize (NautilusTabs *tabs)
-{
- GtkWidget *widget = GTK_WIDGET (tabs);
- char *gray_tab_directory_path;
-
- GTK_WIDGET_SET_FLAGS (widget, GTK_CAN_FOCUS);
- GTK_WIDGET_UNSET_FLAGS (widget, GTK_NO_WINDOW);
-
- gtk_widget_set_events (widget,
- gtk_widget_get_events (widget) | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK);
-
-
- tabs->details = g_new0 (NautilusTabsDetails, 1);
- tabs->details->selected_tab = -1;
-
- /* FIXME bugzilla.eazel.com 5456:
- * Hard coded font size.
- */
- tabs->details->tab_font = eel_scalable_font_get_default_bold_font ();
- tabs->details->font_size = 14;
-
- gray_tab_directory_path = g_strdup (DATADIR "/pixmaps/nautilus/gray_tab_pieces");
- nautilus_tabs_load_tab_pieces (tabs, gray_tab_directory_path);
- g_free (gray_tab_directory_path);
-
- gtk_widget_add_events (widget, GDK_POINTER_MOTION_MASK | GDK_LEAVE_NOTIFY_MASK);
-}
-
-GtkWidget *
-nautilus_tabs_new (void)
-{
- return gtk_widget_new (nautilus_tabs_get_type (), NULL);
-}
-
-/* utility to destroy all the storage used by a tab item */
-
-static void
-tab_item_destroy (TabItem *item)
-{
- g_free (item->tab_text);
- g_free (item);
-}
-
-static void
-tab_item_destroy_cover (gpointer item, gpointer callback_data)
-{
- g_assert (callback_data == NULL);
- tab_item_destroy (item);
-}
-
-static void
-nautilus_tabs_destroy (GtkObject *object)
-{
- NautilusTabs *tabs = NAUTILUS_TABS(object);
-
- /* deallocate the tab piece images, if any */
- if (tabs->details->tab_piece_images[0] != NULL) {
- nautilus_tabs_unload_tab_pieces (tabs);
- }
-
- if (tabs->details->tab_font != NULL) {
- gtk_object_unref (GTK_OBJECT (tabs->details->tab_font));
- }
-
- /* release the tab list, if any */
- eel_g_list_free_deep_custom (tabs->details->tab_items,
- tab_item_destroy_cover,
- NULL);
- g_free (tabs->details);
-
- EEL_CALL_PARENT (GTK_OBJECT_CLASS, destroy, (object));
-}
-
-/* unload the tab piece images, if any */
-static void
-nautilus_tabs_unload_tab_pieces (NautilusTabs *tabs)
-{
- int index;
- for (index = 0; index < LAST_TAB_OFFSET; index++) {
- if (tabs->details->tab_piece_images[index]) {
- gdk_pixbuf_unref (tabs->details->tab_piece_images[index]);
- tabs->details->tab_piece_images[index] = NULL;
- }
- }
-}
-
-/* load the tab piece images */
-
-static GdkPixbuf *
-load_tab_piece (const char *piece_directory, const char *piece_name)
-{
- GdkPixbuf *pixbuf;
- gchar *image_path;
- image_path = g_strdup_printf ("%s/%s.png", piece_directory, piece_name);
- pixbuf = gdk_pixbuf_new_from_file (image_path);
- if (pixbuf == NULL) {
- g_warning ("cant load tab piece: %s", image_path);
- }
-
- g_free (image_path);
- return pixbuf;
-}
-
-static void
-nautilus_tabs_load_tab_pieces (NautilusTabs *tabs, const char* tab_piece_directory)
-{
- tabs->details->tab_piece_images[TAB_BACKGROUND] = load_tab_piece (tab_piece_directory, "fill-background");
-
- tabs->details->tab_piece_images[TAB_ACTIVE_LEFT] = load_tab_piece (tab_piece_directory, "active-left-bumper");
- tabs->details->tab_piece_images[TAB_ACTIVE_FILL] = load_tab_piece (tab_piece_directory, "active-fill");
- tabs->details->tab_piece_images[TAB_ACTIVE_RIGHT] = load_tab_piece (tab_piece_directory, "active-right-bumper");
-
- tabs->details->tab_piece_images[TAB_INACTIVE_LEFT] = load_tab_piece (tab_piece_directory, "inactive-left-bumper");
- tabs->details->tab_piece_images[TAB_INACTIVE_FILL] = load_tab_piece (tab_piece_directory, "inactive-fill");
- tabs->details->tab_piece_images[TAB_INACTIVE_RIGHT] = load_tab_piece (tab_piece_directory, "inactive-right-bumper");
-
- tabs->details->tab_piece_images[TAB_PRELIGHT_LEFT] = load_tab_piece (tab_piece_directory, "prelight-left-bumper");
- tabs->details->tab_piece_images[TAB_PRELIGHT_FILL] = load_tab_piece (tab_piece_directory, "prelight-fill");
- tabs->details->tab_piece_images[TAB_PRELIGHT_RIGHT] = load_tab_piece (tab_piece_directory, "prelight-right-bumper");
-
- tabs->details->tab_piece_images[TAB_INACTIVE_ACTIVE] = load_tab_piece (tab_piece_directory, "inactive-active-bridge");
- tabs->details->tab_piece_images[TAB_ACTIVE_INACTIVE] = load_tab_piece (tab_piece_directory, "active-inactive-bridge");
- tabs->details->tab_piece_images[TAB_PRELIGHT_ACTIVE] = load_tab_piece (tab_piece_directory, "prelight-active-bridge");
- tabs->details->tab_piece_images[TAB_ACTIVE_PRELIGHT] = load_tab_piece (tab_piece_directory, "active-prelight-bridge");
-}
-
-/* determine the tab associated with the passed-in coordinates, and pass back the notebook
- page index associated with it. */
-
-static int
-nautilus_tabs_hit_test (NautilusTabs *tabs, int x, int y)
-{
- GList *current_item;
- TabItem *tab_item;
- GdkRectangle *rect_ptr;
- int result;
-
- tabs->details->total_height = tabs->details->tab_height;
- current_item = tabs->details->tab_items;
-
- if (current_item == NULL)
- return -1;
-
- /* loop through the items, seeing if the passed in point is in one of the rectangles */
- tab_item = (TabItem*) current_item->data;
- if (current_item->next) {
- tab_item = (TabItem*) current_item->next->data;
- }
-
- result = -1;
- while (current_item != NULL) {
- tab_item = (TabItem*) current_item->data;
- rect_ptr = &tab_item->tab_rect;
-
- if ((x >= rect_ptr->x) && (x < rect_ptr->x + rect_ptr->width) &&
- (y >= rect_ptr->y) && (y< rect_ptr->y + rect_ptr->height))
- result = tab_item->notebook_page;
-
- current_item = current_item->next;
- }
- return result;
-}
-
-/* utility routine to the height of the tabs */
-/* this assumes there's only one row of them */
-static int
-measure_height (NautilusTabs *tabs)
-{
- return gdk_pixbuf_get_height (tabs->details->tab_piece_images[TAB_ACTIVE_FILL]);
-}
-
-/* resize the widget based on the number of tabs */
-
-static void
-recalculate_size(NautilusTabs *tabs)
-{
- GtkWidget *widget = GTK_WIDGET (tabs);
-
- /* layout tabs to make sure height measurement is valid */
- tabs->details->total_height = measure_height (tabs);
-
- widget->requisition.width = widget->parent ? widget->parent->allocation.width: 136;
- widget->requisition.height = tabs->details->total_height;
- gtk_widget_queue_resize (widget);
-}
-
-/* handle setting the size */
-static void
-nautilus_tabs_size_request (GtkWidget *widget, GtkRequisition *requisition)
-{
- requisition->width = widget->parent->allocation.width;
- requisition->height = measure_height (NAUTILUS_TABS (widget));;
-}
-
-/* utility to draw a single tab piece into a pixbuf */
-static int
-draw_tab_piece_aa (NautilusTabs *tabs, GdkPixbuf *dest_pixbuf, int x, int y, int x_limit, int which_piece)
-{
- GtkWidget *widget;
- GdkPixbuf *pixbuf;
- int width, height;
- int dest_width, dest_height;
- int blit_width, blit_height;
-
- widget = GTK_WIDGET (tabs);
- pixbuf = tabs->details->tab_piece_images[which_piece];
-
- /* if there's no pixbuf, just exit, returning a nominal size */
- if (pixbuf == NULL) {
- return 32;
- }
-
- width = gdk_pixbuf_get_width (pixbuf);
- height = gdk_pixbuf_get_height (pixbuf);
- dest_width = gdk_pixbuf_get_width (dest_pixbuf);
- dest_height = gdk_pixbuf_get_height (dest_pixbuf);
-
- /* trim tab piece to fit within the destination and the passed in limits */
-
- if (x_limit > 0) {
- if (x_limit < dest_width) {
- dest_width = x_limit;
- }
- }
-
- if (x + width > dest_width) {
- blit_width = dest_width - x;
- } else {
- blit_width = width;
- }
-
-
- if (y + height > dest_height) {
- blit_height = dest_height - y;
- } else {
- blit_height = height;
- }
-
-
- if (x >= 0 && y >= 0 && width > 0 && height > 0) {
- gdk_pixbuf_copy_area (pixbuf,
- 0, 0,
- blit_width, blit_height,
- dest_pixbuf,
- x, y);
- }
- return width;
-}
-
-/* fill the canvas buffer with a tiled pixmap */
-
-static void
-draw_pixbuf_tiled_aa (GdkPixbuf *src_pixbuf, GdkPixbuf *dest_pixbuf, int offset)
-{
- int x, y;
- int start_x, start_y;
- int end_x, end_y;
- int tile_width, tile_height;
- int blit_width, blit_height;
-
- tile_width = gdk_pixbuf_get_width (src_pixbuf);
- tile_height = gdk_pixbuf_get_height (src_pixbuf);
-
- start_x = 0;
- start_y = offset;
- end_x = gdk_pixbuf_get_width (dest_pixbuf);
- end_y = gdk_pixbuf_get_height (dest_pixbuf);
-
- for (y = start_y; y < end_y; y += tile_height) {
- for (x = start_x; x < end_x; x += tile_width) {
-
- if (x + tile_width < end_x) {
- blit_width = tile_width;
- } else {
- blit_width = end_x - x;
- }
-
- if (y + tile_height < end_y) {
- blit_height = tile_height;
- } else {
- blit_height = end_y - y;
- }
-
- gdk_pixbuf_copy_area (src_pixbuf,
- 0, 0,
- blit_width, blit_height,
- dest_pixbuf,
- x, y);
- }
- }
-}
-
-/* allocate_cleared_pixbuf allocates a new pixbuf with the passed-in dimensions and
- clears it to be transparent */
-static GdkPixbuf*
-allocate_cleared_pixbuf (int width, int height)
-{
- guchar *pixels_ptr;
- GdkPixbuf *pixbuf;
- int y_index, row_stride;
-
- pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, 8, width, height);
-
- /* clear it */
- row_stride = gdk_pixbuf_get_rowstride (pixbuf);
- pixels_ptr = gdk_pixbuf_get_pixels (pixbuf);
-
- for (y_index = 0; y_index < height; y_index++) {
- memset (pixels_ptr, 0, row_stride);
- pixels_ptr += row_stride;
- }
-
- return pixbuf;
-}
-
-static int
-measure_tab_name (NautilusTabs *tabs, const char *tab_name)
-{
- return eel_scalable_font_text_width (tabs->details->tab_font,
- tabs->details->font_size,
- tab_name,
- strlen (tab_name));
-}
-
-/* utility to draw the tab label */
-static void
-draw_tab_label (NautilusTabs *tabs, GdkPixbuf *tab_pixbuf, int x_pos, const char* label, gboolean is_active, gboolean is_prelit)
-{
- int text_x, text_y;
- uint text_color;
-
- text_x = x_pos + 1;
- text_y = 5; /* calculate this to center font in label? */
-
- /* make sure we can draw at least some of it */
- if (text_x < gdk_pixbuf_get_width (tab_pixbuf)) {
- eel_scalable_font_draw_text (tabs->details->tab_font, tab_pixbuf,
- text_x, text_y,
- NULL,
- tabs->details->font_size,
- label, strlen (label),
- EEL_RGB_COLOR_BLACK, EEL_OPACITY_FULLY_OPAQUE);
- text_x -= 1;
- text_y -= 1;
-
- if (is_active) {
- text_color = EEL_RGB_COLOR_WHITE;
- } else {
- if (is_prelit) {
- text_color = EEL_RGBA_COLOR_PACK (241, 241, 241, 255);
- } else {
- text_color = EEL_RGBA_COLOR_PACK (223, 223, 223, 255);
- }
- }
-
- eel_scalable_font_draw_text (tabs->details->tab_font, tab_pixbuf,
- text_x, text_y,
- NULL,
- tabs->details->font_size,
- label, strlen (label),
- text_color,
- EEL_OPACITY_FULLY_OPAQUE);
- }
-}
-
-/* draw or layout all of the tabs.
- *
- * NOTE: currently, this only supports two tabs since it was written quickly for the summary view,
- * which only requires two. We should rewrite this to support any number of tabs when we have time.
- */
-
-static void
-draw_all_tabs (NautilusTabs *tabs)
-{
- int x_pos;
- TabItem *left_tab, *right_tab;
- GdkPixbuf *tab_pixbuf;
- GtkWidget *widget;
- int name_width;
- int text_x_pos, right_edge_pos;
- int left_bumper_piece, fill_piece_1;
- int transition_type_piece, fill_piece_2, right_bumper_piece;
-
- g_assert (NAUTILUS_IS_TABS (tabs));
-
- /* check if there's work to do; if there aren't any tabs or the widget isn't allocated yet, return */
- widget = GTK_WIDGET (tabs);
- if (widget->allocation.width <= 0 || widget->allocation.height <= 0) {
- return;
- }
- if (tabs->details->tab_items == NULL) {
- return;
- }
-
- /* set up the pointers to the two tab items */
- left_tab = (TabItem *) tabs->details->tab_items->data;
- if (tabs->details->tab_items->next) {
- right_tab = (TabItem *) tabs->details->tab_items->next->data;
- } else {
- right_tab = NULL;
- }
-
- /* determine the images to use for the different tab pieces, given the selected and prelight state
- of the two tabs. This obviously needs to be rewritten to handle more than two tabs, and should probably use
- a table instead of the if statements */
-
- if (left_tab->selected) {
- if (left_tab->prelit) {
- left_bumper_piece = TAB_PRELIGHT_LEFT;
- fill_piece_1 = TAB_PRELIGHT_FILL;
-
- } else {
- left_bumper_piece = TAB_ACTIVE_LEFT;
- fill_piece_1 = TAB_ACTIVE_FILL;
- }
-
- transition_type_piece = TAB_ACTIVE_INACTIVE;
-
- if (right_tab) {
- if (right_tab->prelit) {
- transition_type_piece = TAB_ACTIVE_PRELIGHT;
- fill_piece_2 = TAB_PRELIGHT_FILL;
- right_bumper_piece = TAB_PRELIGHT_RIGHT;
- } else {
- fill_piece_2 = TAB_INACTIVE_FILL;
- right_bumper_piece = TAB_INACTIVE_RIGHT;
- }
-
- } else {
- transition_type_piece = TAB_ACTIVE_RIGHT;
- fill_piece_2 = TAB_INACTIVE_FILL;
- right_bumper_piece = TAB_INACTIVE_RIGHT;
- }
- } else {
-
- transition_type_piece = TAB_INACTIVE_ACTIVE;
-
- if (left_tab->prelit) {
- left_bumper_piece = TAB_PRELIGHT_LEFT;
- fill_piece_1 = TAB_PRELIGHT_FILL;
- transition_type_piece = TAB_PRELIGHT_ACTIVE;
- } else {
- left_bumper_piece = TAB_INACTIVE_LEFT;
- fill_piece_1 = TAB_INACTIVE_FILL;
- }
-
- if (right_tab) {
- fill_piece_2 = right_tab->prelit ? TAB_PRELIGHT_FILL : TAB_ACTIVE_FILL;
- right_bumper_piece = right_tab->prelit ? TAB_PRELIGHT_RIGHT : TAB_ACTIVE_RIGHT;
- } else {
- fill_piece_2 = TAB_ACTIVE_FILL;
- right_bumper_piece = TAB_ACTIVE_RIGHT;
- }
- }
-
- /* allocate a pixbuf to draw into, and clear it */
- tab_pixbuf = allocate_cleared_pixbuf (widget->allocation.width, widget->allocation.height);
- x_pos = 0;
-
- /* first, fill the area with the tab background */
- draw_pixbuf_tiled_aa (tabs->details->tab_piece_images[TAB_BACKGROUND], tab_pixbuf, 0);
-
- /* draw the first tab's left bumper */
- x_pos += draw_tab_piece_aa (tabs, tab_pixbuf, x_pos, 0, -1, left_bumper_piece);
-
- /* measure the text to determine the first tab's size */
- name_width = measure_tab_name (tabs, left_tab->tab_text) + TAB_RIGHT_MARGIN;
-
- /* set up the first tab's rectangle for later hit-testing */
- left_tab->tab_rect.x = x_pos;
- left_tab->tab_rect.y = 0;
- left_tab->tab_rect.width = name_width;
- left_tab->tab_rect.height = widget->allocation.height;
-
- /* draw the first tab's fill area in a loop */
- text_x_pos = x_pos;
- right_edge_pos = x_pos + name_width;
- while (x_pos < right_edge_pos) {
- x_pos += draw_tab_piece_aa (tabs, tab_pixbuf, x_pos, 0, right_edge_pos, fill_piece_1);
- }
- x_pos = right_edge_pos;
-
- /* draw the first tab's label */
- draw_tab_label (tabs, tab_pixbuf, text_x_pos, left_tab->tab_text, left_tab->selected, left_tab->prelit);
-
- /* draw the transition piece */
- x_pos += draw_tab_piece_aa (tabs, tab_pixbuf, x_pos, 0, -1, transition_type_piece);
- /* measure the text to determine the second tab's size */
- if (right_tab != NULL) {
- name_width = measure_tab_name (tabs, right_tab->tab_text) + TAB_RIGHT_MARGIN;
-
- /* adjust position for transition piece - this shouldn't be hardwired */
- x_pos -= 12;
-
- /* set up the second tab's rectangle for hit-testing */
- right_tab->tab_rect.x = x_pos;
- right_tab->tab_rect.y = 0;
- right_tab->tab_rect.width = name_width;
- right_tab->tab_rect.height = widget->allocation.height;
-
- /* draw the second tab's fill area */
- text_x_pos = x_pos;
- right_edge_pos = x_pos + name_width;
- while (x_pos < right_edge_pos) {
- x_pos += draw_tab_piece_aa (tabs, tab_pixbuf, x_pos, 0, right_edge_pos, fill_piece_2);
- }
- x_pos = right_edge_pos;
-
- /* draw the second tab's label */
- draw_tab_label (tabs, tab_pixbuf, text_x_pos, right_tab->tab_text, right_tab->selected, right_tab->prelit);
-
- /* draw the second tab's right bumper piece */
- draw_tab_piece_aa (tabs, tab_pixbuf, x_pos, 0, -1, right_bumper_piece);
- }
-
- /* draw the off-screen buffer to the screen, then release it */
- gdk_pixbuf_render_to_drawable_alpha (tab_pixbuf,
- widget->window,
- 0, 0,
- 0, 0,
- widget->allocation.width, widget->allocation.height,
- GDK_PIXBUF_ALPHA_BILEVEL, 128,
- GDK_RGB_DITHER_MAX,
- 0, 0);
-
- gdk_pixbuf_unref (tab_pixbuf);
-}
-
-/* find a tab with a given name, or return NULL if we can't find one */
-static TabItem *
-tab_item_find_by_name (NautilusTabs *tabs, const char *name)
-{
- GList *iterator;
-
- g_return_val_if_fail (NAUTILUS_IS_TABS (tabs), NULL);
- g_return_val_if_fail (name != NULL, NULL);
-
- for (iterator = tabs->details->tab_items; iterator != NULL; iterator = iterator->next) {
- TabItem *tab_item = iterator->data;
-
- g_assert (tab_item != NULL);
- g_assert (tab_item->tab_text != NULL);
-
- if (strcmp (tab_item->tab_text, name) == 0) {
- return tab_item;
- }
- }
-
- return NULL;
-}
-
-/* handle an expose event by drawing the tabs */
-
-static int
-nautilus_tabs_expose (GtkWidget *widget, GdkEventExpose *event)
-{
- NautilusTabs *tabs;
-
- g_return_val_if_fail (NAUTILUS_IS_TABS (widget), FALSE);
- g_return_val_if_fail (event != NULL, FALSE);
-
- if (widget->window == NULL) {
- return FALSE;
- }
-
- tabs = NAUTILUS_TABS (widget);
-
- if (tabs->details->tab_count > 0) {
- draw_all_tabs (tabs);
- }
- return FALSE;
-}
-
-static void
-nautilus_tabs_draw (GtkWidget *widget, GdkRectangle *box)
-{
- /* Clear the widget get the default widget background before drawing our stuff */
- gdk_window_clear_area (widget->window,
- 0,
- 0,
- widget->allocation.width,
- widget->allocation.height);
- draw_all_tabs (NAUTILUS_TABS (widget));
-}
-
-/* add a new tab entry, return TRUE if we succeed */
-
-gboolean
-nautilus_tabs_add_tab (NautilusTabs *tabs, const char *name, int page_num)
-{
- TabItem *new_tab_item;
-
- g_return_val_if_fail (NAUTILUS_IS_TABS (tabs), FALSE);
- g_return_val_if_fail (name != NULL, FALSE);
-
- /* Check to see if we already have one with this name, if so, refuse to add it */
- if (tab_item_find_by_name (tabs, name)) {
- g_warning ("nautilus_tabs_add_view: Trying to add duplicate item '%s'", name);
- return FALSE;
- }
-
- /* allocate a new entry, and initialize it */
- new_tab_item = g_new0 (TabItem, 1);
- new_tab_item->tab_text = g_strdup (name);
- new_tab_item->prelit = FALSE;
- new_tab_item->selected = FALSE;
- new_tab_item->notebook_page = page_num;
-
- /* add it to the list */
- tabs->details->tab_items = g_list_append (tabs->details->tab_items, new_tab_item);
- if (tabs->details->selected_tab == -1) {
- tabs->details->selected_tab = page_num;
- new_tab_item->selected = TRUE;
- }
-
- tabs->details->tab_count += 1;
- recalculate_size (tabs);
- gtk_widget_queue_draw (GTK_WIDGET (tabs));
-
- return TRUE;
-}
-
-
-/* remove the specified tab entry */
-void
-nautilus_tabs_remove_tab (NautilusTabs *tabs, const char *name)
-{
- GList *next_tab;
- TabItem *tab_item;
- int old_page_number;
-
- g_return_if_fail (NAUTILUS_IS_TABS (tabs));
- g_return_if_fail (name != NULL);
-
- /* Look up the item */
- tab_item = tab_item_find_by_name (tabs, name);
-
- if (tab_item == NULL) {
- g_warning ("nautilus_tabs_remove_view: Trying to remove a non-existing item '%s'", name);
- return;
- }
-
- /* Remove the item from the list */
- tabs->details->tab_items = g_list_remove (tabs->details->tab_items, tab_item);
-
- old_page_number = tab_item->notebook_page;
- tab_item_destroy (tab_item);
-
- /* decrement all page numbers greater than the one we're removing */
- for (next_tab = tabs->details->tab_items; next_tab != NULL; next_tab = next_tab->next) {
- TabItem *item = next_tab->data;
- if (item->notebook_page >= old_page_number)
- item->notebook_page -= 1;
- }
-
- tabs->details->tab_count -= 1;
-
- recalculate_size (tabs);
- gtk_widget_queue_draw (GTK_WIDGET (tabs));
-}
-
-/* prelight a tab, from its associated notebook page number, by setting the prelight flag of
- the proper tab and clearing the others. Don't allow prelighting of the selected tab */
-static void
-nautilus_tabs_prelight_tab (NautilusTabs *tabs, int which_tab)
-{
- GList *next_tab;
- gboolean is_prelit;
- gboolean changed = FALSE;
-
- g_return_if_fail (NAUTILUS_IS_TABS (tabs));
-
- for (next_tab = tabs->details->tab_items; next_tab != NULL; next_tab = next_tab->next) {
- TabItem *item = next_tab->data;
- is_prelit = (item->notebook_page == which_tab);
- if (item->prelit != is_prelit && (!item->selected || !is_prelit)) {
- item->prelit = is_prelit;
- changed = TRUE;
- }
- }
-
- if (changed)
- gtk_widget_queue_draw (GTK_WIDGET (tabs));
-}
-
-/* select a tab, in a similar fashion */
-static void
-nautilus_tabs_select_tab (NautilusTabs *tabs, int which_tab)
-{
- GList *next_tab;
- gboolean is_selected;
- gboolean changed = FALSE;
-
- g_return_if_fail (NAUTILUS_IS_TABS (tabs));
-
- if (tabs->details->selected_tab == which_tab) {
- return;
- }
-
- tabs->details->selected_tab = which_tab;
-
- for (next_tab = tabs->details->tab_items; next_tab != NULL; next_tab = next_tab->next) {
- TabItem *item = next_tab->data;
- is_selected = (item->notebook_page == which_tab);
- if (item->selected != is_selected) {
- item->selected = is_selected;
- if (is_selected) {
- item->prelit = FALSE;
- }
- changed = TRUE;
- }
- }
-
- if (changed)
- gtk_widget_queue_draw (GTK_WIDGET (tabs));
-
- gtk_signal_emit (GTK_OBJECT (tabs),
- signals[TAB_SELECTED], which_tab);
-
-}
-
-/* handle mouse clicks by selecting a tab if necessary */
-static gboolean
-nautilus_tabs_press_event (GtkWidget *widget, GdkEventButton *event)
-{
- int which_tab;
-
- which_tab = nautilus_tabs_hit_test (NAUTILUS_TABS (widget), event->x, event->y);
- if (which_tab >= 0) {
- nautilus_tabs_select_tab (NAUTILUS_TABS (widget), which_tab);
- }
- return TRUE;
-}
-
-/* handle the leave event by turning off the preliting */
-static gboolean
-nautilus_tabs_leave_event (GtkWidget *tabs_widget, GdkEventCrossing *event)
-{
- nautilus_tabs_prelight_tab (NAUTILUS_TABS (tabs_widget), -1);
- return TRUE;
-}
-
-/* handle mouse motion events by passing it to the tabs if necessary for pre-lighting */
-static gboolean
-nautilus_tabs_motion_event (GtkWidget *tabs_widget, GdkEventMotion *event)
-{
- int x, y;
- int which_tab;
-
- gtk_widget_get_pointer (tabs_widget, &x, &y);
-
-
- /* if the motion is in the main tabs, tell them about it */
- which_tab = nautilus_tabs_hit_test (NAUTILUS_TABS (tabs_widget), x, y);
-
- nautilus_tabs_prelight_tab (NAUTILUS_TABS (tabs_widget), which_tab);
-
- return TRUE;
-}
diff --git a/components/services/summary/nautilus-tabs.h b/components/services/summary/nautilus-tabs.h
deleted file mode 100644
index 144f5d730..000000000
--- a/components/services/summary/nautilus-tabs.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-
-/*
- * Nautilus
- *
- * Copyright (C) 2000 Eazel, Inc.
- *
- * Nautilus is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * Nautilus is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * Author: Andy Hertzfeld <andy@eazel.com>
- *
- */
-
-/*
- * This is the header file for an image-based folder tabs widget.
- */
-
-#ifndef NAUTILUS_TABS_H
-#define NAUTILUS_TABS_H
-
-#include <gtk/gtkdrawingarea.h>
-
-#define NAUTILUS_TYPE_TABS (nautilus_tabs_get_type ())
-#define NAUTILUS_TABS(obj) (GTK_CHECK_CAST ((obj), NAUTILUS_TYPE_TABS, NautilusTabs))
-#define NAUTILUS_TABS_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), NAUTILUS_TYPE_TABS, NautilusTabsClass))
-#define NAUTILUS_IS_TABS(obj) (GTK_CHECK_TYPE ((obj), NAUTILUS_TYPE_TABS))
-#define NAUTILUS_IS_TABS_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), NAUTILUS_TYPE_TABS))
-
-typedef struct NautilusTabsDetails NautilusTabsDetails;
-
-typedef struct
-{
- GtkDrawingArea parent;
- NautilusTabsDetails *details;
-} NautilusTabs;
-
-typedef struct
-{
- GtkDrawingAreaClass parent_class;
-
- void (*tab_selected) (NautilusTabs *tabs, int which_tab);
-} NautilusTabsClass;
-
-GtkType nautilus_tabs_get_type (void);
-GtkWidget *nautilus_tabs_new (void);
-gboolean nautilus_tabs_add_tab (NautilusTabs *tabs,
- const char *name,
- int page_number);
-void nautilus_tabs_remove_tab (NautilusTabs *tabs,
- const char *name);
-
-#endif /* NAUTILUS_TABS_H */
diff --git a/components/services/summary/redirects.xml b/components/services/summary/redirects.xml
deleted file mode 100644
index 197477d18..000000000
--- a/components/services/summary/redirects.xml
+++ /dev/null
@@ -1,56 +0,0 @@
-<?xml version="1.0"?>
-<location_data>
- <location>
- <name>eazel_summary_service</name>
- <uri>eazel:</uri>
- </location>
- <location>
- <name>eazel_install_service</name>
- <uri>eazel-install:</uri>
- </location>
- <location>
- <name>eazel_softcat_service</name>
- <uri>eazel-services://anonymous/catalog</uri>
- </location>
- <location>
- <name>eazel_vault_service</name>
- <uri>eazel-services:/account/register/form</uri>
- </location>
- <location>
- <name>eazel_service_register</name>
- <uri>eazel-services://anonymous/account/register/form</uri>
- </location>
- <location>
- <name>eazel_services_information</name>
- <uri>http://services.eazel.com:7001/services/info</uri>
- </location>
- <location>
- <name>eazel_change_password</name>
- <uri>eazel-pw:</uri>
- </location>
- <location>
- <name>eazel_summary_xml</name>
- <uri>http://localhost/services.xml</uri>
- </location>
- <location>
- <name>eazel_url_table_xml</name>
- <uri>http://localhost/redirects.xml</uri>
- </location>
- <location>
- <name>eazel_install_depend_query</name>
- <uri>http://services.eazel.com:7001/catalog/find</uri>
- </location>
- <location>
- <name>eazel_service_account_maintenance</name>
- <uri>eazel-services:/account/preferences/form</uri>
- </location>
- <location>
- <name>web_search</name>
- <uri>http://services.eazel.com:8888/services/websearch</uri>
- </location>
- <location>
- <name>install_help</name>
- <uri>http://services.eazel.com:8888/support/nautilus/install</uri>
- </location>
-</location_data>
-
diff --git a/components/services/summary/services.xml b/components/services/summary/services.xml
deleted file mode 100644
index a1689d4bf..000000000
--- a/components/services/summary/services.xml
+++ /dev/null
@@ -1,330 +0,0 @@
-<?xml version="1.0"?>
-<SUMMARY_DATA>
- <SERVICES>
- <SERVICE>
- <NAME>eazel_vault_service</NAME>
- <ICON>http://services.eazel.com/images/services/vault-service-icon.png</ICON>
- <BUTTON_LABEL>Registered users only</BUTTON_LABEL>
- <URI>eazel-services://anonymous/account/register/form</URI>
- <DESCRIPTION_HEADER>Eazel Online Storage</DESCRIPTION_HEADER>
- <DESCRIPTION>A file repository accessible from browsers and integrated with Nautilus.</DESCRIPTION>
- <ENABLED>false</ENABLED>
- </SERVICE>
- <SERVICE>
- <NAME>eazel_softcat_service</NAME>
- <ICON>http://services.eazel.com/images/services/softcat-service-icon.png</ICON>
- <BUTTON_LABEL>To software catalog</BUTTON_LABEL>
- <URI>http://services.eazel.com:7001/catalog</URI>
- <DESCRIPTION_HEADER>The Software Catalog</DESCRIPTION_HEADER>
- <DESCRIPTION>Collection of RPMs available for installation using the unique Eazel Software Installer.</DESCRIPTION>
- <ENABLED>true</ENABLED>
- </SERVICE>
- <SERVICE>
- <NAME>eazel_time_sync_service</NAME>
- <ICON>http://services.eazel.com/images/services/time-sync-service-icon.png</ICON>
- <BUTTON_LABEL>To time sync!</BUTTON_LABEL>
- <URI>eazel:</URI>
- <DESCRIPTION_HEADER>The Time Sync Service</DESCRIPTION_HEADER>
- <DESCRIPTION>Automatic clock settings so that your time is always right.</DESCRIPTION>
- <ENABLED>true</ENABLED>
- </SERVICE>
- <SERVICE>
- <NAME>eazel_inventory_service</NAME>
- <ICON>http://services.eazel.com/images/services/inventory-service-icon.png</ICON>
- <BUTTON_LABEL>To client inventory!</BUTTON_LABEL>
- <URI>eazel:</URI>
- <DESCRIPTION_HEADER>The Inventory Control Service</DESCRIPTION_HEADER>
- <DESCRIPTION>Keep your inventory up to date all day every day.</DESCRIPTION>
- <ENABLED>true</ENABLED>
- </SERVICE>
- <SERVICE>
- <NAME>eazel_softcat_service</NAME>
- <ICON>http://services.eazel.com/images/services/softcat-service-icon.png</ICON>
- <BUTTON_LABEL>To software catalog</BUTTON_LABEL>
- <URI>http://services.eazel.com:7001/catalog</URI>
- <DESCRIPTION_HEADER>The Software Catalog</DESCRIPTION_HEADER>
- <DESCRIPTION>Collection of RPMs available for installation using the unique Eazel Software Installer.</DESCRIPTION>
- <ENABLED>true</ENABLED>
- </SERVICE>
- <SERVICE>
- <NAME>eazel_softcat_service</NAME>
- <ICON>http://services.eazel.com/images/services/softcat-service-icon.png</ICON>
- <BUTTON_LABEL>To software catalog</BUTTON_LABEL>
- <URI>http://services.eazel.com:7001/catalog</URI>
- <DESCRIPTION_HEADER>The Software Catalog</DESCRIPTION_HEADER>
- <DESCRIPTION>Collection of RPMs available for installation using the unique Eazel Software Installer.</DESCRIPTION>
- <ENABLED>true</ENABLED>
- </SERVICE>
- <SERVICE>
- <NAME>eazel_softcat_service</NAME>
- <ICON>http://services.eazel.com/images/services/softcat-service-icon.png</ICON>
- <BUTTON_LABEL>To software catalog</BUTTON_LABEL>
- <URI>http://services.eazel.com:7001/catalog</URI>
- <DESCRIPTION_HEADER>The Software Catalog</DESCRIPTION_HEADER>
- <DESCRIPTION>Collection of RPMs available for installation using the unique Eazel Software Installer.</DESCRIPTION>
- <ENABLED>true</ENABLED>
- </SERVICE>
- <SERVICE>
- <NAME>eazel_softcat_service</NAME>
- <ICON>http://services.eazel.com/images/services/softcat-service-icon.png</ICON>
- <BUTTON_LABEL>To software catalog</BUTTON_LABEL>
- <URI>http://services.eazel.com:7001/catalog</URI>
- <DESCRIPTION_HEADER>The Software Catalog</DESCRIPTION_HEADER>
- <DESCRIPTION>Collection of RPMs available for installation using the unique Eazel Software Installer.</DESCRIPTION>
- <ENABLED>true</ENABLED>
- </SERVICE>
- <SERVICE>
- <NAME>eazel_softcat_service</NAME>
- <ICON>http://services.eazel.com/images/services/softcat-service-icon.png</ICON>
- <BUTTON_LABEL>To software catalog</BUTTON_LABEL>
- <URI>http://services.eazel.com:7001/catalog</URI>
- <DESCRIPTION_HEADER>The Software Catalog</DESCRIPTION_HEADER>
- <DESCRIPTION>Collection of RPMs available for installation using the unique Eazel Software Installer.</DESCRIPTION>
- <ENABLED>true</ENABLED>
- </SERVICE>
- <SERVICE>
- <NAME>eazel_softcat_service</NAME>
- <ICON>http://services.eazel.com/images/services/softcat-service-icon.png</ICON>
- <BUTTON_LABEL>To software catalog</BUTTON_LABEL>
- <URI>http://services.eazel.com:7001/catalog</URI>
- <DESCRIPTION_HEADER>The Software Catalog</DESCRIPTION_HEADER>
- <DESCRIPTION>Collection of RPMs available for installation using the unique Eazel Software Installer.</DESCRIPTION>
- <ENABLED>true</ENABLED>
- </SERVICE>
- <SERVICE>
- <NAME>eazel_softcat_service</NAME>
- <ICON>http://services.eazel.com/images/services/softcat-service-icon.png</ICON>
- <BUTTON_LABEL>To software catalog</BUTTON_LABEL>
- <URI>http://services.eazel.com:7001/catalog</URI>
- <DESCRIPTION_HEADER>The Software Catalog</DESCRIPTION_HEADER>
- <DESCRIPTION>Collection of RPMs available for installation using the unique Eazel Software Installer.</DESCRIPTION>
- <ENABLED>true</ENABLED>
- </SERVICE>
- <SERVICE>
- <NAME>eazel_softcat_service</NAME>
- <ICON>http://services.eazel.com/images/services/softcat-service-icon.png</ICON>
- <BUTTON_LABEL>To software catalog</BUTTON_LABEL>
- <URI>http://services.eazel.com:7001/catalog</URI>
- <DESCRIPTION_HEADER>The Software Catalog</DESCRIPTION_HEADER>
- <DESCRIPTION>Collection of RPMs available for installation using the unique Eazel Software Installer.</DESCRIPTION>
- <ENABLED>true</ENABLED>
- </SERVICE>
- <SERVICE>
- <NAME>eazel_softcat_service</NAME>
- <ICON>http://services.eazel.com/images/services/softcat-service-icon.png</ICON>
- <BUTTON_LABEL>To software catalog</BUTTON_LABEL>
- <URI>http://services.eazel.com:7001/catalog</URI>
- <DESCRIPTION_HEADER>The Software Catalog</DESCRIPTION_HEADER>
- <DESCRIPTION>Collection of RPMs available for installation using the unique Eazel Software Installer.</DESCRIPTION>
- <ENABLED>true</ENABLED>
- </SERVICE>
- <SERVICE>
- <NAME>eazel_softcat_service</NAME>
- <ICON>http://services.eazel.com/images/services/softcat-service-icon.png</ICON>
- <BUTTON_LABEL>To software catalog</BUTTON_LABEL>
- <URI>http://services.eazel.com:7001/catalog</URI>
- <DESCRIPTION_HEADER>The Software Catalog</DESCRIPTION_HEADER>
- <DESCRIPTION>Collection of RPMs available for installation using the unique Eazel Software Installer.</DESCRIPTION>
- <ENABLED>true</ENABLED>
- </SERVICE>
- <SERVICE>
- <NAME>eazel_softcat_service</NAME>
- <ICON>http://services.eazel.com/images/services/softcat-service-icon.png</ICON>
- <BUTTON_LABEL>To software catalog</BUTTON_LABEL>
- <URI>http://services.eazel.com:7001/catalog</URI>
- <DESCRIPTION_HEADER>The Software Catalog</DESCRIPTION_HEADER>
- <DESCRIPTION>Collection of RPMs available for installation using the unique Eazel Software Installer.</DESCRIPTION>
- <ENABLED>true</ENABLED>
- </SERVICE>
- <SERVICE>
- <NAME>eazel_softcat_service</NAME>
- <ICON>http://services.eazel.com/images/services/softcat-service-icon.png</ICON>
- <BUTTON_LABEL>To software catalog</BUTTON_LABEL>
- <URI>http://services.eazel.com:7001/catalog</URI>
- <DESCRIPTION_HEADER>The Software Catalog</DESCRIPTION_HEADER>
- <DESCRIPTION>Collection of RPMs available for installation using the unique Eazel Software Installer.</DESCRIPTION>
- <ENABLED>true</ENABLED>
- </SERVICE>
- </SERVICES>
- <EAZEL_NEWS>
- <ITEM>
- <NAME>In the news</NAME>
- <ICON>services-warning.png</ICON>
- <DATE>10/18/00</DATE>
- <MESSAGE>There is no news.</MESSAGE>
- </ITEM>
- </EAZEL_NEWS>
- <UPDATE_NEWS>
- <UPDATE>
- <NAME>Nescape Communicator</NAME>
- <PRIORITY>Useless</PRIORITY>
- <VERSION>4.77</VERSION>
- <DESCRIPTION>Netscape's web browser is god's gift to the world. It will freeze your machine and suck hours of time away from important things. It sort of works but most of the time it won't. Get your copy now!</DESCRIPTION>
- <ICON>netscape.png</ICON>
- <URI>eazel-install:netscape</URI>
- <SOFTCAT_URI>eazel-services://anonymous/catalog/details?id=14&amp;name=Text+Editors&amp;package_id=1905</SOFTCAT_URI>
- <BUTTON_LABEL>More Info!</BUTTON_LABEL>
- </UPDATE>
- <UPDATE>
- <NAME>Ed</NAME>
- <PRIORITY>Severe</PRIORITY>
- <VERSION>0.2-13</VERSION>
- <DESCRIPTION>Ed is a line oriented tesxt editor, used to create, display, and modify text files (both interactively and via shell scripts). For most purposes, ed has been replaced in normal usage by full-screen editors (emacs and vi, for example). Ed was the original UNIX editor, and may be used by some programs </DESCRIPTION>
- <ICON>http://services.eazel.com/images/softcat/ed.png</ICON>
- <URI>eazel-install:DeRIAA</URI>
- <SOFTCAT_URI>eazel-services://anonymous/catalog/details?id=14&amp;name=Text+Editors&amp;package_id=1905</SOFTCAT_URI>
- <BUTTON_LABEL>More Info!</BUTTON_LABEL>
- </UPDATE>
- <UPDATE>
- <NAME>DeRIAA</NAME>
- <PRIORITY>Severe</PRIORITY>
- <VERSION>1.0b</VERSION>
- <DESCRIPTION>The latest must-have utility eliminates the RIAA from existence with only minimal configuration required.</DESCRIPTION>
- <ICON>http://services.eazel.com/images/softcat/ed.png</ICON>
- <URI>eazel-install:DeRIAA</URI>
- <SOFTCAT_URI>eazel-services://anonymous/catalog/details?id=14&amp;name=Text+Editors&amp;package_id=1905</SOFTCAT_URI>
- <BUTTON_LABEL>More info!</BUTTON_LABEL>
- </UPDATE>
- <UPDATE>
- <NAME>Ed</NAME>
- <PRIORITY>Severe</PRIORITY>
- <VERSION>0.2-13</VERSION>
- <DESCRIPTION>Ed is a line oriented tesxt editor, used to create, display, and modify text files (both interactively and via shell scripts). For most purposes, ed has been replaced in normal usage by full-screen editors (emacs and vi, for example). Ed was the original UNIX editor, and may be used by some programs </DESCRIPTION>
- <ICON>http://services.eazel.com/images/softcat/ed.png</ICON>
- <URI>eazel-install:DeRIAA</URI>
- <SOFTCAT_URI>eazel-services://anonymous/catalog/details?id=14&amp;name=Text+Editors&amp;package_id=1905</SOFTCAT_URI>
- <BUTTON_LABEL>More Info!</BUTTON_LABEL>
- </UPDATE>
- <UPDATE>
- <NAME>Ed</NAME>
- <PRIORITY>Severe</PRIORITY>
- <VERSION>0.2-13</VERSION>
- <DESCRIPTION>Ed is a line oriented tesxt editor, used to create, display, and modify text files (both interactively and via shell scripts). For most purposes, ed has been replaced in normal usage by full-screen editors (emacs and vi, for example). Ed was the original UNIX editor, and may be used by some programs </DESCRIPTION>
- <ICON>http://services.eazel.com/images/softcat/ed.png</ICON>
- <URI>eazel-install:DeRIAA</URI>
- <SOFTCAT_URI>eazel-services://anonymous/catalog/details?id=14&amp;name=Text+Editors&amp;package_id=1905</SOFTCAT_URI>
- <BUTTON_LABEL>More Info!</BUTTON_LABEL>
- </UPDATE>
- <UPDATE>
- <NAME>Ed</NAME>
- <PRIORITY>Severe</PRIORITY>
- <VERSION>0.2-13</VERSION>
- <DESCRIPTION>Ed is a line oriented tesxt editor, used to create, display, and modify text files (both interactively and via shell scripts). For most purposes, ed has been replaced in normal usage by full-screen editors (emacs and vi, for example). Ed was the original UNIX editor, and may be used by some programs </DESCRIPTION>
- <ICON>http://services.eazel.com/images/softcat/ed.png</ICON>
- <URI>eazel-install:DeRIAA</URI>
- <SOFTCAT_URI>eazel-services://anonymous/catalog/details?id=14&amp;name=Text+Editors&amp;package_id=1905</SOFTCAT_URI>
- <BUTTON_LABEL>More Info!</BUTTON_LABEL>
- </UPDATE>
- <UPDATE>
- <NAME>Ed</NAME>
- <PRIORITY>Severe</PRIORITY>
- <VERSION>0.2-13</VERSION>
- <DESCRIPTION>Ed is a line oriented tesxt editor, used to create, display, and modify text files (both interactively and via shell scripts). For most purposes, ed has been replaced in normal usage by full-screen editors (emacs and vi, for example). Ed was the original UNIX editor, and may be used by some programs </DESCRIPTION>
- <ICON>http://services.eazel.com/images/softcat/ed.png</ICON>
- <URI>eazel-install:DeRIAA</URI>
- <SOFTCAT_URI>eazel-services://anonymous/catalog/details?id=14&amp;name=Text+Editors&amp;package_id=1905</SOFTCAT_URI>
- <BUTTON_LABEL>More Info!</BUTTON_LABEL>
- </UPDATE>
- <UPDATE>
- <NAME>Ed</NAME>
- <PRIORITY>Severe</PRIORITY>
- <VERSION>0.2-13</VERSION>
- <DESCRIPTION>Ed is a line oriented tesxt editor, used to create, display, and modify text files (both interactively and via shell scripts). For most purposes, ed has been replaced in normal usage by full-screen editors (emacs and vi, for example). Ed was the original UNIX editor, and may be used by some programs </DESCRIPTION>
- <ICON>http://services.eazel.com/images/softcat/ed.png</ICON>
- <URI>eazel-install:DeRIAA</URI>
- <SOFTCAT_URI>eazel-services://anonymous/catalog/details?id=14&amp;name=Text+Editors&amp;package_id=1905</SOFTCAT_URI>
- <BUTTON_LABEL>More Info!</BUTTON_LABEL>
- </UPDATE>
- <UPDATE>
- <NAME>Ed</NAME>
- <PRIORITY>Severe</PRIORITY>
- <VERSION>0.2-13</VERSION>
- <DESCRIPTION>Ed is a line oriented tesxt editor, used to create, display, and modify text files (both interactively and via shell scripts). For most purposes, ed has been replaced in normal usage by full-screen editors (emacs and vi, for example). Ed was the original UNIX editor, and may be used by some programs </DESCRIPTION>
- <ICON>http://services.eazel.com/images/softcat/ed.png</ICON>
- <URI>eazel-install:DeRIAA</URI>
- <SOFTCAT_URI>eazel-services://anonymous/catalog/details?id=14&amp;name=Text+Editors&amp;package_id=1905</SOFTCAT_URI>
- <BUTTON_LABEL>More Info!</BUTTON_LABEL>
- </UPDATE>
- <UPDATE>
- <NAME>Ed</NAME>
- <PRIORITY>Severe</PRIORITY>
- <VERSION>0.2-13</VERSION>
- <DESCRIPTION>Ed is a line oriented tesxt editor, used to create, display, and modify text files (both interactively and via shell scripts). For most purposes, ed has been replaced in normal usage by full-screen editors (emacs and vi, for example). Ed was the original UNIX editor, and may be used by some programs </DESCRIPTION>
- <ICON>http://services.eazel.com/images/softcat/ed.png</ICON>
- <URI>eazel-install:DeRIAA</URI>
- <SOFTCAT_URI>eazel-services://anonymous/catalog/details?id=14&amp;name=Text+Editors&amp;package_id=1905</SOFTCAT_URI>
- <BUTTON_LABEL>More Info!</BUTTON_LABEL>
- </UPDATE>
- <UPDATE>
- <NAME>Ed</NAME>
- <PRIORITY>Severe</PRIORITY>
- <VERSION>0.2-13</VERSION>
- <DESCRIPTION>Ed is a line oriented tesxt editor, used to create, display, and modify text files (both interactively and via shell scripts). For most purposes, ed has been replaced in normal usage by full-screen editors (emacs and vi, for example). Ed was the original UNIX editor, and may be used by some programs </DESCRIPTION>
- <ICON>http://services.eazel.com/images/softcat/ed.png</ICON>
- <URI>eazel-install:DeRIAA</URI>
- <SOFTCAT_URI>eazel-services://anonymous/catalog/details?id=14&amp;name=Text+Editors&amp;package_id=1905</SOFTCAT_URI>
- <BUTTON_LABEL>More Info!</BUTTON_LABEL>
- </UPDATE>
- <UPDATE>
- <NAME>Ed</NAME>
- <PRIORITY>Severe</PRIORITY>
- <VERSION>0.2-13</VERSION>
- <DESCRIPTION>Ed is a line oriented tesxt editor, used to create, display, and modify text files (both interactively and via shell scripts). For most purposes, ed has been replaced in normal usage by full-screen editors (emacs and vi, for example). Ed was the original UNIX editor, and may be used by some programs </DESCRIPTION>
- <ICON>http://services.eazel.com/images/softcat/ed.png</ICON>
- <URI>eazel-install:DeRIAA</URI>
- <SOFTCAT_URI>eazel-services://anonymous/catalog/details?id=14&amp;name=Text+Editors&amp;package_id=1905</SOFTCAT_URI>
- <BUTTON_LABEL>More Info!</BUTTON_LABEL>
- </UPDATE>
- <UPDATE>
- <NAME>Ed</NAME>
- <PRIORITY>Severe</PRIORITY>
- <VERSION>0.2-13</VERSION>
- <DESCRIPTION>Ed is a line oriented tesxt editor, used to create, display, and modify text files (both interactively and via shell scripts). For most purposes, ed has been replaced in normal usage by full-screen editors (emacs and vi, for example). Ed was the original UNIX editor, and may be used by some programs </DESCRIPTION>
- <ICON>http://services.eazel.com/images/softcat/ed.png</ICON>
- <URI>eazel-install:DeRIAA</URI>
- <SOFTCAT_URI>eazel-services://anonymous/catalog/details?id=14&amp;name=Text+Editors&amp;package_id=1905</SOFTCAT_URI>
- <BUTTON_LABEL>More Info!</BUTTON_LABEL>
- </UPDATE>
- <UPDATE>
- <NAME>Ed</NAME>
- <PRIORITY>Severe</PRIORITY>
- <VERSION>0.2-13</VERSION>
- <DESCRIPTION>Ed is a line oriented tesxt editor, used to create, display, and modify text files (both interactively and via shell scripts). For most purposes, ed has been replaced in normal usage by full-screen editors (emacs and vi, for example). Ed was the original UNIX editor, and may be used by some programs </DESCRIPTION>
- <ICON>http://services.eazel.com/images/softcat/ed.png</ICON>
- <URI>eazel-install:DeRIAA</URI>
- <SOFTCAT_URI>eazel-services://anonymous/catalog/details?id=14&amp;name=Text+Editors&amp;package_id=1905</SOFTCAT_URI>
- <BUTTON_LABEL>More Info!</BUTTON_LABEL>
- </UPDATE>
- <UPDATE>
- <NAME>Ed</NAME>
- <PRIORITY>Severe</PRIORITY>
- <VERSION>0.2-13</VERSION>
- <DESCRIPTION>Ed is a line oriented tesxt editor, used to create, display, and modify text files (both interactively and via shell scripts). For most purposes, ed has been replaced in normal usage by full-screen editors (emacs and vi, for example). Ed was the original UNIX editor, and may be used by some programs </DESCRIPTION>
- <ICON>http://services.eazel.com/images/softcat/ed.png</ICON>
- <URI>eazel-install:DeRIAA</URI>
- <SOFTCAT_URI>eazel-services://anonymous/catalog/details?id=14&amp;name=Text+Editors&amp;package_id=1905</SOFTCAT_URI>
- <BUTTON_LABEL>More Info!</BUTTON_LABEL>
- </UPDATE>
- <UPDATE>
- <NAME>Ed</NAME>
- <PRIORITY>Severe</PRIORITY>
- <VERSION>0.2-13</VERSION>
- <DESCRIPTION>Ed is a line oriented tesxt editor, used to create, display, and modify text files (both interactively and via shell scripts). For most purposes, ed has been replaced in normal usage by full-screen editors (emacs and vi, for example). Ed was the original UNIX editor, and may be used by some programs </DESCRIPTION>
- <ICON>http://services.eazel.com/images/softcat/ed.png</ICON>
- <URI>eazel-install:DeRIAA</URI>
- <SOFTCAT_URI>eazel-services://anonymous/catalog/details?id=14&amp;name=Text+Editors&amp;package_id=1905</SOFTCAT_URI>
- <BUTTON_LABEL>More Info!</BUTTON_LABEL>
- </UPDATE>
- <UPDATE>
- <NAME>Ed</NAME>
- <PRIORITY>Severe</PRIORITY>
- <VERSION>0.2-13</VERSION>
- <DESCRIPTION>Ed is a line oriented tesxt editor, used to create, display, and modify text files (both interactively and via shell scripts). For most purposes, ed has been replaced in normal usage by full-screen editors (emacs and vi, for example). Ed was the original UNIX editor, and may be used by some programs </DESCRIPTION>
- <ICON>http://services.eazel.com/images/softcat/ed.png</ICON>
- <URI>eazel-install:DeRIAA</URI>
- <SOFTCAT_URI>eazel-services://anonymous/catalog/details?id=14&amp;name=Text+Editors&amp;package_id=1905</SOFTCAT_URI>
- <BUTTON_LABEL>More Info!</BUTTON_LABEL>
- </UPDATE>
- </UPDATE_NEWS>
-</SUMMARY_DATA>
-
diff --git a/components/services/summary/tests.txt b/components/services/summary/tests.txt
deleted file mode 100644
index b8ff1482f..000000000
--- a/components/services/summary/tests.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-To use these tests do the following:
-su - root
-cp *.xml /home/httpd/html or wherever the root of your webserver lives.
-set #define DEBUG_TEST 1
-rebuild the summary view and install.
-It will probably fail right now if you don't have access to services.eazel.com
-since several of the remote images live there.
diff --git a/components/services/time/.cvsignore b/components/services/time/.cvsignore
deleted file mode 100644
index 282522db0..000000000
--- a/components/services/time/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-Makefile
-Makefile.in
diff --git a/components/services/time/Makefile.am b/components/services/time/Makefile.am
deleted file mode 100644
index c852c3033..000000000
--- a/components/services/time/Makefile.am
+++ /dev/null
@@ -1,2 +0,0 @@
-SUBDIRS = service command-line nautilus-view idl
-
diff --git a/components/services/time/command-line/.cvsignore b/components/services/time/command-line/.cvsignore
deleted file mode 100644
index 6763997eb..000000000
--- a/components/services/time/command-line/.cvsignore
+++ /dev/null
@@ -1,12 +0,0 @@
-.deps
-.libs
-Makefile
-Makefile.in
-eazel-time
-idl_stamp
-trilobite-eazel-time-service-cli
-trilobite-eazel-time-service-common.c
-trilobite-eazel-time-service-skels.c
-trilobite-eazel-time-service-stubs.c
-trilobite-eazel-time-service.h
-trilobite_eazel_time_service_idl_stamp
diff --git a/components/services/time/command-line/Makefile.am b/components/services/time/command-line/Makefile.am
deleted file mode 100644
index 96f75c803..000000000
--- a/components/services/time/command-line/Makefile.am
+++ /dev/null
@@ -1,66 +0,0 @@
-NULL =
-
-INCLUDES = \
- -DPREFIX=\"$(prefix)\" \
- -DG_LOG_DOMAIN=\"trilobite-eazel-time-service-cli\" \
- -DGNOMELOCALEDIR=\""$(datadir)/locale"\" \
- -I$(top_srcdir) \
- -I$(top_builddir) \
- -I$(top_srcdir)/components/services/trilobite/libtrilobite \
- -I$(top_builddir)/components/services/trilobite/libtrilobite \
- -I$(top_srcdir)/components/services/trilobite \
- -I$(top_builddir)/components/services/trilobite \
- $(GNOMEUI_CFLAGS) \
- $(GCONF_CFLAGS) \
- $(NULL)
-
-
-
-oafdir = $(datadir)/oaf
-
-# CORBA magic
-
-CORBA_GENERATED = \
- trilobite-eazel-time-service.h \
- trilobite-eazel-time-service-skels.c \
- trilobite-eazel-time-service-stubs.c \
- trilobite-eazel-time-service-common.c \
- $(NULL)
-
-IDLDIR = $(top_srcdir)/components/services/time/idl
-IDL = $(IDLDIR)/trilobite-eazel-time-service.idl
-
-# make the auto-generated files depend on a timestamp file.
-# this is to ensure the individual files wait for each other before
-# proceeding which is needed in parallel makes
-
-$(CORBA_GENERATED): idl_stamp
-
-idl_stamp: $(IDL)
- $(ORBIT_IDL) $(IDL_CFLAGS) $(IDL)
- touch idl_stamp
-
-main.c: $(CORBA_GENERATED)
-
-CLEANFILES+=$(CORBA_GENERATED) idl_stamp
-
-## Binaries
-
-bin_PROGRAMS = \
- eazel-time
-
-eazel_time_SOURCES = \
- main.c \
- trilobite-eazel-time-service-common.c \
- trilobite-eazel-time-service-stubs.c \
- $(NULL)
-
-eazel_time_LDADD = \
- $(BONOBO_LIBS) \
- $(GNOMEUI_LIBS) \
- $(GCONF_LIBS) \
- $(VFS_LIBS) \
- $(OAF_LIBS) \
- $(top_builddir)/components/services/trilobite/libtrilobite/libtrilobite.la \
- $(NULL)
-
diff --git a/components/services/time/command-line/main.c b/components/services/time/command-line/main.c
deleted file mode 100644
index c9b61f6bc..000000000
--- a/components/services/time/command-line/main.c
+++ /dev/null
@@ -1,169 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: Eskil Heyn Olsen <eskil@eazel.com>
- *
- */
-
-#include <config.h>
-#include <gnome.h>
-#include <liboaf/liboaf.h>
-#include <bonobo.h>
-#include <unistd.h> /* for getpass() */
-
-#include <libtrilobite/libtrilobite.h>
-#include <libtrilobite/libtrilobite-service.h>
-
-#include "trilobite-eazel-time-service.h"
-
-#define OAF_ID "OAFIID:trilobite_eazel_time_service:13a2dbd9-84f9-4400-bd9e-bb4575b86894"
-
-int arg_list_info,
- arg_max_diff,
- arg_update_time;
-char *arg_server;
-
-static const struct poptOption options[] = {
- {"info", 'i', POPT_ARG_NONE, &arg_list_info, 0, N_("display service name and such"), NULL},
- {"maxdiff", '\0', POPT_ARG_INT, &arg_max_diff, -1, N_("maximum allowed difference in seconds"), NULL},
- {"update", 'u', POPT_ARG_NONE, &arg_update_time, 0, N_("update the system clock"), NULL},
- {"server", '\0', POPT_ARG_STRING, &arg_server, 0, N_("specify time server"), NULL},
- {NULL, '\0', 0, NULL, 0}
-};
-
-CORBA_Environment ev;
-CORBA_ORB orb;
-
-
-static char *
-get_password (GtkObject *object, const char *prompt)
-{
- char * real_prompt;
- char * passwd;
-
- real_prompt = g_strdup_printf ("%s: ", prompt);
- passwd = getpass (real_prompt);
- g_free (real_prompt);
-
- return g_strdup (passwd);
-}
-
-
-/* This is basically ripped from empty-client */
-
-int main(int argc, char *argv[]) {
- BonoboObjectClient *service;
- Trilobite_Eazel_Time timeservice;
- CORBA_long diff;
- TrilobiteRootClient *root_client;
-
- CORBA_exception_init (&ev);
- gnomelib_register_popt_table (oaf_popt_options, oaf_get_popt_table_name ());
- orb = oaf_init (argc, argv);
- gnome_init_with_popt_table ("trilobite-eazel-time-service-cli", "1.0",argc, argv, options, 0, NULL);
-
- if (!bonobo_init (NULL, NULL, NULL)) {
- g_error ("Could not init bonobo");
- }
- bonobo_activate ();
-
- service = bonobo_object_activate (OAF_ID, 0);
- if (!service) {
- g_error ("Cannot activate %s\n",OAF_ID);
- }
-
- if (! bonobo_object_client_has_interface (service, "IDL:Trilobite/Service:1.0", &ev)) {
- g_error ("Object does not support IDL:/Trilobite/Service:1.0");
- }
- if (! bonobo_object_client_has_interface (service, "IDL:Trilobite/Eazel/Time:1.0", &ev)) {
- g_error ("Object does not support IDL:/Trilobite/Eazel/Time:1.0");
- }
-
- /* If a trilobite, get the interface and dump the info */
- if (arg_list_info) {
- Trilobite_Service trilobite;
- trilobite = bonobo_object_query_interface (BONOBO_OBJECT (service), "IDL:Trilobite/Service:1.0");
- g_message ("service name : %s", Trilobite_Service_get_name (trilobite, &ev));
- g_message ("service version : %s", Trilobite_Service_get_version (trilobite, &ev));
- g_message ("service vendor name : %s", Trilobite_Service_get_vendor_name (trilobite, &ev));
- g_message ("service vendor url : %s", Trilobite_Service_get_vendor_url (trilobite, &ev));
- g_message ("service url : %s", Trilobite_Service_get_url (trilobite, &ev));
- g_message ("service icon : %s", Trilobite_Service_get_icon (trilobite, &ev));
- Trilobite_Service_unref (trilobite, &ev);
- CORBA_Object_release (trilobite, &ev);
- }
-
- /* set callbacks to get the root password */
- root_client = trilobite_root_client_new ();
- trilobite_root_client_attach (root_client, service);
- gtk_signal_connect (GTK_OBJECT (root_client), "need_password",
- GTK_SIGNAL_FUNC (get_password), NULL);
-
- timeservice = bonobo_object_query_interface (BONOBO_OBJECT (service), "IDL:Trilobite/Eazel/Time:1.0");
-
- if (arg_max_diff>=0) {
- Trilobite_Eazel_Time_set_max_difference (timeservice, arg_max_diff, &ev);
- }
-
- if (arg_server) {
- Trilobite_Eazel_Time_set_time_server (timeservice, arg_server, &ev);
- }
-
- diff = Trilobite_Eazel_Time_check_time (timeservice, &ev);
- if (ev._major != CORBA_NO_EXCEPTION) {
- if (strcmp (ex_Trilobite_Eazel_Time_CannotGetTime, CORBA_exception_id (&ev)) == 0) {
- Trilobite_Eazel_Time_CannotGetTime *exn;
- fprintf (stderr, "Unable to obtain time from server\n");
- exn = (Trilobite_Eazel_Time_CannotGetTime*)CORBA_exception_value (&ev);
- fprintf (stderr, "server was %s\nReason is %s\n", exn->server, exn->reason);
- } else {
- fprintf (stderr, "Unhandleable error occured while communicating with the time-service\n");
- fprintf (stderr, "Caught %s\n", CORBA_exception_id (&ev));
- }
- arg_update_time = 0;
- CORBA_exception_free (&ev);
- } else {
- if (diff != 0) {
- fprintf (stdout, "Time mismatch (%d seconds %s), %s\n",
- abs (diff),
- diff < 0 ? "behind" : "ahead",
- arg_update_time ? "will update." : "suggest you update the time.");
- } else {
- fprintf (stdout, "Time matches server time\n");
- }
- }
-
- if (arg_update_time) {
- Trilobite_Eazel_Time_update_time (timeservice, &ev);
- if (ev._major == CORBA_USER_EXCEPTION) {
- if (strcmp (ex_Trilobite_Eazel_Time_NotPermitted, CORBA_exception_id (&ev)) == 0) {
- fprintf (stderr, "You are not permitted to change system time\n");
- }
- CORBA_exception_free (&ev);
- }
- }
-
- trilobite_root_client_unref (GTK_OBJECT (root_client));
- Bonobo_Unknown_unref (timeservice, &ev);
- CORBA_Object_release (timeservice, &ev);
- bonobo_object_unref (BONOBO_OBJECT (service));
- CORBA_exception_free (&ev);
-
- return 0;
-};
diff --git a/components/services/time/idl/.cvsignore b/components/services/time/idl/.cvsignore
deleted file mode 100644
index 282522db0..000000000
--- a/components/services/time/idl/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-Makefile
-Makefile.in
diff --git a/components/services/time/idl/Makefile.am b/components/services/time/idl/Makefile.am
deleted file mode 100644
index de136b009..000000000
--- a/components/services/time/idl/Makefile.am
+++ /dev/null
@@ -1,6 +0,0 @@
-idldir = ${prefix}/idl
-idl_DATA = \
- trilobite-eazel-time-service.idl
-
-EXTRA_DIST=\
- $(idl_DATA)
diff --git a/components/services/time/idl/trilobite-eazel-time-service.idl b/components/services/time/idl/trilobite-eazel-time-service.idl
deleted file mode 100644
index 4d735373f..000000000
--- a/components/services/time/idl/trilobite-eazel-time-service.idl
+++ /dev/null
@@ -1,24 +0,0 @@
-/* -*- Mode: IDL; tab-width: 8; indent-tabs-mode: 8; c-basic-offset: 8 -*- */
-
-#include <Bonobo.idl>
-
-module Trilobite {
- module Eazel {
- interface Time : Bonobo::Unknown {
-
- exception NotPermitted {};
-
- exception CannotSet {};
-
- exception CannotGetTime {
- string server;
- string reason;
- };
-
- void set_max_difference (in long maxd);
- void set_time_server (in string server);
- unsigned long check_time () raises (CannotGetTime);
- void update_time () raises (NotPermitted, CannotGetTime);
- };
- };
-};
diff --git a/components/services/time/nautilus-view/.cvsignore b/components/services/time/nautilus-view/.cvsignore
deleted file mode 100644
index dc047a297..000000000
--- a/components/services/time/nautilus-view/.cvsignore
+++ /dev/null
@@ -1,11 +0,0 @@
-.deps
-.libs
-Makefile
-Makefile.in
-idl_stamp
-trilobite-eazel-time-service-common.c
-trilobite-eazel-time-service-skels.c
-trilobite-eazel-time-service-stubs.c
-trilobite-eazel-time-service.h
-trilobite-eazel-time-view
-trilobite_eazel_time_service_idl_stamp
diff --git a/components/services/time/nautilus-view/Makefile.am b/components/services/time/nautilus-view/Makefile.am
deleted file mode 100644
index b1e69e3f5..000000000
--- a/components/services/time/nautilus-view/Makefile.am
+++ /dev/null
@@ -1,73 +0,0 @@
-NULL =
-
-INCLUDES = \
- -DPREFIX=\"$(prefix)\" \
- -DG_LOG_DOMAIN=\"trilobite-eazel-time-service\" \
- -DGNOMELOCALEDIR=\""$(datadir)/locale"\" \
- -I$(top_srcdir) \
- -I$(top_builddir) \
- -I$(top_srcdir)/components/services/trilobite/libtrilobite \
- -I$(top_builddir)/components/services/trilobite/libtrilobite \
- -I$(top_srcdir)/components/services/trilobite \
- -I$(top_builddir)/components/services/trilobite \
- $(GCONF_CFLAGS) \
- $(GNOMEUI_CFLAGS) \
- $(GNOME_CFLAGS) \
- $(GNOME_INCLUDEDIR) \
- $(OAF_CFLAGS) \
- $(XML_CFLAGS) \
- $(NULL)
-
-
-IDLDIR = $(top_srcdir)/components/services/time/idl
-IDL = $(IDLDIR)/trilobite-eazel-time-service.idl
-
-CORBA_GENERATED = \
- trilobite-eazel-time-service.h \
- trilobite-eazel-time-service-skels.c \
- trilobite-eazel-time-service-stubs.c \
- trilobite-eazel-time-service-common.c \
- $(NULL)
-
-# make the auto-generated files depend on a timestamp file.
-# this is to ensure the individual files wait for each other before
-# proceeding which is needed in parallel makes
-
-$(CORBA_GENERATED): idl_stamp
-
-idl_stamp: $(IDL)
- $(ORBIT_IDL) $(IDL_CFLAGS) $(IDL)
- touch idl_stamp
-
-main.c trilobite-eazel-time-view.c: $(CORBA_GENERATED)
-
-CLEANFILES+=$(CORBA_GENERATED) idl_stamp
-
-
-
-oafdir = $(datadir)/oaf
-
-oaf_DATA = \
- trilobite-eazel-time-view.oafinfo
-
-
-bin_PROGRAMS = \
- trilobite-eazel-time-view
-
-trilobite_eazel_time_view_SOURCES = \
- trilobite-eazel-time-view.h \
- trilobite-eazel-time-view.c \
- trilobite-eazel-time-service-common.c \
- trilobite-eazel-time-service-stubs.c \
- main.c \
- ${NULL}
-
-trilobite_eazel_time_view_LDADD = \
- $(top_builddir)/components/services/trilobite/libtrilobite/libtrilobite.la \
- $(top_builddir)/libnautilus/libnautilus.la \
- $(GNOMEUI_LIBS) \
- $(BONOBO_LIBS) \
- $(GCONF_LIBS) \
- $(OAF_LIBS)
-
-EXTRA_DIST = $(oaf_DATA)
diff --git a/components/services/time/nautilus-view/main.c b/components/services/time/nautilus-view/main.c
deleted file mode 100644
index f473da57a..000000000
--- a/components/services/time/nautilus-view/main.c
+++ /dev/null
@@ -1,118 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Michael Fleming <mfleming@eazel.com>
- * Based on nautilus-sample-content-view by Maciej Stachowiak <mjs@eazel.com>
- */
-
-/* main.c - main function and object activation function for sample
- content view component. */
-
-#include <config.h>
-
-#include "trilobite-eazel-time-view.h"
-
-#include <gnome.h>
-#include <liboaf/liboaf.h>
-#include <eel/eel-debug.h>
-#include <bonobo.h>
-
-static int object_count = 0;
-
-static void
-sample_object_destroyed(GtkObject *obj)
-{
- object_count--;
- if (object_count <= 0) {
- gtk_main_quit ();
- }
-}
-
-static BonoboObject *
-sample_make_object (BonoboGenericFactory *factory,
- const char *iid,
- void *closure)
-{
- TrilobiteEazelTimeView *view;
- NautilusView *nautilus_view;
-
- g_message ("Checking IID!");
-
- if (strcmp (iid, OAFIID_TRILOBITE_EAZEL_TIME_VIEW)) {
- return NULL;
- }
-
- g_message ("Trying to make object!");
-
- view = TRILOBITE_EAZEL_TIME_VIEW (gtk_object_new (TRILOBITE_TYPE_EAZEL_TIME_VIEW, NULL));
-
- object_count++;
-
- nautilus_view = trilobite_eazel_time_view_get_nautilus_view (view);
-
- gtk_signal_connect (GTK_OBJECT (nautilus_view), "destroy", sample_object_destroyed, NULL);
-
- return BONOBO_OBJECT (nautilus_view);
-}
-
-int main(int argc, char *argv[])
-{
- BonoboGenericFactory *factory;
- CORBA_ORB orb;
- CORBA_Environment ev;
- char *registration_id;
-
- CORBA_exception_init(&ev);
-
- /* Make criticals and warnings stop in the debugger if NAUTILUS_DEBUG is set.
- Unfortunately, this has to be done explicitly for each domain.
- */
- if (getenv("NAUTILUS_DEBUG") != NULL)
- eel_make_warnings_and_criticals_stop_in_debugger
- (G_LOG_DOMAIN, g_log_domain_glib, "Gdk", "Gtk", "GnomeVFS", NULL);
-
-
- g_message ("In component.");
-
- gnomelib_register_popt_table (oaf_popt_options, oaf_get_popt_table_name ());
- orb = oaf_init (argc, argv);
-
- gnome_init ("trilobite-eazel-time-view", VERSION,
- argc, argv);
-
- bonobo_init (orb, CORBA_OBJECT_NIL, CORBA_OBJECT_NIL);
-
-#if 0
- glade_gnome_init();
-#endif /* 0 */
-
- registration_id = oaf_make_registration_id (OAFIID_TRILOBITE_EAZEL_TIME_VIEW_FACTORY, getenv ("DISPLAY"));
- factory = bonobo_generic_factory_new_multi (registration_id,
- sample_make_object,
- NULL);
- g_free (registration_id);
-
- g_message ("About to do main loop.");
-
- do {
- bonobo_main ();
- } while (object_count > 0);
-
- return 0;
-}
diff --git a/components/services/time/nautilus-view/trilobite-eazel-time-view.c b/components/services/time/nautilus-view/trilobite-eazel-time-view.c
deleted file mode 100644
index be2e11fcd..000000000
--- a/components/services/time/nautilus-view/trilobite-eazel-time-view.c
+++ /dev/null
@@ -1,484 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: Michael Fleming <mfleming@eazel.com>
- * Robey Pointer <robey@eazel.com>
- *
- * Based on nautilus-sample-content-view by Maciej Stachowiak <mjs@eazel.com>
- */
-
-/* trilobite-eazel-time-view.c: a simple Nautilus view for a simple service
- */
-
-#include <config.h>
-#include "trilobite-eazel-time-service.h"
-#include "trilobite-eazel-time-view.h"
-
-#include <gnome.h>
-#include <bonobo.h>
-#include <gtk/gtk.h>
-#include <gdk-pixbuf/gdk-pixbuf.h>
-#include <libgnome/gnome-i18n.h>
-#include <libgnomeui/gnome-stock.h>
-#include <libnautilus/nautilus-bonobo-ui.h>
-#include <eel/eel-gtk-macros.h>
-#include <eel/eel-password-dialog.h>
-
-#include <libtrilobite/libtrilobite.h>
-
-/*
- * Defaults Macros
- *
- */
-
-/* FIXME bugzilla.eazel.com 2588: no way to save the url once you change it */
-#define DEFAULT_SERVER "nist1.sjc.certifiedtime.com"
-#define DEFAULT_TIME_DIFF "180"
-
-#define OAFIID_TIME_SERVICE "OAFIID:trilobite_eazel_time_service:13a2dbd9-84f9-4400-bd9e-bb4575b86894"
-
-#define STATUS_ERROR_NO_SERVER "Could not load time service backend"
-
-/* A NautilusContentView's private information. */
-struct TrilobiteEazelTimeViewDetails {
- char * server;
- char * max_time_diff;
- NautilusView * nautilus_view;
- GtkEntry * p_localtime;
- GtkEntry * p_servertime;
- GtkEntry * p_server;
- GtkEntry * p_maxdiff;
- GtkLabel * p_status;
- Trilobite_Eazel_Time service;
- guint timeout_slot;
- TrilobiteRootClient *root_client;
- char * remembered_password;
- guint password_attempts;
-};
-
-static void trilobite_eazel_time_view_initialize_class (TrilobiteEazelTimeViewClass *klass);
-static void trilobite_eazel_time_view_initialize (TrilobiteEazelTimeView *view);
-static void trilobite_eazel_time_view_destroy (GtkObject *object);
-static void load_location_callback (NautilusView *nautilus_view,
- const char *location,
- TrilobiteEazelTimeView *view);
-
-
-EEL_DEFINE_CLASS_BOILERPLATE (TrilobiteEazelTimeView, trilobite_eazel_time_view, GTK_TYPE_EVENT_BOX)
-
-static void
-set_status_text (TrilobiteEazelTimeView *view, const char *status_str)
-{
- g_return_if_fail (view->details->p_status);
- gtk_label_set_text (view->details->p_status, status_str);
-}
-
-
-static void
-sync_button_pressed( GtkButton *p_button, TrilobiteEazelTimeView *view )
-{
- CORBA_Environment ev;
-
- g_assert (TRILOBITE_IS_EAZEL_TIME_VIEW (view));
-
- if (! view->details->service) {
- set_status_text (view, STATUS_ERROR_NO_SERVER);
- return;
- }
-
- view->details->password_attempts = 0;
-
- CORBA_exception_init (&ev);
-
- while (1) {
- Trilobite_Eazel_Time_update_time (view->details->service, &ev);
-
- if (ev._major != CORBA_USER_EXCEPTION) {
- set_status_text (view, "Set time!");
- break;
- }
-
- if ( 0 == strcmp( ex_Trilobite_Eazel_Time_NotPermitted, CORBA_exception_id (&ev) ) ) {
- /* bad password -- let em try again? */
- if (view->details->password_attempts == 0) {
- /* cancelled */
- set_status_text (view, "Cancelled");
- break;
- }
-
- /* a wrong password shouldn't be remembered :) */
- g_free (view->details->remembered_password);
- view->details->remembered_password = NULL;
- CORBA_exception_free (&ev);
-
- if (view->details->password_attempts >= 3) {
- /* give up. */
- set_status_text (view, "Operation not permitted");
- break;
- }
- } else {
- set_status_text (view, "Exception: could not set time");
- break;
- }
- }
-
- CORBA_exception_free (&ev);
-}
-
-
-static void
-server_button_pressed( GtkButton *p_button, TrilobiteEazelTimeView *view )
-{
- CORBA_Environment ev;
-
- g_assert (TRILOBITE_IS_EAZEL_TIME_VIEW (view));
-
- CORBA_exception_init (&ev);
-
- if (view->details->service) {
-
- g_free (view->details->server);
- view->details->server = gtk_editable_get_chars (GTK_EDITABLE (view->details->p_server), 0, -1);
-
- Trilobite_Eazel_Time_set_time_server (view->details->service, view->details->server, &ev);
-
- set_status_text (view, "Time server changed");
-
- } else {
- set_status_text (view, STATUS_ERROR_NO_SERVER);
- }
-
- CORBA_exception_free (&ev);
-}
-
-static void
-timediff_button_pressed( GtkButton *p_button, TrilobiteEazelTimeView *view )
-{
- CORBA_Environment ev;
-
- CORBA_exception_init (&ev);
-
- g_assert (TRILOBITE_IS_EAZEL_TIME_VIEW (view));
-
- if (view->details->service) {
-
- g_free (view->details->server);
- view->details->server = gtk_editable_get_chars (GTK_EDITABLE (view->details->p_maxdiff), 0, -1);
-
- Trilobite_Eazel_Time_set_max_difference (view->details->service, atoi (view->details->max_time_diff), &ev);
-
- set_status_text (view, "Max Difference changed");
-
- } else {
- set_status_text (view, STATUS_ERROR_NO_SERVER);
- }
-
- CORBA_exception_free (&ev);
-
-}
-
-static gint
-update_time_display( TrilobiteEazelTimeView *view )
-{
- time_t local_time, remote_time;
- CORBA_Environment ev;
-
- CORBA_exception_init (&ev);
-
- g_return_val_if_fail (TRILOBITE_IS_EAZEL_TIME_VIEW (view), 1 );
-
- local_time = time( NULL );
-
- if (view->details->service) {
- remote_time = Trilobite_Eazel_Time_check_time(view->details->service, &ev );
-
- if (CORBA_USER_EXCEPTION == ev._major) {
- if ( 0 == strcmp( ex_Trilobite_Eazel_Time_CannotGetTime, CORBA_exception_id (&ev) ) ) {
- set_status_text (view, "Error: Cannot get remote time");
- } else {
- set_status_text (view, "Exception: could not get time");
- }
- } else {
- /* time service returns 0 if you're within the max time diff delta,
- * or the number of seconds you'd need to add to be correct.
- */
- remote_time += local_time;
- gtk_entry_set_text (GTK_ENTRY(view->details->p_servertime), ctime (&remote_time));
- }
- }
-
- gtk_entry_set_text (GTK_ENTRY(view->details->p_localtime), ctime( &local_time));
-
- CORBA_exception_free (&ev);
-
- return TRUE;
-}
-
-static char *
-trilobite_eazel_time_view_get_password (GtkObject *object, const char *prompt, void *my_object)
-{
- TrilobiteEazelTimeView *view;
- GtkWidget *dialog;
- gboolean okay;
- char *tmp;
- char *message = NULL;
-
- view = TRILOBITE_EAZEL_TIME_VIEW (my_object);
-
- if (view->details->remembered_password) {
- return g_strdup (view->details->remembered_password);
- }
-
- if (view->details->password_attempts > 0) {
- message = "Incorrect password.";
- }
-
- dialog = eel_password_dialog_new ("Authenticate Me", message, prompt, "", TRUE);
- okay = eel_password_dialog_run_and_block (EEL_PASSWORD_DIALOG (dialog));
-
- if (! okay) {
- view->details->password_attempts = 0;
- tmp = g_strdup ("");
- } else {
- tmp = eel_password_dialog_get_password (EEL_PASSWORD_DIALOG (dialog));
- if (eel_password_dialog_get_remember (EEL_PASSWORD_DIALOG (dialog))) {
- view->details->remembered_password = g_strdup (tmp);
- }
- }
- gtk_widget_destroy (dialog);
- gtk_main_iteration ();
-
- if (okay) {
- view->details->password_attempts++;
- }
-
- return tmp;
-}
-
-static void
-trilobite_eazel_time_view_initialize_class (TrilobiteEazelTimeViewClass *klass)
-{
- GtkObjectClass *object_class;
-
- object_class = GTK_OBJECT_CLASS (klass);
-
- object_class->destroy = trilobite_eazel_time_view_destroy;
-}
-
-static void
-trilobite_eazel_time_view_initialize (TrilobiteEazelTimeView *view)
-{
- GtkWidget *p_vbox;
- GtkWidget *p_hbox0;
- GtkWidget *p_hbox1;
- GtkWidget *p_hbox2;
- GtkWidget *p_hbox3;
- GtkWidget *p_sync;
- GtkWidget *p_server_button;
- GtkWidget *p_timediff_button;
- BonoboObjectClient *p_service;
-
- CORBA_Environment ev;
-
- CORBA_exception_init (&ev);
-
- view->details = g_new0 (TrilobiteEazelTimeViewDetails, 1);
-
- /* Instance initialization */
-
- view->details->nautilus_view = nautilus_view_new (GTK_WIDGET (view));
-
- view->details->server = g_strdup(DEFAULT_SERVER);
- view->details->max_time_diff = g_strdup(DEFAULT_TIME_DIFF);
-
- view->details->p_localtime = GTK_ENTRY (gtk_entry_new());
- view->details->p_servertime = GTK_ENTRY (gtk_entry_new());
- view->details->p_server = GTK_ENTRY (gtk_entry_new());
- view->details->p_maxdiff = GTK_ENTRY (gtk_entry_new());
- view->details->p_status = GTK_LABEL (gtk_label_new("(no status)"));
-
- gtk_entry_set_editable (GTK_ENTRY(view->details->p_localtime), FALSE);
- gtk_entry_set_editable (GTK_ENTRY(view->details->p_servertime), FALSE);
-
- gtk_entry_set_text (GTK_ENTRY(view->details->p_server), view->details->server);
- gtk_entry_set_text (GTK_ENTRY(view->details->p_maxdiff), view->details->max_time_diff);
-
- p_service = bonobo_object_activate (OAFIID_TIME_SERVICE, 0);
-
- /* Ensure service object exists and is OK */
- if (NULL == p_service
- || NULL == (view->details->service = bonobo_object_query_interface (BONOBO_OBJECT (p_service), "IDL:Trilobite/Eazel/Time:1.0"))
- ) {
- set_status_text (view, STATUS_ERROR_NO_SERVER);
- g_warning (STATUS_ERROR_NO_SERVER);
- }
-
- /* Initialize service params */
-
- if (view->details->service) {
- Trilobite_Eazel_Time_set_time_server (view->details->service, view->details->server, &ev);
- Trilobite_Eazel_Time_set_max_difference (view->details->service, atoi (view->details->max_time_diff), &ev);
- }
-
- /* init the widgets */
-
- p_vbox = gtk_vbox_new (FALSE, 0);
-
- /* label */
- gtk_box_pack_start (GTK_BOX(p_vbox), gtk_label_new ("Eazel Time Service"), FALSE, FALSE, 0);
-
- /* Local Time */
- p_hbox0 = gtk_hbox_new (FALSE, 0);
- gtk_box_pack_start (GTK_BOX(p_hbox0), gtk_label_new ("Local Time"), FALSE, FALSE, 0);
- gtk_box_pack_start (GTK_BOX(p_hbox0), GTK_WIDGET (view->details->p_localtime), FALSE, FALSE, 0);
- gtk_box_pack_start (GTK_BOX(p_vbox), GTK_WIDGET (p_hbox0), FALSE, FALSE, 0);
-
- /* Server Time */
- p_hbox1 = gtk_hbox_new (FALSE, 0);
- gtk_box_pack_start (GTK_BOX(p_hbox1), gtk_label_new ("Server Time"), FALSE, FALSE, 0);
- gtk_box_pack_start (GTK_BOX(p_hbox1), GTK_WIDGET (view->details->p_servertime), FALSE, FALSE, 0);
- gtk_box_pack_start (GTK_BOX(p_vbox), GTK_WIDGET (p_hbox1), FALSE, FALSE, 0);
-
- /* sync button */
- p_sync = gtk_button_new_with_label ("Synchronize local time\nwith server");
-
- gtk_signal_connect (GTK_OBJECT (p_sync), "pressed", GTK_SIGNAL_FUNC (sync_button_pressed), view);
-
- gtk_box_pack_start (GTK_BOX (p_vbox), GTK_WIDGET (p_sync), FALSE, FALSE, 0);
-
- /* Time SERVER */
-
- p_hbox2 = gtk_hbox_new (FALSE,0);
- gtk_box_pack_start (GTK_BOX(p_hbox2), gtk_label_new ("Time server"), FALSE, FALSE, 0);
- gtk_box_pack_start (GTK_BOX(p_hbox2), GTK_WIDGET (view->details->p_server), FALSE, FALSE, 0);
- p_server_button = gtk_button_new_with_label ("Set");
- gtk_signal_connect (GTK_OBJECT (p_server_button), "pressed", GTK_SIGNAL_FUNC (server_button_pressed), view);
- gtk_box_pack_start (GTK_BOX(p_hbox2), GTK_WIDGET (p_server_button), FALSE, FALSE, 0);
-
- gtk_box_pack_start (GTK_BOX (p_vbox), GTK_WIDGET (p_hbox2), FALSE, FALSE, 0);
-
- /* Time diff */
-
- p_hbox3 = gtk_hbox_new (FALSE, 0);
- gtk_box_pack_start (GTK_BOX(p_hbox3), gtk_label_new ("Max Time Diff"), FALSE, FALSE, 0);
- gtk_box_pack_start (GTK_BOX(p_hbox3), GTK_WIDGET (view->details->p_maxdiff), FALSE, FALSE, 0);
- p_timediff_button = gtk_button_new_with_label ("Set");
- gtk_signal_connect (GTK_OBJECT (p_timediff_button), "pressed", GTK_SIGNAL_FUNC (timediff_button_pressed), view);
- gtk_box_pack_start (GTK_BOX(p_hbox3), GTK_WIDGET (p_timediff_button), FALSE, FALSE, 0);
-
- gtk_box_pack_start (GTK_BOX (p_vbox), GTK_WIDGET (p_hbox3), FALSE, FALSE, 0);
-
- /* Status */
-
- gtk_box_pack_start (GTK_BOX (p_vbox), GTK_WIDGET (view->details->p_status), FALSE, FALSE, 0 );
-
- gtk_container_add (GTK_CONTAINER(view), GTK_WIDGET(p_vbox));
-
- gtk_signal_connect (GTK_OBJECT (view->details->nautilus_view),
- "load_location",
- GTK_SIGNAL_FUNC (load_location_callback),
- view);
-
- /* set up callbacks to ask for the root password */
- view->details->root_client = trilobite_root_client_new ();
- trilobite_root_client_attach (view->details->root_client, p_service);
- gtk_signal_connect (GTK_OBJECT (view->details->root_client), "need_password",
- GTK_SIGNAL_FUNC (trilobite_eazel_time_view_get_password), view);
-
- if (p_service) {
- bonobo_object_unref (BONOBO_OBJECT(p_service));
- p_service = NULL;
- }
-
- update_time_display (view);
-
- view->details->timeout_slot = gtk_timeout_add( 1000, (GtkFunction)update_time_display, view );
-
- gtk_widget_show_all (GTK_WIDGET (view));
-
- CORBA_exception_free (&ev);
-
-}
-
-static void
-trilobite_eazel_time_view_destroy (GtkObject *object)
-{
- TrilobiteEazelTimeView *view;
- CORBA_Environment ev;
-
- CORBA_exception_init (&ev);
-
- view = TRILOBITE_EAZEL_TIME_VIEW (object);
-
- g_free (view->details->server);
- g_free (view->details->max_time_diff);
- g_free (view->details->remembered_password);
-
- Trilobite_Eazel_Time_unref (view->details->service, NULL);
- trilobite_root_client_unref (GTK_OBJECT (view->details->root_client));
-
- gtk_timeout_remove (view->details->timeout_slot);
-
- g_free (view->details);
-
- EEL_CALL_PARENT (GTK_OBJECT_CLASS, destroy, (object));
-
- CORBA_exception_free (&ev);
-
-}
-
-
-/**
- * trilobite_eazel_time_view_get_nautilus_view:
- *
- * Return the NautilusView object associated with this view; this
- * is needed to export the view via CORBA/Bonobo.
- * @view: TrilobiteEazelTimeView to get the nautilus_view from..
- *
- **/
-NautilusView *
-trilobite_eazel_time_view_get_nautilus_view (TrilobiteEazelTimeView *view)
-{
- return view->details->nautilus_view;
-}
-
-/**
- * trilobite_eazel_time_view_load_uri:
- *
- * Load the resource pointed to by the specified URI.
- *
- **/
-void
-trilobite_eazel_time_view_load_uri (TrilobiteEazelTimeView *view,
- const char *uri)
-{
-}
-
-static void
-load_location_callback (NautilusView *nautilus_view,
- const char *location,
- TrilobiteEazelTimeView *view)
-{
- g_assert (nautilus_view == view->details->nautilus_view);
-
- nautilus_view_report_load_underway (nautilus_view);
- trilobite_eazel_time_view_load_uri (view, location);
- nautilus_view_report_load_complete (nautilus_view);
-}
diff --git a/components/services/time/nautilus-view/trilobite-eazel-time-view.h b/components/services/time/nautilus-view/trilobite-eazel-time-view.h
deleted file mode 100644
index a49d54ccc..000000000
--- a/components/services/time/nautilus-view/trilobite-eazel-time-view.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Maciej Stachowiak <mjs@eazel.com>
- */
-
-/* trilobite-eazel-time-view.h - sample time service nautilus view.*/
-
-#ifndef TRILOBITE_EAZEL_TIME_VIEW_H
-#define TRILOBITE_EAZEL_TIME_VIEW_H
-
-#include <libnautilus/nautilus-view.h>
-#include <gtk/gtkeventbox.h>
-
-#define OAFIID_TRILOBITE_EAZEL_TIME_VIEW "OAFIID:trilobite_eazel_time_view:de32d812-af19-4359-9902-42318e0089b3"
-#define OAFIID_TRILOBITE_EAZEL_TIME_VIEW_FACTORY "OAFIID:trilobite_eazel_time_view_factory:9797487c-08f7-4ef1-9981-0c4b36df220b"
-
-#define TRILOBITE_TYPE_EAZEL_TIME_VIEW (trilobite_eazel_time_view_get_type ())
-#define TRILOBITE_EAZEL_TIME_VIEW(obj) (GTK_CHECK_CAST ((obj), TRILOBITE_TYPE_EAZEL_TIME_VIEW, TrilobiteEazelTimeView))
-#define TRILOBITE_EAZEL_TIME_VIEW_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), TRILOBITE_TYPE_EAZEL_TIME_VIEW, TrilobiteEazelTimeViewClass))
-#define TRILOBITE_IS_EAZEL_TIME_VIEW(obj) (GTK_CHECK_TYPE ((obj), TRILOBITE_TYPE_EAZEL_TIME_VIEW))
-#define TRILOBITE_IS_EAZEL_TIME_VIEW_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), TRILOBITE_TYPE_EAZEL_TIME_VIEW))
-
-typedef struct TrilobiteEazelTimeViewDetails TrilobiteEazelTimeViewDetails;
-
-typedef struct {
- GtkEventBox parent;
- TrilobiteEazelTimeViewDetails *details;
-} TrilobiteEazelTimeView;
-
-typedef struct {
- GtkEventBoxClass parent_class;
-} TrilobiteEazelTimeViewClass;
-
-/* GtkObject support */
-GtkType trilobite_eazel_time_view_get_type (void);
-
-/* Component embedding support */
-NautilusView *trilobite_eazel_time_view_get_nautilus_view (TrilobiteEazelTimeView *view);
-
-
-/* URI handling */
-void trilobite_eazel_time_view_load_uri (TrilobiteEazelTimeView *view,
- const char *uri);
-
-#endif /* TRILOBITE_EAZEL_TIME_VIEW_H */
diff --git a/components/services/time/nautilus-view/trilobite-eazel-time-view.oafinfo b/components/services/time/nautilus-view/trilobite-eazel-time-view.oafinfo
deleted file mode 100644
index ae3a63dbd..000000000
--- a/components/services/time/nautilus-view/trilobite-eazel-time-view.oafinfo
+++ /dev/null
@@ -1,26 +0,0 @@
-<oaf_info>
-
-<oaf_server iid="OAFIID:trilobite_eazel_time_view_factory:9797487c-08f7-4ef1-9981-0c4b36df220b" type="exe" location="trilobite-eazel-time-view">
-<oaf_attribute name="repo_ids" type="stringv">
-<item value="IDL:GNOME/ObjectFactory:1.0"/>
-</oaf_attribute>
-<oaf_attribute name="name" type="string" value="Eazel Trilobite time view factory"/>
-<oaf_attribute name="description" type="string" value="Factory for trilobite time view"/>
-</oaf_server>
-
-<oaf_server iid="OAFIID:trilobite_eazel_time_view:de32d812-af19-4359-9902-42318e0089b3" type="factory"
- location="OAFIID:trilobite_eazel_time_view_factory:9797487c-08f7-4ef1-9981-0c4b36df220b">
-<oaf_attribute name="repo_ids" type="stringv">
-<item value="IDL:Bonobo/Unknown:1.0"/>
-<item value="IDL:Bonobo/Control:1.0"/>
-<item value="IDL:Nautilus/View:1.0"/>
-</oaf_attribute>
-<oaf_attribute name="name" type="string" value="Nautilus Trilobite time view"/>
-<oaf_attribute name="description" type="string" value="View for Trilobite time service"/>
-<oaf_attribute name="bonobo:supported_uri_schemes" type="stringv">
-<item value="eazel-time"/>
-</oaf_attribute>
-<oaf_attribute name="nautilus:view_as_name" type="string" value="Service-Time"/>
-</oaf_server>
-
-</oaf_info>
diff --git a/components/services/time/service/.cvsignore b/components/services/time/service/.cvsignore
deleted file mode 100644
index e9d6bb15e..000000000
--- a/components/services/time/service/.cvsignore
+++ /dev/null
@@ -1,10 +0,0 @@
-.deps
-.libs
-Makefile
-Makefile.in
-trilobite-eazel-time-service
-trilobite-eazel-time-service-common.c
-trilobite-eazel-time-service-skels.c
-trilobite-eazel-time-service-stubs.c
-trilobite-eazel-time-service.h
-trilobite_eazel_time_service_idl_stamp
diff --git a/components/services/time/service/Makefile.am b/components/services/time/service/Makefile.am
deleted file mode 100644
index 4f1ca616a..000000000
--- a/components/services/time/service/Makefile.am
+++ /dev/null
@@ -1,81 +0,0 @@
-NULL =
-
-INCLUDES = \
- -DPREFIX=\"$(prefix)\" \
- -DG_LOG_DOMAIN=\"trilobite-eazel-time-service\" \
- -DGNOMELOCALEDIR=\""$(datadir)/locale"\" \
- -I$(top_srcdir) \
- -I$(top_builddir) \
- -I$(top_srcdir)/components/services/trilobite/libtrilobite \
- -I$(top_builddir)/components/services/trilobite/libtrilobite \
- -I$(top_srcdir)/components/services/trilobite \
- -I$(top_builddir)/components/services/trilobite \
- -I../server/ \
- $(GHTTP_CFLAGS) \
- $(GCONF_CFLAGS) \
- $(GNOME_CFLAGS) \
- $(GNOME_INCLUDEDIR) \
- $(OAF_CFLAGS) \
- $(XML_CFLAGS) \
- $(NULL)
-
-pixmapdir = $(datadir)/pixmaps
-pixmap_DATA = trilobite-eazel-time-service.png
-
-# CORBA magic
-
-oafdir = $(datadir)/oaf
-oaf_DATA = trilobite-eazel-time-service.oafinfo
-
-CORBA_GENERATED = \
- trilobite-eazel-time-service.h \
- trilobite-eazel-time-service-skels.c \
- trilobite-eazel-time-service-stubs.c \
- trilobite-eazel-time-service-common.c \
- $(NULL)
-
-
-IDLDIR = $(top_srcdir)/components/services/time/idl
-IDL = $(IDLDIR)/trilobite-eazel-time-service.idl
-
-# make the auto-generated files depend on a timestamp file.
-# this is to ensure the individual files wait for each other before
-# proceeding which is needed in parallel makes
-
-$(CORBA_GENERATED): trilobite_eazel_time_service_idl_stamp
-
-trilobite_eazel_time_service_idl_stamp: $(IDL)
- $(ORBIT_IDL) $(IDL_CFLAGS) -I$(IDLDIR) $(IDL)
- touch trilobite_eazel_time_service_idl_stamp
-
-trilobite-eazel-time-service.c main.c: $(CORBA_GENERATED)
-
-CLEANFILES+=$(CORBA_GENERATED) trilobite_eazel_time_service_idl_stamp
-
-## Binaries
-
-bin_PROGRAMS = trilobite-eazel-time-service
-
-trilobite_eazel_time_service_SOURCES = \
- trilobite-eazel-time-service.c \
- trilobite-eazel-time-service-public.h \
- trilobite-eazel-time-service-private.h \
- main.c \
- trilobite-eazel-time-service-common.c \
- trilobite-eazel-time-service-skels.c \
- $(NULL)
-
-trilobite_eazel_time_service_LDADD = \
- $(top_builddir)/components/services/trilobite/libtrilobite/libtrilobite.la \
- $(top_builddir)/components/services/trilobite/libtrilobite/libtrilobite-service.la \
- $(BONOBO_LIBS) \
- $(OAF_LIBS) \
- $(GHTTP_LIBS) \
- $(NULL)
-
-## Extra stuff
-
-EXTRA_DIST = \
- $(oaf_DATA) \
- $(pixmap_DATA) \
- $(NULL)
diff --git a/components/services/time/service/main.c b/components/services/time/service/main.c
deleted file mode 100644
index 9f600b334..000000000
--- a/components/services/time/service/main.c
+++ /dev/null
@@ -1,128 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: Eskil Heyn Olsen <eskil@eazel.com>
- *
- */
-
-#include <config.h>
-#include <gnome.h>
-#include <liboaf/liboaf.h>
-#include <bonobo.h>
-#include <libtrilobite/libtrilobite.h>
-#include <libtrilobite/libtrilobite-service.h>
-
-#include "trilobite-eazel-time-service.h"
-#include <trilobite-eazel-time-service-public.h>
-
-#define OAF_ID_FACTORY "OAFIID:trilobite_eazel_time_service_factory:1acc6ab1-f79f-4c8d-ab87-04982fc8c19f"
-#define OAF_ID "OAFIID:trilobite_eazel_time_service:13a2dbd9-84f9-4400-bd9e-bb4575b86894"
-/*
- These are some generally needed objects to get CORBA connectivity
-*/
-CORBA_Environment ev;
-
-static BonoboGenericFactory *factory;
-static int trilobites_active = 0;
-
-/* #define DEBUG */
-
-static void
-trilobite_service_factory_destroy (GtkObject *object)
-{
- trilobites_active--;
-
- if (trilobites_active != 0) {
- return;
- }
-
- bonobo_object_unref (BONOBO_OBJECT (factory));
- trilobite_main_quit ();
-}
-
-static BonoboObject*
-trilobite_eazel_time_service_factory (BonoboGenericFactory *this_factory,
- const gchar *oaf_id,
- gpointer data)
-{
- TrilobiteService *trilobite;
- TrilobiteEazelTimeService *service;
- TrilobitePasswordQuery *trilobite_password;
-
- if (strcmp (oaf_id, OAF_ID)) {
- g_warning ("Unhandled OAF id %s", oaf_id);
- return NULL;
- }
-
- trilobite = TRILOBITE_SERVICE (gtk_object_new (TRILOBITE_TYPE_SERVICE,
- "name", "Time",
- "version", "0.3",
- "vendor_name", "Eazel, inc.",
- "vendor_url", "http://www.eazel.com",
- "url", "http://testmachine.eazel.com:8888/examples/time/current/",
- "icon", "file:///gnome/share/pixmaps/gnome-default-dlg.png",
- NULL));
-
- trilobite_password = TRILOBITE_PASSWORDQUERY (gtk_object_new (TRILOBITE_TYPE_PASSWORDQUERY,
- "prompt", "root password",
- NULL));
-
- service = trilobite_eazel_time_service_new ();
-
- g_assert (trilobite != NULL);
- g_assert (service != NULL);
-
- trilobites_active++;
-
- trilobite_service_add_interface (trilobite, BONOBO_OBJECT (service));
- trilobite_passwordquery_add_interface (trilobite_password, BONOBO_OBJECT (service));
-
- gtk_signal_connect (GTK_OBJECT (trilobite),
- "destroy",
- trilobite_service_factory_destroy, NULL);
-
- return BONOBO_OBJECT (trilobite);
-}
-
-int main(int argc, char *argv[]) {
-
-#ifdef ENABLE_NLS /* sadly we need this ifdef because otherwise the following get empty statement warnings */
- bindtextdomain (PACKAGE, GNOMELOCALEDIR);
- textdomain (PACKAGE);
-#endif
-
- trilobite_init ("trilobite-eazel-time-service-factory", "0.1", NULL, NULL, argc, argv);
-
- factory = bonobo_generic_factory_new_multi (OAF_ID_FACTORY,
- trilobite_eazel_time_service_factory,
- NULL);
-
- if (factory == NULL) {
- g_error ("Could not register factory");
- }
-
- bonobo_activate();
- do {
- trilobite_main ();
- } while (trilobites_active > 0);
-
- CORBA_exception_free (&ev);
-
- return 0;
-};
diff --git a/components/services/time/service/trilobite-eazel-time-service-private.h b/components/services/time/service/trilobite-eazel-time-service-private.h
deleted file mode 100644
index d14321c75..000000000
--- a/components/services/time/service/trilobite-eazel-time-service-private.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: Eskil Heyn Olsen <eskil@eazel.com>
- *
- */
-
-/* trilobite-eazel-time-service-private.h: The private parts of
- a trilobite eazel time service(I shit you not) */
-
-#ifndef TRILOBITE_EAZEL_TIME__PRIVATE_H
-#define TRILOBITE_EAZEL_TIME__PRIVATE_H
-
-struct _TrilobiteEazelTimeServicePrivate {
- int maxd;
- char *time_server;
-
- time_t server_time;
- time_t time_obtained;
-};
-
-#endif /* TRILOBITE_EAZEL_TIME__PRIVATE_H */
diff --git a/components/services/time/service/trilobite-eazel-time-service-public.h b/components/services/time/service/trilobite-eazel-time-service-public.h
deleted file mode 100644
index 1b81657a0..000000000
--- a/components/services/time/service/trilobite-eazel-time-service-public.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: Eskil Heyn Olsen <eskil@eazel.com>
- *
- */
-
-#ifndef TRILOBITE_EAZEL_TIME_SERVICE_PUBLIC_H
-#define TRILOBITE_EAZEL_TIME_SERVICE_PUBLIC_H
-
-#include <libgnome/gnome-defs.h>
-#include "trilobite-eazel-time-service.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-#define TRILOBITE_TYPE_EAZEL_TIME_SERVICE (trilobite_eazel_time_service_get_type ())
-#define TRILOBITE_EAZEL_TIME_SERVICE(obj) (GTK_CHECK_CAST ((obj), TRILOBITE_TYPE_EAZEL_TIME_SERVICE, TrilobiteEazelTimeService))
-#define TRILOBITE_EAZEL_TIME_SERVICE_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), TRILOBITE_TYPE_EAZEL_TIME_SERVICE, TrilobiteEazelTimeServiceClass))
-#define TRILOBITE_IS_EAZEL_TIME_SERVICE(obj) (GTK_CHECK_TYPE ((obj), TRILOBITE_TYPE_EAZEL_TIME_SERVICE))
-#define TRILOBITE_IS_EAZEL_TIME_SERVICE_CLASS(klass)(GTK_CHECK_CLASS_TYPE ((klass), TRILOBITE_TYPE_EAZEL_TIME_SERVICE))
-
-typedef struct _TrilobiteEazelTimeService TrilobiteEazelTimeService;
-typedef struct _TrilobiteEazelTimeServiceClass TrilobiteEazelTimeServiceClass;
-
-struct _TrilobiteEazelTimeServiceClass
-{
- BonoboObjectClass parent_class;
-
- gpointer servant_vepv;
-};
-
-typedef struct _TrilobiteEazelTimeServicePrivate TrilobiteEazelTimeServicePrivate;
-
-struct _TrilobiteEazelTimeService
-{
- BonoboObject parent;
- TrilobiteEazelTimeServicePrivate *private;
-};
-
-GtkType trilobite_eazel_time_service_get_type (void);
-TrilobiteEazelTimeService* trilobite_eazel_time_service_new (void);
-POA_Trilobite_Eazel_Time__epv* trilobite_eazel_time_service_get_epv (void);
-void trilobite_eazel_time_service_unref (GtkObject *object);
-
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* TRILOBITE_EAZEL_TIME_SERVICE_PUBLIC_H */
diff --git a/components/services/time/service/trilobite-eazel-time-service.c b/components/services/time/service/trilobite-eazel-time-service.c
deleted file mode 100644
index fdafa4528..000000000
--- a/components/services/time/service/trilobite-eazel-time-service.c
+++ /dev/null
@@ -1,630 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: Eskil Heyn Olsen <eskil@eazel.com>
- *
- */
-
-#include <config.h>
-#include <gnome.h>
-#include <liboaf/liboaf.h>
-#include <bonobo.h>
-
-#include <libtrilobite/libtrilobite.h>
-#include <libtrilobite/libtrilobite-service.h>
-
-#include "trilobite-eazel-time-service.h"
-#include "trilobite-eazel-time-service-public.h"
-#include "trilobite-eazel-time-service-private.h"
-
-#include <gnome-xml/parser.h>
-#include <ghttp.h>
-#include <time.h>
-
-#include <netdb.h>
-
-#include <sys/types.h>
-#include <netinet/in.h>
-#include <sys/socket.h>
-#include <sys/timeb.h>
-#include <sys/time.h>
-
-
-/* might wanna make this configable */
-/* # of seconds to wait between bugging the time server again */
-#define TIME_SERVER_CACHE_TIMEOUT 1800
-#define PORT 13
-#define MAXDATASIZE 100
-
-/* This is the parent class pointer */
-static GtkObjectClass *trilobite_eazel_time_service_parent_class;
-
-/* prototypes */
-
-time_t trilobite_eazel_time_service_get_server_time (TrilobiteEazelTimeService*, CORBA_Environment *ev);
-
-/*****************************************
- Corba stuff
-*****************************************/
-
-static PortableServer_ServantBase__epv base_epv = { NULL, NULL, NULL };
-
-typedef struct {
- POA_Trilobite_Eazel_Time poa;
- TrilobiteEazelTimeService *object;
-} impl_POA_Trilobite_Eazel_Time_Service;
-
-static void
-impl_Trilobite_Eazel_Time_Service_set_max_difference (impl_POA_Trilobite_Eazel_Time_Service *service,
- const CORBA_long maxd,
- CORBA_Environment *ev)
-{
- service->object->private->maxd = maxd;
- service->object->private->time_obtained = 0;
-}
-
-static void
-impl_Trilobite_Eazel_Time_Service_set_time_server (impl_POA_Trilobite_Eazel_Time_Service *service,
- const CORBA_char *server,
- CORBA_Environment *ev)
-{
- if (service->object->private->time_server != NULL) {
- g_free (service->object->private->time_server);
- }
- service->object->private->time_server = g_strdup (server);
- service->object->private->time_obtained = 0;
-}
-
-static CORBA_unsigned_long
-impl_Trilobite_Eazel_Time_Service_check_time (impl_POA_Trilobite_Eazel_Time_Service *service,
- CORBA_Environment *ev)
-{
- time_t server_time;
- time_t local_time;
- CORBA_unsigned_long result;
-
- result = 0;
- local_time = time (NULL);
- server_time = trilobite_eazel_time_service_get_server_time (service->object, ev);
-
-#if 0
- g_message ("Local time : %ld", local_time);
- g_message ("Server time : %ld", server_time);
- g_message ("Diff is : %d", abs (server_time - local_time));
- g_message ("Allowed d : %d", service->object->private->maxd);
-#endif
- if (server_time == 0) {
- g_warning (_("Unable to get server time"));
- } else if (abs (server_time - local_time) > service->object->private->maxd) {
- g_warning (_("Time off by %d, max allowed diff is %d"),
- abs (server_time - local_time),
- service->object->private->maxd);
- }
-
- /* If we did not get the time, raise an exception */
- if (server_time != 0) {
- /* if we are beyond the max difference, return it */
- if (abs (server_time - local_time) > service->object->private->maxd) {
- result = server_time - local_time;
- }
- }
-
- return result;
-}
-
-static void
-impl_Trilobite_Eazel_Time_Service_update_time (impl_POA_Trilobite_Eazel_Time_Service *service,
- CORBA_Environment *ev)
-{
- time_t server_time;
- TrilobiteRootHelper *root_helper;
- GList *args;
- char *tmp;
-
- root_helper = gtk_object_get_data (GTK_OBJECT (service->object), "trilobite-root-helper");
- if (trilobite_root_helper_start (root_helper) != TRILOBITE_ROOT_HELPER_SUCCESS) {
- Trilobite_Eazel_Time_NotPermitted *exn;
- exn = Trilobite_Eazel_Time_NotPermitted__alloc ();
- CORBA_exception_set (ev, CORBA_USER_EXCEPTION, ex_Trilobite_Eazel_Time_NotPermitted, exn);
- return;
- }
-
- server_time = trilobite_eazel_time_service_get_server_time (service->object, ev);
- if (server_time == 0) {
- return;
- }
-
- tmp = g_strdup_printf ("%ld", server_time);
- args = g_list_prepend (NULL, tmp);
-
- if (trilobite_root_helper_run (root_helper, TRILOBITE_ROOT_HELPER_RUN_SET_TIME, args, NULL) != TRILOBITE_ROOT_HELPER_SUCCESS) {
- Trilobite_Eazel_Time_NotPermitted *exn;
- exn = Trilobite_Eazel_Time_CannotSet__alloc ();
- CORBA_exception_set (ev, CORBA_USER_EXCEPTION, ex_Trilobite_Eazel_Time_CannotSet, exn);
- }
-
- g_list_free (args);
- g_free (tmp);
-}
-
-POA_Trilobite_Eazel_Time__epv*
-trilobite_eazel_time_service_get_epv ()
-{
- POA_Trilobite_Eazel_Time__epv *epv;
-
- epv = g_new0 (POA_Trilobite_Eazel_Time__epv, 1);
-
- epv->set_max_difference = (gpointer) &impl_Trilobite_Eazel_Time_Service_set_max_difference;
- epv->set_time_server = (gpointer) &impl_Trilobite_Eazel_Time_Service_set_time_server;
- epv->check_time = (gpointer) &impl_Trilobite_Eazel_Time_Service_check_time;
- epv->update_time = (gpointer) &impl_Trilobite_Eazel_Time_Service_update_time;
-
- return epv;
-};
-
-/*****************************************
- GTK+ object stuff
-*****************************************/
-
-/* This is the object finalizer. It should clean up any
- data allocated by the object, and if possible, call
- the parent finalize */
-static void
-trilobite_eazel_time_service_finalize (GtkObject *object)
-{
- TrilobiteEazelTimeService *service;
-
- g_return_if_fail (object != NULL);
- g_return_if_fail (TRILOBITE_EAZEL_TIME_SERVICE (object));
-
- service = TRILOBITE_EAZEL_TIME_SERVICE (object);
-
- if (service->private->time_server) {
- g_free (service->private->time_server);
- }
-
- g_free (service->private);
-
- /* Call parents destroy */
- if (GTK_OBJECT_CLASS (trilobite_eazel_time_service_parent_class)->finalize) {
- GTK_OBJECT_CLASS (trilobite_eazel_time_service_parent_class)->finalize (object);
- }
-
-}
-
-/* This is a wrapper for the bonobo object unref.
- */
-void
-trilobite_eazel_time_service_unref (GtkObject *object)
-{
- g_return_if_fail (object != NULL);
- g_return_if_fail (TRILOBITE_EAZEL_TIME_SERVICE (object));
-
- bonobo_object_unref (BONOBO_OBJECT (object));
-}
-
-/*
- This is the trilobite_eazel_time_service class initializer, see
- GGAD (http://developer.gnome.org/doc/GGAD/sec-classinit.html)
- for more on these
- */
-static void
-trilobite_eazel_time_service_class_initialize (TrilobiteEazelTimeServiceClass *klass)
-{
- GtkObjectClass *object_class;
-
- object_class = (GtkObjectClass*)klass;
- object_class->finalize = (void(*)(GtkObject*))trilobite_eazel_time_service_finalize;
-
- trilobite_eazel_time_service_parent_class = gtk_type_class (gtk_object_get_type ());
-
- klass->servant_vepv = g_new0 (POA_Trilobite_Eazel_Time__vepv,1);
- ((POA_Trilobite_Eazel_Time__vepv*)klass->servant_vepv)->_base_epv = &base_epv;
- ((POA_Trilobite_Eazel_Time__vepv*)klass->servant_vepv)->Bonobo_Unknown_epv = bonobo_object_get_epv ();
- ((POA_Trilobite_Eazel_Time__vepv*)klass->servant_vepv)->Trilobite_Eazel_Time_epv = trilobite_eazel_time_service_get_epv ();
-}
-
-/*
- _corba_object does all the greasy corba building and whatnot.
- */
-static Trilobite_Eazel_Time
-trilobite_eazel_time_service_create_corba_object (BonoboObject *service) {
- impl_POA_Trilobite_Eazel_Time_Service *servant;
- CORBA_Environment ev;
-
- /* g_message ("trilobite_eazel_time_service_create_corba_object"); */
-
- g_assert (service != NULL);
- g_assert (TRILOBITE_IS_EAZEL_TIME_SERVICE (service));
-
- CORBA_exception_init (&ev);
-
- servant = g_new0 (impl_POA_Trilobite_Eazel_Time_Service, 1);
- ((POA_Trilobite_Eazel_Time *)servant)->vepv = TRILOBITE_EAZEL_TIME_SERVICE_CLASS ( GTK_OBJECT (service)->klass)->servant_vepv;
- POA_Trilobite_Eazel_Time__init (servant, &ev);
- ORBIT_OBJECT_KEY (((POA_Trilobite_Eazel_Time *)servant)->_private)->object = NULL;
-
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_warning ("Cannot instantiate Trilobite_Eazel_Time corba object");
- g_free (servant);
- CORBA_exception_free (&ev);
- return CORBA_OBJECT_NIL;
- }
-
- CORBA_exception_free (&ev);
-
- /* Return the bonobo activation of the servant */
- return (Trilobite_Eazel_Time) bonobo_object_activate_servant (service, servant);
-}
-
-/* This function sets the defaults, and then tries to load them from
- a xml file */
-
-static void
-trilobite_eazel_time_service_initialize_load_config (TrilobiteEazelTimeService *service) {
- xmlDocPtr doc;
- xmlNodePtr base;
- char *config_file;
-
- config_file = g_strdup_printf ("%s/eazel/time", trilobite_get_config_dir_string ());
- doc = xmlParseFile (config_file);
-
- service->private->maxd = 180;
- service->private->time_server = g_strdup ("nist1.sjc.certifiedtime.com");
-
- if (!doc) {
- g_warning (_("Could not read time-service config from %s"), config_file);
- g_free (config_file);
- xmlFreeDoc (doc);
- return;
- }
-
- base = doc->root;
- if (!base) {
- g_warning ("Could not read time-service config from %s, missing root base", config_file);
- g_free (config_file);
- xmlFreeDoc (doc);
- return;
- }
-
- if (g_strcasecmp (base->name, "EAZEL_TIME_SERVICE")) {
- g_warning ("Could not read time-service config from %s, missing first tag", config_file);
- g_free (config_file);
- xmlFreeDoc (doc);
- return;
- }
-
- if (trilobite_xml_get_string (base, "TIME_SERVER")) {
- g_free (service->private->time_server);
- service->private->time_server = trilobite_xml_get_string (base, "TIME_SERVER");
- }
- if (trilobite_xml_get_string (base, "MAXD")) {
- const char *tmp = trilobite_xml_get_string (base, "MAXD");
- service->private->maxd = atoi (tmp);
- }
-
- xmlFreeDoc (doc);
- g_free (config_file);
-}
-
-/*
- This is the TrilobiteEazelTimeService instance initializer.
- Its responsibility is to create the corba object and
- build the bonobo_object structures using the corba object.
- */
-static void
-trilobite_eazel_time_service_initialize (TrilobiteEazelTimeService *service) {
- Trilobite_Eazel_Time corba_service;
-
- /* g_message ("in trilobite_eazel_time_service_initialize"); */
-
- g_assert (service != NULL);
- g_assert (TRILOBITE_IS_EAZEL_TIME_SERVICE (service));
-
- /* This builds the corba object */
- corba_service = trilobite_eazel_time_service_create_corba_object (BONOBO_OBJECT (service));
-
- service->private = g_new0 (TrilobiteEazelTimeServicePrivate, 1);
-
- trilobite_eazel_time_service_initialize_load_config (service);
-
- /* This sets the bonobo structures in service using the corba object */
- if (!bonobo_object_construct (BONOBO_OBJECT (service), corba_service)) {
- g_warning ("bonobo_object_construct failed");
- }
-}
-
-/*
- The GtkType generator. Again, see GGAD for more
- */
-GtkType
-trilobite_eazel_time_service_get_type() {
- static GtkType trilobite_service_type = 0;
-
- /* g_message ("into trilobite_eazel_time_service_get_type"); */
-
- /* First time it's called ? */
- if (!trilobite_service_type)
- {
- static const GtkTypeInfo trilobite_service_info =
- {
- "TrilobiteEazelTimeService",
- sizeof (TrilobiteService),
- sizeof (TrilobiteServiceClass),
- (GtkClassInitFunc) trilobite_eazel_time_service_class_initialize,
- (GtkObjectInitFunc) trilobite_eazel_time_service_initialize,
- /* reserved_1 */ NULL,
- /* reserved_2 */ NULL,
- (GtkClassInitFunc) NULL,
- };
-
- /* Get a unique GtkType */
- trilobite_service_type = gtk_type_unique (bonobo_object_get_type (), &trilobite_service_info);
- }
-
- return trilobite_service_type;
-}
-
-/*
- The _new method simply builds the service
- using gtk_object_new
-*/
-TrilobiteEazelTimeService *
-trilobite_eazel_time_service_new (void)
-{
- TrilobiteEazelTimeService *service;
-
- /* g_message ("in trilobite_eazel_time_service_new"); */
-
- service = TRILOBITE_EAZEL_TIME_SERVICE (gtk_object_new (TRILOBITE_TYPE_EAZEL_TIME_SERVICE, NULL));
- gtk_object_ref (GTK_OBJECT (service));
- gtk_object_sink (GTK_OBJECT (service));
-
- return service;
-}
-
-#if 0
-/*
- NOTE:
- the parser isn't using XML, since the contents of body is so basic
- */
-static time_t
-trilobite_eazel_time_service_parse_body (char *body)
-{
- time_t result;
- char *ptr, *nptr;
-
- result = 0;
- ptr = strstr (body, "<time>");
-
- if (ptr!= NULL) {
- ptr += strlen ("<time>");
- result = strtol (ptr, &nptr, 10);
- if (nptr == NULL || (strncmp (nptr, "</time>",7) != 0) ) {
- result = 0;
- }
- }
-
- return result;
-}
-
-/*
- Requesting via. HTTP
-*/
-static time_t
-trilobite_eazel_time_service_do_http_request (TrilobiteEazelTimeService *service,
- CORBA_Environment *ev)
-{
- time_t result;
- ghttp_request *request;
- ghttp_status request_status;
-
- g_return_val_if_fail (service != NULL, 0);
- g_return_val_if_fail (TRILOBITE_IS_EAZEL_TIME_SERVICE (service), 0);
- g_return_val_if_fail (service->private != NULL, 0);
-
- request = ghttp_request_new ();
- ghttp_set_header (request, http_hdr_User_Agent, "Trilobite");
- ghttp_set_uri (request, service->private->time_url);
- ghttp_set_type (request, ghttp_type_get);
- ghttp_prepare (request);
- request_status = ghttp_process (request);
-
- switch (request_status) {
- case ghttp_error: {
- Trilobite_Eazel_Time_CannotGetTime *exn;
- const char *reason;
- exn = Trilobite_Eazel_Time_CannotGetTime__alloc ();
-
- reason = ghttp_get_error (request);
- exn->url = CORBA_string_dup (service->private->time_url);
- exn->reason = reason==NULL ? CORBA_string_dup ("Bad url"): CORBA_string_dup ( reason );
- CORBA_exception_set (ev, CORBA_USER_EXCEPTION, ex_Trilobite_Eazel_Time_CannotGetTime, exn);
-
- result = 0;
- }
- break;
- case ghttp_not_done:
- g_message ("hest");
- result = 0;
- break;
- case ghttp_done:
- result = trilobite_eazel_time_service_parse_body (ghttp_get_body (request));
- break;
- default:
- result = 0;
- g_assert_not_reached ();
- break;
- }
-
- ghttp_clean (request);
- g_free (request);
-
- return result;
-}
-#endif
-
-/* This code was blatantly ripped from gnuclear/src/app.c.
- Modified for local variables and nautilus style guidelines.
- Gnuclear 0.6
- Havoc Pennington <hp@pobox.com>
-*/
-static time_t
-get_nist_time (TrilobiteEazelTimeService *service)
-{
- struct tm server;
- time_t server_unixtime;
- gint server_health;
- char buf[MAXDATASIZE];
- char buffy[MAXDATASIZE];
- int sockfd, numbytes;
-
- struct hostent *he;
- struct sockaddr_in their_addr; /* connector's address information */
-
- if ((he = gethostbyname (service->private->time_server)) == NULL) {
- /* get the host info */
- perror ("gethostbyname");
- return 0;
- }
-
- if ((sockfd = socket (AF_INET, SOCK_STREAM, 0)) == -1) {
- perror ("socket");
- return 0;
- }
-
- their_addr.sin_family = AF_INET; /* host byte order */
- their_addr.sin_port = htons (PORT); /* short, network byte order */
- their_addr.sin_addr = *((struct in_addr *)he->h_addr);
- bzero (&(their_addr.sin_zero), 8); /* zero the rest of the struct */
-
- if (connect (sockfd, (struct sockaddr *)&their_addr, sizeof(struct sockaddr)) == -1) {
- perror ("connect");
- return 0;
- }
-
- if ((numbytes=recv (sockfd, buf, MAXDATASIZE, 0)) == -1) {
- perror ("recv");
- return 0;
- }
-
- buf[numbytes] = '\0';
-
- close (sockfd);
-
- /* Let's parse buf[]! */
- /* Year */
- sprintf (buffy, "%c%c", buf[7], buf[8]);
- server.tm_year = atoi (buffy);
- if (server.tm_year<99)
- server.tm_year+=100;
- /* note: 1999 is stored as "99", 2001 as "101" */
-
-
- /* reset buffy */
- buffy[0] = '\0';
-
- /* Month */
- /* the local month variable is stored 0-11, not 1-12 as on the server.
- * so I need to subtract the server's value by 1. */
- sprintf (buffy, "%c%c", buf[10], buf[11]);
- server.tm_mon = atoi (buffy);
- server.tm_mon--;
- /* reset buffy */
- buffy[0] = '\0';
-
- /* Day */
- sprintf (buffy, "%c%c", buf[13], buf[14]);
- server.tm_mday = atoi (buffy);
- /* reset buffy */
- buffy[0] = '\0';
-
- /* Hour */
- sprintf (buffy, "%c%c", buf[16], buf[17]);
- server.tm_hour = atoi (buffy);
- /* reset buffy */
- buffy[0] = '\0';
-
- /* Minute */
- sprintf (buffy, "%c%c", buf[19], buf[20]);
- server.tm_min = atoi (buffy);
- /* reset buffy */
- buffy[0] = '\0';
-
- /* Second */
- sprintf (buffy, "%c%c", buf[22], buf[23]);
- server.tm_sec = atoi (buffy);
- /* reset buffy */
- buffy[0] = '\0';
-
- /* Standard vs. Daylight Savings */
- if ( buf[24]=='0' ) {
- server.tm_isdst = 0;
- } else {
- server.tm_isdst = 1;
- }
-
- /* Time Server Health */
- sprintf (buffy, "%c", buf[35]);
- server_health = atoi (buffy);
- /* reset buffy */
- buffy[0] = '\0';
-
- (time_t)server_unixtime = mktime (&server);
-
- if (server_unixtime == -1) {
- printf ("Error in server time conversion\n");
- return 0;
- }
-
-
- /* investigate this */
- /* adjust for time zone difference (I thought this was done automagically? */
- server_unixtime -= timezone;
-
- /* now check for daylight savings time. If 'yes', adjust accordingly */
- if (server.tm_isdst > 0) {
- server_unixtime += 3600; /* 3600 seconds in an hour ;) */
- }
-
- return server_unixtime;
-}
-
-time_t
-trilobite_eazel_time_service_get_server_time (TrilobiteEazelTimeService *service,
- CORBA_Environment *ev)
-{
- time_t result;
- time_t now;
-
- result = get_nist_time (service);
- now = time (NULL);
- if ((service->private->time_obtained > 0) &&
- (now - service->private->time_obtained < TIME_SERVER_CACHE_TIMEOUT)) {
- /* don't bug the time server again -- just extrapolate the time */
- return service->private->server_time + (now - service->private->time_obtained);
- }
-
- service->private->server_time = result;
- if (result != 0) {
- service->private->time_obtained = time (NULL);
- }
-
- return result;
-}
diff --git a/components/services/time/service/trilobite-eazel-time-service.oafinfo b/components/services/time/service/trilobite-eazel-time-service.oafinfo
deleted file mode 100644
index 15ab11af0..000000000
--- a/components/services/time/service/trilobite-eazel-time-service.oafinfo
+++ /dev/null
@@ -1,27 +0,0 @@
-<oaf_info>
-
-<oaf_server iid="OAFIID:trilobite_eazel_time_service_factory:1acc6ab1-f79f-4c8d-ab87-04982fc8c19f" type="exe" location="trilobite-eazel-time-service">
-<oaf_attribute name="repo_ids" type="stringv">
-<item value="IDL:GNOME/ObjectFactory:1.0"/>
-</oaf_attribute>
-<oaf_attribute name="description" type="string" value="Factory for the time service"/>
-</oaf_server>
-
-<oaf_server iid="OAFIID:trilobite_eazel_time_service:13a2dbd9-84f9-4400-bd9e-bb4575b86894" type="factory" location="OAFIID:trilobite_eazel_time_service_factory:1acc6ab1-f79f-4c8d-ab87-04982fc8c19f">
-<oaf_attribute name="repo_ids" type="stringv">
-<item value="IDL:Bonobo/Unknown:1.0"/>
-<item value="IDL:Trilobite/Service:1.0"/>
-<item value="IDL:Trilobite/Eazel/Time:1.0"/>
-</oaf_attribute>
-
-<oaf_attribute name="trilobite:name" type="string" value="Time"/>
-<oaf_attribute name="trilobite:version" type="string" value="0.5"/>
-<oaf_attribute name="trilobite:vendor_name" type="string" value="Eazel, inc."/>
-<oaf_attribute name="trilobite:vendor_url" type="string" value="http://www.eazel.com"/>
-<oaf_attribute name="trilobite:info_url" type="string" value="http://www.eazel.com/time/"/>
-<oaf_attribute name="trilobite:icon" type="string" value="trilobite-time-service.png"/>
-<oaf_attribute name="trilobite:uri_scheme" type="string" value="eazel-time:"/>
-
-</oaf_server>
-
-</oaf_info>
diff --git a/components/services/time/service/trilobite-eazel-time-service.png b/components/services/time/service/trilobite-eazel-time-service.png
deleted file mode 100644
index 01f611262..000000000
--- a/components/services/time/service/trilobite-eazel-time-service.png
+++ /dev/null
Binary files differ
diff --git a/components/services/trilobite/.cvsignore b/components/services/trilobite/.cvsignore
deleted file mode 100644
index 282522db0..000000000
--- a/components/services/trilobite/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-Makefile
-Makefile.in
diff --git a/components/services/trilobite/Makefile.am b/components/services/trilobite/Makefile.am
deleted file mode 100644
index ad496750f..000000000
--- a/components/services/trilobite/Makefile.am
+++ /dev/null
@@ -1 +0,0 @@
-SUBDIRS = helper idl libtrilobite sample utils
diff --git a/components/services/trilobite/doc/gconf.txt b/components/services/trilobite/doc/gconf.txt
deleted file mode 100644
index 497b92822..000000000
--- a/components/services/trilobite/doc/gconf.txt
+++ /dev/null
@@ -1,39 +0,0 @@
-the happy table of gconf settings used by trilobite!
-
-(i) int value
-(b) boolean value
-brackets surround the [default value] that you should use if the gconf
- setting doesn't exist.
-
-/apps/eazel-trilobite/
- default-services-uri
- default-services-login-path
- default-services-user
- services-host [services.eazel.com:8888]
- redirect-table/
- (temporary items for redirecting serivce -> url)
- install/
- protocol
- package-list
- transaction-dir
- verbose (b)
- silent (b)
- debug (b)
- dry-run (b)
- force (b)
- depend (b)
- allow-update (b)
- allow-downgrade (b)
- jump-after-install (b) [TRUE]
- jump-url
- use-local-db (b) [TRUE]
- server/
- port (i)
- hostname (if "hostname:port", overrides above port)
- temp-dir
- rpmrc
- cgi-path
- eazel-auth (b)
-
-
-
diff --git a/components/services/trilobite/helper/.cvsignore b/components/services/trilobite/helper/.cvsignore
deleted file mode 100644
index 2de049fee..000000000
--- a/components/services/trilobite/helper/.cvsignore
+++ /dev/null
@@ -1,6 +0,0 @@
-.deps
-.libs
-Makefile
-Makefile.in
-eazel-helper
-eazel-helper.security
diff --git a/components/services/trilobite/helper/Makefile.am b/components/services/trilobite/helper/Makefile.am
deleted file mode 100644
index 57fc2a25a..000000000
--- a/components/services/trilobite/helper/Makefile.am
+++ /dev/null
@@ -1,49 +0,0 @@
-NULL =
-
-security_file = eazel-helper.security
-PAM_FILES = $(security_file) eazel-helper.pam
-
-bin_PROGRAMS = eazel-helper
-
-# do mv on a separate step in case the sed fails
-$(security_file): $(srcdir)/eazel-helper.security.in Makefile
- sed -e 's^\@bindir\@^$(bindir)^g' < $(srcdir)/eazel-helper.security.in > $(srcdir)/eazel-helper.security.tmp \
- && mv $(srcdir)/eazel-helper.security.tmp $(srcdir)/eazel-helper.security
-
-install-data-local: $(PAM_FILES)
- mkdir -p $(sysconfdir)/security/console.apps
- cp $(srcdir)/eazel-helper.security $(sysconfdir)/security/console.apps/eazel-helper
- mkdir -p $(sysconfdir)/pam.d
- cp $(srcdir)/eazel-helper.pam $(sysconfdir)/pam.d/eazel-helper
-
-## This and bin_SCRIPTS is a hack to ensure
-## that eazel-helper.security is build during
-## make and not make install
-## If its build during make install, the rpm
-## build will make eazel-helper.security point
-## to /var/tmp/%{name}-%{version}-%{release}/argle/bargle/glop/glyf
-## and thats no good
-CLEANFILES = \
- $(security_file) \
- $(NULL)
-
-bin_SCRIPTS = \
- $(security_file) \
- $(NULL)
-
-eazel_helper_SOURCES = \
- eazel-helper.c \
- $(NULL)
-
-eazel_helper_LDADD = \
- $(GLIB_LIBS) \
- $(NULL)
-
-INCLUDES = \
- $(GLIB_CFLAGS) \
- $(NULL)
-
-EXTRA_DIST = \
- eazel-helper.security.in \
- eazel-helper.pam \
- $(NULL)
diff --git a/components/services/trilobite/helper/README b/components/services/trilobite/helper/README
deleted file mode 100644
index c46b1e249..000000000
--- a/components/services/trilobite/helper/README
+++ /dev/null
@@ -1,22 +0,0 @@
-For eazel-helper to work, it must be installed in a well-known
-location, and it needs two config files to be placed in the PAM setup
-directories. You get this for free if you do 'gmake install' as root.
-
-If you're using eazel-hacking tools (and if you're hacking on Nautilus
-or Trilobite, I highly recommend them), then 'gmake install' will
-install the required PAM files into /gnome/etc instead of /etc. This
-is fine. To finish the setup, do (as root):
-
-# ln -s /gnome/etc/pam.d/eazel-helper /etc/pam.d/eazel-helper
-# ln -s /gnome/etc/security/console.apps/eazel-helper /etc/security/console.apps/eazel-helper
-
-If you have an eazel-hacking from December 2000 or later, it should make
-those links for you, for free. I forgot to do it before them because
-I'm a loser.
-
-The whole setup requires "userhelper" to be installed in /usr/sbin.
-On Redhat, this is package "usermode". I recommend version 1.36 at
-least, because the API has changed a lot.
-
--- Robey Pointer, 7 jul 2000
- updated 6 dec 2000
diff --git a/components/services/trilobite/helper/eazel-helper.c b/components/services/trilobite/helper/eazel-helper.c
deleted file mode 100644
index 66289c7be..000000000
--- a/components/services/trilobite/helper/eazel-helper.c
+++ /dev/null
@@ -1,170 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * eazel-helper is a standalone binary app that's meant to be used
- * via 'userhelper' by the Eazel Services. You can send it commands
- * over stdin, and it will do certain functions for you (assuming it's
- * running as root). The command API may change at random, so you
- * should always use TrilobiteRootHelper instead of using eazel-helper
- * directly.
- *
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: Robey Pointer <robey@eazel.com>
- *
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <time.h>
-#include <errno.h>
-#include <glib.h>
-#include <string.h>
-
-#define RPM_EXEC "/bin/rpm"
-
-/* paths to search for executables (like RPM) in */
-static const char *search_path[] = {
- "/bin",
- "/usr/bin",
- "/usr/local/bin",
- "/sbin",
- "/usr/sbin",
- "/usr/local/sbin",
- NULL
-};
-
-
-static void
-chomp (char *buffer)
-{
- int x = strlen (buffer);
-
- while ((x > 0) && ((buffer[x - 1] == '\n') || (buffer[x - 1] == '\r'))) {
- buffer[x - 1] = 0;
- x--;
- }
-}
-
-static const char *
-find_path_to (const char *filename)
-{
- char *path;
- int i;
-
- for (i = 0; search_path[i]; i++) {
- path = g_strdup_printf ("%s/%s", search_path[i], filename);
- /* i guess g_file_exists() is going away, and not part of glib anyway :( */
- if (access (path, X_OK) == 0) {
- g_free (path);
- return search_path[i];
- }
- g_free (path);
- }
-
- return NULL;
-}
-
-static void
-do_command (char *command, int args)
-{
- char *filename;
- const char *path;
- char buffer[256];
- char **pargv;
- int i;
-
- pargv = g_new0 (char *, args + 2);
-
- path = find_path_to (command);
- if (! path) {
- printf ("* Can't find %s. :(\n", command);
- exit (1);
- }
-
- filename = g_strdup_printf ("%s/%s", path, command);
- pargv[0] = command;
- for (i = 0; i < args; i++) {
- fgets (buffer, 256, stdin);
- chomp (buffer);
- pargv[i + 1] = g_strdup (buffer);
- }
- pargv[args + 1] = NULL;
-
- /* we never free any of the args, but it doesn't matter, because
- * if the exec succeeds, this all suddenly vanishes. :)
- */
- execv (filename, pargv);
-
- printf ("* Can't run %s :(\n", command);
- exit (1);
-}
-
-int
-main (int argc, char **argv)
-{
- char buffer[256];
- int args;
- time_t new_time;
-
- printf ("* OK.\n");
- fflush (stdout);
-
- /* send stderr to stdout */
- dup2 (1, 2);
-
- /* get command */
- fgets (buffer, 256, stdin);
- if (feof (stdin)) {
- /* give up */
- exit (1);
- }
- chomp (buffer);
-
- /* rpm <# of parameters> */
- /* (followed by N lines of parameters) */
- if (g_strncasecmp (buffer, "rpm ", 4) == 0) {
- args = atoi (buffer + 4);
- do_command ("rpm", args);
- }
-
- /* set-time <time_t> */
- if (g_strncasecmp (buffer, "set-time ", 9) == 0) {
- new_time = strtoul (buffer + 9, NULL, 0);
- if (stime (&new_time) != 0) {
- printf ("X failed: %d\n", errno);
- } else {
- printf ("* done.\n");
- }
-
- exit (0);
- }
-
- /* ls <# of parameters> */
- if (g_strncasecmp (buffer, "ls ", 3) == 0) {
- args = atoi (buffer + 3);
- do_command ("ls", args);
- }
-
- if (g_strncasecmp (buffer, "start-medusa", 12) == 0) {
- do_command ("start-medusa", 0);
- }
-
- printf ("* What?\n");
- exit (1);
-}
diff --git a/components/services/trilobite/helper/eazel-helper.pam b/components/services/trilobite/helper/eazel-helper.pam
deleted file mode 100644
index eab6ee948..000000000
--- a/components/services/trilobite/helper/eazel-helper.pam
+++ /dev/null
@@ -1,5 +0,0 @@
-#%PAM-1.0
-auth sufficient /lib/security/pam_rootok.so
-auth required /lib/security/pam_pwdb.so nullok
-session optional /lib/security/pam_xauth.so
-account required /lib/security/pam_permit.so
diff --git a/components/services/trilobite/helper/eazel-helper.security.in b/components/services/trilobite/helper/eazel-helper.security.in
deleted file mode 100644
index 60b82d9b4..000000000
--- a/components/services/trilobite/helper/eazel-helper.security.in
+++ /dev/null
@@ -1,4 +0,0 @@
-USER=root
-PROGRAM=@bindir@/eazel-helper
-SESSION=false
-FALLBACK=false
diff --git a/components/services/trilobite/idl/.cvsignore b/components/services/trilobite/idl/.cvsignore
deleted file mode 100644
index 282522db0..000000000
--- a/components/services/trilobite/idl/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-Makefile
-Makefile.in
diff --git a/components/services/trilobite/idl/Makefile.am b/components/services/trilobite/idl/Makefile.am
deleted file mode 100644
index 8731ae720..000000000
--- a/components/services/trilobite/idl/Makefile.am
+++ /dev/null
@@ -1,6 +0,0 @@
-idldir = ${prefix}/idl
-idl_DATA = \
- trilobite-service.idl
-
-EXTRA_DIST=\
- $(idl_DATA)
diff --git a/components/services/trilobite/idl/trilobite-service.idl b/components/services/trilobite/idl/trilobite-service.idl
deleted file mode 100644
index cb7899f70..000000000
--- a/components/services/trilobite/idl/trilobite-service.idl
+++ /dev/null
@@ -1,55 +0,0 @@
-/* -*- Mode: IDL; tab-width: 8; indent-tabs-mode: 8; c-basic-offset: 8 -*- */
-
-#ifndef TRILOBITE_SERVICE_IDL
-#define TRILOBITE_SERVICE_IDL
-
-#include <Bonobo.idl>
-
-module Trilobite {
- /* The basic trilobite service interface */
- interface Service : Bonobo::Unknown {
-
- /* Should return the name of the service, eg. "TimeService" */
- string get_name ();
-
- /* Should return the version of the service, eg. "1.0" */
- string get_version ();
-
- /* Should return the company/organization who's responsible for the service,
- eg. "Eazel, inc."
- */
- string get_vendor_name ();
-
- /* Should return URL of the company/organization who's responsible for the service,
- eg. "http://www.eazel.com"
- */
- string get_vendor_url ();
-
- /* Should give a URL for the service. This should either contain
- a decription or a page containing account info or whatnor for the service
- */
- string get_url ();
-
- /* Should return a filename an icon for the service. The filename
- should be in a format that can be used by gnome_pixmap_file
- */
- string get_icon ();
- };
-
- /***** Root helper interfaces ******/
-
- /* The client object should define this interface to query
- the user for the password */
- interface PasswordQueryClient : Bonobo::Unknown {
- string get_password (in string prompt);
- boolean try_again ();
- };
-
- /* The server implements this, and uses the "client" object
- to ask for a password */
- interface PasswordQuery : Bonobo::Unknown {
- void set_query_client (in PasswordQueryClient client);
- };
-};
-
-#endif
diff --git a/components/services/trilobite/libtrilobite/.cvsignore b/components/services/trilobite/libtrilobite/.cvsignore
deleted file mode 100644
index 81eabda2b..000000000
--- a/components/services/trilobite/libtrilobite/.cvsignore
+++ /dev/null
@@ -1,12 +0,0 @@
-*.la
-*.lo
-.deps
-.libs
-Makefile
-Makefile.in
-idl_stamp
-makefile.staticlib
-trilobite-service-common.c
-trilobite-service-skels.c
-trilobite-service-stubs.c
-trilobite-service.h
diff --git a/components/services/trilobite/libtrilobite/Makefile.am b/components/services/trilobite/libtrilobite/Makefile.am
deleted file mode 100644
index 7e0a34e3e..000000000
--- a/components/services/trilobite/libtrilobite/Makefile.am
+++ /dev/null
@@ -1,108 +0,0 @@
-NULL =
-
-lib_LTLIBRARIES = libtrilobite.la libtrilobite-service.la
-
-INCLUDES = \
- -DPREFIX=\"$(prefix)\" \
- -DG_LOG_DOMAIN=\"libtrilobite\" \
- -DSTANDALONE \
- -DTRILOBITE_VERSION=\"0.3.0\" \
- -I$(srcdir) \
- -I. \
- -I$(top_srcdir) \
- -I$(top_builddir) \
- -I$(top_srcdir)/components/services/trilobite/libtrilobite \
- $(GNOME_CFLAGS) \
- $(GCONF_CFLAGS) \
- $(OAF_CFLAGS) \
- $(XML_CFLAGS) \
- $(VFS_CFLAGS) \
- $(NULL)
-
-libtrilobite_la_LDFLAGS = \
- $(GNOME_LIBS) \
- $(OAF_LIBS) \
- $(GCONF_LIBS) \
- $(BONOBO_LIBS) \
- $(XML_LIBS) \
- $(VFS_LIBS) \
- $(NULL)
-
-libtrilobite_service_la_LDFLAGS =\
- $(GNOME_LIBS) \
- $(GNOMEUI_LIBS) \
- $(OAF_LIBS) \
- $(GCONF_LIBS) \
- $(BONOBO_LIBS) \
- $(XML_LIBS) \
- $(NULL)
-
-libtrilobiteincludedir = $(includedir)/libtrilobite
-libtrilobite_serviceincludedir = $(includedir)/libtrilobite
-
-TRILOBITE_CORBA_GENERATED = \
- trilobite-service.h \
- trilobite-service-stubs.c \
- trilobite-service-common.c \
- trilobite-service-skels.c \
- $(NULL)
-
-libtrilobiteinclude_HEADERS = \
- libtrilobite.h \
- trilobite-core-messaging.h \
- trilobite-core-distribution.h \
- trilobite-core-network.h \
- trilobite-core-utils.h \
- trilobite-i18n.h \
- trilobite-root-helper.h \
- trilobite-root-client-public.h \
- trilobite-redirect.h \
- trilobite-md5-tools.h \
- $(NULL)
-
-libtrilobite_la_SOURCES = \
- $(TRILOBITE_CORBA_GENERATED) \
- trilobite-core-messaging.c \
- trilobite-core-distribution.c \
- trilobite-core-network.c \
- trilobite-core-utils.c \
- trilobite-root-helper.c \
- trilobite-root-client.c \
- trilobite-redirect.c \
- trilobite-md5-tools.c \
- $(NULL)
-
-noinst_HEADERS = \
- trilobite-service-passwordquery-private.h \
- trilobite-root-client-private.h \
- trilobite-service-private.h \
- $(NULL)
-
-libtrilobite_serviceinclude_HEADERS = \
- libtrilobite-service.h \
- trilobite-service.h \
- trilobite-service-public.h \
- trilobite-service-passwordquery-public.h \
- $(NULL)
-
-libtrilobite_service_la_SOURCES = \
- trilobite-service.c \
- trilobite-service-passwordquery.c \
- $(NULL)
-
-$(TRILOBITE_CORBA_GENERATED): idl_stamp
-
-IDL = $(top_srcdir)/components/services/trilobite/idl/trilobite-service.idl
-
-idl_stamp: $(IDL)
- $(ORBIT_IDL) $(IDL_CFLAGS) $(IDL)
- touch idl_stamp
-
-CLEANFILES= $(TRILOBITE_CORBA_GENERATED) idl_stamp
-
-trilobite-service.c: trilobite-service.h
-
-EXTRA_DIST = \
- trilobite-core-network-slim.c \
- $(NULL)
-
diff --git a/components/services/trilobite/libtrilobite/libtrilobite-service.h b/components/services/trilobite/libtrilobite/libtrilobite-service.h
deleted file mode 100644
index c12065b96..000000000
--- a/components/services/trilobite/libtrilobite/libtrilobite-service.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the Free
- * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * Authors: Eskil Heyn Olsen <eskil@eazel.com>
- *
- */
-
-/*
- * libtrilobite - Useful functions shared between all services. This
- * includes things like xml parsing, logging, error control, and others.
- *
- */
-
-#ifndef __LIBTRILOBITE_SERVICE_H__
-#define __LIBTRILOBITE_SERVICE_H__
-
-#include <gnome.h>
-
-#include "trilobite-service.h"
-#include "trilobite-service-public.h"
-#include "trilobite-service-passwordquery-public.h"
-
-#endif /* __LIBTRILOBITE_SERVICE_H__ */
-
-/*********************** end libtrilobite.h ***********************************/
-
diff --git a/components/services/trilobite/libtrilobite/libtrilobite.h b/components/services/trilobite/libtrilobite/libtrilobite.h
deleted file mode 100644
index c9b6879eb..000000000
--- a/components/services/trilobite/libtrilobite/libtrilobite.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the Free
- * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * Authors: J Shane Culpepper <pepper@eazel.com>
- *
- */
-
-/*
- * libtrilobite - Useful functions shared between all services. This
- * includes things like xml parsing, logging, error control, and others.
- *
- */
-
-#ifndef __LIBTRILOBITE_H__
-#define __LIBTRILOBITE_H__
-
-#include <gnome.h>
-
-#include "trilobite-core-messaging.h"
-#include "trilobite-core-utils.h"
-#include "trilobite-core-distribution.h"
-#include "trilobite-core-network.h"
-#include "trilobite-root-helper.h"
-#include "trilobite-redirect.h"
-#include "trilobite-root-client-public.h"
-
-#endif /* __LIBTRILOBITE_H__ */
-
-/*********************** end libtrilobite.h ***********************************/
-
diff --git a/components/services/trilobite/libtrilobite/makefile.staticlib.in b/components/services/trilobite/libtrilobite/makefile.staticlib.in
deleted file mode 100644
index 0a3c92427..000000000
--- a/components/services/trilobite/libtrilobite/makefile.staticlib.in
+++ /dev/null
@@ -1,31 +0,0 @@
-OBJS=\
- trilobite-core-distribution.o \
- trilobite-root-helper.o \
- trilobite-core-utils.o \
- trilobite-core-network-slim.o \
- trilobite-core-messaging.o \
- trilobite-md5-tools.o \
- $(NULL)
-
-INCLUDES=\
- -DTRILOBITE_VERSION=\"0.1.0\" \
- -I. \
- -I@top_srcdir@ \
- -I@top_srcdir@/components/services/trilobite \
- @GNOME_CFLAGS@ \
- @XML_CFLAGS@ \
- $(NULL)
-
-LIB=libtrilobite_minimal.a
-
-CC=gcc
-CPPFLAGS=$(INCLUDES) $(DEFINES)
-
-all: $(LIB)
-
-$(LIB): $(OBJS)
- $(AR) $(ARFLAGS) libtrilobite_minimal.a $(OBJS)
-
-clean:
- rm -f $(OBJS)
- rm -f $(LIB)
diff --git a/components/services/trilobite/libtrilobite/trilobite-core-distribution.c b/components/services/trilobite/libtrilobite/trilobite-core-distribution.c
deleted file mode 100644
index 3b9dc79dc..000000000
--- a/components/services/trilobite/libtrilobite/trilobite-core-distribution.c
+++ /dev/null
@@ -1,458 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: Eskil Heyn Olsen <eskil@eazel.com>
- */
-
-/*
- This is based in the distribution stuff from helixcode-utils.c, from
- the HelixCode Installer.
- I had to revamp it because it used some evil float stuff (redhat v. 6.09999)
- and its enums were evil.
- */
-
-#include <config.h>
-#include "trilobite-core-distribution.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <sys/utsname.h>
-#include <string.h>
-
-#define RHAT "RedHat Linux"
-#define DEBI "Debian GNU/Linux"
-#define CALD "Caldera"
-#define SUSE "S.u.S.E"
-#define LPPC "LinuxPPC"
-#define TURB "TurboLinux"
-#define CORL "CorelLinux"
-#define MAND "Mandrake"
-#define UNKW "unknown"
-
-#define RHATc "RedHat"
-#define DEBIc "Debian"
-#define CALDc "Caldera"
-#define SUSEc "S.u.S.E"
-#define LPPCc "LinuxPPC"
-#define TURBc "TurboLinux"
-#define CORLc "CorelLinux"
-#define MANDc "Mandrake"
-#define UNKWc "unknown"
-
-/* avoid confusing RPM */
-#define ASSUME_ix86_IS_i386
-
-
-/* FIXME bugzilla.eazel.com 908
- need to implement the rest of the determine_FOO_version
-*/
-static void
-determine_turbolinux_version (TrilobiteDistributionInfo *distinfo)
-{
- FILE *f;
- char buf[1024];
- char *text, *v;
- int version_major, version_minor;
-
- /* contents, according to syke:
- * "release 6.0 English Server (Coyote)"
- */
- f = fopen ("/etc/turbolinux-release", "rt");
- g_return_if_fail (f != NULL);
-
- fread ((char*)buf, 1023, 1, f);
- fclose (f);
- buf[1023] = 0;
-
- text = strstr (buf, "release ");
- if (text) {
- text += 8;
- v = g_strndup (text, 4);
- sscanf (v, "%d.%d", &version_major, &version_minor);
- g_free (v);
- distinfo->version_major = version_major;
- distinfo->version_minor = version_minor;
- return;
- }
-}
-
-static void
-determine_mandrake_version (TrilobiteDistributionInfo *distinfo)
-{
- FILE *f;
- char buf[1024];
- char *text, *v;
- int version_major, version_minor;
-
- /* contents, according to loiosh:
- * "Linux Mandrake release 7.1 (something)"
- */
- f = fopen ("/etc/mandrake-release", "rt");
- g_return_if_fail (f != NULL);
-
- fread ((char *)buf, 1023, 1, f);
- fclose (f);
- buf[1023] = 0;
-
- text = strstr (buf, "release ");
- if (text) {
- text += 8;
- v = g_strndup (text, 4);
- sscanf (v, "%d.%d", &version_major, &version_minor);
- g_free (v);
- distinfo->version_major = version_major;
- distinfo->version_minor = version_minor;
- return;
- }
-}
-
-static void
-determine_suse_version (TrilobiteDistributionInfo *distinfo)
-{
- FILE *fd;
- char buf[1024];
- char *ptr;
- int version_major, version_minor;
- const char *version_marker = "VERSION = ";
-
- /*
- * <scherfa> scherfa@Xerxes:/etc > cat SuSE-release
- * <scherfa> SuSE Linux 7.0 (i386)
- * <scherfa> VERSION = 7.0
- * <scherfa> scherfa@Xerxes:/etc >
- */
-
- g_assert (distinfo != NULL);
-
- distinfo->version_major = -1;
- distinfo->version_minor = -1;
-
- fd = fopen ("/etc/SuSE-release", "rt");
- g_return_if_fail (fd != NULL);
-
- fread ((char*)buf, 1023, 1, fd);
- fclose (fd);
-
- ptr = strstr (buf, version_marker);
- g_return_if_fail (ptr != NULL);
-
- ptr += strlen (version_marker);
-
- if (sscanf (ptr, "%d.%d", &version_major, &version_minor) == 2) {
- distinfo->version_major = version_major;
- distinfo->version_minor = version_minor;
- }
-}
-
-static void
-determine_debian_version (TrilobiteDistributionInfo *distinfo)
-{
- FILE *fd;
- char buf[1024];
- int version_major, version_minor;
-
- g_assert (distinfo != NULL);
-
- fd = fopen ("/etc/debian_version", "rt");
- g_return_if_fail (fd != NULL);
-
- fread ((char*)buf, 1023, 1, fd);
- fclose (fd);
-
- /* /etc/debian_version is in the format major.minor if its a release
- * version, but the development versions have strings like
- * "testing/unstable".
- */
-
- if (sscanf (buf, "%d.%d", &version_major, &version_minor) == 2) {
- distinfo->version_major = version_major;
- distinfo->version_minor = version_minor;
- } else {
- /* couldn't determine the version */
- distinfo->version_major = -1;
- distinfo->version_minor = -1;
- }
-}
-
-static void
-determine_redhat_version (TrilobiteDistributionInfo *distinfo)
-{
- FILE *fd;
- char buf[1024];
- char* text;
- char* v;
- int version_major, version_minor;
-
- g_assert (distinfo != NULL);
-
- fd = fopen ("/etc/redhat-release", "rt");
- g_return_if_fail (fd != NULL);
-
- fread ((char*)buf, 1023, 1, fd);
- fclose (fd);
-
- buf[1023] = '\0';
- /*
- These check for LinuxPPC. For whatever reason, they use
- /etc/redhat-release
- */
- text = strstr (buf, "1999");
- if (text) {
- distinfo->version_major = 1999;
- return;
- }
- text = strstr (buf, "2000");
- if (text) {
- distinfo->version_major = 2000;
- return;
- }
- text = strstr (buf, "release");
- if (text) {
- text += 8;
- v = g_strndup (text, 3);
- sscanf (v, "%d.%d", &version_major, &version_minor);
- g_free (v);
- distinfo->version_major = version_major;
- distinfo->version_minor = version_minor;
- return;
- }
-}
-
-TrilobiteDistributionInfo
-trilobite_get_distribution ()
-{
- TrilobiteDistributionInfo distinfo;
-
- distinfo.name = DISTRO_UNKNOWN;
- distinfo.version_major = -1;
- distinfo.version_minor = -1;
- /* Check for TurboLinux */
- if (!access ("/etc/turbolinux-release", F_OK)) {
- distinfo.name = DISTRO_TURBOLINUX;
- determine_turbolinux_version (&distinfo);
- }
- /* Check for Mandrake */
- else if (!access ("/etc/mandrake-release", F_OK)) {
- distinfo.name = DISTRO_MANDRAKE;
- determine_mandrake_version (&distinfo);
- }
- /* Check for SuSE */
- else if (!access ("/etc/SuSE-release", F_OK)) {
- distinfo.name = DISTRO_SUSE;
- determine_suse_version (&distinfo);
- }
- /* Check for Corel */
- else if (!access ("/etc/environment.corel", F_OK)) {
- distinfo.name = DISTRO_COREL;
- }
- /* Check for Debian */
- else if (!access ("/etc/debian_version", F_OK)) {
- distinfo.name = DISTRO_DEBIAN;
- determine_debian_version (&distinfo);
- }
- /* Check for Caldera */
- else if (!access ("/etc/coas", F_OK)) {
- distinfo.name = DISTRO_CALDERA;
- }
- /* Check for Red Hat/LinuxPPC */
- /* This has to be checked last because many of the Red Hat knockoff
- distros keep /etc/redhat-release around. */
- else if (!access ("/etc/redhat-release", F_OK)) {
- distinfo.name = DISTRO_REDHAT;
- determine_redhat_version (&distinfo);
- }
- return distinfo;
-}
-
-char*
-trilobite_get_distribution_name (TrilobiteDistributionInfo distinfo,
- gboolean show_version,
- gboolean compact)
-{
- char *result;
- char *name;
- char *version;
- char *arch;
-
- version = g_strdup ("");
- arch = g_strdup (""); /* We don't set the arch type yet */
-
- switch (distinfo.name) {
- case DISTRO_REDHAT:
- name = g_strdup (compact ? RHATc : RHAT);
- break;
- case DISTRO_DEBIAN:
- name = g_strdup (compact ? DEBIc : DEBI);
- break;
- case DISTRO_CALDERA:
- name = g_strdup (compact ? CALDc : CALD);
- break;
- case DISTRO_SUSE:
- name = g_strdup (compact ? SUSEc : SUSE);
- break;
- case DISTRO_LINUXPPC:
- name = g_strdup (compact ? LPPCc : LPPC);
- break;
- case DISTRO_TURBOLINUX:
- name = g_strdup (compact ? TURBc : TURB);
- break;
- case DISTRO_COREL:
- name = g_strdup (compact ? CORLc : CORL);
- break;
- case DISTRO_MANDRAKE:
- name = g_strdup (compact ? MANDc : MAND);
- break;
- default:
- name = g_strdup (compact ? UNKWc : UNKW);
- break;
- }
-
- if (show_version) {
- if (distinfo.version_major >= 0 && distinfo.version_minor >= 0) {
- g_free (version);
- if (compact) {
- version = g_strdup_printf ("%d%d",
- distinfo.version_major,
- distinfo.version_minor);
- } else {
- version = g_strdup_printf (" %d.%d",
- distinfo.version_major,
- distinfo.version_minor);
- }
- } else if (distinfo.version_major >= 0) {
- g_free (version);
- if (compact) {
- version = g_strdup_printf ("%d", distinfo.version_major);
- } else {
- version = g_strdup_printf (" %d", distinfo.version_major);
- }
- }
- }
-
- /* This g_strconcat is odd, so it can be expanded, eg. to add arch */
- result = g_strconcat (name,
- version,
- arch,
- NULL);
-
- g_free (name);
- g_free (version);
- g_free (arch);
-
- return result;
-}
-
-static TrilobiteDistributionName
-trilobite_get_distribution_enum_compact (const char *name)
-{
- g_return_val_if_fail (name!=NULL, DISTRO_UNKNOWN);
- if (strncmp (name, RHATc, strlen (RHATc)) == 0) {
- return DISTRO_REDHAT;
- } else if (strncmp (name, DEBIc, strlen (DEBIc)) == 0) {
- return DISTRO_DEBIAN;
- } else if (strncmp (name, CALDc, strlen (CALDc)) == 0) {
- return DISTRO_CALDERA;
- } else if (strncmp (name, SUSEc, strlen (SUSEc)) == 0) {
- return DISTRO_SUSE;
- } else if (strncmp (name, LPPCc, strlen (LPPCc)) == 0) {
- return DISTRO_LINUXPPC;
- } else if (strncmp (name, TURBc, strlen (TURBc)) == 0) {
- return DISTRO_TURBOLINUX;
- } else if (strncmp (name, CORLc, strlen (CORLc)) == 0) {
- return DISTRO_COREL;
- } else if (strncmp (name, MANDc, strlen (MANDc)) == 0) {
- return DISTRO_MANDRAKE;
- }
- return DISTRO_UNKNOWN;
-}
-
-static TrilobiteDistributionName
-trilobite_get_distribution_enum_verbose (const char *name)
-{
- g_return_val_if_fail (name!=NULL, DISTRO_UNKNOWN);
- if (strncmp (name, RHAT, strlen (RHAT)) == 0) {
- return DISTRO_REDHAT;
- } else if (strncmp (name, DEBI, strlen (DEBI)) == 0) {
- return DISTRO_DEBIAN;
- } else if (strncmp (name, CALD, strlen (CALD)) == 0) {
- return DISTRO_CALDERA;
- } else if (strncmp (name, SUSE, strlen (SUSE)) == 0) {
- return DISTRO_SUSE;
- } else if (strncmp (name, LPPC, strlen (LPPC)) == 0) {
- return DISTRO_LINUXPPC;
- } else if (strncmp (name, TURB, strlen (TURB)) == 0) {
- return DISTRO_TURBOLINUX;
- } else if (strncmp (name, CORL, strlen (CORL)) == 0) {
- return DISTRO_COREL;
- } else if (strncmp (name, MAND, strlen (MAND)) == 0) {
- return DISTRO_MANDRAKE;
- }
- return DISTRO_UNKNOWN;
-}
-
-TrilobiteDistributionName
-trilobite_get_distribution_enum (const char *name, gboolean compact)
-{
- if (compact) {
- return trilobite_get_distribution_enum_compact (name);
- } else {
- return trilobite_get_distribution_enum_verbose (name);
- }
-}
-
-/* returns something like "i386", we hope */
-char *
-trilobite_get_distribution_arch (void)
-{
- struct utsname utsbuffer;
- char *arch;
-
- uname (&utsbuffer);
- arch = g_strdup (utsbuffer.machine);
-
-#ifdef ASSUME_ix86_IS_i386
- /* always assume that "ix86" should be "i386", because otherwise RPM can't figure it out */
- if ((strlen (arch) == 4) && (arch[0] == 'i') &&
- ((arch[1] >= '3') && (arch[1] <= '9')) &&
- (arch[2] == '8') && (arch[3] == '6')) {
- arch[1] = '3';
- }
-#endif
-
- return arch;
-}
-
-gboolean
-trilobite_distribution_compare (TrilobiteDistributionInfo a,
- TrilobiteDistributionInfo b)
-{
- if (a.name == b.name) {
- if (a.version_major == b.version_major) {
- if (a.version_minor == b.version_minor) {
- return 0;
- } else {
- return a.version_minor > b.version_minor ? a.version_minor : b.version_minor;
- }
- } else {
- return a.version_major > b.version_major ? a.version_major : b.version_major;
- }
- }
- return -1;
-}
diff --git a/components/services/trilobite/libtrilobite/trilobite-core-distribution.h b/components/services/trilobite/libtrilobite/trilobite-core-distribution.h
deleted file mode 100644
index ba2e45e5d..000000000
--- a/components/services/trilobite/libtrilobite/trilobite-core-distribution.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: Eskil Heyn Olsen <eskil@eazel.com>
- */
-
-#ifndef EAZEL_SERVICES_DISTRIBUTION_H
-#define EAZEL_SERVICES_DISTRIBUTION_H
-
-#include <glib.h>
-
-typedef struct _TrilobiteDistributionInfo TrilobiteDistributionInfo;
-typedef enum _TrilobiteDistributionName TrilobiteDistributionName;
-
-enum _TrilobiteDistributionName {
- DISTRO_UNKNOWN = 0,
- DISTRO_REDHAT,
- DISTRO_DEBIAN,
- DISTRO_CALDERA,
- DISTRO_SUSE,
- DISTRO_LINUXPPC,
- DISTRO_TURBOLINUX,
- DISTRO_COREL,
- DISTRO_MANDRAKE,
- DISTRO_YELLOWDOG
-};
-
-struct _TrilobiteDistributionInfo {
- TrilobiteDistributionName name;
- int version_major; /* -1 equals unset */
- int version_minor; /* -1 equals unset */
-};
-
-/*
- Returns a structure containing the distribution
-*/
-TrilobiteDistributionInfo trilobite_get_distribution (void);
-
-/* Return the distribution name, optinally with version number
- Return value must be freed
-*/
-char* trilobite_get_distribution_name (TrilobiteDistributionInfo distinfo,
- gboolean show_version,
- gboolean compact);
-
-/*
- Returns the enum corresponding to the given string,
- which should be one of the strings that trilobite_get_distribution_name
- returns. The version part (if show_version = TRUE was used) is
- _not_ parsed */
-
-TrilobiteDistributionName trilobite_get_distribution_enum (const char *name, gboolean compact);
-
-/* Return an allocated string holding this machine's architecture name
- * (usually "i386" for now, but who knows what the future holds?)
- * caller must deallocate returned string
- */
-char *trilobite_get_distribution_arch (void);
-
-/*
- Distribution comparison
-*/
-gboolean trilobite_distribution_compare (TrilobiteDistributionInfo a,
- TrilobiteDistributionInfo b);
-
-#endif /* EAZEL_SERVICES_DISTRIBUTION_H */
diff --git a/components/services/trilobite/libtrilobite/trilobite-core-messaging.c b/components/services/trilobite/libtrilobite/trilobite-core-messaging.c
deleted file mode 100644
index 80a0e400a..000000000
--- a/components/services/trilobite/libtrilobite/trilobite-core-messaging.c
+++ /dev/null
@@ -1,129 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the Free
- * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * Authors: Robey Pointer <robey@eazel.com>
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <sys/time.h>
-#include <stdarg.h>
-#include <string.h>
-#include "trilobite-core-utils.h"
-#include "trilobite-core-messaging.h"
-
-#define ROBEY_LIKES_TIMESTAMPS
-
-
-static FILE *saved_logf = NULL;
-static int do_debug_log = 0;
-static int set_atexit = 0;
-
-
-/* handler for trapping g_log/g_warning/g_error/g_message stuff, and sending it to
- * a standard logfile.
- */
-static void
-trilobite_add_log (const char *domain, GLogLevelFlags flags, const char *message, FILE *logf)
-{
- char *prefix;
- char *timestamp = NULL;
- char **lines;
- int i;
-#ifdef ROBEY_LIKES_TIMESTAMPS
- struct timeval now;
-#endif
-
- if (logf == NULL) {
- return;
- }
-
- if (flags & G_LOG_LEVEL_DEBUG) {
- if (do_debug_log) {
- prefix = "d:";
- } else {
- return;
- }
- } else if (flags & G_LOG_LEVEL_MESSAGE) {
- prefix = "---";
- } else if (flags & G_LOG_LEVEL_WARNING) {
- prefix = "*** warning:";
- } else if (flags & G_LOG_LEVEL_ERROR) {
- prefix = "!!! ERROR:";
- } else {
- prefix = "???";
- }
-
-#ifdef ROBEY_LIKES_TIMESTAMPS
- gettimeofday (&now, NULL);
- timestamp = g_malloc (40);
- strftime (timestamp, 40, "%d-%b %H:%M:%S", localtime ((time_t *)&now.tv_sec));
- sprintf (timestamp + strlen (timestamp), ".%02ld ", now.tv_usec/10000L);
-#endif
-
- lines = g_strsplit (message, "\n", 0);
- for (i = 0; lines[i] != NULL; i++) {
- fprintf (logf, "%s%s %s\n", timestamp != NULL ? timestamp : "", prefix, lines[i]);
- }
- g_strfreev (lines);
- fflush (logf);
-}
-
-static void
-trilobite_close_log (void)
-{
- if (saved_logf != NULL) {
- fclose (saved_logf);
- }
-}
-
-void
-trilobite_debug (const gchar *format, ...)
-{
- va_list args;
- va_start (args, format);
- g_logv (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, format, args);
- va_end (args);
-}
-
-void
-trilobite_set_debug_mode (gboolean debug_mode)
-{
- do_debug_log = (debug_mode ? 1 : 0);
-}
-
-void
-trilobite_set_log_handler (FILE *logf, const char *service_name)
-{
- if (service_name != NULL) {
- g_log_set_handler (service_name, G_LOG_LEVEL_MESSAGE | G_LOG_LEVEL_WARNING |
- G_LOG_LEVEL_ERROR | G_LOG_LEVEL_DEBUG,
- (GLogFunc)trilobite_add_log, logf);
- }
- /* send libtrilobite messages there, too */
- g_log_set_handler (G_LOG_DOMAIN, G_LOG_LEVEL_MESSAGE | G_LOG_LEVEL_WARNING |
- G_LOG_LEVEL_ERROR | G_LOG_LEVEL_DEBUG,
- (GLogFunc)trilobite_add_log, logf);
-
- if (! set_atexit) {
- saved_logf = logf;
- g_atexit (trilobite_close_log);
- set_atexit = 1;
- }
-}
diff --git a/components/services/trilobite/libtrilobite/trilobite-core-messaging.h b/components/services/trilobite/libtrilobite/trilobite-core-messaging.h
deleted file mode 100644
index 1da2a5fe8..000000000
--- a/components/services/trilobite/libtrilobite/trilobite-core-messaging.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the Free
- * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#ifndef TRILOBITE_CORE_MESSAGING_H
-#define TRILOBITE_CORE_MESSAGING_H
-
-void trilobite_debug (const gchar *format, ...);
-void trilobite_set_debug_mode (gboolean debug_mode);
-void trilobite_set_log_handler (FILE *logf, const char *service_name);
-
-#endif /* TRILOBITE_CORE_MESSAGING_H */
-
diff --git a/components/services/trilobite/libtrilobite/trilobite-core-network-slim.c b/components/services/trilobite/libtrilobite/trilobite-core-network-slim.c
deleted file mode 100644
index 7c2136db2..000000000
--- a/components/services/trilobite/libtrilobite/trilobite-core-network-slim.c
+++ /dev/null
@@ -1,178 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * trilobite-core-network: functions for retrieving files from the
- * network and parsing XML documents
- * (this version is for the bootstrap installer, it's "slimmed down")
- *
- * Copyright (C) 2000 Eazel, Inc
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the Free
- * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * Authors: J Shane Culpepper <pepper@eazel.com>
- * Robey Pointer <robey@eazel.com>
- * Eskil Heyn Olsen <eskil@eazel.com>
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "trilobite-core-network.h"
-
-#include "trilobite-core-utils.h"
-#include <ghttp.h>
-#include <glib.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include "trilobite-i18n.h"
-
-/* function for lazy bastards who can't be bothered to figure out the format of the xml they're parsing:
- * it checks for a property with the name, and then if there isn't one, then it tries to find a child
- * with that name instead.
- */
-char *
-trilobite_xml_get_string (xmlNode *node, const char *name)
-{
- char *ret;
- char *tmp;
- xmlNode *child;
-
- ret = xmlGetProp (node, name);
- if (ret) {
- goto good;
- }
- child = node->xmlChildrenNode;
- while (child) {
- if (g_strcasecmp (child->name, name) == 0) {
- ret = xmlNodeGetContent (child);
- if (ret) {
- goto good;
- }
- }
- child = child->next;
- }
- return NULL;
-
-good:
- tmp = g_strdup (ret);
- xmlFree (ret);
- return tmp;
-}
-
-gboolean
-trilobite_fetch_uri (const char *uri_text, char **body, int *length)
-{
- char *uri = NULL;
- ghttp_request* request;
- ghttp_status status;
- gboolean result = TRUE;
-
- g_assert (body!=NULL);
- g_assert (uri_text != NULL);
- g_assert (length != NULL);
-
- uri = g_strdup (uri_text);
- request = NULL;
- (*length) = -1;
- (*body) = NULL;
-
- if ((request = ghttp_request_new())==NULL) {
- g_warning (_("Could not create an http request !"));
- result = FALSE;
- }
-
- /* bootstrap installer does it this way */
- if (result && (g_getenv ("http_proxy") != NULL)) {
- if (ghttp_set_proxy (request, g_getenv ("http_proxy")) != 0) {
- g_warning (_("Proxy: Invalid uri !"));
- result = FALSE;
- }
- }
-
- if (result && (ghttp_set_uri (request, uri) != 0)) {
- g_warning (_("Invalid uri !"));
- result = FALSE;
- }
-
- if (result) {
- ghttp_set_header (request, http_hdr_Connection, "close");
- ghttp_set_header (request, http_hdr_User_Agent, trilobite_get_useragent_string (NULL));
- }
-
- if (result && (ghttp_prepare (request) != 0)) {
- g_warning (_("Could not prepare http request !"));
- result = FALSE;
- }
-
- if (result && ghttp_set_sync (request, ghttp_async)) {
- g_warning (_("Couldn't get async mode "));
- result = FALSE;
- }
-
- while (result && (status = ghttp_process (request)) == ghttp_not_done) {
- /* ghttp_current_status curStat = ghttp_get_status (request); */
- g_main_iteration (FALSE);
- }
-
- if (result && (ghttp_status_code (request) != 200)) {
- g_warning (_("HTTP error %d \"%s\" on uri %s"),
- ghttp_status_code (request),
- ghttp_reason_phrase (request),
- uri);
- result = FALSE;
- }
- if (result && (ghttp_status_code (request) != 404)) {
- (*length) = ghttp_get_body_len (request);
- (*body) = g_new0 (char, *length + 1);
- memcpy (*body, ghttp_get_body (request), *length);
- (*body)[*length] = 0;
- } else {
- result = FALSE;
- }
-
- if (request) {
- ghttp_request_destroy (request);
- }
-
- g_free (uri);
-
- return result;
-}
-
-gboolean
-trilobite_fetch_uri_to_file (const char *uri_text, const char *filename)
-{
- char *body = NULL;
- int length;
- gboolean result = FALSE;
-
- result = trilobite_fetch_uri (uri_text, &body, &length);
- if (result) {
- FILE* file;
- file = fopen (filename, "wb");
- if (file == NULL) {
- g_warning (_("Could not open target file %s"),filename);
- result = FALSE;
- } else {
- fwrite (body, length, 1, file);
- }
- fclose (file);
- }
-
- return result;
-}
diff --git a/components/services/trilobite/libtrilobite/trilobite-core-network.c b/components/services/trilobite/libtrilobite/trilobite-core-network.c
deleted file mode 100644
index e4723cacb..000000000
--- a/components/services/trilobite/libtrilobite/trilobite-core-network.c
+++ /dev/null
@@ -1,197 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * trilobite-core-network: functions for retrieving files from the
- * network and parsing XML documents
- *
- * Copyright (C) 2000, 2001 Eazel, Inc
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the Free
- * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * Authors: J Shane Culpepper <pepper@eazel.com>
- * Robey Pointer <robey@eazel.com>
- */
-
-#include <config.h>
-#include "trilobite-core-network.h"
-
-#include "trilobite-core-utils.h"
-#include <eel/eel-glib-extensions.h>
-#include <libgnomevfs/gnome-vfs.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-
-/* function for lazy bastards who can't be bothered to figure out the format of the xml they're parsing:
- * it checks for a property with the name, and then if there isn't one, then it tries to find a child
- * with that name instead.
- */
-char *
-trilobite_xml_get_string (xmlNode *node, const char *name)
-{
- char *ret;
- char *tmp;
- xmlNode *child;
-
- ret = xmlGetProp (node, name);
- if (ret) {
- goto good;
- }
- child = node->xmlChildrenNode;
- while (child) {
- if (g_strcasecmp (child->name, name) == 0) {
- ret = xmlNodeGetContent (child);
- if (ret) {
- goto good;
- }
- }
- child = child->next;
- }
- return NULL;
-
-good:
- tmp = g_strdup (ret);
- xmlFree (ret);
- return tmp;
-}
-
-static GnomeVFSHandle *
-trilobite_open_uri (const char *uri_text)
-{
- GnomeVFSResult err;
- GnomeVFSURI *uri;
- GnomeVFSHandle *handle = NULL;
-
- if (! gnome_vfs_initialized ()) {
- eel_setenv ("GNOME_VFS_HTTP_USER_AGENT", trilobite_get_useragent_string (NULL), 1);
-
- if (! gnome_vfs_init ()) {
- g_warning ("cannot initialize gnome-vfs!");
- return NULL;
- }
- }
-
- uri = gnome_vfs_uri_new (uri_text);
- if (uri == NULL) {
- trilobite_debug ("fetch-uri: invalid uri");
- return NULL;
- }
-
- err = gnome_vfs_open_uri (&handle, uri, GNOME_VFS_OPEN_READ);
- if (err != GNOME_VFS_OK) {
- trilobite_debug ("fetch-uri on '%s': open failed: %s",
- uri_text,
- gnome_vfs_result_to_string (err));
- handle = NULL;
- }
-
- gnome_vfs_uri_unref (uri);
- return handle;
-}
-
-/* fetch a file from an url, using gnome-vfs
- * (using gnome-vfs allows urls of the type "eazel-auth:/etc" to work)
- * generally this will be used to fetch XML files.
- * on success, the body will be null-terminated (this helps work around bugs in libxml,
- * and also makes it easy to manipulate a small body using string operations).
- */
-gboolean
-trilobite_fetch_uri (const char *uri_text,
- char **body,
- int *length)
-{
- GnomeVFSResult err;
- GnomeVFSHandle *handle;
- int buffer_size;
- GnomeVFSFileSize bytes;
-
- handle = trilobite_open_uri (uri_text);
- if (handle == NULL) {
- return FALSE;
- }
-
- /* start the buffer at a reasonable size */
- buffer_size = 4096;
- *body = g_malloc (buffer_size);
- *length = 0;
-
- while (1) {
- /* FIXME: this is almost certainly a mistake */
- /* i think this is probably pretty loser: */
- g_main_iteration (FALSE);
- err = gnome_vfs_read (handle, (*body) + (*length), buffer_size - (*length), &bytes);
- if ((bytes == 0) || (err != GNOME_VFS_OK)) {
- break;
- }
- *length += bytes;
- if (*length >= buffer_size - 64) {
- /* expando time! */
- buffer_size *= 4;
- *body = g_realloc (*body, buffer_size);
- }
- }
-
- /* EOF is now an "error" :) */
- if ((err != GNOME_VFS_OK) && (err != GNOME_VFS_ERROR_EOF)) {
- g_free (*body);
- *body = NULL;
- goto fail;
- }
-
- (*body)[*length] = 0;
- gnome_vfs_close (handle);
- return TRUE;
-
-fail:
- trilobite_debug ("fetch-uri on %s: %s (%d)", uri_text, gnome_vfs_result_to_string (err), err);
- gnome_vfs_close (handle);
- return FALSE;
-}
-
-gboolean
-trilobite_fetch_uri_to_file (const char *uri_text, const char *filename)
-{
- GnomeVFSResult err;
- GnomeVFSHandle *handle;
- FILE *file;
- char buffer[1024];
- GnomeVFSFileSize bytes;
-
- file = fopen (filename, "w");
- if (file == NULL) {
- return FALSE;
- }
-
- handle = trilobite_open_uri (uri_text);
- if (handle == NULL) {
- fclose (file);
- return FALSE;
- }
-
- while (1) {
- g_main_iteration (FALSE);
- err = gnome_vfs_read (handle, buffer, sizeof(buffer), &bytes);
- if ((bytes == 0) || (err != GNOME_VFS_OK)) {
- break;
- }
- fwrite (buffer, bytes, 1, file);
- }
-
- gnome_vfs_close (handle);
- fclose (file);
-
- return (err == GNOME_VFS_OK);
-}
-
-
diff --git a/components/services/trilobite/libtrilobite/trilobite-core-network.h b/components/services/trilobite/libtrilobite/trilobite-core-network.h
deleted file mode 100644
index 38b0519cb..000000000
--- a/components/services/trilobite/libtrilobite/trilobite-core-network.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the Free
- * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-/*
- * libtrilobite - Useful functions shared between all services. This
- * includes things like xml parsing, logging, error control, and others.
- */
-
-#ifndef TRILOBITE_CORE_NETWORK_H
-#define TRILOBITE_CORE_NETWORK_H
-
-#include <parser.h>
-#include <xmlmemory.h>
-#include <glib.h>
-
-char *trilobite_xml_get_string (xmlNode *node, const char *name);
-gboolean trilobite_fetch_uri (const char *uri_text, char **body, int *length);
-gboolean trilobite_fetch_uri_to_file (const char *uri_text, const char *filename);
-
-
-#endif /* TRILOBITE_CORE_NETWORK_H */
diff --git a/components/services/trilobite/libtrilobite/trilobite-core-utils.c b/components/services/trilobite/libtrilobite/trilobite-core-utils.c
deleted file mode 100644
index 78fd65411..000000000
--- a/components/services/trilobite/libtrilobite/trilobite-core-utils.c
+++ /dev/null
@@ -1,293 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the Free
- * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * Authors: J Shane Culpepper <pepper@eazel.com>
- * Robey Pointer <robey@eazel.com>
- */
-
-/*
- * libtrilobite - Useful functions shared between all services. This
- * includes things like xml parsing, logging, error control, and others.
- *
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-
-
-#include "trilobite-core-utils.h"
-#include "trilobite-core-messaging.h"
-
-#ifndef TRILOBITE_SLIM
-#include <gnome.h>
-#include <liboaf/liboaf.h>
-#include <bonobo.h>
-#endif /* TRILOBITE_SLIM */
-
-
-#define TRILOBITE_SERVICE_CONFIG_DIR "/etc/trilobite"
-#define TRILOBITE_SERVICE_CONFIG_DIR_ENV "TRILOBITE_CONFIG"
-
-#ifdef OPEN_MAX
-#define LAST_FD OPEN_MAX
-#else
-#define LAST_FD 1024
-#endif
-
-/* better/safer replacement for popen (which doesn't exist on all platforms, anyway).
- * forks and executes a specific program, with pipes carrying stdin/stdout/stderr back
- * to you. this way, you can fork off a subprocess and control its environment. and
- * it doesn't use system() like most evil popen implementations.
- * for the future, it'd be nice to be able to clear out the subprocess's env vars.
- */
-int
-trilobite_pexec (const char *path, char * const argv[], int *stdin_fd, int *stdout_fd, int *stderr_fd)
-{
- pid_t child;
- int pipe_in[2], pipe_out[2], pipe_err[2];
- int i;
-
- pipe_in[0] = pipe_in[1] = pipe_out[0] = pipe_out[1] = pipe_err[0] = pipe_err[1] = -1;
- if ((pipe (pipe_in) != 0) || (pipe (pipe_out) != 0) || (pipe (pipe_err) != 0)) {
- goto close_and_give_up;
- }
- child = fork ();
- if (child < 0) {
- goto close_and_give_up;
- }
-
- if (child == 0) {
-#if 0
- child = fork ();
- if (child != 0) {
- exit (0);
- }
-
- /* keep child processes from trying to write to the tty */
- setsid ();
- setpgid (0, 0);
-#endif
-
- /* make stdin/stdout/stderr use the pipes */
- if (stdin_fd) {
- dup2 (pipe_in[0], 0);
- }
- if (stdout_fd) {
- dup2 (pipe_out[1], 1);
- }
- if (stderr_fd) {
- dup2 (pipe_err[1], 2);
- }
- /* close all open fd's */
- for (i = 3; i < LAST_FD; i++) {
- close(i);
- }
-
- /* FIXME bugzilla.eazel.com 2589: might we want to specify our own environment here? */
- execv (path, argv);
-
- /* if we get here, then somehow, exec failed */
- exit (-1);
- }
-
- /* copy out all the in/out/err fd's */
- close (pipe_in[0]);
- close (pipe_out[1]);
- close (pipe_err[1]);
- if (stdin_fd) {
- *stdin_fd = pipe_in[1];
- } else {
- close (pipe_in[1]);
- }
- if (stdout_fd) {
- *stdout_fd = pipe_out[0];
- } else {
- close (pipe_out[0]);
- }
- if (stderr_fd) {
- *stderr_fd = pipe_err[0];
- } else {
- close (pipe_err[0]);
- }
-
- return (int)child;
-
-close_and_give_up:
- close (pipe_in[0]);
- close (pipe_in[1]);
- close (pipe_out[0]);
- close (pipe_out[1]);
- close (pipe_err[0]);
- close (pipe_err[1]);
-
- return 0;
-}
-
-
-#ifndef TRILOBITE_SLIM
-
-#undef TRILOBITE_USE_X
-static poptContext trilobite_popt;
-
-poptContext
-trilobite_get_popt_context (void)
-{
- return trilobite_popt;
-}
-
-#ifndef TRILOBITE_SLIM
-/* trilobite_init
- *
- * This does all of the initialization needed for command-line utilities or
- * background CORBA services: The GTK type & signal system is initialized,
- * along with OAF and bonobo and all their friends. If you specify a logfile,
- * logging begins (service_name should be your G_LOG_DOMAIN).
- *
- * This initialization does not start any X services! It's meant to be used
- * by processes that won't talk to an X server -- use normal GNOME init
- * functions if you will be using X or doing any GUI stuff.
- *
- * Returns FALSE if init fails, TRUE on success.
- */
-gboolean
-trilobite_init (const char *service_name, const char *version_name, const char *log_filename,
- const struct poptOption *options, int argc, char **argv)
-{
- CORBA_ORB orb;
- FILE *logf;
- char *real_log_filename;
-
- gnomelib_register_popt_table (oaf_popt_options, oaf_get_popt_table_name ());
- orb = oaf_init (argc, argv);
-
-#ifdef TRILOBITE_USE_X
- if (options) {
- gnome_init_with_popt_table (service_name, version_name, argc, argv, pass_options, 0, NULL);
- } else {
- gnome_init (service_name, version_name, argc, argv);
- }
- trilobite_popt = NULL;
-#else
- gtk_type_init ();
- gtk_signal_init ();
- gnomelib_init (service_name, version_name);
- if (options != NULL) {
- gnomelib_register_popt_table (options, service_name);
- }
- trilobite_popt = gnomelib_parse_args (argc, argv, 0);
-#endif
-
- if (!bonobo_init (orb, CORBA_OBJECT_NIL, CORBA_OBJECT_NIL)) {
- g_error (_("Could not initialize Bonobo"));
- goto fail;
- }
-
- if (log_filename != NULL) {
- if ((log_filename[0] == '~') && (log_filename[1] == '/')) {
- real_log_filename = g_strdup_printf ("%s%s", g_get_home_dir (), log_filename+1);
- } else {
- real_log_filename = g_strdup (log_filename);
- }
-
- logf = fopen (real_log_filename, "wt");
- if (logf != NULL) {
- trilobite_set_log_handler (logf, service_name);
- } else {
- g_warning (_("Can't write logfile %s -- using default log handler"), real_log_filename);
- }
- g_free (real_log_filename);
- }
-
- return TRUE;
-
-fail:
- return FALSE;
-}
-#endif
-
-static GList *loop_list = NULL;
-
-/* if you want to be able to run without X, you should use trilobite_main and
- * trilobite_main_quit instead of the gtk_* varieties.
- *
- * if you use bonobo_main, you can substitute the sequence of calls
- * { bonobo_activate; trilobite_main; }
- * and get the same effect. this is an attempt to remove the X requirements
- * from trilobite services and command-line utilities.
- */
-void
-trilobite_main (void)
-{
- GMainLoop *loop;
-
- loop = g_main_new (TRUE);
- loop_list = g_list_prepend (loop_list, loop);
- if (g_main_is_running (loop)) {
- g_main_run (loop);
- }
- loop_list = g_list_remove (loop_list, loop);
-
- g_main_destroy (loop);
-}
-
-void
-trilobite_main_quit (void)
-{
- if (loop_list != NULL) {
- g_main_quit ((GMainLoop *)(loop_list->data));
- loop_list = g_list_remove (loop_list, loop_list->data);
- }
-}
-#endif /* TRILOBITE_SLIM */
-
-const char *
-trilobite_get_useragent_string (char *suffix)
-{
- static char *result = NULL;
-
- g_free (result);
- result = g_strdup_printf ("Trilobite/%s%s%s",
- TRILOBITE_VERSION,
- suffix ? "/" : "",
- suffix ? suffix : "");
- return result;
-}
-
-const char *
-trilobite_get_config_dir_string ()
-{
- static const char *res = NULL;
-
- if (res!=NULL) {
- return res;
- }
-
- if (getenv (TRILOBITE_SERVICE_CONFIG_DIR_ENV)) {
- res = g_strdup (getenv (TRILOBITE_SERVICE_CONFIG_DIR_ENV));
- } else {
- res = g_strdup (TRILOBITE_SERVICE_CONFIG_DIR);
- }
-
- return res;
-}
diff --git a/components/services/trilobite/libtrilobite/trilobite-core-utils.h b/components/services/trilobite/libtrilobite/trilobite-core-utils.h
deleted file mode 100644
index 3bc683f55..000000000
--- a/components/services/trilobite/libtrilobite/trilobite-core-utils.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the Free
- * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * Authors: J Shane Culpepper <pepper@eazel.com>
- * Robey Pointer <robey@eazel.com>
- */
-
-/*
- * libtrilobite - Useful functions shared between all services. This
- * includes things like xml parsing, logging, error control, and others.
- *
- */
-
-#ifndef TRILOBITE_CORE_UTILS_H
-#define TRILOBITE_CORE_UTILS_H
-
-#include <config.h>
-#include <stdio.h>
-#include <glib.h>
-#ifndef TRILOBITE_SLIM
-#include <popt.h>
-#include <bonobo.h>
-#endif
-
-void trilobite_debug (const char *format, ...);
-
-int trilobite_pexec (const char *path,
- char * const argv[],
- int *stdin_fd,
- int *stdout_fd,
- int *stderr_fd);
-
-/* The TRILOBITE_SLIM is set for the nautilus_installer.
- It trims down on the amount of random code and libs the
- bootstrap installer needs to link against */
-#ifndef TRILOBITE_SLIM
-gboolean trilobite_init (const char *service_name,
- const char *version_name,
- const char *log_filename,
- const struct poptOption *options,
- int argc,
- char **argv);
-poptContext trilobite_get_popt_context (void);
-void trilobite_main (void);
-void trilobite_main_quit (void);
-#endif /* TRILOBITE_SLIM */
-
-const char *trilobite_get_useragent_string (char *suffix);
-const char *trilobite_get_config_dir_string (void);
-
-#endif /* TRILOBITE_CORE_UTILS_H */
-
diff --git a/components/services/trilobite/libtrilobite/trilobite-i18n.h b/components/services/trilobite/libtrilobite/trilobite-i18n.h
deleted file mode 100644
index 478f41975..000000000
--- a/components/services/trilobite/libtrilobite/trilobite-i18n.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-
-/*
- * Copyright (C) 2001 Eazel, Inc
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the Free
- * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#ifndef TRILOBITE_I18N_H
-#define TRILOBITE_I18N_H
-
-#ifdef ENABLE_NLS
-# include <libintl.h>
-# undef _
-# define _(String) dgettext (PACKAGE, String)
-# ifdef gettext_noop
-# define N_(String) gettext_noop (String)
-# else
-# define N_(String) (String)
-# endif
-#else
-/* Stubs that do something close enough. */
-# define textdomain(String) (String)
-# define gettext(String) (String)
-# define dgettext(Domain,Message) (Message)
-# define dcgettext(Domain,Message,Type) (Message)
-# define bindtextdomain(Domain,Directory) (Domain)
-# define _(String) (String)
-# define N_(String) (String)
-#endif
-
-#endif /* TRILOBITE_I18N_H */
diff --git a/components/services/trilobite/libtrilobite/trilobite-md5-tools.c b/components/services/trilobite/libtrilobite/trilobite-md5-tools.c
deleted file mode 100644
index ebb19add8..000000000
--- a/components/services/trilobite/libtrilobite/trilobite-md5-tools.c
+++ /dev/null
@@ -1,428 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * This code implements the MD5 message-digest algorithm.
- * The algorithm is due to Ron Rivest. This code was
- * written by Colin Plumb in 1993, no copyright is claimed.
- * This code is in the public domain; do with it what you wish.
- *
- * Equivalent code is available from RSA Data Security, Inc.
- * This code has been tested against that, and is equivalent,
- * except that you don't need to include two pages of legalese
- * with every copy.
- *
- * To compute the message digest of a chunk of bytes, declare an
- * MD5Context structure, pass it to md5_init, call md5_update as
- * needed on buffers full of bytes, and then call md5_Final, which
- * will fill a supplied 16-byte array with the digest.
- */
-
-/* parts of this file are :
- * Written March 1993 by Branko Lankester
- * Modified June 1993 by Colin Plumb for altered md5.c.
- * Modified October 1995 by Erik Troan for RPM
- */
-
-
-#include "trilobite-md5-tools.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "trilobite-core-utils.h"
-
-#undef _MD5_STANDALONE
-
-
-static void md5_transform (guint32 buf[4], const guint32 in[16]);
-
-static int _ie = 0x44332211;
-static union _endian { int i; char b[4]; } *_endian = (union _endian *)&_ie;
-#define IS_BIG_ENDIAN() (_endian->b[0] == '\x44')
-#define IS_LITTLE_ENDIAN() (_endian->b[0] == '\x11')
-
-
-/*
- * Note: this code is harmless on little-endian machines.
- */
-static void
-_byte_reverse (guchar *buf, guint32 longs)
-{
- guint32 t;
- do {
- t = (guint32) ((guint32) buf[3] << 8 | buf[2]) << 16 |
- ((guint32) buf[1] << 8 | buf[0]);
- *(guint32 *) buf = t;
- buf += 4;
- } while (--longs);
-}
-
-/**
- * md5_init: Initialise an md5 context object
- * @ctx: md5 context
- *
- * Initialise an md5 buffer.
- *
- **/
-static void
-md5_init (MD5Context *ctx)
-{
- ctx->buf[0] = 0x67452301;
- ctx->buf[1] = 0xefcdab89;
- ctx->buf[2] = 0x98badcfe;
- ctx->buf[3] = 0x10325476;
-
- ctx->bits[0] = 0;
- ctx->bits[1] = 0;
-
- if (IS_BIG_ENDIAN())
- ctx->doByteReverse = 1;
- else
- ctx->doByteReverse = 0;
-}
-
-
-
-/**
- * md5_update: add a buffer to md5 hash computation
- * @ctx: conetxt object used for md5 computaion
- * @buf: buffer to add
- * @len: buffer length
- *
- * Update context to reflect the concatenation of another buffer full
- * of bytes. Use this to progressively construct an md5 hash.
- **/
-static void
-md5_update (MD5Context *ctx, const guchar *buf, guint32 len)
-{
- guint32 t;
-
- /* Update bitcount */
-
- t = ctx->bits[0];
- if ((ctx->bits[0] = t + ((guint32) len << 3)) < t)
- ctx->bits[1]++; /* Carry from low to high */
- ctx->bits[1] += len >> 29;
-
- t = (t >> 3) & 0x3f; /* Bytes already in shsInfo->data */
-
- /* Handle any leading odd-sized chunks */
-
- if (t) {
- guchar *p = (guchar *) ctx->in + t;
-
- t = 64 - t;
- if (len < t) {
- memcpy (p, buf, len);
- return;
- }
- memcpy (p, buf, t);
- if (ctx->doByteReverse)
- _byte_reverse (ctx->in, 16);
- md5_transform (ctx->buf, (guint32 *) ctx->in);
- buf += t;
- len -= t;
- }
- /* Process data in 64-byte chunks */
-
- while (len >= 64) {
- memcpy (ctx->in, buf, 64);
- if (ctx->doByteReverse)
- _byte_reverse (ctx->in, 16);
- md5_transform (ctx->buf, (guint32 *) ctx->in);
- buf += 64;
- len -= 64;
- }
-
- /* Handle any remaining bytes of data. */
-
- memcpy (ctx->in, buf, len);
-}
-
-
-
-
-
-/*
- * Final wrapup - pad to 64-byte boundary with the bit pattern
- * 1 0* (64-bit count of bits processed, MSB-first)
- */
-/**
- * md5_final: copy the final md5 hash to a bufer
- * @digest: 16 bytes buffer
- * @ctx: context containing the calculated md5
- *
- * copy the final md5 hash to a bufer
- **/
-static void
-md5_final (MD5Context *ctx, guchar digest[16])
-{
- guint32 count;
- guchar *p;
-
- /* Compute number of bytes mod 64 */
- count = (ctx->bits[0] >> 3) & 0x3F;
-
- /* Set the first char of padding to 0x80. This is safe since there is
- always at least one byte free */
- p = ctx->in + count;
- *p++ = 0x80;
-
- /* Bytes of padding needed to make 64 bytes */
- count = 64 - 1 - count;
-
- /* Pad out to 56 mod 64 */
- if (count < 8) {
- /* Two lots of padding: Pad the first block to 64 bytes */
- memset (p, 0, count);
- if (ctx->doByteReverse)
- _byte_reverse (ctx->in, 16);
- md5_transform (ctx->buf, (guint32 *) ctx->in);
-
- /* Now fill the next block with 56 bytes */
- memset (ctx->in, 0, 56);
- } else {
- /* Pad block to 56 bytes */
- memset (p, 0, count - 8);
- }
- if (ctx->doByteReverse)
- _byte_reverse (ctx->in, 14);
-
- /* Append length in bits and transform */
- ((guint32 *) ctx->in)[14] = ctx->bits[0];
- ((guint32 *) ctx->in)[15] = ctx->bits[1];
-
- md5_transform (ctx->buf, (guint32 *) ctx->in);
- if (ctx->doByteReverse)
- _byte_reverse ((guchar *) ctx->buf, 4);
- memcpy (digest, ctx->buf, 16);
-}
-
-
-
-
-/* The four core functions - F1 is optimized somewhat */
-
-/* #define F1(x, y, z) (x & y | ~x & z) */
-#define F1(x, y, z) (z ^ (x & (y ^ z)))
-#define F2(x, y, z) F1(z, x, y)
-#define F3(x, y, z) (x ^ y ^ z)
-#define F4(x, y, z) (y ^ (x | ~z))
-
-/* This is the central step in the MD5 algorithm. */
-#define MD5STEP(f, w, x, y, z, data, s) \
- ( w += f(x, y, z) + data, w = w<<s | w>>(32-s), w += x )
-
-/*
- * The core of the MD5 algorithm, this alters an existing MD5 hash to
- * reflect the addition of 16 longwords of new data. md5_Update blocks
- * the data and converts bytes into longwords for this routine.
- */
-static void
-md5_transform (guint32 buf[4], const guint32 in[16])
-{
- register guint32 a, b, c, d;
-
- a = buf[0];
- b = buf[1];
- c = buf[2];
- d = buf[3];
-
- MD5STEP (F1, a, b, c, d, in[0] + 0xd76aa478, 7);
- MD5STEP (F1, d, a, b, c, in[1] + 0xe8c7b756, 12);
- MD5STEP (F1, c, d, a, b, in[2] + 0x242070db, 17);
- MD5STEP (F1, b, c, d, a, in[3] + 0xc1bdceee, 22);
- MD5STEP (F1, a, b, c, d, in[4] + 0xf57c0faf, 7);
- MD5STEP (F1, d, a, b, c, in[5] + 0x4787c62a, 12);
- MD5STEP (F1, c, d, a, b, in[6] + 0xa8304613, 17);
- MD5STEP (F1, b, c, d, a, in[7] + 0xfd469501, 22);
- MD5STEP (F1, a, b, c, d, in[8] + 0x698098d8, 7);
- MD5STEP (F1, d, a, b, c, in[9] + 0x8b44f7af, 12);
- MD5STEP (F1, c, d, a, b, in[10] + 0xffff5bb1, 17);
- MD5STEP (F1, b, c, d, a, in[11] + 0x895cd7be, 22);
- MD5STEP (F1, a, b, c, d, in[12] + 0x6b901122, 7);
- MD5STEP (F1, d, a, b, c, in[13] + 0xfd987193, 12);
- MD5STEP (F1, c, d, a, b, in[14] + 0xa679438e, 17);
- MD5STEP (F1, b, c, d, a, in[15] + 0x49b40821, 22);
-
- MD5STEP (F2, a, b, c, d, in[1] + 0xf61e2562, 5);
- MD5STEP (F2, d, a, b, c, in[6] + 0xc040b340, 9);
- MD5STEP (F2, c, d, a, b, in[11] + 0x265e5a51, 14);
- MD5STEP (F2, b, c, d, a, in[0] + 0xe9b6c7aa, 20);
- MD5STEP (F2, a, b, c, d, in[5] + 0xd62f105d, 5);
- MD5STEP (F2, d, a, b, c, in[10] + 0x02441453, 9);
- MD5STEP (F2, c, d, a, b, in[15] + 0xd8a1e681, 14);
- MD5STEP (F2, b, c, d, a, in[4] + 0xe7d3fbc8, 20);
- MD5STEP (F2, a, b, c, d, in[9] + 0x21e1cde6, 5);
- MD5STEP (F2, d, a, b, c, in[14] + 0xc33707d6, 9);
- MD5STEP (F2, c, d, a, b, in[3] + 0xf4d50d87, 14);
- MD5STEP (F2, b, c, d, a, in[8] + 0x455a14ed, 20);
- MD5STEP (F2, a, b, c, d, in[13] + 0xa9e3e905, 5);
- MD5STEP (F2, d, a, b, c, in[2] + 0xfcefa3f8, 9);
- MD5STEP (F2, c, d, a, b, in[7] + 0x676f02d9, 14);
- MD5STEP (F2, b, c, d, a, in[12] + 0x8d2a4c8a, 20);
-
- MD5STEP (F3, a, b, c, d, in[5] + 0xfffa3942, 4);
- MD5STEP (F3, d, a, b, c, in[8] + 0x8771f681, 11);
- MD5STEP (F3, c, d, a, b, in[11] + 0x6d9d6122, 16);
- MD5STEP (F3, b, c, d, a, in[14] + 0xfde5380c, 23);
- MD5STEP (F3, a, b, c, d, in[1] + 0xa4beea44, 4);
- MD5STEP (F3, d, a, b, c, in[4] + 0x4bdecfa9, 11);
- MD5STEP (F3, c, d, a, b, in[7] + 0xf6bb4b60, 16);
- MD5STEP (F3, b, c, d, a, in[10] + 0xbebfbc70, 23);
- MD5STEP (F3, a, b, c, d, in[13] + 0x289b7ec6, 4);
- MD5STEP (F3, d, a, b, c, in[0] + 0xeaa127fa, 11);
- MD5STEP (F3, c, d, a, b, in[3] + 0xd4ef3085, 16);
- MD5STEP (F3, b, c, d, a, in[6] + 0x04881d05, 23);
- MD5STEP (F3, a, b, c, d, in[9] + 0xd9d4d039, 4);
- MD5STEP (F3, d, a, b, c, in[12] + 0xe6db99e5, 11);
- MD5STEP (F3, c, d, a, b, in[15] + 0x1fa27cf8, 16);
- MD5STEP (F3, b, c, d, a, in[2] + 0xc4ac5665, 23);
-
- MD5STEP (F4, a, b, c, d, in[0] + 0xf4292244, 6);
- MD5STEP (F4, d, a, b, c, in[7] + 0x432aff97, 10);
- MD5STEP (F4, c, d, a, b, in[14] + 0xab9423a7, 15);
- MD5STEP (F4, b, c, d, a, in[5] + 0xfc93a039, 21);
- MD5STEP (F4, a, b, c, d, in[12] + 0x655b59c3, 6);
- MD5STEP (F4, d, a, b, c, in[3] + 0x8f0ccc92, 10);
- MD5STEP (F4, c, d, a, b, in[10] + 0xffeff47d, 15);
- MD5STEP (F4, b, c, d, a, in[1] + 0x85845dd1, 21);
- MD5STEP (F4, a, b, c, d, in[8] + 0x6fa87e4f, 6);
- MD5STEP (F4, d, a, b, c, in[15] + 0xfe2ce6e0, 10);
- MD5STEP (F4, c, d, a, b, in[6] + 0xa3014314, 15);
- MD5STEP (F4, b, c, d, a, in[13] + 0x4e0811a1, 21);
- MD5STEP (F4, a, b, c, d, in[4] + 0xf7537e82, 6);
- MD5STEP (F4, d, a, b, c, in[11] + 0xbd3af235, 10);
- MD5STEP (F4, c, d, a, b, in[2] + 0x2ad7d2bb, 15);
- MD5STEP (F4, b, c, d, a, in[9] + 0xeb86d391, 21);
-
- buf[0] += a;
- buf[1] += b;
- buf[2] += c;
- buf[3] += d;
-}
-
-
-
-
-/**
- * md5_get_digest: get the md5 hash of a buffer
- * @buffer: byte buffer
- * @buffer_size: buffer size (in bytes)
- * @digest: 16 bytes buffer receiving the hash code.
- *
- * Get the md5 hash of a buffer. The result is put in
- * the 16 bytes buffer @digest .
- **/
-void
-trilobite_md5_get_digest (const char *buffer, int buffer_size, guchar digest[16])
-{
- MD5Context ctx;
-
- md5_init (&ctx);
- md5_update (&ctx, buffer, buffer_size);
- md5_final (&ctx, digest);
-
-}
-
-
-/**
- * md5_get_digest_from_file: get the md5 hash of a file
- * @filename: file name
- * @digest: 16 bytes buffer receiving the hash code.
- *
- * Get the md5 hash of a file. The result is put in
- * the 16 bytes buffer @digest .
- **/
-void
-trilobite_md5_get_digest_from_file (const char *filename, guchar digest[16])
-{
- MD5Context ctx;
- guchar tmp_buf[1024];
- int nb_bytes_read;
- FILE *fp;
-
- if (filename == NULL) {
- return;
- }
-
- md5_init (&ctx);
- fp = fopen(filename, "r");
- if (!fp) {
- trilobite_debug ("could not open \"%s\" for md5 digest", filename);
- return;
- }
-
- while ((nb_bytes_read = fread (tmp_buf, sizeof (guchar), 1024, fp)) > 0)
- md5_update (&ctx, tmp_buf, nb_bytes_read);
-
- if (ferror(fp)) {
- fclose(fp);
- return;
- }
-
- fclose(fp);
- md5_final (&ctx, digest);
-}
-
-void
-trilobite_md5_get_digest_from_md5_string (const char *md5string,
- guchar pmd5[16])
-{
- char snippet[3];
- const char *iterator;
- int cnt = 0;
-
- g_return_if_fail (md5string != NULL);
-
- iterator = md5string;
- while (cnt<16) {
- unsigned long int tmp_val;
-
- strncpy (snippet, iterator, 2);
- snippet[2] = 0;
-
- tmp_val = strtoul (snippet, NULL, 16);
- g_assert (tmp_val < 256);
- pmd5[cnt] = tmp_val;
-
- iterator += 2;
- cnt++;
- }
-}
-
-const char *
-trilobite_md5_get_string_from_md5_digest (const guchar md5[16])
-{
- static char *str = NULL;
- int cnt;
-
- g_free (str);
- str = g_new0 (char, 33);
-
- for (cnt = 0; cnt < 16; cnt++) {
- char *tmp;
- tmp = g_strdup_printf ("%02x", md5[cnt]);
- str[cnt*2] = tmp[0];
- str[cnt*2 + 1] = tmp[1];
- g_free (tmp);
- }
-
- return str;
-}
-
-#ifdef _MD5_STANDALONE
-int
-main (int argc, char **argv)
-{
- guchar digest[16];
- int i;
-
- trilobite_md5_get_digest_from_file (argv[1], digest);
- for (i = 0; i < 16; i++) {
- printf ("%02X", digest[i]);
- }
- printf ("\n");
-
- return 0;
-}
-#endif
diff --git a/components/services/trilobite/libtrilobite/trilobite-md5-tools.h b/components/services/trilobite/libtrilobite/trilobite-md5-tools.h
deleted file mode 100644
index 92e02bcc5..000000000
--- a/components/services/trilobite/libtrilobite/trilobite-md5-tools.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * This code implements the MD5 message-digest algorithm.
- * The algorithm is due to Ron Rivest. This code was
- * written by Colin Plumb in 1993, no copyright is claimed.
- * This code is in the public domain; do with it what you wish.
- *
- * Equivalent code is available from RSA Data Security, Inc.
- * This code has been tested against that, and is equivalent,
- * except that you don't need to include two pages of legalese
- * with every copy.
- *
- * To compute the message digest of a chunk of bytes, declare an
- * MD5Context structure, pass it to rpmMD5Init, call rpmMD5Update as
- * needed on buffers full of bytes, and then call rpmMD5Final, which
- * will fill a supplied 16-byte array with the digest.
- */
-
-/* parts of this file are :
- * Written March 1993 by Branko Lankester
- * Modified June 1993 by Colin Plumb for altered md5.c.
- * Modified October 1995 by Erik Troan for RPM
- */
-
-
-#ifndef TRILOBITE_MD5_TOOLS_H
-#define TRILOBITE_MD5_TOOLS_H
-
-#include <glib.h>
-
-typedef struct {
- guint32 buf[4];
- guint32 bits[2];
- guchar in[64];
- int doByteReverse;
-} MD5Context ;
-
-
-void trilobite_md5_get_digest (const char *buffer, int buffer_size, guchar digest[16]);
-void trilobite_md5_get_digest_from_file (const char *filename, guchar digest[16]);
-
-/* Converts a 32 char hex'ified md5 to a 16 byte md5 digest */
-void trilobite_md5_get_digest_from_md5_string (const char *md5string, guchar pmd5[16]);
-
-/* Converts a 16 byte md5 digest to a 32 char hex'ified */
-const char *trilobite_md5_get_string_from_md5_digest (const guchar md5[16]);
-
-#endif /* TRILOBITE_MD5_TOOLS_H */
diff --git a/components/services/trilobite/libtrilobite/trilobite-redirect.c b/components/services/trilobite/libtrilobite/trilobite-redirect.c
deleted file mode 100644
index 1e8a874e6..000000000
--- a/components/services/trilobite/libtrilobite/trilobite-redirect.c
+++ /dev/null
@@ -1,299 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-
-/*
- * trilobite-redirect: functions to fetch a redirection table from
- * a remote xml file, store it in gconf, and then lookup entries
- * later. this may only be useful for eazel services.
- *
- * Copyright (C) 2000, 2001 Eazel, Inc
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the Free
- * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * Authors: Robey Pointer <robey@eazel.com>
- */
-
-#include <config.h>
-#include "trilobite-redirect.h"
-
-#include "trilobite-core-network.h"
-#include "trilobite-core-utils.h"
-#include <ctype.h>
-#include <eel/eel-vfs-extensions.h>
-#include <gconf/gconf-engine.h>
-#include <gconf/gconf.h>
-#include <glib.h>
-#include <gnome-xml/parser.h>
-#include <libgnomevfs/gnome-vfs.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-static gboolean trilobite_redirect_parse_xml (char *blob,
- int length);
-
-#define REDIRECT_TABLE_URI "eazel-services:/table.xml"
-#define REDIRECT_GCONF_PATH "/apps/eazel-trilobite/redirect-table"
-
-#define SERVICES_DEFAULT_HOST "services.eazel.com"
-#define SERVICES_GCONF_PATH "/apps/eazel-trilobite/services-host"
-
-static GConfEngine *conf_engine = NULL;
-
-
-/* called by atexit so we can close the gconf connection */
-static void
-trilobite_redirect_done (void)
-{
- gconf_engine_unref (conf_engine);
-}
-
-static void
-check_gconf_init (void)
-{
- GError *error = NULL;
-
- if (! gconf_is_initialized ()) {
- char *argv[] = { "trilobite", NULL };
-
- if (! gconf_init (1, argv, &error)) {
- g_assert (error != NULL);
- g_warning ("gconf init error: %s", error->message);
- g_error_free (error);
- }
- }
- if (conf_engine == NULL) {
- conf_engine = gconf_engine_get_default ();
- g_atexit (trilobite_redirect_done);
- }
-}
-
-
-/* erase everything currently in our gconf table (so we can add new entries now) */
-static void
-wipe_redirect_table (void)
-{
- GSList *list, *iter;
- GError *error = NULL;
- GConfEntry *entry;
-
- check_gconf_init ();
- list = gconf_engine_all_entries (conf_engine, REDIRECT_GCONF_PATH, &error);
- if (error != NULL) {
- g_warning ("gconf wipe error: %s", error->message);
- g_error_free (error);
- return;
- }
-
- for (iter = list; iter; iter = g_slist_next (iter)) {
- entry = (GConfEntry *) (iter->data);
- gconf_engine_unset (conf_engine, gconf_entry_get_key (entry), &error);
- if (error != NULL) {
- g_warning ("trilobite redirect: gconf couldn't delete key '%s': %s",
- gconf_entry_get_key (entry), error->message);
- g_error_free (error);
- }
- gconf_entry_free (entry);
- }
- g_slist_free (list);
-}
-
-static void
-add_redirect (const char *key, const char *value)
-{
- GError *error = NULL;
- char *full_key, *p;
-
- check_gconf_init ();
- full_key = g_strdup_printf ("%s/%s", REDIRECT_GCONF_PATH, key);
-
- /* convert all spaces to dashes */
- while ((p = strchr (full_key, ' ')) != NULL) {
- *p = '-';
- }
-
- gconf_engine_set_string (conf_engine, full_key, value, &error);
- if (error != NULL) {
- g_warning ("trilobite redirect: gconf can't add key '%s': %s", full_key, error->message);
- g_error_free (error);
- }
- g_free (full_key);
-}
-
-/* parse an xml file into the redirect table */
-gboolean
-trilobite_redirect_parse_xml (char *blob, int length)
-{
- xmlDocPtr doc;
- xmlNodePtr base, child, child2;
- char *name, *uri;
-
- g_return_val_if_fail (blob != NULL, FALSE);
- g_return_val_if_fail (length > 0, FALSE);
-
- /* <rant> libxml will have a temper tantrum if there is whitespace before the
- * first tag. so we must babysit it.
- */
- while ((length > 0) && (isspace (*blob))) {
- blob++;
- length--;
- }
-
- blob[length] = '\0';
-
- doc = xmlParseMemory (blob, length);
- if (doc == NULL || doc->root == NULL ||
- g_strcasecmp (doc->root->name, "location_data") != 0) {
- goto bad;
- }
-
- base = doc->root;
-
- wipe_redirect_table ();
-
- for (child = base->xmlChildrenNode; child; child = child->next) {
- if (g_strcasecmp (child->name, "location") == 0) {
- /* libxml sucks */
- name = NULL;
- uri = NULL;
-
- for (child2 = child->xmlChildrenNode; child2; child2 = child2->next) {
- if (g_strcasecmp (child2->name, "name") == 0) {
- name = xmlNodeGetContent (child2);
- }
- if (g_strcasecmp (child2->name, "uri") == 0) {
- uri = xmlNodeGetContent (child2);
- }
- }
-
- if ((name != NULL) && (uri != NULL)) {
- add_redirect (name, uri);
- }
- g_free (name);
- g_free (uri);
-
- }
- }
- xmlFreeDoc (doc);
- return TRUE;
-
-bad:
- xmlFreeDoc (doc);
- return FALSE;
-}
-
-
-struct TrilobiteRedirectFetchHandle {
- EelReadFileHandle *handle;
- TrilobiteRedirectFetchCallback callback;
- gpointer callback_data;
-};
-
-
-static void
-redirect_fetch_callback (GnomeVFSResult result,
- GnomeVFSFileSize file_size,
- char *file_contents,
- gpointer callback_data)
-{
- TrilobiteRedirectFetchHandle *handle;
- gboolean parsed_xml;
-
- parsed_xml = FALSE;
-
- handle = callback_data;
-
- if (result == GNOME_VFS_OK) {
- parsed_xml = trilobite_redirect_parse_xml (file_contents, file_size);
- }
-
- (*handle->callback) (result, parsed_xml, handle->callback_data);
- g_free (handle);
- g_free (file_contents);
-}
-
-
-TrilobiteRedirectFetchHandle *
-trilobite_redirect_fetch_table_async (const char *uri,
- TrilobiteRedirectFetchCallback callback,
- gpointer callback_data)
-{
- TrilobiteRedirectFetchHandle *handle;
-
- handle = g_new0 (TrilobiteRedirectFetchHandle, 1);
-
- handle->callback = callback;
- handle->callback_data = callback_data;
-
- handle->handle = eel_read_entire_file_async (uri, redirect_fetch_callback, handle);
-
- return handle;
-}
-
-void
-trilobite_redirect_fetch_table_cancel (TrilobiteRedirectFetchHandle *handle)
-{
- eel_read_file_cancel (handle->handle);
- g_free (handle);
-}
-
-
-
-/* find the uri for a redirect (you must free the string when done) */
-char *
-trilobite_redirect_lookup (const char *key)
-{
- GError *error = NULL;
- char *full_key, *p;
- char *value;
-
- check_gconf_init ();
- full_key = g_strdup_printf ("%s/%s", REDIRECT_GCONF_PATH, key);
-
- /* convert all spaces to dashes */
- while ((p = strchr (full_key, ' ')) != NULL) {
- *p = '-';
- }
-
- value = gconf_engine_get_string (conf_engine, full_key, &error);
- if (error != NULL) {
- g_warning ("trilobite redirect: gconf can't find key '%s': %s", full_key, error->message);
- g_error_free (error);
- }
-
- g_free (full_key);
- return value;
-}
-
-/* find the default server hostname and port to use for eazel services
- * NOTE: this should be in "host:port" format, if the ':port' is missing,
- * the port should default to 443 (https)
- */
-const char *
-trilobite_get_services_address (void)
-{
- GError *error = NULL;
- char *value;
-
- check_gconf_init ();
- value = gconf_engine_get_string (conf_engine, SERVICES_GCONF_PATH, &error);
- if ((value == NULL) || (error != NULL)) {
- if (error != NULL) {
- g_error_free (error);
- }
- value = SERVICES_DEFAULT_HOST;
- }
-
- return value;
-}
diff --git a/components/services/trilobite/libtrilobite/trilobite-redirect.h b/components/services/trilobite/libtrilobite/trilobite-redirect.h
deleted file mode 100644
index 61d12bc1d..000000000
--- a/components/services/trilobite/libtrilobite/trilobite-redirect.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-
-/*
- * trilobite-redirect: functions to fetch a redirection table from
- * a remote xml file, store it in gconf, and then lookup entries
- * later. this may only be useful for eazel services.
- *
- * Copyright (C) 2000, 2001 Eazel, Inc
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the Free
- * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * Authors: Robey Pointer <robey@eazel.com>
- */
-
-#ifndef TRILOBITE_REDIRECT_H
-#define TRILOBITE_REDIRECT_H
-
-#include <libgnomevfs/gnome-vfs.h>
-#include <glib.h>
-
-typedef void (* TrilobiteRedirectFetchCallback) (GnomeVFSResult result,
- gboolean parsed_xml,
- gpointer callback_data);
-
-typedef struct TrilobiteRedirectFetchHandle TrilobiteRedirectFetchHandle;
-
-
-TrilobiteRedirectFetchHandle *trilobite_redirect_fetch_table_async (const char *uri,
- TrilobiteRedirectFetchCallback callback,
- gpointer callback_data);
-
-void trilobite_redirect_fetch_table_cancel (TrilobiteRedirectFetchHandle *handle);
-
-
-char *trilobite_redirect_lookup (const char *key);
-
-const char *trilobite_get_services_address (void);
-
-#endif /* TRILOBITE_REDIRECT_H */
diff --git a/components/services/trilobite/libtrilobite/trilobite-root-client-private.h b/components/services/trilobite/libtrilobite/trilobite-root-client-private.h
deleted file mode 100644
index 3da6e4dc2..000000000
--- a/components/services/trilobite/libtrilobite/trilobite-root-client-private.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: Robey Pointer <robey@eazel.com>
- *
- */
-
-#ifndef TRILOBITE_ROOT_CLIENT_PRIVATE_H
-#define TRILOBITE_ROOT_CLIENT_PRIVATE_H
-
-struct _TrilobiteRootClientPrivate {
- Trilobite_PasswordQueryClient pq_client;
-};
-
-#endif /* TRILOBITE_ROOT_CLIENT_PRIVATE_H */
diff --git a/components/services/trilobite/libtrilobite/trilobite-root-client-public.h b/components/services/trilobite/libtrilobite/trilobite-root-client-public.h
deleted file mode 100644
index a4acda8cc..000000000
--- a/components/services/trilobite/libtrilobite/trilobite-root-client-public.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * GtkObject definition for TrilobiteRootClient.
- *
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: Robey Pointer <robey@eazel.com>
- *
- */
-
-#ifndef _TRILOBITE_ROOT_CLIENT_PUBLIC_H_
-#define _TRILOBITE_ROOT_CLIENT_PUBLIC_H_
-
-#include "trilobite-service.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-#define TRILOBITE_TYPE_ROOT_CLIENT \
- (trilobite_root_client_get_type ())
-#define TRILOBITE_ROOT_CLIENT(obj) \
- (GTK_CHECK_CAST ((obj), TRILOBITE_TYPE_ROOT_CLIENT, TrilobiteRootClient))
-#define TRILOBITE_ROOT_CLIENT_CLASS(klass) \
- (GTK_CHECK_CLASS_CAST ((klass), TRILOBITE_TYPE_ROOT_CLIENT, TrilobiteRootClientClass))
-#define TRILOBITE_IS_ROOT_CLIENT(obj) \
- (GTK_CHECK_TYPE ((obj), TRILOBITE_TYPE_ROOT_CLIENT))
-#define TRILOBITE_IS_ROOT_CLIENT_CLASS(klass) \
- (GTK_CHECK_CLASS_TYPE ((obj), TRILOBITE_TYPE_ROOT_CLIENT))
-
-typedef struct _TrilobiteRootClient TrilobiteRootClient;
-typedef struct _TrilobiteRootClientClass TrilobiteRootClientClass;
-typedef struct _TrilobiteRootClientPrivate TrilobiteRootClientPrivate;
-typedef struct _TrilobiteRootClientClassPrivate TrilobiteRootClientClassPrivate;
-
-struct _TrilobiteRootClientClass
-{
- BonoboObjectClass parent_class;
-
- gpointer servant_init;
- gpointer servant_fini;
- gpointer servant_vepv;
-};
-
-struct _TrilobiteRootClient
-{
- BonoboObject parent;
- TrilobiteRootClientPrivate *private;
-};
-
-/* prototypes for autogenerated functions */
-GtkType trilobite_root_client_get_type (void);
-gboolean trilobite_root_client_construct (TrilobiteRootClient *root_client,
- Trilobite_PasswordQueryClient corba_trilobite);
-TrilobiteRootClient *trilobite_root_client_new (void);
-POA_Trilobite_PasswordQueryClient__epv *trilobite_root_client_get_epv (void);
-void trilobite_root_client_unref (GtkObject *object);
-
-Trilobite_PasswordQueryClient trilobite_root_client_get_passwordqueryclient (TrilobiteRootClient *root_client);
-gboolean trilobite_root_client_attach (TrilobiteRootClient *root_client, BonoboObjectClient *service);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* _TRILOBITE_ROOT_CLIENT_PUBLIC_H_ */
diff --git a/components/services/trilobite/libtrilobite/trilobite-root-client.c b/components/services/trilobite/libtrilobite/trilobite-root-client.c
deleted file mode 100644
index cee409585..000000000
--- a/components/services/trilobite/libtrilobite/trilobite-root-client.c
+++ /dev/null
@@ -1,340 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * TrilobiteRootClient is a GtkObject wrapper for the corba object
- * PasswordQueryClient.
- *
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: Robey Pointer <robey@eazel.com>
- *
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <liboaf/liboaf.h>
-#include <bonobo.h>
-#include "libtrilobite.h"
-#include "trilobite-service.h" /* autogenerated */
-#include "trilobite-root-client-public.h"
-#include "trilobite-root-client-private.h"
-
-
-static GtkObject *parent_class;
-
-/* signals that a TrilobiteRootClient can emit */
-/* LAST_SIGNAL is just a sentinel marking the end of the list */
-enum {
- NEED_PASSWORD,
- TRY_AGAIN,
- LAST_SIGNAL
-};
-static guint root_client_signals[LAST_SIGNAL] = { 0 };
-
-
-/********** corba stuff **********/
-
-static PortableServer_ServantBase__epv base_epv = { NULL, NULL, NULL };
-
-typedef struct {
- POA_Trilobite_PasswordQueryClient servant;
- BonoboObject *bonobo_object;
-} impl_POA_Trilobite_PasswordQueryClient;
-
-/* emit the signal to get the password */
-static CORBA_char *
-impl_Trilobite_PasswordQueryClient_get_password (impl_POA_Trilobite_PasswordQueryClient *trilobite,
- CORBA_char *prompt,
- CORBA_Environment *ev)
-{
- char *password;
- char *result;
-
- /* now emit a signal and get the password */
- password = NULL;
- gtk_signal_emit (GTK_OBJECT (trilobite->bonobo_object), root_client_signals[NEED_PASSWORD], prompt, &password);
- if (password == NULL) {
- /* bummer. nobody caught the signal. */
- password = g_strdup ("");
- }
-
- /* make it be owned by corba */
- result = CORBA_string_dup (password);
- g_free (password);
-
- return result;
-};
-
-static CORBA_boolean
-impl_Trilobite_PasswordQueryClient_try_again (impl_POA_Trilobite_PasswordQueryClient *trilobite,
- CORBA_Environment *ev)
-{
- gboolean result;
-
- result = FALSE;
- gtk_signal_emit (GTK_OBJECT (trilobite->bonobo_object), root_client_signals[TRY_AGAIN], &result);
- return (CORBA_boolean)result;
-}
-
-POA_Trilobite_PasswordQueryClient__epv *
-trilobite_root_client_get_epv(void)
-{
- POA_Trilobite_PasswordQueryClient__epv *epv;
-
- epv = g_new0 (POA_Trilobite_PasswordQueryClient__epv, 1);
- epv->get_password = (gpointer)&impl_Trilobite_PasswordQueryClient_get_password;
- epv->try_again = (gpointer)&impl_Trilobite_PasswordQueryClient_try_again;
-
- return epv;
-};
-
-static Trilobite_PasswordQueryClient
-trilobite_root_client_create_corba_object (BonoboObject *trilobite)
-{
- impl_POA_Trilobite_PasswordQueryClient *servant;
- CORBA_Environment ev;
-
- g_assert (trilobite != NULL);
-
- CORBA_exception_init (&ev);
-
- servant = g_new0 (impl_POA_Trilobite_PasswordQueryClient, 1);
- ((POA_Trilobite_PasswordQueryClient *)servant)->vepv =
- TRILOBITE_ROOT_CLIENT_CLASS (GTK_OBJECT (trilobite)->klass)->servant_vepv;
- servant->bonobo_object = trilobite;
-
- POA_Trilobite_PasswordQueryClient__init (servant, &ev);
- ORBIT_OBJECT_KEY (((POA_Trilobite_PasswordQueryClient *)servant)->_private)->object = NULL;
-
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_warning ("Cannot instantiate Trilobite_PasswordQueryClient corba object");
- g_free (servant);
- CORBA_exception_free (&ev);
- return CORBA_OBJECT_NIL;
- }
-
- CORBA_exception_free (&ev);
-
- return (Trilobite_PasswordQueryClient) bonobo_object_activate_servant (trilobite, servant);
-}
-
-
-/********** gtk object stuff **********/
-
-/* have to make my own signal marshaller for STRING__STRING (grumble) */
-typedef gchar *(*GtkSignal_STRING__STRING) (GtkObject *object, gchar *arg1, gpointer user_data);
-static void
-gtk_marshal_STRING__STRING (GtkObject *object, GtkSignalFunc func, gpointer func_data, GtkArg *args)
-{
- GtkSignal_STRING__STRING rfunc;
- gchar **return_value;
-
- return_value = GTK_RETLOC_STRING (args[1]);
- rfunc = (GtkSignal_STRING__STRING)func;
- *return_value = (*rfunc) (object, GTK_VALUE_STRING (args[0]), func_data);
-}
-
-
-/* destroy callback, and accessible from the outside world */
-void
-trilobite_root_client_unref (GtkObject *object)
-{
- TrilobiteRootClient *root_client;
-
- g_return_if_fail (object != NULL);
- g_return_if_fail (TRILOBITE_IS_ROOT_CLIENT (object));
-
- root_client = TRILOBITE_ROOT_CLIENT (object);
-
- bonobo_object_unref (BONOBO_OBJECT (object));
-}
-
-static void
-trilobite_root_client_finalize (GtkObject *object)
-{
- TrilobiteRootClient *root_client;
-
- g_return_if_fail (object != NULL);
- g_return_if_fail (TRILOBITE_IS_ROOT_CLIENT (object));
-
- root_client = TRILOBITE_ROOT_CLIENT (object);
-
- g_free (root_client->private);
- root_client->private = NULL;
-
- /* call parent destructor */
- if (GTK_OBJECT_CLASS (parent_class)->finalize) {
- GTK_OBJECT_CLASS (parent_class)->finalize (object);
- }
-}
-
-/* class initializer */
-static void
-trilobite_root_client_class_initialize (TrilobiteRootClientClass *klass)
-{
- GtkObjectClass *object_class;
-
- parent_class = gtk_type_class (GTK_TYPE_OBJECT);
-
- object_class = (GtkObjectClass *)klass;
- object_class->finalize = trilobite_root_client_finalize;
-
- klass->servant_init = POA_Trilobite_PasswordQueryClient__init;
- klass->servant_fini = POA_Trilobite_PasswordQueryClient__fini;
- klass->servant_vepv = g_new0 (POA_Trilobite_PasswordQueryClient__vepv, 1);
-
- ((POA_Trilobite_PasswordQueryClient__vepv*)klass->servant_vepv)->_base_epv = &base_epv;
- ((POA_Trilobite_PasswordQueryClient__vepv*)klass->servant_vepv)->Bonobo_Unknown_epv = bonobo_object_get_epv ();
- ((POA_Trilobite_PasswordQueryClient__vepv*)klass->servant_vepv)->Trilobite_PasswordQueryClient_epv =
- trilobite_root_client_get_epv ();
-
- root_client_signals[NEED_PASSWORD] =
- gtk_signal_new ("need_password", 0, object_class->type, 0,
- gtk_marshal_STRING__STRING, GTK_TYPE_STRING, 1, GTK_TYPE_STRING);
- root_client_signals[TRY_AGAIN] =
- gtk_signal_new ("try_again", 0, object_class->type, 0,
- gtk_marshal_BOOL__NONE, GTK_TYPE_BOOL, 0);
- gtk_object_class_add_signals (object_class, root_client_signals, LAST_SIGNAL);
-}
-
-gboolean
-trilobite_root_client_construct (TrilobiteRootClient *root_client,
- Trilobite_PasswordQueryClient corba_trilobite)
-{
- g_assert (root_client != NULL);
- g_assert (TRILOBITE_IS_ROOT_CLIENT (root_client));
- g_return_val_if_fail (corba_trilobite != CORBA_OBJECT_NIL, FALSE);
-
- if (!bonobo_object_construct (BONOBO_OBJECT (root_client), (CORBA_Object) corba_trilobite)) {
- return FALSE;
- }
-
- return TRUE;
-}
-
-/* object initializer */
-static void
-trilobite_root_client_initialize (TrilobiteRootClient *object)
-{
- TrilobiteRootClient *root_client;
- Trilobite_PasswordQueryClient corba_trilobite;
-
- g_assert (object != NULL);
- g_assert (TRILOBITE_IS_ROOT_CLIENT (object));
-
- root_client = TRILOBITE_ROOT_CLIENT (object);
-
- corba_trilobite = trilobite_root_client_create_corba_object (BONOBO_OBJECT (object));
- if (!trilobite_root_client_construct (object, corba_trilobite)) {
- /* no good way to bail out now :( */
- corba_trilobite = CORBA_OBJECT_NIL;
- }
-
- object->private = g_new0 (TrilobiteRootClientPrivate, 1);
- object->private->pq_client = corba_trilobite;
-}
-
-/* generate the GtkType for TrilobiteRootClient */
-GtkType
-trilobite_root_client_get_type (void)
-{
- static GtkType trilobite_root_client_type = 0;
-
- /* First time it's called ? */
- if (! trilobite_root_client_type) {
- static const GtkTypeInfo root_client_info = {
- "TrilobiteRootClient",
- sizeof (TrilobiteRootClient),
- sizeof (TrilobiteRootClientClass),
- (GtkClassInitFunc) trilobite_root_client_class_initialize,
- (GtkObjectInitFunc) trilobite_root_client_initialize,
- /* reserved_1 */ NULL,
- /* reserved_2 */ NULL,
- (GtkClassInitFunc) NULL,
- };
-
- /* Get a unique GtkType */
- trilobite_root_client_type = gtk_type_unique (bonobo_object_get_type(), &root_client_info);
- }
-
- return trilobite_root_client_type;
-}
-
-TrilobiteRootClient *
-trilobite_root_client_new (void)
-{
- return TRILOBITE_ROOT_CLIENT (gtk_object_new (TRILOBITE_TYPE_ROOT_CLIENT, NULL));
-}
-
-
-/********** functions that actually implement the root client **********/
-
-/* returns the actual corba object for the PasswordQueryClient.
- * only needed if you feel like writing your own _attach function instead of using the one below.
- */
-Trilobite_PasswordQueryClient
-trilobite_root_client_get_passwordqueryclient (TrilobiteRootClient *root_client)
-{
- g_return_val_if_fail (root_client != NULL, CORBA_OBJECT_NIL);
- g_return_val_if_fail (TRILOBITE_IS_ROOT_CLIENT (root_client), CORBA_OBJECT_NIL);
-
- return root_client->private->pq_client;
-}
-
-/* if 'service' implements PasswordQuery, this function attaches the TrilobiteRootClient to that
- * PasswordQuery as the callback mechanism.
- * --- this is a necessary step, if you want a working TrilobiteRootClient.
- * returns TRUE on success
- */
-gboolean
-trilobite_root_client_attach (TrilobiteRootClient *root_client, BonoboObjectClient *service)
-{
- Trilobite_PasswordQuery trilobite_password;
- CORBA_Environment ev;
-
- g_return_val_if_fail (root_client != NULL, FALSE);
- g_return_val_if_fail (TRILOBITE_IS_ROOT_CLIENT (root_client), FALSE);
- g_return_val_if_fail (service != NULL, FALSE);
- g_return_val_if_fail (BONOBO_IS_OBJECT_CLIENT (service), FALSE);
- g_assert (root_client->private->pq_client != CORBA_OBJECT_NIL);
-
- CORBA_exception_init (&ev);
- if (! bonobo_object_client_has_interface (service, "IDL:Trilobite/PasswordQuery:1.0", &ev)) {
- goto fail;
- }
-
- trilobite_password = bonobo_object_query_interface (BONOBO_OBJECT (service),
- "IDL:Trilobite/PasswordQuery:1.0");
- if (trilobite_password == CORBA_OBJECT_NIL) {
- g_warning ("somehow query-interface(PasswordQuery) returned nil");
- goto fail;
- }
-
- Trilobite_PasswordQuery_set_query_client (trilobite_password, root_client->private->pq_client, &ev);
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_warning ("set-query-client got exception :(");
- }
- Trilobite_PasswordQuery_unref (trilobite_password, &ev);
- CORBA_Object_release (trilobite_password, &ev);
-
- CORBA_exception_free (&ev);
- return TRUE;
-
-fail:
- CORBA_exception_free (&ev);
- return FALSE;
-}
diff --git a/components/services/trilobite/libtrilobite/trilobite-root-helper.c b/components/services/trilobite/libtrilobite/trilobite-root-helper.c
deleted file mode 100644
index c262db2eb..000000000
--- a/components/services/trilobite/libtrilobite/trilobite-root-helper.c
+++ /dev/null
@@ -1,634 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * TrilobiteRootHelper is an object that allows a user process to ask for
- * certain tasks to be handled by the superuser, using the usermode
- * library (man userhelper) to run eazel-helper. A signal is emitted
- * when the root password is needed, so the caller can ask for it in a
- * special way.
- *
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: Robey Pointer <robey@eazel.com>
- *
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-#include <fcntl.h>
-#include <sys/poll.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <errno.h>
-#include <signal.h>
-#include <time.h>
-#include <gtk/gtk.h>
-#include "trilobite-core-utils.h"
-#include "trilobite-root-helper.h"
-
-#define USERHELPER_PATH "/usr/sbin/userhelper"
-#define EAZEL_HELPER "eazel-helper"
-
-
-static GtkObject *parent_class;
-
-/* signals that a TrilobiteRootHelper can emit */
-/* LAST_SIGNAL is just a sentinel marking the end of the list */
-enum {
- NEED_PASSWORD,
- TRY_AGAIN,
- LAST_SIGNAL
-};
-static guint root_helper_signals[LAST_SIGNAL] = { 0 };
-
-
-/* have to make my own signal marshaller for STRING__NONE (grumble) */
-typedef gchar *(*GtkSignal_STRING__NONE) (GtkObject *object, gpointer user_data);
-static void
-gtk_marshal_STRING__NONE (GtkObject *object, GtkSignalFunc func, gpointer func_data, GtkArg *args)
-{
- GtkSignal_STRING__NONE rfunc;
- gchar **return_value;
-
- return_value = GTK_RETLOC_STRING (args[0]);
- rfunc = (GtkSignal_STRING__NONE)func;
- *return_value = (*rfunc) (object, func_data);
-}
-
-
-/* destroy callback, and accessible from the outside world */
-void
-trilobite_root_helper_destroy (GtkObject *object)
-{
- TrilobiteRootHelper *root_helper;
- GList *iter;
-
- g_return_if_fail (object != NULL);
- g_return_if_fail (TRILOBITE_IS_ROOT_HELPER (object));
-
- root_helper = TRILOBITE_ROOT_HELPER (object);
-
- /* anything that needs to be freed? */
- for (iter = g_list_first (root_helper->old_fd_list); iter; iter = g_list_next (iter)) {
- trilobite_debug ("roothelper: tossing old fd %d", GPOINTER_TO_INT (iter->data));
- close (GPOINTER_TO_INT (iter->data));
- }
- g_list_free (root_helper->old_fd_list);
-
- close (root_helper->pipe_stdin);
- close (root_helper->pipe_stdout);
- if (root_helper->pid) {
- waitpid (root_helper->pid, NULL, 0);
- root_helper->pid = 0;
- }
-
- /* call parent destructor */
- if (GTK_OBJECT_CLASS (parent_class)->destroy) {
- GTK_OBJECT_CLASS (parent_class)->destroy (object);
- }
-}
-
-/* class initializer */
-static void
-trilobite_root_helper_class_initialize (TrilobiteRootHelperClass *klass)
-{
- GtkObjectClass *object_class;
-
- parent_class = gtk_type_class (GTK_TYPE_OBJECT);
-
- object_class = (GtkObjectClass *)klass;
- object_class->destroy = trilobite_root_helper_destroy;
-
- root_helper_signals[NEED_PASSWORD] =
- gtk_signal_new ("need_password", 0, object_class->type,
- GTK_SIGNAL_OFFSET (TrilobiteRootHelperClass, need_password),
- gtk_marshal_STRING__NONE, GTK_TYPE_STRING, 0);
- root_helper_signals[TRY_AGAIN] =
- gtk_signal_new ("try_again", 0, object_class->type,
- GTK_SIGNAL_OFFSET (TrilobiteRootHelperClass, try_again),
- gtk_marshal_BOOL__NONE, GTK_TYPE_BOOL, 0);
- gtk_object_class_add_signals (object_class, root_helper_signals, LAST_SIGNAL);
-
- klass->need_password = NULL;
- klass->try_again = NULL;
-}
-
-/* object initializer */
-static void
-trilobite_root_helper_initialize (TrilobiteRootHelper *object)
-{
- TrilobiteRootHelper *root_helper;
-
- g_assert (object != NULL);
- g_assert (TRILOBITE_IS_ROOT_HELPER (object));
-
- root_helper = TRILOBITE_ROOT_HELPER (object);
- root_helper->state = TRILOBITE_ROOT_HELPER_STATE_NEW;
-}
-
-/* generate the GtkType for TrilobiteRootHelper */
-GtkType
-trilobite_root_helper_get_type (void)
-{
- static GtkType trilobite_root_helper_type = 0;
-
- /* First time it's called ? */
- if (! trilobite_root_helper_type) {
- static const GtkTypeInfo root_helper_info = {
- "TrilobiteRootHelper",
- sizeof (TrilobiteRootHelper),
- sizeof (TrilobiteRootHelperClass),
- (GtkClassInitFunc) trilobite_root_helper_class_initialize,
- (GtkObjectInitFunc) trilobite_root_helper_initialize,
- /* reserved_1 */ NULL,
- /* reserved_2 */ NULL,
- (GtkClassInitFunc) NULL,
- };
-
- /* Get a unique GtkType */
- trilobite_root_helper_type = gtk_type_unique (GTK_TYPE_OBJECT, &root_helper_info);
- }
-
- return trilobite_root_helper_type;
-}
-
-TrilobiteRootHelper *
-trilobite_root_helper_new (void)
-{
- return TRILOBITE_ROOT_HELPER (gtk_object_new (TRILOBITE_TYPE_ROOT_HELPER, NULL));
-}
-
-
-/********** functions that actually implement the root helper **********/
-
-
-static int
-make_nonblocking (int fd)
-{
- int flags;
-
- flags = fcntl (fd, F_GETFL, 0);
- fcntl (fd, F_SETFL, flags | O_NONBLOCK);
- return 0;
-}
-
-static int
-make_blocking (int fd)
-{
- int flags;
-
- flags = fcntl (fd, F_GETFL, 0);
- fcntl (fd, F_SETFL, flags &~ O_NONBLOCK);
- return 0;
-}
-
-
-/* wait for and read one character from the eazel-helper */
-static char
-eazel_helper_response (int pipe_stdout)
-{
- struct pollfd pollfd;
- char buffer[4];
- int bytes;
-
- /* wait for something to come in */
- memset (&pollfd, 0, sizeof (pollfd));
- pollfd.fd = pipe_stdout;
- pollfd.events = POLLIN;
- pollfd.revents = 0;
- poll (&pollfd, 1, 3000);
- bytes = read (pipe_stdout, buffer, 1);
- if (bytes <= 0) {
- return '\0';
- } else {
- return buffer[0];
- }
-}
-
-/* read chars from eazel-helper (and discard them) until we reach a linefeed
- * (or there's nothing else in the buffer -- older buggy versions of userhelper
- * won't end msg-type "5" with a linefeed correctly.)
- */
-static void
-discard_line (int pipe_stdout)
-{
- char in;
- char line[2048];
- int i;
-
- i = 0;
- do {
- in = 0;
- read (pipe_stdout, &in, 1);
- if ((in != 0) && (in != '\n') && (i < 2000)) {
- line[i++] = in;
- }
- } while ((in != 0) && (in != '\n'));
- line[i] = 0;
- trilobite_debug ("roothelper: throwaway line '%s'", line);
-}
-
-
-/* /usr/sbin/userhelper
- * userhelper
- * -w
- * eazel-helper
- */
-static TrilobiteRootHelperStatus
-eazel_helper_start (int *pipe_stdin, int *pipe_stdout, int *child_pid)
-{
- char *pipe_argv[4];
- int useless_stderr;
- char buffer[256];
- TrilobiteRootHelperStatus err;
-
- pipe_argv[0] = "userhelper";
- pipe_argv[1] = "-w";
- pipe_argv[2] = EAZEL_HELPER;
- pipe_argv[3] = NULL;
- *child_pid = trilobite_pexec (USERHELPER_PATH, pipe_argv, pipe_stdin, pipe_stdout, &useless_stderr);
- if (*child_pid == 0) {
- trilobite_debug ("roothelper: system userhelper utility not found");
- return TRILOBITE_ROOT_HELPER_NO_USERHELPER;
- }
- close (useless_stderr);
-
- make_nonblocking (*pipe_stdout);
-
- while (1) {
- buffer[0] = eazel_helper_response (*pipe_stdout);
- trilobite_debug ("roothelper: state '0x%02X'", buffer[0]);
- switch (buffer[0]) {
- case '\0':
- trilobite_debug ("roothelper: userhelper died (stdin: %d, stdout: %d, pid: %d)",
- *pipe_stdin, *pipe_stdout, *child_pid);
- err = TRILOBITE_ROOT_HELPER_NO_USERHELPER;
- goto give_up;
- case '2':
- /* need root password. but first, clear the buffer of crap. */
- discard_line (*pipe_stdout);
- err = TRILOBITE_ROOT_HELPER_NEED_PASSWORD;
- goto done;
- case '3':
- case '5':
- case '6':
- case '7':
- case '8':
- /* informational messages from userhelper -- don't care */
- /* trilobite_debug ("roothelper: info msg '%c'", buffer[0]); */
- discard_line (*pipe_stdout);
- continue;
- case '*':
- /* the winner! */
- discard_line (*pipe_stdout);
- err = TRILOBITE_ROOT_HELPER_SUCCESS;
- goto done;
- default:
- /* ?! */
- g_warning ("TrilobiteRootHelper: unknown userhelper result %02X", buffer[0]);
- err = TRILOBITE_ROOT_HELPER_INTERNAL_ERROR;
- goto give_up;
- }
- }
-
-give_up:
- close (*pipe_stdin);
- close (*pipe_stdout);
-
-done:
- return err;
-}
-
-static TrilobiteRootHelperStatus
-eazel_helper_password (int pipe_stdin, int pipe_stdout, const char *password)
-{
- char buffer[256];
- int bytes;
- TrilobiteRootHelperStatus err;
-
- /* clear out anything lingering in the input buffer */
- read (pipe_stdout, buffer, 256);
-
- /* send password followed by linefeed */
- memset (buffer, 0, 256);
- strncpy (buffer, password, 200);
- strcat (buffer, "\n");
- bytes = write (pipe_stdin, buffer, strlen(buffer));
-
- /* now check for response */
- while (1) {
- switch (buffer[0] = eazel_helper_response (pipe_stdout)) {
- case '\0':
- trilobite_debug ("roothelper: userhelper closed pipe");
- err = TRILOBITE_ROOT_HELPER_LOST_PIPE;
- goto give_up;
- case '2':
- trilobite_debug ("roothelper: bad password");
- err = TRILOBITE_ROOT_HELPER_BAD_PASSWORD;
- /* don't close the pipe, let them try again if they want */
- discard_line (pipe_stdout);
- goto done;
- case '3':
- case '5':
- case '6':
- case '7':
- case '8':
- /* useless info messages */
- trilobite_debug ("roothelper: info msg '%c'", buffer[0]);
- discard_line (pipe_stdout);
- continue;
- case '*':
- /* clear buffer */
- discard_line (pipe_stdout);
- err = TRILOBITE_ROOT_HELPER_SUCCESS;
- goto done;
- default:
- /* ?! */
- g_warning ("TrilobiteRootHelper: unknown userhelper 2nd result %02X", buffer[0]);
- err = TRILOBITE_ROOT_HELPER_INTERNAL_ERROR;
- goto give_up;
- }
- }
-
-give_up:
- close (pipe_stdin);
- close (pipe_stdout);
-
-done:
- return err;
-}
-
-
-/********** actual API functions to make the root helper work **********/
-
-
-/* returns ROOT_HELPER_STATUS_SUCCESS (0) on success */
-TrilobiteRootHelperStatus
-trilobite_root_helper_start (TrilobiteRootHelper *root_helper)
-{
- TrilobiteRootHelperStatus err;
- char *password;
- gboolean try_again;
- int child_pid;
-
- g_return_val_if_fail (root_helper != NULL, FALSE);
- g_return_val_if_fail (TRILOBITE_IS_ROOT_HELPER (root_helper), FALSE);
-
- password = NULL;
- if (root_helper->state == TRILOBITE_ROOT_HELPER_STATE_CONNECTED) {
- /* already connected, dude. */
- return TRILOBITE_ROOT_HELPER_SUCCESS;
- }
- if (root_helper->state == TRILOBITE_ROOT_HELPER_STATE_PIPE) {
- /* starting over from a previous operation */
- /* won't hurt to error on close, just don't want to leak fd's in case the
- * caller forgot to close stdout */
- close (root_helper->pipe_stdout);
- root_helper->pipe_stdin = root_helper->pipe_stdout = -1;
- root_helper->state = TRILOBITE_ROOT_HELPER_STATE_NEW;
- }
-
- while (1) {
- err = eazel_helper_start (&root_helper->pipe_stdin, &root_helper->pipe_stdout, &child_pid);
- switch (err) {
- case TRILOBITE_ROOT_HELPER_SUCCESS:
- /* already done -- nice! */
- goto connected;
- case TRILOBITE_ROOT_HELPER_NEED_PASSWORD:
- /* the expected case -- continue */
- break;
- default:
- /* anything else is an error */
- goto failed;
- }
-
- /* now emit a signal and get the password */
- trilobite_debug ("roothelper: asking for password");
- gtk_signal_emit (GTK_OBJECT (root_helper), root_helper_signals[NEED_PASSWORD], &password);
- if (password == NULL) {
- /* bummer. nobody caught the signal. */
- err = TRILOBITE_ROOT_HELPER_NEED_PASSWORD;
- goto failed;
- }
-
- err = eazel_helper_password (root_helper->pipe_stdin, root_helper->pipe_stdout, password);
- switch (err) {
- case TRILOBITE_ROOT_HELPER_SUCCESS:
- /* yeah! set! */
- goto connected;
- case TRILOBITE_ROOT_HELPER_BAD_PASSWORD:
- try_again = FALSE;
- gtk_signal_emit (GTK_OBJECT (root_helper), root_helper_signals[TRY_AGAIN], &try_again);
- if (! try_again) {
- trilobite_debug ("roothelper: not going to try again.");
- /* then we fail. */
- goto failed;
- } else {
- g_free (password);
- /* for some reason, userhelper will spaz out if we close stdin. */
- /* so we have this awful hack where we push stdin onto a stack to close in the
- * destructor. pathetic! :(
- */
- close (root_helper->pipe_stdout);
- root_helper->old_fd_list = g_list_append(root_helper->old_fd_list,
- GINT_TO_POINTER (root_helper->pipe_stdin));
- root_helper->pipe_stdin = root_helper->pipe_stdout = -1;
- }
- break;
- default:
- /* all else is error */
- goto failed;
- }
- }
-
-connected:
- g_free (password);
- root_helper->state = TRILOBITE_ROOT_HELPER_STATE_CONNECTED;
- root_helper->pid = child_pid;
- return TRILOBITE_ROOT_HELPER_SUCCESS;
-
-failed:
- g_free (password);
- close (root_helper->pipe_stdout);
- close (root_helper->pipe_stdin);
- root_helper->pipe_stdin = root_helper->pipe_stdout = -1;
- waitpid (child_pid, NULL, 0);
- root_helper->state = TRILOBITE_ROOT_HELPER_STATE_NEW;
- return err;
-}
-
-/* on an already-connected root helper, run rpm with the given arguments.
- * argv is a GList of (char *) containing the arguments
- * on success, returns an fd containing stdout/stderr from rpm.
- * on failure, returns -1.
- */
-static TrilobiteRootHelperStatus
-trilobite_root_helper_run_program (TrilobiteRootHelper *root_helper, const char *program, GList *argv, int *fd)
-{
- GList *item;
- char *p, *out;
- int len;
-
- /* any argument containing an unprintable is an immediate error */
- for (item = g_list_first (argv); item; item = g_list_next (item)) {
- if (item->data == NULL) {
- g_warning ("TrilobiteRootHelper: run %s: argument %d was (null)",
- program, g_list_position (argv, item));
- continue;
- }
- for (p = (char *)item->data; *p; p++) {
- if ((*p < ' ') || (*p == 127)) {
- g_warning ("TrilobiteRootHelper: run %s: argument %d contained an "
- "unprintable character: %02X",
- program, g_list_position (argv, item), *p);
- return TRILOBITE_ROOT_HELPER_BAD_ARGS;
- }
- }
- }
-
- out = g_strdup_printf ("%s %u\n", program, g_list_length (argv));
- len = strlen (out);
- if (write (root_helper->pipe_stdin, out, len) < len) {
- g_free (out);
- goto bail;
- }
- g_free (out);
-
- for (item = g_list_first (argv); item; item = g_list_next (item)) {
- len = strlen ((char *)item->data);
- if ((write (root_helper->pipe_stdin, (char *)item->data, len) < len) ||
- (write (root_helper->pipe_stdin, "\n", 1) < 1)) {
- trilobite_debug ("roothelper: eazel-helper closed pipe before i was done");
- goto bail;
- }
- }
-
- /* the service will probably call fdopen on this fd, so the pipe needs to be made
- * blocking, or else the buffered reads and writes will barf everywhere.
- */
- make_blocking (root_helper->pipe_stdout);
- *fd = root_helper->pipe_stdout;
- close (root_helper->pipe_stdin);
- root_helper->state = TRILOBITE_ROOT_HELPER_STATE_PIPE;
- return TRILOBITE_ROOT_HELPER_SUCCESS;
-
-bail:
- /* unable to write everything to the pipe */
- close (root_helper->pipe_stdin);
- close (root_helper->pipe_stdout);
- root_helper->state = TRILOBITE_ROOT_HELPER_STATE_NEW;
- return TRILOBITE_ROOT_HELPER_LOST_PIPE;
-}
-
-/* this is horrible. you should never set your time this way. use NTP. please. */
-/* ie, this is for demonstration purposes only. */
-static TrilobiteRootHelperStatus
-trilobite_root_helper_set_time (TrilobiteRootHelper *root_helper, GList *argv, int *fd)
-{
- GList *item;
- char *out;
- char ch;
- int len;
-
- if (fd) {
- *fd = -1;
- }
-
- item = g_list_first (argv);
- if (!item || g_list_next (argv)) {
- g_warning ("TrilobiteRootHelper: set time: needs exactly 1 arg");
- return TRILOBITE_ROOT_HELPER_BAD_ARGS;
- }
-
- out = g_strdup_printf ("set-time %s\n", (char *)item->data);
- len = strlen (out);
- if (write (root_helper->pipe_stdin, out, len) < len) {
- g_free (out);
- goto bail;
- }
- g_free (out);
-
- ch = eazel_helper_response (root_helper->pipe_stdout);
- if (ch != '*') {
- goto bail;
- }
-
- /* success, but pipe isn't needed anymore */
- close (root_helper->pipe_stdin);
- close (root_helper->pipe_stdout);
- root_helper->state = TRILOBITE_ROOT_HELPER_STATE_NEW;
- return TRILOBITE_ROOT_HELPER_SUCCESS;
-
-bail:
- /* unable to write anything to the pipe */
- close (root_helper->pipe_stdin);
- close (root_helper->pipe_stdout);
- root_helper->state = TRILOBITE_ROOT_HELPER_STATE_NEW;
- return TRILOBITE_ROOT_HELPER_LOST_PIPE;
-}
-
-
-TrilobiteRootHelperStatus
-trilobite_root_helper_run (TrilobiteRootHelper *root_helper, TrilobiteRootHelperCommand command, GList *argv, int *fd)
-{
- g_return_val_if_fail (root_helper != NULL, TRILOBITE_ROOT_HELPER_BAD_ARGS);
- /* g_return_val_if_fail (argv != NULL, TRILOBITE_ROOT_HELPER_BAD_ARGS); */
- g_return_val_if_fail (TRILOBITE_IS_ROOT_HELPER (root_helper), TRILOBITE_ROOT_HELPER_BAD_ARGS);
- g_return_val_if_fail (TRILOBITE_ROOT_HELPER_IS_CONNECTED (root_helper), TRILOBITE_ROOT_HELPER_BAD_ARGS);
-
- switch (command) {
- case TRILOBITE_ROOT_HELPER_RUN_RPM:
- return trilobite_root_helper_run_program (root_helper, "rpm", argv, fd);
- case TRILOBITE_ROOT_HELPER_RUN_START_MEDUSA:
- return trilobite_root_helper_run_program (root_helper, "start-medusa",
- NULL, fd);
- case TRILOBITE_ROOT_HELPER_RUN_SET_TIME:
- return trilobite_root_helper_set_time (root_helper, argv, fd);
- case TRILOBITE_ROOT_HELPER_RUN_LS:
- return trilobite_root_helper_run_program (root_helper, "ls", argv, fd);
- default:
- g_warning ("unknown TrilobiteRootHelper command: 0x%02X", command);
- return TRILOBITE_ROOT_HELPER_BAD_COMMAND;
- }
-}
-
-int
-trilobite_root_helper_get_exit_code (TrilobiteRootHelper *root_helper)
-{
- int status = 0;
-
- g_return_val_if_fail (root_helper != NULL, -1);
- g_return_val_if_fail (TRILOBITE_IS_ROOT_HELPER (root_helper), -1);
-
- if (root_helper->pid) {
- trilobite_debug (">>> waiting on pid %d", root_helper->pid);
- while ((waitpid (root_helper->pid, &status, 0) == -1) && (errno == EINTR))
- ;
- root_helper->pid = 0;
- trilobite_debug (">>> status = %d", status);
- if (WIFEXITED (status)) {
- root_helper->child_status = WEXITSTATUS (status);
- } else {
- root_helper->child_status = -1;
- }
- }
-
- trilobite_debug (">>> returning %d", root_helper->child_status);
- return root_helper->child_status;
-}
diff --git a/components/services/trilobite/libtrilobite/trilobite-root-helper.h b/components/services/trilobite/libtrilobite/trilobite-root-helper.h
deleted file mode 100644
index ffd0b523f..000000000
--- a/components/services/trilobite/libtrilobite/trilobite-root-helper.h
+++ /dev/null
@@ -1,116 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * GtkObject definition for TrilobiteRootHelper.
- *
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: Robey Pointer <robey@eazel.com>
- *
- */
-
-#ifndef _TRILOBITE_ROOT_HELPER_H_
-#define _TRILOBITE_ROOT_HELPER_H_
-
-/* #include <libgnome/gnome-defs.h> */
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-#define TRILOBITE_TYPE_ROOT_HELPER (trilobite_root_helper_get_type ())
-#define TRILOBITE_ROOT_HELPER(obj) (GTK_CHECK_CAST ((obj), TRILOBITE_TYPE_ROOT_HELPER, \
- TrilobiteRootHelper))
-#define TRILOBITE_ROOT_HELPER_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), TRILOBITE_TYPE_ROOT_HELPER, \
- TrilobiteRootHelperClass))
-#define TRILOBITE_IS_ROOT_HELPER(obj) (GTK_CHECK_TYPE ((obj), TRILOBITE_TYPE_ROOT_HELPER))
-#define TRILOBITE_IS_ROOT_HELPER_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), TRILOBITE_TYPE_ROOT_HELPER))
-
-typedef struct _TrilobiteRootHelper TrilobiteRootHelper;
-typedef struct _TrilobiteRootHelperClass TrilobiteRootHelperClass;
-
-/* used only internally */
-typedef enum {
- TRILOBITE_ROOT_HELPER_STATE_NEW = 0,
- TRILOBITE_ROOT_HELPER_STATE_CONNECTED,
- TRILOBITE_ROOT_HELPER_STATE_PIPE /* gave stdout pipe to caller */
-} TrilobiteRootHelperState;
-
-typedef enum {
- TRILOBITE_ROOT_HELPER_SUCCESS = 0,
- TRILOBITE_ROOT_HELPER_NO_USERHELPER, /* couldn't fork/exec the "userhelper" utility */
- TRILOBITE_ROOT_HELPER_NEED_PASSWORD, /* no signal handler supplied a root password */
- TRILOBITE_ROOT_HELPER_BAD_PASSWORD, /* password was supplied, but it was wrong */
- TRILOBITE_ROOT_HELPER_LOST_PIPE, /* "userhelper" pipe closed prematurely */
- TRILOBITE_ROOT_HELPER_BAD_ARGS, /* arguments to trilobite_root_helper_run() were bad */
- TRILOBITE_ROOT_HELPER_BAD_COMMAND, /* command unknown to TrilobiteRootHelper */
- TRILOBITE_ROOT_HELPER_INTERNAL_ERROR /* something weird went wrong */
-} TrilobiteRootHelperStatus;
-
-/* commands that can be sent to the root helper, once it's running */
-typedef enum {
- TRILOBITE_ROOT_HELPER_RUN_RPM = 1, /* argv: args to rpm -- fd: pipe from rpm */
- TRILOBITE_ROOT_HELPER_RUN_SET_TIME = 2, /* argv: list of 1 string containing a time_t -- fd: unused */
- TRILOBITE_ROOT_HELPER_RUN_START_MEDUSA = 3, /* No args */
- TRILOBITE_ROOT_HELPER_RUN_LS = 23 /* argv: args to ls -- fd: pipe from ls [DEMO] */
-} TrilobiteRootHelperCommand;
-
-struct _TrilobiteRootHelperClass
-{
- GtkObjectClass parent_class;
-
- gchar *(*need_password) (TrilobiteRootHelper *helper);
- gboolean (*try_again) (TrilobiteRootHelper *helper);
-};
-
-/*
- * the first time a password is needed, 'need_password' is emitted. it should return the root password.
- * if that password is wrong, 'try_again' will be emitted. if it returns true, 'need_password' will be
- * called again. the loop continues until the password is correct, or 'try_again' returns false.
- */
-
-struct _TrilobiteRootHelper
-{
- GtkObject parent;
- TrilobiteRootHelperState state;
- int pipe_stdin; /* pipe to/from the eazel-helper utility */
- int pipe_stdout;
- int pid;
- int child_status;
- GList *old_fd_list; /* part of hack to avoid userhelper bug: fd's to close later */
-};
-
-
-#define TRILOBITE_ROOT_HELPER_IS_CONNECTED(obj) (TRILOBITE_ROOT_HELPER (obj)->state == \
- TRILOBITE_ROOT_HELPER_STATE_CONNECTED)
-
-
-GtkType trilobite_root_helper_get_type (void);
-TrilobiteRootHelper *trilobite_root_helper_new (void);
-void trilobite_root_helper_destroy (GtkObject *object);
-
-TrilobiteRootHelperStatus trilobite_root_helper_start (TrilobiteRootHelper *root_helper);
-TrilobiteRootHelperStatus trilobite_root_helper_run (TrilobiteRootHelper *root_helper,
- TrilobiteRootHelperCommand command, GList *argv, int *fd);
-int trilobite_root_helper_get_exit_code (TrilobiteRootHelper *root_helper);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-
-#endif /* _TRILOBITE_ROOT_HELPER_H_ */
diff --git a/components/services/trilobite/libtrilobite/trilobite-service-passwordquery-private.h b/components/services/trilobite/libtrilobite/trilobite-service-passwordquery-private.h
deleted file mode 100644
index 0b30c9b15..000000000
--- a/components/services/trilobite/libtrilobite/trilobite-service-passwordquery-private.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: Eskil Heyn Olsen <eskil@eazel.com>
- *
- */
-
-#ifndef TRILOBITE_PASSWORDQUERY_PRIVATE_H
-#define TRILOBITE_PASSWORDQUERY_PRIVATE_H
-
-#include "trilobite-root-helper.h"
-
-struct _TrilobitePasswordQueryPrivate {
- gboolean destroyed;
- gboolean alive;
-
- char *prompt;
- TrilobiteRootHelper *root_helper;
- Trilobite_PasswordQueryClient client;
-};
-
-#endif /* TRILOBITE_PASSWORDQUERY_PRIVATE_H */
diff --git a/components/services/trilobite/libtrilobite/trilobite-service-passwordquery-public.h b/components/services/trilobite/libtrilobite/trilobite-service-passwordquery-public.h
deleted file mode 100644
index 31fcd0a6b..000000000
--- a/components/services/trilobite/libtrilobite/trilobite-service-passwordquery-public.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: Eskil Heyn Olsen <eskil@eazel.com>
- *
- */
-
-/* trilobite-service.h: Interface for objects representing
- the toplevel type for services ("trilobites").
- */
-
-#ifndef TRILOBITE_PASSWORDQUERY_H
-#define TRILOBITE_PASSWORDQUERY_H
-
-#include <libgnome/gnome-defs.h>
-#include <bonobo/bonobo-object.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-#define TRILOBITE_TYPE_PASSWORDQUERY (trilobite_passwordquery_get_type ())
-#define TRILOBITE_PASSWORDQUERY(obj) (GTK_CHECK_CAST ((obj), TRILOBITE_TYPE_PASSWORDQUERY, TrilobitePasswordQuery))
-#define TRILOBITE_PASSWORDQUERY_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), TRILOBITE_TYPE_PASSWORDQUERY, TrilobitePasswordQueryClass))
-#define TRILOBITE_IS_PASSWORDQUERY(obj) (GTK_CHECK_TYPE ((obj), TRILOBITE_TYPE_PASSWORDQUERY))
-#define TRILOBITE_IS_PASSWORDQUERY_CLASS(klass)(GTK_CHECK_CLASS_TYPE ((klass), TRILOBITE_TYPE_PASSWORDQUERY))
-
-typedef struct _TrilobitePasswordQuery TrilobitePasswordQuery;
-typedef struct _TrilobitePasswordQueryClass TrilobitePasswordQueryClass;
-
-struct _TrilobitePasswordQueryClass
-{
- BonoboObjectClass parent_class;
-
-
- gpointer servant_init;
- gpointer servant_fini;
- gpointer servant_vepv;
-};
-
-typedef struct _TrilobitePasswordQueryPrivate TrilobitePasswordQueryPrivate;
-
-struct _TrilobitePasswordQuery
-{
- BonoboObject parent;
- TrilobitePasswordQueryPrivate *private;
-};
-
-GtkType trilobite_passwordquery_get_type (void);
-gboolean trilobite_passwordquery_construct (TrilobitePasswordQuery *trilobite,
- Trilobite_PasswordQuery corba_trilobite);
-TrilobitePasswordQuery* trilobite_passwordquery_new (void);
-POA_Trilobite_PasswordQuery__epv* trilobite_passwordquery_get_epv (void);
-void trilobite_passwordquery_destroy (GtkObject *object);
-
-/* This should be called from the service factory.
- It adds the interface and sets the following data :
- "trilobite-root-helper" - a TrilobiteRootHelper object, do not destroy */
-void trilobite_passwordquery_add_interface (TrilobitePasswordQuery *trilobite,
- BonoboObject *service);
-
-/* Sets the prompt */
-void trilobite_passwordquery_set_prompt (TrilobitePasswordQuery *trilobite,
- const char *prompt);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* TRILOBITE_PASSWORDQUERY_H */
diff --git a/components/services/trilobite/libtrilobite/trilobite-service-passwordquery.c b/components/services/trilobite/libtrilobite/trilobite-service-passwordquery.c
deleted file mode 100644
index 881aae2ff..000000000
--- a/components/services/trilobite/libtrilobite/trilobite-service-passwordquery.c
+++ /dev/null
@@ -1,373 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: Eskil Heyn Olsen <eskil@eazel.com>
- *
- */
-
-/* trilobite-service.c: Implementation for the toplevel
- interface for trilobite objects */
-
-#include <config.h>
-#include <bonobo.h>
-
-#include "trilobite-service.h"
-#include "trilobite-service-passwordquery-public.h"
-#include "trilobite-service-passwordquery-private.h"
-
-
-enum {
- ARG_0,
- ARG_PROMPT
-};
-
-enum {
- LAST_SIGNAL
-};
-
-static char* trilobite_passwordquery_get_password (TrilobiteRootHelper *roothelper,
- TrilobitePasswordQuery *trilobite);
-static gboolean trilobite_passwordquery_try_again (TrilobiteRootHelper *roothelper,
- TrilobitePasswordQuery *trilobite);
-
-/* static guint trilobite_passwordquery_signals[LAST_SIGNAL] = { 0 }; */
-
-static BonoboObjectClass *trilobite_passwordquery_parent_class;
-
-/*****************************************
- Corba stuff
-*****************************************/
-
-static PortableServer_ServantBase__epv base_epv = { NULL, NULL, NULL };
-
-typedef struct {
- POA_Trilobite_PasswordQuery servant;
- BonoboObject *bonobo_object;
-} impl_POA_Trilobite_PasswordQuery;
-
-static void
-impl_Trilobite_PasswordQuery_set_query_client(impl_POA_Trilobite_PasswordQuery *service,
- const Trilobite_PasswordQueryClient client,
- CORBA_Environment * ev)
-{
- TrilobitePasswordQuery *trilobite;
-
- trilobite = TRILOBITE_PASSWORDQUERY (service->bonobo_object);
- if (trilobite->private->client != CORBA_OBJECT_NIL) {
- CORBA_Object_release (trilobite->private->client, ev);
- }
- trilobite->private->client = CORBA_Object_duplicate (client, ev);
-}
-
-
-POA_Trilobite_PasswordQuery__epv*
-trilobite_passwordquery_get_epv(void)
-{
- POA_Trilobite_PasswordQuery__epv *epv;
-
- epv = g_new0 (POA_Trilobite_PasswordQuery__epv, 1);
-
- epv->set_query_client = (gpointer)&impl_Trilobite_PasswordQuery_set_query_client;
-
- return epv;
-};
-
-/*****************************************
- GTK+ object stuff
-*****************************************/
-
-void
-trilobite_passwordquery_destroy (GtkObject *object)
-{
- TrilobitePasswordQuery *trilobite;
- CORBA_Environment ev;
- /* g_message ("in trilobite_passwordquery_destroy"); */
-
- CORBA_exception_init (&ev);
- g_return_if_fail (object != NULL);
- g_return_if_fail (TRILOBITE_IS_PASSWORDQUERY (object));
-
- trilobite = TRILOBITE_PASSWORDQUERY (object);
-
- if (trilobite->private != NULL) {
- trilobite_root_helper_destroy (GTK_OBJECT (trilobite->private->root_helper));
- g_free (trilobite->private->prompt);
- if (trilobite->private->client != CORBA_OBJECT_NIL) {
- CORBA_Object_release (trilobite->private->client, &ev);
- }
- g_free (trilobite->private);
- }
-
- CORBA_exception_free (&ev);
-
- if (GTK_OBJECT_CLASS (trilobite_passwordquery_parent_class)->destroy) {
- /* g_message ("calling trilobite-passwordquery-parent->destroy ()"); */
- GTK_OBJECT_CLASS (trilobite_passwordquery_parent_class)->destroy (object);
- }
-}
-
-static void
-trilobite_passwordquery_set_arg (GtkObject *object,
- GtkArg *arg,
- guint arg_id)
-{
- TrilobitePasswordQuery *trilobite;
-
- g_assert (object != NULL);
- g_assert (TRILOBITE_IS_PASSWORDQUERY (object));
-
- trilobite = TRILOBITE_PASSWORDQUERY (object);
-
- switch (arg_id) {
- case ARG_PROMPT:
- trilobite_passwordquery_set_prompt (trilobite, (char*)GTK_VALUE_OBJECT (*arg));
- break;
-
- }
-}
-
-static void
-trilobite_passwordquery_class_initialize (TrilobitePasswordQueryClass *klass)
-{
- GtkObjectClass *object_class;
-
- /* g_message ("in trilobite_passwordquery_class_initialize"); */
-
- object_class = (GtkObjectClass*) klass;
- object_class->destroy = (void(*)(GtkObject*))trilobite_passwordquery_destroy;
- object_class->set_arg = trilobite_passwordquery_set_arg;
-
- trilobite_passwordquery_parent_class = gtk_type_class (bonobo_object_get_type ());
-
- klass->servant_init = POA_Trilobite_PasswordQuery__init;
- klass->servant_fini = POA_Trilobite_PasswordQuery__fini;
-
- klass->servant_vepv = g_new0 (POA_Trilobite_PasswordQuery__vepv,1);
- ((POA_Trilobite_PasswordQuery__vepv*)klass->servant_vepv)->_base_epv = &base_epv;
- ((POA_Trilobite_PasswordQuery__vepv*)klass->servant_vepv)->Bonobo_Unknown_epv = bonobo_object_get_epv ();
- ((POA_Trilobite_PasswordQuery__vepv*)klass->servant_vepv)->Trilobite_PasswordQuery_epv = trilobite_passwordquery_get_epv ();
-
- gtk_object_add_arg_type ("TrilobitePasswordQuery::prompt",
- GTK_TYPE_POINTER,
- GTK_ARG_READWRITE | GTK_ARG_CONSTRUCT | GTK_ARG_CONSTRUCT_ONLY,
- ARG_PROMPT);
-
-};
-
-gboolean
-trilobite_passwordquery_construct (TrilobitePasswordQuery *trilobite,
- Trilobite_PasswordQuery corba_trilobite)
-{
- g_assert (trilobite != NULL);
- g_assert (TRILOBITE_IS_PASSWORDQUERY (trilobite));
- g_return_val_if_fail (corba_trilobite != CORBA_OBJECT_NIL, FALSE);
-
- if (!bonobo_object_construct (BONOBO_OBJECT (trilobite), (CORBA_Object) corba_trilobite)) {
- return FALSE;
- }
-
- return TRUE;
-}
-
-static Trilobite_PasswordQuery
-trilobite_passwordquery_create_corba_object (BonoboObject *trilobite)
-{
- impl_POA_Trilobite_PasswordQuery *servant;
- void (*servant_init) (PortableServer_Servant servant, CORBA_Environment *ev);
- CORBA_Environment ev;
-
- /* g_message ("in trilobite_passwordquery_create_corba_object"); */
-
- g_assert (trilobite != NULL);
-
- CORBA_exception_init(&ev);
-
- servant = (impl_POA_Trilobite_PasswordQuery*) g_new0 (BonoboObjectServant, 1);
- ((POA_Trilobite_PasswordQuery*) servant)->vepv = TRILOBITE_PASSWORDQUERY_CLASS ( GTK_OBJECT (trilobite)->klass)->servant_vepv;
- servant->bonobo_object = trilobite;
-
- servant_init = TRILOBITE_PASSWORDQUERY_CLASS ( GTK_OBJECT (trilobite)->klass)->servant_init;
- servant_init ((PortableServer_Servant)servant, &ev);
- ORBIT_OBJECT_KEY (((POA_Trilobite_PasswordQuery*) servant)->_private)->object = NULL;
-
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_warning ("Cannot instantiate Trilobite_PasswordQuery corba object");
- g_free (servant);
- CORBA_exception_free (&ev);
- return CORBA_OBJECT_NIL;
- }
-
- CORBA_exception_free (&ev);
-
- return (Trilobite_PasswordQuery) bonobo_object_activate_servant (trilobite, servant);
-}
-
-static void
-trilobite_passwordquery_initialize (TrilobitePasswordQuery *trilobite)
-{
- Trilobite_PasswordQuery corba_trilobite;
-
- /* g_message ("in trilobite_passwordquery_initialize"); */
-
- g_return_if_fail (trilobite != NULL);
- g_return_if_fail (TRILOBITE_IS_PASSWORDQUERY (trilobite));
-
- corba_trilobite = trilobite_passwordquery_create_corba_object (BONOBO_OBJECT (trilobite));
-
- if (!trilobite_passwordquery_construct (trilobite, corba_trilobite)) {
- trilobite_passwordquery_destroy (GTK_OBJECT (trilobite));
- trilobite = NULL;
- }
-
- trilobite->private = g_new0 (TrilobitePasswordQueryPrivate,1);
-
- trilobite->private->destroyed = FALSE;
- trilobite->private->alive = TRUE;
- trilobite->private->client = CORBA_OBJECT_NIL;
- trilobite->private->prompt = g_strdup ("");
-
- trilobite->private->root_helper = trilobite_root_helper_new ();
- gtk_signal_connect (GTK_OBJECT (trilobite->private->root_helper),
- "need_password",
- (GFunc)trilobite_passwordquery_get_password,
- trilobite);
- gtk_signal_connect (GTK_OBJECT (trilobite->private->root_helper),
- "try_again",
- (GFunc)trilobite_passwordquery_try_again,
- trilobite);
-}
-
-GtkType
-trilobite_passwordquery_get_type (void)
-{
- static GtkType trilobite_passwordquery_type = 0;
-
- /* g_message ("into trilobite_passwordquery_get_type"); */
-
- /* First time it's called ? */
- if (!trilobite_passwordquery_type)
- {
- static const GtkTypeInfo trilobite_passwordquery_info =
- {
- "TrilobitePasswordQuery",
- sizeof (TrilobitePasswordQuery),
- sizeof (TrilobitePasswordQueryClass),
- (GtkClassInitFunc) trilobite_passwordquery_class_initialize,
- (GtkObjectInitFunc) trilobite_passwordquery_initialize,
- /* reserved_1 */ NULL,
- /* reserved_2 */ NULL,
- (GtkClassInitFunc) NULL,
- };
-
- /* Get a unique GtkType */
- trilobite_passwordquery_type = gtk_type_unique (bonobo_object_get_type (), &trilobite_passwordquery_info);
- }
-
- return trilobite_passwordquery_type;
-}
-
-TrilobitePasswordQuery *
-trilobite_passwordquery_new (void)
-{
- TrilobitePasswordQuery *trilobite;
-
- /* g_message ("in trilobite_passwordquery_new"); */
-
- trilobite = TRILOBITE_PASSWORDQUERY (gtk_object_new (TRILOBITE_TYPE_PASSWORDQUERY, NULL));
-
- if (trilobite == NULL) {
- g_warning ("Could not create a TrilobitePasswordQuery*");
- }
-
- trilobite_passwordquery_initialize (trilobite);
-
- return trilobite;
-}
-
-void trilobite_passwordquery_add_interface (TrilobitePasswordQuery *trilobite,
- BonoboObject *service)
-{
- g_assert (trilobite!=NULL);
- g_assert (TRILOBITE_IS_PASSWORDQUERY (trilobite));
- g_assert (service!=NULL);
- g_assert (BONOBO_IS_OBJECT (service));
-
- gtk_object_set_data (GTK_OBJECT (service), "trilobite-root-helper", trilobite->private->root_helper);
-
- bonobo_object_add_interface (BONOBO_OBJECT (trilobite), service);
-}
-
-static char*
-trilobite_passwordquery_get_password (TrilobiteRootHelper *roothelper,
- TrilobitePasswordQuery *trilobite)
-{
- if (trilobite->private->client == CORBA_OBJECT_NIL) {
- /* you lose. */
- return NULL;
- } else {
- CORBA_Environment ev;
- CORBA_char *tmp;
-
- CORBA_exception_init (&ev);
- tmp = Trilobite_PasswordQueryClient_get_password (trilobite->private->client,
- trilobite->private->prompt,
- &ev);
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_warning ("Error during query of password from client: %s",
- CORBA_exception_id (&ev));
- }
- CORBA_exception_free (&ev);
-
- return g_strdup (tmp);
- }
-}
-
-static gboolean
-trilobite_passwordquery_try_again (TrilobiteRootHelper *roothelper,
- TrilobitePasswordQuery *trilobite)
-{
- if (trilobite->private->client == CORBA_OBJECT_NIL) {
- /* you lose. */
- return FALSE;
- } else {
- CORBA_Environment ev;
- CORBA_boolean result;
-
- CORBA_exception_init (&ev);
- result = Trilobite_PasswordQueryClient_try_again (trilobite->private->client, &ev);
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_warning ("Error during query of try-again from client: %s",
- CORBA_exception_id (&ev));
- }
- CORBA_exception_free (&ev);
-
- return (gboolean)result;
- }
-}
-
-/* Sets the prompt */
-void
-trilobite_passwordquery_set_prompt (TrilobitePasswordQuery *trilobite,
- const char *prompt)
-{
- if (trilobite->private->prompt != NULL) {
- g_free (trilobite->private->prompt);
- }
- trilobite->private->prompt = g_strdup (prompt);
-}
diff --git a/components/services/trilobite/libtrilobite/trilobite-service-private.h b/components/services/trilobite/libtrilobite/trilobite-service-private.h
deleted file mode 100644
index 2f5ef7ea3..000000000
--- a/components/services/trilobite/libtrilobite/trilobite-service-private.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: Eskil Heyn Olsen <eskil@eazel.com>
- *
- */
-
-/* trilobite-service-private.h: The private parts of
- a trilobite (I shit you not) */
-
-#ifndef TRILOBITE_SERVICE_PRIVATE_H
-#define TRILOBITE_SERVICE_PRIVATE_H
-
-struct _TrilobiteServicePrivate {
- gboolean destroyed;
- gboolean alive;
-
- char *service_name;
- char *service_version;
- char *service_vendor_name;
- char *service_vendor_url;
- char *service_url;
- char *service_icon;
-
-};
-
-#endif /* TRILOBITE_SERVICE_PRIVATE_H */
diff --git a/components/services/trilobite/libtrilobite/trilobite-service-public.h b/components/services/trilobite/libtrilobite/trilobite-service-public.h
deleted file mode 100644
index be9e82c0f..000000000
--- a/components/services/trilobite/libtrilobite/trilobite-service-public.h
+++ /dev/null
@@ -1,107 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: Eskil Heyn Olsen <eskil@eazel.com>
- *
- */
-
-/* trilobite-service.h: Interface for objects representing
- the toplevel type for services ("trilobites").
- */
-
-#ifndef TRILOBITE_SERVICE_H
-#define TRILOBITE_SERVICE_H
-
-#include <libgnome/gnome-defs.h>
-#include <bonobo/bonobo-object.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-#define TRILOBITE_TYPE_SERVICE (trilobite_service_get_type ())
-#define TRILOBITE_SERVICE(obj) (GTK_CHECK_CAST ((obj), TRILOBITE_TYPE_SERVICE, TrilobiteService))
-#define TRILOBITE_SERVICE_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), TRILOBITE_TYPE_SERVICE, TrilobiteServiceClass))
-#define TRILOBITE_IS_SERVICE(obj) (GTK_CHECK_TYPE ((obj), TRILOBITE_TYPE_SERVICE))
-#define TRILOBITE_IS_SERVICE_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), TRILOBITE_TYPE_SERVICE))
-
-typedef struct _TrilobiteService TrilobiteService;
-typedef struct _TrilobiteServiceClass TrilobiteServiceClass;
-
-struct _TrilobiteServiceClass
-{
- BonoboObjectClass parent_class;
-
- char* (*get_name) (TrilobiteService *trilobite);
- char* (*get_version) (TrilobiteService *trilobite);
- char* (*get_vendor_name) (TrilobiteService *trilobite);
- char* (*get_vendor_url) (TrilobiteService *trilobite);
- char* (*get_url) (TrilobiteService *trilobite);
- char* (*get_icon) (TrilobiteService *trilobite);
-
- void (*set_name) (TrilobiteService *trilobite, const char *value);
- void (*set_version) (TrilobiteService *trilobite, const char *value);
- void (*set_vendor_name) (TrilobiteService *trilobite, const char *value);
- void (*set_vendor_url) (TrilobiteService *trilobite, const char *value);
- void (*set_url) (TrilobiteService *trilobite, const char *value);
- void (*set_icon) (TrilobiteService *trilobite, const char *value);
-
- gpointer servant_init;
- gpointer servant_fini;
- gpointer servant_vepv;
-};
-
-typedef struct _TrilobiteServicePrivate TrilobiteServicePrivate;
-
-struct _TrilobiteService
-{
- BonoboObject parent;
- TrilobiteServicePrivate *private;
-};
-
-GtkType trilobite_service_get_type (void);
-gboolean trilobite_service_construct (TrilobiteService *trilobite, Trilobite_Service corba_trilobite);
-TrilobiteService* trilobite_service_new (void);
-POA_Trilobite_Service__epv* trilobite_service_get_epv (void);
-void trilobite_service_destroy (GtkObject *object);
-
-/* This should be called from the service factory.
- It adds the interface and any data that you might need access to */
-void trilobite_service_add_interface (TrilobiteService *trilobite,
- BonoboObject *service);
-
-char* trilobite_service_get_name (TrilobiteService *trilobite);
-char* trilobite_service_get_version (TrilobiteService *trilobite);
-char* trilobite_service_get_vendor_name (TrilobiteService *trilobite);
-char* trilobite_service_get_vendor_url (TrilobiteService *trilobite);
-char* trilobite_service_get_url (TrilobiteService *trilobite);
-char* trilobite_service_get_icon (TrilobiteService *trilobite);
-
-void trilobite_service_set_name (TrilobiteService *trilobite, const char *value);
-void trilobite_service_set_version (TrilobiteService *trilobite, const char *value);
-void trilobite_service_set_vendor_name (TrilobiteService *trilobite, const char *value);
-void trilobite_service_set_vendor_url (TrilobiteService *trilobite, const char *value);
-void trilobite_service_set_url (TrilobiteService *trilobite, const char *value);
-void trilobite_service_set_icon (TrilobiteService *trilobite, const char *value);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* TRILOBITE_SERVICE_H */
diff --git a/components/services/trilobite/libtrilobite/trilobite-service.c b/components/services/trilobite/libtrilobite/trilobite-service.c
deleted file mode 100644
index fa2b20821..000000000
--- a/components/services/trilobite/libtrilobite/trilobite-service.c
+++ /dev/null
@@ -1,635 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: Eskil Heyn Olsen <eskil@eazel.com>
- *
- */
-
-/* trilobite-service.c: Implementation for the toplevel
- interface for trilobite objects */
-
-#include <config.h>
-#include <bonobo.h>
-
-#include "trilobite-service.h"
-#include "trilobite-service-public.h"
-#include "trilobite-service-private.h"
-
-/*
- These are enums used for the signals binding.
- LAST_SIGNAL indicates the end.
-*/
-enum {
- GET_NAME,
- GET_VERSION,
- GET_VENDOR_NAME,
- GET_VENDOR_URL,
- GET_URL,
- GET_ICON,
- LAST_SIGNAL
-};
-
-enum {
- ARG_0,
- ARG_NAME,
- ARG_VERSION,
- ARG_VENDOR_NAME,
- ARG_VENDOR_URL,
- ARG_URL,
- ARG_ICON
-};
-
-/* The signal array and prototypes for default handlers */
-
-static guint trilobite_service_signals[LAST_SIGNAL] = { 0 };
-
-static BonoboObjectClass *trilobite_service_parent_class;
-
-/*****************************************
- Corba stuff
-*****************************************/
-
-static PortableServer_ServantBase__epv base_epv = { NULL, NULL, NULL };
-
-typedef struct {
- POA_Trilobite_Service servant;
- BonoboObject *bonobo_object;
-} impl_POA_Trilobite_Service;
-
-static CORBA_char*
-impl_Trilobite_Service_get_name(impl_POA_Trilobite_Service *trilobite,
- CORBA_Environment *ev)
-{
- char *result;
-
- /* g_message ("in impl_Trilobite_Service_get_name"); */
- gtk_signal_emit (GTK_OBJECT (trilobite->bonobo_object), trilobite_service_signals[GET_NAME], &result);
- return CORBA_string_dup (result);
-};
-
-static CORBA_char*
-impl_Trilobite_Service_get_version(impl_POA_Trilobite_Service *trilobite,
- CORBA_Environment *ev)
-{
- char *result;
-
- /* g_message ("in impl_Trilobite_Service_get_version"); */
- gtk_signal_emit (GTK_OBJECT (trilobite->bonobo_object), trilobite_service_signals[GET_VERSION], &result);
- return CORBA_string_dup (result);
-};
-
-static CORBA_char*
-impl_Trilobite_Service_get_vendor_name(impl_POA_Trilobite_Service *trilobite,
- CORBA_Environment *ev)
-{
- char *result;
-
- /* g_message ("in impl_Trilobite_Service_get_vendor_name"); */
- gtk_signal_emit (GTK_OBJECT (trilobite->bonobo_object), trilobite_service_signals[GET_VENDOR_NAME], &result);
- return CORBA_string_dup (result);
-};
-
-static CORBA_char*
-impl_Trilobite_Service_get_vendor_url(impl_POA_Trilobite_Service *trilobite,
- CORBA_Environment *ev)
-{
- char *result;
-
- /* g_message ("in impl_Trilobite_Service_get_vendor_url"); */
- gtk_signal_emit (GTK_OBJECT (trilobite->bonobo_object), trilobite_service_signals[GET_VENDOR_URL], &result);
- return CORBA_string_dup (result);
-};
-
-static CORBA_char*
-impl_Trilobite_Service_get_url(impl_POA_Trilobite_Service *trilobite,
- CORBA_Environment *ev)
-{
- char *result;
-
- /* g_message ("in impl_Trilobite_Service_get_url"); */
- gtk_signal_emit (GTK_OBJECT (trilobite->bonobo_object), trilobite_service_signals[GET_URL], &result);
- return CORBA_string_dup (result);
-};
-
-static CORBA_char*
-impl_Trilobite_Service_get_icon(impl_POA_Trilobite_Service *trilobite,
- CORBA_Environment *ev)
-{
- char *result;
-
- /* g_message ("in impl_Trilobite_Service_get_icon"); */
- gtk_signal_emit (GTK_OBJECT (trilobite->bonobo_object), trilobite_service_signals[GET_ICON], &result);
- return CORBA_string_dup (result);
-};
-
-POA_Trilobite_Service__epv*
-trilobite_service_get_epv(void)
-{
- POA_Trilobite_Service__epv *epv;
-
- epv = g_new0 (POA_Trilobite_Service__epv, 1);
-
- epv->get_name = (gpointer) &impl_Trilobite_Service_get_name,
- epv->get_version = (gpointer) &impl_Trilobite_Service_get_version;
- epv->get_vendor_name = (gpointer) &impl_Trilobite_Service_get_vendor_name;
- epv->get_vendor_url = (gpointer) &impl_Trilobite_Service_get_vendor_url;
- epv->get_url = (gpointer) &impl_Trilobite_Service_get_url;
- epv->get_icon = (gpointer) &impl_Trilobite_Service_get_icon;
-
- return epv;
-};
-
-/*****************************************
- The marshallers
-*****************************************/
-
-typedef gpointer (*GtkSignal_POINTER__NONE) (GtkObject * object,
- gpointer user_data);
-static void
-gtk_marshal_POINTER__NONE (GtkObject * object,
- GtkSignalFunc func,
- gpointer func_data,
- GtkArg * args)
-{
- GtkSignal_POINTER__NONE rfunc;
- gpointer *return_val;
- return_val = GTK_RETLOC_POINTER (args[0]);
- rfunc = (GtkSignal_POINTER__NONE) func;
- *return_val = (*rfunc) (object,
- func_data);
-}
-
-/*****************************************
- GTK+ object stuff
-*****************************************/
-
-void
-trilobite_service_destroy (GtkObject *object)
-{
- TrilobiteService *trilobite;
- /* g_message ("in trilobite_service_destroy"); */
-
- g_return_if_fail (object != NULL);
- g_return_if_fail (TRILOBITE_IS_SERVICE (object));
-
- trilobite = TRILOBITE_SERVICE (object);
-
- if (trilobite->private != NULL) {
- g_free (trilobite->private->service_name);
- g_free (trilobite->private->service_version);
- g_free (trilobite->private->service_vendor_name);
- g_free (trilobite->private->service_vendor_url);
- g_free (trilobite->private->service_url);
- g_free (trilobite->private->service_icon);
- g_free (trilobite->private);
- }
-
- if (GTK_OBJECT_CLASS (trilobite_service_parent_class)->destroy) {
- /* g_message ("calling trilobite-service-parent->destroy ()"); */
- GTK_OBJECT_CLASS (trilobite_service_parent_class)->destroy (object);
- }
-}
-
-static void
-trilobite_service_set_arg (GtkObject *object,
- GtkArg *arg,
- guint arg_id)
-{
- TrilobiteService *trilobite;
-
- g_assert (object != NULL);
- g_assert (TRILOBITE_IS_SERVICE (object));
-
- trilobite = TRILOBITE_SERVICE (object);
-
- switch (arg_id) {
- case ARG_NAME:
- trilobite_service_set_name (trilobite, (char*)GTK_VALUE_OBJECT(*arg));
- break;
- case ARG_VERSION:
- trilobite_service_set_version (trilobite, (char*)GTK_VALUE_OBJECT(*arg));
- break;
- case ARG_VENDOR_NAME:
- trilobite_service_set_vendor_name (trilobite, (char*)GTK_VALUE_OBJECT(*arg));
- break;
- case ARG_VENDOR_URL:
- trilobite_service_set_vendor_url (trilobite, (char*)GTK_VALUE_OBJECT(*arg));
- break;
- case ARG_URL:
- trilobite_service_set_url (trilobite, (char*)GTK_VALUE_OBJECT(*arg));
- break;
- case ARG_ICON:
- trilobite_service_set_icon (trilobite, (char*)GTK_VALUE_OBJECT(*arg));
- break;
- }
-}
-
-static void
-trilobite_service_class_initialize (TrilobiteServiceClass *klass)
-{
- GtkObjectClass *object_class;
-
- /* g_message ("in trilobite_service_class_initialize"); */
-
- object_class = (GtkObjectClass*) klass;
- object_class->destroy = (void(*)(GtkObject*))trilobite_service_destroy;
- object_class->set_arg = trilobite_service_set_arg;
-
- trilobite_service_parent_class = gtk_type_class (bonobo_object_get_type ());
-
- klass->servant_init = POA_Trilobite_Service__init;
- klass->servant_fini = POA_Trilobite_Service__fini;
-
- klass->servant_vepv = g_new0 (POA_Trilobite_Service__vepv,1);
- ((POA_Trilobite_Service__vepv*)klass->servant_vepv)->_base_epv = &base_epv;
- ((POA_Trilobite_Service__vepv*)klass->servant_vepv)->Bonobo_Unknown_epv = bonobo_object_get_epv ();
- ((POA_Trilobite_Service__vepv*)klass->servant_vepv)->Trilobite_Service_epv = trilobite_service_get_epv ();
-
- trilobite_service_signals[GET_NAME] =
- gtk_signal_new ("get_name",
- GTK_RUN_LAST,
- object_class->type,
- GTK_SIGNAL_OFFSET (TrilobiteServiceClass,get_name),
- gtk_marshal_POINTER__NONE,
- GTK_TYPE_POINTER,0);
- trilobite_service_signals[GET_VERSION] =
- gtk_signal_new ("get_version",
- GTK_RUN_LAST,
- object_class->type,
- GTK_SIGNAL_OFFSET (TrilobiteServiceClass,get_version),
- gtk_marshal_POINTER__NONE,
- GTK_TYPE_POINTER,0);
- trilobite_service_signals[GET_VENDOR_NAME] =
- gtk_signal_new ("get_vendor_name",
- GTK_RUN_LAST,
- object_class->type,
- GTK_SIGNAL_OFFSET (TrilobiteServiceClass,get_vendor_name),
- gtk_marshal_POINTER__NONE,
- GTK_TYPE_POINTER,0);
- trilobite_service_signals[GET_VENDOR_URL] =
- gtk_signal_new ("get_vendor_url",
- GTK_RUN_LAST,
- object_class->type,
- GTK_SIGNAL_OFFSET (TrilobiteServiceClass,get_vendor_url),
- gtk_marshal_POINTER__NONE,
- GTK_TYPE_POINTER,0);
- trilobite_service_signals[GET_URL] =
- gtk_signal_new ("get_url",
- GTK_RUN_LAST,
- object_class->type,
- GTK_SIGNAL_OFFSET (TrilobiteServiceClass,get_url),
- gtk_marshal_POINTER__NONE,
- GTK_TYPE_POINTER,0);
- trilobite_service_signals[GET_ICON] =
- gtk_signal_new ("get_icon",
- GTK_RUN_LAST,
- object_class->type,
- GTK_SIGNAL_OFFSET (TrilobiteServiceClass,get_icon),
- gtk_marshal_POINTER__NONE,
- GTK_TYPE_POINTER,0);
-
- gtk_object_class_add_signals (object_class, trilobite_service_signals,LAST_SIGNAL);
-
- gtk_object_add_arg_type ("TrilobiteService::name",
- GTK_TYPE_POINTER,
- GTK_ARG_READWRITE | GTK_ARG_CONSTRUCT | GTK_ARG_CONSTRUCT_ONLY,
- ARG_NAME);
- gtk_object_add_arg_type ("TrilobiteService::version",
- GTK_TYPE_POINTER,
- GTK_ARG_WRITABLE | GTK_ARG_CONSTRUCT_ONLY,
- ARG_VERSION);
- gtk_object_add_arg_type ("TrilobiteService::vendor_name",
- GTK_TYPE_POINTER,
- GTK_ARG_WRITABLE | GTK_ARG_CONSTRUCT_ONLY,
- ARG_VENDOR_NAME);
- gtk_object_add_arg_type ("TrilobiteService::vendor_url",
- GTK_TYPE_POINTER,
- GTK_ARG_WRITABLE | GTK_ARG_CONSTRUCT_ONLY,
- ARG_VENDOR_URL);
- gtk_object_add_arg_type ("TrilobiteService::url",
- GTK_TYPE_POINTER,
- GTK_ARG_WRITABLE | GTK_ARG_CONSTRUCT_ONLY,
- ARG_URL);
- gtk_object_add_arg_type ("TrilobiteService::icon",
- GTK_TYPE_POINTER,
- GTK_ARG_WRITABLE | GTK_ARG_CONSTRUCT_ONLY,
- ARG_ICON);
-
- klass->get_name = trilobite_service_get_name;
- klass->get_version = trilobite_service_get_version;
- klass->get_vendor_name = trilobite_service_get_vendor_name;
- klass->get_vendor_url = trilobite_service_get_vendor_url;
- klass->get_url = trilobite_service_get_url;
- klass->get_icon = trilobite_service_get_icon;
-
- klass->set_name = trilobite_service_set_name;
- klass->set_version = trilobite_service_set_version;
- klass->set_vendor_name = trilobite_service_set_vendor_name;
- klass->set_vendor_url = trilobite_service_set_vendor_url;
- klass->set_url = trilobite_service_set_url;
- klass->set_icon = trilobite_service_set_icon;
-};
-
-void
-trilobite_service_add_interface (TrilobiteService *trilobite,
- BonoboObject *service)
-{
- g_assert (trilobite!=NULL);
- g_assert (TRILOBITE_IS_SERVICE (trilobite));
- g_assert (service!=NULL);
- g_assert (BONOBO_IS_OBJECT (service));
-
- bonobo_object_add_interface (BONOBO_OBJECT (trilobite), service);
-}
-
-
-gboolean
-trilobite_service_construct (TrilobiteService *trilobite,
- Trilobite_Service corba_trilobite)
-{
- g_assert (trilobite != NULL);
- g_assert (TRILOBITE_IS_SERVICE (trilobite));
- g_return_val_if_fail (corba_trilobite != CORBA_OBJECT_NIL, FALSE);
-
- if (!bonobo_object_construct (BONOBO_OBJECT (trilobite), (CORBA_Object) corba_trilobite)) {
- return FALSE;
- }
-
- return TRUE;
-}
-
-static Trilobite_Service
-trilobite_service_create_corba_object (BonoboObject *trilobite)
-{
- impl_POA_Trilobite_Service *servant;
- void (*servant_init) (PortableServer_Servant servant, CORBA_Environment *ev);
- CORBA_Environment ev;
-
- /* g_message ("in trilobite_service_create_corba_object"); */
-
- g_assert (trilobite != NULL);
-
- CORBA_exception_init(&ev);
-
- servant = (impl_POA_Trilobite_Service*) g_new0 (BonoboObjectServant, 1);
- ((POA_Trilobite_Service*) servant)->vepv = TRILOBITE_SERVICE_CLASS ( GTK_OBJECT (trilobite)->klass)->servant_vepv;
- servant->bonobo_object = trilobite;
-
- servant_init = TRILOBITE_SERVICE_CLASS ( GTK_OBJECT (trilobite)->klass)->servant_init;
- servant_init ((PortableServer_Servant)servant, &ev);
- ORBIT_OBJECT_KEY (((POA_Trilobite_Service*) servant)->_private)->object = NULL;
-
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_warning ("Cannot instantiate Trilobite_Service corba object");
- g_free (servant);
- CORBA_exception_free (&ev);
- return CORBA_OBJECT_NIL;
- }
-
- CORBA_exception_free (&ev);
-
- return (Trilobite_Service) bonobo_object_activate_servant (trilobite, servant);
-}
-
-static void
-trilobite_service_initialize (TrilobiteService *trilobite)
-{
- Trilobite_Service corba_trilobite;
-
- /* g_message ("in trilobite_service_initialize"); */
-
- g_return_if_fail (trilobite != NULL);
- g_return_if_fail (TRILOBITE_IS_SERVICE (trilobite));
-
- corba_trilobite = trilobite_service_create_corba_object (BONOBO_OBJECT (trilobite));
-
- if (!trilobite_service_construct (trilobite, corba_trilobite)) {
- trilobite_service_destroy (GTK_OBJECT (trilobite));
- trilobite = NULL;
- }
-
- trilobite->private = g_new0 (TrilobiteServicePrivate,1);
-
- /* By defaulting to "" instead of NULL, we avoid
- accidently passing a NULL through CORBA */
- trilobite->private->service_name = g_strdup ("");
- trilobite->private->service_version = g_strdup ("");
- trilobite->private->service_vendor_name = g_strdup ("");
- trilobite->private->service_vendor_url = g_strdup ("");
- trilobite->private->service_url = g_strdup ("");
- trilobite->private->service_icon = g_strdup ("");
-
- trilobite->private->destroyed = FALSE;
- trilobite->private->alive = TRUE;
-}
-
-GtkType
-trilobite_service_get_type (void)
-{
- static GtkType trilobite_service_type = 0;
-
- /* g_message ("into trilobite_service_get_type"); */
-
- /* First time it's called ? */
- if (!trilobite_service_type)
- {
- static const GtkTypeInfo trilobite_service_info =
- {
- "TrilobiteService",
- sizeof (TrilobiteService),
- sizeof (TrilobiteServiceClass),
- (GtkClassInitFunc) trilobite_service_class_initialize,
- (GtkObjectInitFunc) trilobite_service_initialize,
- /* reserved_1 */ NULL,
- /* reserved_2 */ NULL,
- (GtkClassInitFunc) NULL,
- };
-
- /* Get a unique GtkType */
- trilobite_service_type = gtk_type_unique (bonobo_object_get_type (), &trilobite_service_info);
- }
-
- return trilobite_service_type;
-}
-
-TrilobiteService*
-trilobite_service_new()
-{
- TrilobiteService *trilobite;
-
- /* g_message ("in trilobite_service_new"); */
-
- trilobite = TRILOBITE_SERVICE (gtk_object_new (TRILOBITE_TYPE_SERVICE, NULL));
-
- if (trilobite == NULL) {
- g_warning ("Could not create a TrilobiteService*");
- }
-
- trilobite_service_initialize (trilobite);
-
- return trilobite;
-}
-
-/**************************************************/
-/* Class methods */
-/**************************************************/
-
-char*
-trilobite_service_get_name(TrilobiteService *trilobite)
-{
- g_return_val_if_fail (trilobite != NULL, NULL);
- g_return_val_if_fail (TRILOBITE_IS_SERVICE (trilobite), NULL);
- g_assert (trilobite->private != NULL);
-
- return trilobite->private->service_name;
-}
-
-char*
-trilobite_service_get_version(TrilobiteService *trilobite)
-{
- g_return_val_if_fail (trilobite != NULL, NULL);
- g_return_val_if_fail (TRILOBITE_IS_SERVICE (trilobite), NULL);
- g_assert (trilobite->private != NULL);
-
- return trilobite->private->service_version;
-}
-
-char*
-trilobite_service_get_vendor_name(TrilobiteService *trilobite)
-{
- g_return_val_if_fail (trilobite != NULL, NULL);
- g_return_val_if_fail (TRILOBITE_IS_SERVICE (trilobite), NULL);
- g_assert (trilobite->private != NULL);
-
- return trilobite->private->service_vendor_name;
-}
-
-char*
-trilobite_service_get_vendor_url(TrilobiteService *trilobite)
-{
- g_return_val_if_fail (trilobite != NULL, NULL);
- g_return_val_if_fail (TRILOBITE_IS_SERVICE (trilobite), NULL);
- g_assert (trilobite->private != NULL);
-
- return trilobite->private->service_vendor_url;
-}
-
-char*
-trilobite_service_get_url(TrilobiteService *trilobite)
-{
- g_return_val_if_fail (trilobite != NULL, NULL);
- g_return_val_if_fail (TRILOBITE_IS_SERVICE (trilobite), NULL);
- g_assert (trilobite->private != NULL);
-
- return trilobite->private->service_url;
-}
-
-char*
-trilobite_service_get_icon(TrilobiteService *trilobite)
-{
- g_return_val_if_fail (trilobite != NULL, NULL);
- g_return_val_if_fail (TRILOBITE_IS_SERVICE (trilobite), NULL);
- g_assert (trilobite->private != NULL);
-
- return trilobite->private->service_icon;
-}
-
-/*
- This is a helper function, since the code in the
- _set_x calls is so identical. I have not moved the g_returns
- and g_asserts into the helper, as I still want the
- warnings and assertions to happen in the correct function.
- */
-static void
-trilobite_service_set_helper (const char *value,
- char **element)
-{
- g_free (*element);
- if (value == NULL) {
- (*element) = g_strdup ("");
- } else {
- (*element) = g_strdup (value);
- }
-}
-
-void
-trilobite_service_set_name (TrilobiteService *trilobite,
- const char *value)
-{
- g_return_if_fail (trilobite != NULL);
- g_return_if_fail (TRILOBITE_IS_SERVICE (trilobite));
- g_assert (trilobite->private != NULL);
-
- trilobite_service_set_helper (value, &(trilobite->private->service_name));
-}
-
-void
-trilobite_service_set_version (TrilobiteService *trilobite,
- const char *value)
-{
- g_return_if_fail (trilobite != NULL);
- g_return_if_fail (TRILOBITE_IS_SERVICE (trilobite));
- g_assert (trilobite->private != NULL);
-
- trilobite_service_set_helper (value, &(trilobite->private->service_version));
-}
-
-void
-trilobite_service_set_vendor_name (TrilobiteService *trilobite,
- const char *value)
-{
- g_return_if_fail (trilobite != NULL);
- g_return_if_fail (TRILOBITE_IS_SERVICE (trilobite));
- g_assert (trilobite->private != NULL);
-
- trilobite_service_set_helper (value, &(trilobite->private->service_vendor_name));
-}
-
-void
-trilobite_service_set_vendor_url (TrilobiteService *trilobite,
- const char *value)
-{
- g_return_if_fail (trilobite != NULL);
- g_return_if_fail (TRILOBITE_IS_SERVICE (trilobite));
- g_assert (trilobite->private != NULL);
-
- trilobite_service_set_helper (value, &(trilobite->private->service_vendor_url));
-}
-
-void
-trilobite_service_set_url (TrilobiteService *trilobite,
- const char *value)
-{
- g_return_if_fail (trilobite != NULL);
- g_return_if_fail (TRILOBITE_IS_SERVICE (trilobite));
- g_assert (trilobite->private != NULL);
-
- trilobite_service_set_helper (value, &(trilobite->private->service_url));
-}
-
-void
-trilobite_service_set_icon (TrilobiteService *trilobite,
- const char *value)
-{
- g_return_if_fail (trilobite != NULL);
- g_return_if_fail (TRILOBITE_IS_SERVICE (trilobite));
- g_assert (trilobite->private != NULL);
-
- trilobite_service_set_helper (value, &(trilobite->private->service_icon));
-}
diff --git a/components/services/trilobite/sample/.cvsignore b/components/services/trilobite/sample/.cvsignore
deleted file mode 100644
index 4cfe07926..000000000
--- a/components/services/trilobite/sample/.cvsignore
+++ /dev/null
@@ -1,3 +0,0 @@
-Makefile
-Makefile.in
-Nautius_View_sample-service.oaf
diff --git a/components/services/trilobite/sample/Makefile.am b/components/services/trilobite/sample/Makefile.am
deleted file mode 100644
index e1c4ded52..000000000
--- a/components/services/trilobite/sample/Makefile.am
+++ /dev/null
@@ -1 +0,0 @@
-SUBDIRS = idl lib command-line nautilus-view service
diff --git a/components/services/trilobite/sample/command-line/.cvsignore b/components/services/trilobite/sample/command-line/.cvsignore
deleted file mode 100644
index 6b88b2eaa..000000000
--- a/components/services/trilobite/sample/command-line/.cvsignore
+++ /dev/null
@@ -1,6 +0,0 @@
-.deps
-.libs
-Makefile
-Makefile.in
-eazel-sample-client
-trilobite-eazel-sample-client
diff --git a/components/services/trilobite/sample/command-line/Makefile.am b/components/services/trilobite/sample/command-line/Makefile.am
deleted file mode 100644
index 3d628e7d9..000000000
--- a/components/services/trilobite/sample/command-line/Makefile.am
+++ /dev/null
@@ -1,39 +0,0 @@
-NULL =
-
-INCLUDES = \
- -DPREFIX=\"$(prefix)\" \
- -DG_LOG_DOMAIN=\"trilobite-sample-client\" \
- -I$(top_srcdir) \
- -I$(top_builddir) \
- -I$(top_srcdir)/components/services/trilobite \
- -I$(top_builddir)/components/services/trilobite \
- -I$(top_srcdir)/components/services/trilobite/libtrilobite \
- -I$(top_builddir)/components/services/trilobite/libtrilobite \
- -I$(top_srcdir)/components/services/trilobite/sample/lib \
- -I$(top_builddir)/components/services/trilobite/sample/lib \
- $(EEL_INCLUDEDIR) \
- $(LIBRSVG_INCLUDEDIR) \
- $(GNOMEUI_CFLAGS) \
- $(GCONF_CFLAGS) \
- $(XML_CFLAGS) \
- $(NULL)
-
-bin_PROGRAMS = \
- eazel-sample-client
-
-eazel_sample_client_SOURCES = \
- main.c \
- $(NULL)
-
-eazel_sample_client_LDADD = \
- $(EEL_LIBS) \
- $(LIBRSVG_LIBS) \
- $(BONOBO_LIBS) \
- $(GNOMEUI_LIBS) \
- $(GCONF_LIBS) \
- $(VFS_LIBS) \
- $(OAF_LIBS) \
- $(top_builddir)/components/services/trilobite/libtrilobite/libtrilobite.la \
- $(top_builddir)/components/services/trilobite/sample/lib/libsample_corba.a \
- $(NULL)
-
diff --git a/components/services/trilobite/sample/command-line/main.c b/components/services/trilobite/sample/command-line/main.c
deleted file mode 100644
index 9b1b8aebf..000000000
--- a/components/services/trilobite/sample/command-line/main.c
+++ /dev/null
@@ -1,140 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: Eskil Heyn Olsen <eskil@eazel.com>
- *
- */
-
-#include <config.h>
-#include <gnome.h>
-#include <liboaf/liboaf.h>
-#include <bonobo.h>
-
-#include <libtrilobite/libtrilobite.h>
-#include <libtrilobite/libtrilobite-service.h>
-
-#include <unistd.h>
-
-#include "sample-service.h"
-
-#define OAF_ID "OAFIID:trilobite_eazel_sample_service:3d972cc6-d42d-4669-bd42-966998b3c306"
-
-
-CORBA_Environment ev;
-CORBA_ORB orb;
-
-
-static char *
-get_password_dude (TrilobiteRootClient *root_client, const char *prompt, void *user_data)
-{
- char * real_prompt;
- char * passwd;
-
- real_prompt = g_strdup_printf ("%s: ", prompt);
- passwd = getpass (real_prompt);
- g_free (real_prompt);
-
- return g_strdup (passwd);
-}
-
-
-/* This is basically ripped from empty-client */
-
-int main(int argc, char *argv[]) {
- BonoboObjectClient *service;
- Trilobite_Service trilobite;
- Trilobite_Eazel_Sample sample_service;
-
- TrilobiteRootClient *root_client = NULL;
-
- if (!trilobite_init ("trilobite-sample-client", "0.1", NULL, NULL, argc, argv)) {
- g_error ("Could not initialize trilobite. :(");
- exit (1);
- }
-
- CORBA_exception_init (&ev);
-
- bonobo_activate ();
-
- service = bonobo_object_activate (OAF_ID, 0);
- if (!service) {
- g_error ("Cannot activate %s\n",OAF_ID);
- }
-
- /* Display some stuff about the bonobo object interfaces */
- g_message ("BONOBO Object properties :\ncorba object\t%s\nbonobo unknown\t%s\ntrilobite\t%s\ntestservice\t%s\n",
- bonobo_object_client_has_interface (service, "IDL:CORBA/Object:1.0", &ev)?"yes":"no",
- bonobo_object_client_has_interface (service, "IDL:Bonobo/Unknown:1.0", &ev)?"yes":"no",
- bonobo_object_client_has_interface (service, "IDL:Trilobite/Service:1.0", &ev)?"yes":"no",
- bonobo_object_client_has_interface (service, "IDL:Trilobite/Eazel/Sample:1.0", &ev)?"yes":"no");
-
- /* If a trilobite, get the interface and dump the info */
- if (bonobo_object_client_has_interface (service, "IDL:Trilobite/Service:1.0", &ev)) {
- trilobite = bonobo_object_query_interface (BONOBO_OBJECT (service), "IDL:Trilobite/Service:1.0");
- g_message ("service name : %s", Trilobite_Service_get_name (trilobite, &ev));
- g_message ("service version : %s", Trilobite_Service_get_version (trilobite, &ev));
- g_message ("service vendor name : %s", Trilobite_Service_get_vendor_name (trilobite, &ev));
- g_message ("service vendor url : %s", Trilobite_Service_get_vendor_url (trilobite, &ev));
- g_message ("service url : %s", Trilobite_Service_get_url (trilobite, &ev));
- g_message ("service icon : %s", Trilobite_Service_get_icon (trilobite, &ev));
-
- /* Cleanup the refs and objects from query_interface */
- Trilobite_Service_unref (trilobite, &ev);
- CORBA_Object_release (trilobite, &ev);
- } else {
- g_warning ("Object does not support IDL:Trilobite/Service:1.0");
- }
-
- if (bonobo_object_client_has_interface (service, "IDL:Trilobite/PasswordQuery:1.0", &ev)) {
- root_client = trilobite_root_client_new ();
- gtk_signal_connect (GTK_OBJECT (root_client), "need_password", GTK_SIGNAL_FUNC (get_password_dude),
- NULL);
-
- if (! trilobite_root_client_attach (root_client, service)) {
- g_warning ("root_client_attach to Trilobite/PasswordQuery failed :(");
- }
- } else {
- g_warning ("Object does not support IDL:Trilobite/PasswordQuery:1.0");
- }
-
- /* If a test server, call the two methods */
- if (bonobo_object_client_has_interface (service, "IDL:Trilobite/Eazel/Sample:1.0", &ev)) {
- sample_service = bonobo_object_query_interface (BONOBO_OBJECT (service), "IDL:Trilobite/Eazel/Sample:1.0");
-
- Trilobite_Eazel_Sample_remember (sample_service, "horsedung", &ev);
- Trilobite_Eazel_Sample_say_it (sample_service, &ev);
- Trilobite_Eazel_Sample_list_it (sample_service, "/root", &ev);
-
- /* Cleanup the refs and objects from query_interface */
- Trilobite_Eazel_Sample_unref (sample_service, &ev);
- CORBA_Object_release (sample_service, &ev);
- }
-
- /* throw away the root client if we made one */
- if (root_client != NULL) {
- trilobite_root_client_unref (GTK_OBJECT (root_client));
- }
-
- /* Clean up the bonobo_object_activate return value */
- bonobo_object_unref (BONOBO_OBJECT (service));
- /* And free the exception structure */
- CORBA_exception_free (&ev);
-
- return 0;
-};
diff --git a/components/services/trilobite/sample/idl/.cvsignore b/components/services/trilobite/sample/idl/.cvsignore
deleted file mode 100644
index 282522db0..000000000
--- a/components/services/trilobite/sample/idl/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-Makefile
-Makefile.in
diff --git a/components/services/trilobite/sample/idl/Makefile.am b/components/services/trilobite/sample/idl/Makefile.am
deleted file mode 100644
index eddf9b97b..000000000
--- a/components/services/trilobite/sample/idl/Makefile.am
+++ /dev/null
@@ -1,6 +0,0 @@
-idldir = ${prefix}/idl
-idl_DATA = \
- sample-service.idl
-
-EXTRA_DIST= \
- $(idl_DATA)
diff --git a/components/services/trilobite/sample/idl/sample-service.idl b/components/services/trilobite/sample/idl/sample-service.idl
deleted file mode 100644
index 9a1112f98..000000000
--- a/components/services/trilobite/sample/idl/sample-service.idl
+++ /dev/null
@@ -1,13 +0,0 @@
-/* -*- Mode: IDL; tab-width: 8; indent-tabs-mode: 8; c-basic-offset: 8 -*- */
-
-#include <Bonobo.idl>
-
-module Trilobite {
- module Eazel {
- interface Sample : Bonobo::Unknown {
- void remember(in string something);
- void say_it();
- void list_it (in string dir);
- };
- };
-};
diff --git a/components/services/trilobite/sample/lib/.cvsignore b/components/services/trilobite/sample/lib/.cvsignore
deleted file mode 100644
index 30bcff503..000000000
--- a/components/services/trilobite/sample/lib/.cvsignore
+++ /dev/null
@@ -1,8 +0,0 @@
-.deps
-Makefile
-Makefile.in
-idl_stamp
-sample-service-common.c
-sample-service-skels.c
-sample-service-stubs.c
-sample-service.h
diff --git a/components/services/trilobite/sample/lib/Makefile.am b/components/services/trilobite/sample/lib/Makefile.am
deleted file mode 100644
index d31a77aaa..000000000
--- a/components/services/trilobite/sample/lib/Makefile.am
+++ /dev/null
@@ -1,44 +0,0 @@
-NULL =
-
-INCLUDES = \
- -DPREFIX=\"$(prefix)\" \
- -DG_LOG_DOMAIN=\"trilobite-sample-service\" \
- -DSTANDALONE \
- -I$(top_srcdir) \
- -I$(top_builddir) \
- -I$(top_srcdir)/components/services/trilobite \
- $(GNOME_CFLAGS) \
- $(GCONF_CFLAGS) \
- $(GHTTP_CFLAGS) \
- $(NULL)
-
-noinst_LIBRARIES = libsample_corba.a
-
-## CORBA magic
-
-CORBA_GENERATED = \
- sample-service.h \
- sample-service-common.c \
- sample-service-skels.c \
- sample-service-stubs.c \
- $(NULL)
-
-$(CORBA_GENERATED): idl_stamp
-
-IDLDIR = $(top_srcdir)/components/services/trilobite/sample/idl
-IDL = $(IDLDIR)/sample-service.idl
-
-idl_stamp: $(IDL)
- $(ORBIT_IDL) $(IDL_CFLAGS) -I$(IDLDIR) $(IDL)
- touch idl_stamp
-
-CLEANFILES+=$(CORBA_GENERATED) idl_stamp
-
-noinst_HEADERS = \
- sample-service-public.h \
- $(NULL)
-
-libsample_corba_a_SOURCES = \
- $(CORBA_GENERATED) \
- $(NULL)
-
diff --git a/components/services/trilobite/sample/lib/sample-service-public.h b/components/services/trilobite/sample/lib/sample-service-public.h
deleted file mode 100644
index 20c75df59..000000000
--- a/components/services/trilobite/sample/lib/sample-service-public.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: Eskil Heyn Olsen <eskil@eazel.com>
- *
- */
-
-#ifndef SAMPLE_SERVICE_PUBLIC_H
-#define SAMPLE_SERVICE_PUBLIC_H
-
-#include <libgnome/gnome-defs.h>
-#include "sample-service.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-#define SAMPLE_TYPE_SERVICE (sample_service_get_type ())
-#define SAMPLE_SERVICE(obj) (GTK_CHECK_CAST ((obj), SAMPLE_TYPE_SERVICE, SampleService))
-#define SAMPLE_SERVICE_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), SAMPLE_TYPE_SERVICE, SampleServiceClass))
-#define SAMPLE_IS_SERVICE(obj) (GTK_CHECK_TYPE ((obj), SAMPLE_TYPE_SERVICE))
-#define SAMPLE_IS_SERVICE_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), SAMPLE_TYPE_SERVICE))
-
-typedef struct _SampleService SampleService;
-typedef struct _SampleServiceClass SampleServiceClass;
-
-struct _SampleServiceClass
-{
- BonoboObjectClass parent_class;
-
- void (*remember) (SampleService *service, const char *something);
- void (*say_it) (SampleService *service);
-
- gpointer servant_vepv;
-};
-
-typedef struct _SampleServicePrivate SampleServicePrivate;
-
-struct _SampleService
-{
- BonoboObject parent;
- char *my_string;
-};
-
-GtkType sample_service_get_type (void);
-SampleService* sample_service_new (void);
-POA_Trilobite_Eazel_Sample__epv* sample_service_get_epv (void);
-void sample_service_unref (GtkObject *object);
-
-void sample_service_remember (SampleService *sample, const char *something);
-void sample_service_say_it (SampleService *sample);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* SAMPLE_SERVICE_PUBLIC_H */
diff --git a/components/services/trilobite/sample/nautilus-view/.cvsignore b/components/services/trilobite/sample/nautilus-view/.cvsignore
deleted file mode 100644
index a7316e103..000000000
--- a/components/services/trilobite/sample/nautilus-view/.cvsignore
+++ /dev/null
@@ -1,6 +0,0 @@
-.deps
-.libs
-Makefile
-Makefile.in
-nautilus-sample-service-view
-Nautilus_View_service-sample.oaf \ No newline at end of file
diff --git a/components/services/trilobite/sample/nautilus-view/Makefile.am b/components/services/trilobite/sample/nautilus-view/Makefile.am
deleted file mode 100644
index a1d272b38..000000000
--- a/components/services/trilobite/sample/nautilus-view/Makefile.am
+++ /dev/null
@@ -1,51 +0,0 @@
-NULL =
-
-SUBDIRS = icons
-
-INCLUDES = \
- -DPREFIX=\"$(prefix)\" \
- -DG_LOG_DOMAIN=\"trilobite-sample-service\" \
- -I$(top_srcdir) \
- -I$(top_srcdir)/components/services/trilobite/libtrilobite \
- -I$(top_srcdir)/components/services/trilobite/sample/lib \
- -I$(top_builddir) \
- $(EEL_INCLUDEDIR) \
- $(LIBRSVG_INCLUDEDIR) \
- $(GNOMEUI_CFLAGS) \
- $(GCONF_CFLAGS) \
- $(NULL)
-
-bin_PROGRAMS = \
- nautilus-sample-service-view
-
-nautilus_sample_service_view_SOURCES = \
- nautilus-sample-service-view.h \
- nautilus-sample-service-view.c \
- main.c \
- $(NULL)
-
-nautilus_sample_service_view_LDADD = \
- $(top_builddir)/components/services/trilobite/sample/lib/libsample_corba.a \
- $(top_builddir)/components/services/trilobite/libtrilobite/libtrilobite.la \
- $(top_builddir)/libnautilus/libnautilus.la \
- $(EEL_LIBS) \
- $(LIBRSVG_LIBS) \
- $(BONOBO_LIBS) \
- $(GNOMEUI_LIBS) \
- $(GCONF_LIBS) \
- $(VFS_LIBS) \
- $(GHTTP_LIBS) \
- $(OAF_LIBS) \
- $(NULL)
-
-
-oafdir = $(datadir)/oaf
-oaf_in_files = \
- Nautilus_View_service-sample.oaf.in \
- $(NULL)
-oaf_DATA = $(oaf_in_files:.oaf.in=.oaf)
-
-@XML_I18N_MERGE_OAF_RULE@
-
-
-EXTRA_DIST = $(oaf_in_files) $(oaf_DATA)
diff --git a/components/services/trilobite/sample/nautilus-view/Nautilus_View_service-sample.oaf.in b/components/services/trilobite/sample/nautilus-view/Nautilus_View_service-sample.oaf.in
deleted file mode 100644
index c8d3c55d7..000000000
--- a/components/services/trilobite/sample/nautilus-view/Nautilus_View_service-sample.oaf.in
+++ /dev/null
@@ -1,27 +0,0 @@
-<oaf_info>
-
-<oaf_server iid="OAFIID:nautilus_sample_service_view_factory:fafa0f0d-a2d1-41f9-8164-4beb5e34656c" type="exe" location="nautilus-sample-service-view">
- <oaf_attribute name="repo_ids" type="stringv">
- <item value="IDL:GNOME/ObjectFactory:1.0"/>
- </oaf_attribute>
- <oaf_attribute name="name" type="string" _value="Services startup view factory"/>
- <oaf_attribute name="description" type="string" _value="Nautilus services startup view factory"/>
-</oaf_server>
-
-<oaf_server iid="OAFIID:nautilus_sample_service_view:a8f1b0ef-a39f-4f92-84bc-1704f0321a82" type="factory" location="OAFIID:nautilus_sample_service_view_factory:fafa0f0d-a2d1-41f9-8164-4beb5e34656c">
- <oaf_attribute name="repo_ids" type="stringv">
- <item value="IDL:Bonobo/Unknown:1.0"/>
- <item value="IDL:Bonobo/Control:1.0"/>
- <item value="IDL:Nautilus/View:1.0"/>
- </oaf_attribute>
- <oaf_attribute name="name" type="string" _value="eazel sample service view"/>
- <oaf_attribute name="description" type="string" _value="Nautilus eazel sample service view component"/>
- <oaf_attribute name="bonobo:supported_uri_schemes" type="stringv">
- <item value="eazel-sample"/>
- </oaf_attribute>
- <oaf_attribute name="nautilus:view_as_name" type="string" _value="Service"/>
- <oaf_attribute name="nautilus:view_as_label" type="string" _value="View as Service"/>
- <oaf_attribute name="nautilus:viewer_label" type="string" _value="Service Viewer"/>
-</oaf_server>
-
-</oaf_info>
diff --git a/components/services/trilobite/sample/nautilus-view/icons/.cvsignore b/components/services/trilobite/sample/nautilus-view/icons/.cvsignore
deleted file mode 100644
index 282522db0..000000000
--- a/components/services/trilobite/sample/nautilus-view/icons/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-Makefile
-Makefile.in
diff --git a/components/services/trilobite/sample/nautilus-view/icons/Makefile.am b/components/services/trilobite/sample/nautilus-view/icons/Makefile.am
deleted file mode 100644
index ee0a1f219..000000000
--- a/components/services/trilobite/sample/nautilus-view/icons/Makefile.am
+++ /dev/null
@@ -1,8 +0,0 @@
-NULL =
-
-icondir = $(datadir)/pixmaps/nautilus
-
-icon_DATA = \
- $(NULL)
-
-EXTRA_DIST = $(icon_DATA)
diff --git a/components/services/trilobite/sample/nautilus-view/main.c b/components/services/trilobite/sample/nautilus-view/main.c
deleted file mode 100644
index 06b2df52f..000000000
--- a/components/services/trilobite/sample/nautilus-view/main.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors:
- *
- */
-
-
-int
-main(int argc, char *argv[])
-{
- return 0;
-}
diff --git a/components/services/trilobite/sample/nautilus-view/nautilus-sample-service-view.c b/components/services/trilobite/sample/nautilus-view/nautilus-sample-service-view.c
deleted file mode 100644
index 1eac73441..000000000
--- a/components/services/trilobite/sample/nautilus-view/nautilus-sample-service-view.c
+++ /dev/null
@@ -1,23 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors:
- *
- */
-
diff --git a/components/services/trilobite/sample/nautilus-view/nautilus-sample-service-view.h b/components/services/trilobite/sample/nautilus-view/nautilus-sample-service-view.h
deleted file mode 100644
index e8ffb4e35..000000000
--- a/components/services/trilobite/sample/nautilus-view/nautilus-sample-service-view.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors:
- *
- */
-
-#ifndef NAUTILUS_SAMPLE_SERVICE_VIEW_H
-#define NAUTILUS_SAMPLE_SERVICE_VIEW_H
-
-#endif /* NAUTILUS_SAMPLE_SERVICE_VIEW_H */
-
-
diff --git a/components/services/trilobite/sample/service/.cvsignore b/components/services/trilobite/sample/service/.cvsignore
deleted file mode 100644
index 959c71e70..000000000
--- a/components/services/trilobite/sample/service/.cvsignore
+++ /dev/null
@@ -1,6 +0,0 @@
-.deps
-.libs
-Makefile
-Makefile.in
-trilobite-eazel-sample-service
-Trilobite_Service_sample.oaf
diff --git a/components/services/trilobite/sample/service/Makefile.am b/components/services/trilobite/sample/service/Makefile.am
deleted file mode 100644
index 79e2e3904..000000000
--- a/components/services/trilobite/sample/service/Makefile.am
+++ /dev/null
@@ -1,53 +0,0 @@
-NULL =
-
-INCLUDES = \
- -DPREFIX=\"$(prefix)\" \
- -DG_LOG_DOMAIN=\"trilobite-sample-service\" \
- -DGNOMELOCALEDIR=\""$(datadir)/locale"\" \
- -I$(top_srcdir) \
- -I$(top_builddir) \
- -I$(top_srcdir)/components/services/trilobite \
- -I$(top_builddir)/components/services/trilobite \
- -I$(top_srcdir)/components/services/trilobite/libtrilobite \
- -I$(top_builddir)/components/services/trilobite/libtrilobite \
- -I$(top_builddir)/components/services/trilobite/sample/lib \
- -I$(top_srcdir)/components/services/trilobite/sample/lib \
- -I../server/ \
- $(EEL_INCLUDEDIR) \
- $(LIBRSVG_INCLUDEDIR) \
- $(GCONF_CFLAGS) \
- $(GNOME_CFLAGS) \
- $(GNOME_INCLUDEDIR) \
- $(OAF_CFLAGS) \
- $(XML_CFLAGS) \
- $(NULL)
-
-bin_PROGRAMS = trilobite-eazel-sample-service
-
-trilobite_eazel_sample_service_SOURCES = \
- sample-service-impl.c \
- main.c \
- $(NULL)
-
-trilobite_eazel_sample_service_LDADD = \
- $(top_builddir)/components/services/trilobite/libtrilobite/libtrilobite.la \
- $(top_builddir)/components/services/trilobite/libtrilobite/libtrilobite-service.la \
- $(top_builddir)/components/services/trilobite/sample/lib/libsample_corba.a \
- $(EEL_LIBS) \
- $(LIBRSVG_LIBS) \
- $(BONOBO_LIBS) \
- $(NULL)
-
-oafdir = $(datadir)/oaf
-oaf_in_files = Trilobite_Service_sample.oaf.in
-oaf_DATA = $(oaf_in_files:.oaf.in=.oaf)
-
-@XML_I18N_MERGE_OAF_RULE@
-
-EXTRA_DIST = \
- $(oaf_in_files) \
- $(oaf_DATA) \
- $(NULL)
-
-
-
diff --git a/components/services/trilobite/sample/service/Trilobite_Service_sample.oaf.in b/components/services/trilobite/sample/service/Trilobite_Service_sample.oaf.in
deleted file mode 100644
index 3d02b479e..000000000
--- a/components/services/trilobite/sample/service/Trilobite_Service_sample.oaf.in
+++ /dev/null
@@ -1,30 +0,0 @@
-<oaf_info>
-
-<oaf_server iid="OAFIID:trilobite_eazel_sample_service_factory:19084a03-2f85-456e-95ed-bcebf8141e97" type="exe" location="trilobite-eazel-sample-service">
- <oaf_attribute name="repo_ids" type="stringv">
- <item value="IDL:GNOME/ObjectFactory:1.0"/>
- </oaf_attribute>
- <oaf_attribute name="description" type="string" _value="Factory for the sample service"/>
-</oaf_server>
-
-<oaf_server iid="OAFIID:trilobite_eazel_sample_service:3d972cc6-d42d-4669-bd42-966998b3c306" type="factory" location="OAFIID:trilobite_eazel_sample_service_factory:19084a03-2f85-456e-95ed-bcebf8141e97">
- <oaf_attribute name="repo_ids" type="stringv">
- <item value="IDL:Bonobo/Unknown:1.0"/>
- <item value="IDL:Trilobite/Service:1.0"/>
- <item value="IDL:Trilobite/Eazel/Sample:1.0"/>
- </oaf_attribute>
-
- <oaf_attribute name="trilobite:name" type="string" _value="Sample"/>
- <oaf_attribute name="trilobite:version" type="string" value="0.1"/>
- <oaf_attribute name="trilobite:vendor_name" type="string" value="Eazel, Inc."/>
- <oaf_attribute name="trilobite:vendor_url" type="string" value="http://www.eazel.com"/>
- <oaf_attribute name="trilobite:info_url" type="string" value="http://www.eazel.com/sample/"/>
- <oaf_attribute name="trilobite:icon" type="string" value="gnome-default-dlg.png"/>
- <oaf_attribute name="trilobite:uri_scheme" type="string" value="eazel-sample:"/>
- <oaf_attribute name="bonobo:supported_uri_schemes" type="stringv">
- <item value="eazel-sample:"/>
- </oaf_attribute>
-
-</oaf_server>
-
-</oaf_info>
diff --git a/components/services/trilobite/sample/service/main.c b/components/services/trilobite/sample/service/main.c
deleted file mode 100644
index 2b5135415..000000000
--- a/components/services/trilobite/sample/service/main.c
+++ /dev/null
@@ -1,150 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: Eskil Heyn Olsen <eskil@eazel.com>
- *
- */
-
-#include <config.h>
-#include <gnome.h>
-#include <liboaf/liboaf.h>
-#include <bonobo.h>
-
-#include <libtrilobite/libtrilobite.h>
-#include <libtrilobite/libtrilobite-service.h>
-
-#include "sample-service.h"
-#include <sample-service-public.h>
-
-#define OAF_ID_FACTORY "OAFIID:trilobite_eazel_sample_service_factory:19084a03-2f85-456e-95ed-bcebf8141e97"
-#define OAF_ID "OAFIID:trilobite_eazel_sample_service:3d972cc6-d42d-4669-bd42-966998b3c306"
-
-/*
- These are some generally needed objects to get CORBA connectivity
-*/
-CORBA_ORB orb;
-CORBA_Environment ev;
-
-static BonoboGenericFactory *factory;
-static int trilobites_active = 0;
-static TrilobitePasswordQuery *trilobite_password;
-
-static void
-trilobite_service_factory_destroy (GtkObject *object)
-{
- trilobites_active--;
-
- if (trilobites_active > 0) {
- return;
- }
-
- g_message ("in factory_destroy");
-
- bonobo_object_unref (BONOBO_OBJECT (factory));
- trilobite_passwordquery_destroy (GTK_OBJECT (trilobite_password));
-
- trilobite_main_quit ();
- g_message ("out factory_destroy");
-}
-
-static BonoboObject*
-trilobite_sample_service_factory (BonoboGenericFactory *this_factory,
- const gchar *oaf_id,
- gpointer data)
-{
- TrilobiteService *trilobite;
- SampleService *service;
-
- g_message ("in trilobite_sample_service_factory");
-
- if (strcmp (oaf_id, OAF_ID)) {
- return NULL;
- }
-
- trilobite = TRILOBITE_SERVICE (gtk_object_new (TRILOBITE_TYPE_SERVICE,
- "name", "Sample",
- "version", "0.1",
- "vendor_name", "Eazel, inc.",
- "vendor_url", "http://www.eazel.com",
- "url", "http://www.eazel.com/sample",
- "icon", "gnome-default-dlg.png",
- NULL));
-
- trilobite_password = TRILOBITE_PASSWORDQUERY (gtk_object_new (TRILOBITE_TYPE_PASSWORDQUERY,
- "prompt", "root",
- NULL));
-
- service = sample_service_new ();
-
- trilobites_active++;
-
- trilobite_service_add_interface (trilobite, BONOBO_OBJECT (service));
- trilobite_passwordquery_add_interface (trilobite_password, BONOBO_OBJECT (service));
-
- gtk_signal_connect (GTK_OBJECT (trilobite),
- "destroy",
- trilobite_service_factory_destroy, NULL);
-
- return BONOBO_OBJECT (trilobite);
-}
-
-int main(int argc, char *argv[]) {
-
- char *registration_id;
-
-#ifdef ENABLE_NLS /* sadly we need this ifdef because otherwise the following get empty statement warnings */
- bindtextdomain (PACKAGE, GNOMELOCALEDIR);
- textdomain (PACKAGE);
-#endif
-
- /* Disable session manager connection */
- gnome_client_disable_master_connection ();
-
- if (!trilobite_init ("trilobite-sample-service", "0.1", "/tmp/trilobite.log", NULL, argc, argv)) {
- g_error ("Could not initialize trilobite. :(");
- exit (1);
- }
- trilobite_set_debug_mode (TRUE);
-
- registration_id = oaf_make_registration_id (OAF_ID_FACTORY, getenv ("DISPLAY"));
-
- factory = bonobo_generic_factory_new_multi (registration_id,
- trilobite_sample_service_factory,
- NULL);
-
- g_free (registration_id);
-
- if (factory == NULL) {
- g_error ("Could not register factory");
- }
-
- bonobo_activate();
-
- g_message ("%s ready", argv[0]);
-
- do {
- trilobite_main ();
- } while (trilobites_active > 0);
-
- g_message ("%s quitting", argv[0]);
-
- CORBA_exception_free (&ev);
-
- return 0;
-};
diff --git a/components/services/trilobite/sample/service/sample-service-impl.c b/components/services/trilobite/sample/service/sample-service-impl.c
deleted file mode 100644
index 43f3c59a3..000000000
--- a/components/services/trilobite/sample/service/sample-service-impl.c
+++ /dev/null
@@ -1,379 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Copyright (C) 2000 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: Eskil Heyn Olsen <eskil@eazel.com>
- *
- */
-
-#include <config.h>
-#include <gnome.h>
-#include <liboaf/liboaf.h>
-#include <bonobo.h>
-
-#include <libtrilobite/libtrilobite.h>
-#include <libtrilobite/libtrilobite-service.h>
-
-#include "sample-service.h"
-#include "sample-service-public.h"
-
-/*
- These are enums used for the signals binding.
- LAST_SIGNAL indicates the end.
-*/
-enum {
- REMEMBER,
- SAY_IT,
- LAST_SIGNAL
-};
-
-/* The signal array, used for building the signal bindings */
-
-static guint sample_service_signals[LAST_SIGNAL] = { 0 };
-
-/* This is the parent class pointer */
-
-static BonoboObjectClass *sample_service_parent_class;
-
-/*****************************************
- Corba stuff
-*****************************************/
-
-static PortableServer_ServantBase__epv base_epv = { NULL, NULL, NULL };
-
-/*
- This is POA_Trilobite_Sample structure we will use,
- as it will let us access the SampleService object in
- the corba methods
- */
-typedef struct {
- POA_Trilobite_Eazel_Sample poa;
- SampleService *object;
-} impl_POA_Sample_Service;
-
-/*
- The implementation of
- void remember (in string something);
- */
-static void
-impl_Trilobite_Eazel_Sample_remember(impl_POA_Sample_Service *service,
- const CORBA_char *something,
- CORBA_Environment *ev)
-{
- /* This does not have to be a signal, it's just done
- as a signal for the educational purpose.
- Since service->object is the SampleService object, you
- could just access the data fields here directly */
-
- gtk_signal_emit (GTK_OBJECT (service->object), sample_service_signals[REMEMBER], something);
-}
-
-/*
- The implementation of
- void say_id();
-*/
-static void
-impl_Trilobite_Eazel_Sample_say_it(impl_POA_Sample_Service *service,
- CORBA_Environment *ev)
-{
- gtk_signal_emit (GTK_OBJECT (service->object), sample_service_signals[SAY_IT]);
-}
-
-/*
- The implementation of
- void list_it (in string dir);
- */
-static void
-impl_Trilobite_Eazel_Sample_list_it(impl_POA_Sample_Service *service,
- const CORBA_char *dir,
- CORBA_Environment *ev)
-{
- TrilobiteRootHelper *helper;
- GList *args;
- char *tmp;
- int fd;
- FILE *f;
-
- /* Get the TrilobiteRootHelper object. This datafield is set
- when the factory object in main.c called trilobite_passwordquery_add_interface */
- helper = gtk_object_get_data (GTK_OBJECT (service->object), "trilobite-root-helper");
-
- /* Create the GList of arguments */
- tmp = g_strdup (dir);
- args = g_list_append (NULL, "-lart");
- args = g_list_append (args, tmp);
-
- /* Start and run the eazel-helper */
- if (trilobite_root_helper_start (helper) == TRILOBITE_ROOT_HELPER_BAD_PASSWORD) {
- g_warning ("Incorrect password");
- return;
- } else {
- if (trilobite_root_helper_run (helper, TRILOBITE_ROOT_HELPER_RUN_LS, args, &fd) != TRILOBITE_ROOT_HELPER_SUCCESS) {
- g_warning ("trilobite_root_helper failed");
- }
- }
- /* Clean up */
- g_list_free (args);
- g_free (tmp);
-
- f = fdopen (fd, "r");
- fflush (f);
- tmp = g_new0 (char, 1024);
- while (!feof (f)) {
- fgets (tmp, 1023, f);
- if (feof (f)) {
- break;
- }
- fprintf (stdout, "GNE: %s", tmp);
- }
- fclose (f);
-}
-
-/*
- This creates the epv for the object.
- Basically you just have to alloc a structure of the
- appropriate type (POA_Trilobite_Eazel_Sample__epv in
- this case), and set the pointers for the method implementations.
- */
-POA_Trilobite_Eazel_Sample__epv*
-sample_service_get_epv()
-{
- POA_Trilobite_Eazel_Sample__epv *epv;
-
- epv = g_new0 (POA_Trilobite_Eazel_Sample__epv, 1);
-
- epv->remember = (gpointer) &impl_Trilobite_Eazel_Sample_remember;
- epv->say_it = (gpointer) &impl_Trilobite_Eazel_Sample_say_it;
- epv->list_it = (gpointer) &impl_Trilobite_Eazel_Sample_list_it;
-
- return epv;
-};
-
-/*****************************************
- GTK+ object stuff
-*****************************************/
-
-/* This is the object finalize. It should clean up any
- data allocated by the object, and if possible, call
-the parent finalize */
-static void
-sample_service_finalize (GtkObject *object)
-{
- SampleService *service;
-
- g_message ("in sample_service_finalize");
-
- g_return_if_fail (object != NULL);
- g_return_if_fail (SAMPLE_SERVICE (object));
-
- service = SAMPLE_SERVICE (object);
-
- /* Free the objects own crap */
- if (service->my_string) {
- g_free (service->my_string);
- }
-
- /* Call parents destroy */
- if (GTK_OBJECT_CLASS (sample_service_parent_class)->finalize) {
- GTK_OBJECT_CLASS (sample_service_parent_class)->finalize (object);
- }
-
- g_message ("out sample_service_finalize");
-}
-
-void sample_service_unref (GtkObject *object)
-{
- g_message ("sample_service_unref");
- g_return_if_fail (object != NULL);
- g_return_if_fail (SAMPLE_SERVICE (object));
- bonobo_object_unref (BONOBO_OBJECT (object));
-}
-
-/*
- This is the sample_service class initializer, see
- GGAD (http://developer.gnome.org/doc/GGAD/sec-classinit.html)
- for more on these
- */
-static void
-sample_service_class_initialize (SampleServiceClass *klass)
-{
- GtkObjectClass *object_class;
-
- object_class = (GtkObjectClass*)klass;
- object_class->finalize = sample_service_finalize;
-
- sample_service_parent_class = gtk_type_class (bonobo_object_get_type ());
-
- /* Here I get allocate and set up the vepv. This ensures that the
- servant_vepv will hold the proper bindings for the corba object for
- the sample_service */
- klass->servant_vepv = g_new0 (POA_Trilobite_Eazel_Sample__vepv,1);
- ((POA_Trilobite_Eazel_Sample__vepv*)klass->servant_vepv)->_base_epv = &base_epv;
- ((POA_Trilobite_Eazel_Sample__vepv*)klass->servant_vepv)->Bonobo_Unknown_epv = bonobo_object_get_epv ();
- ((POA_Trilobite_Eazel_Sample__vepv*)klass->servant_vepv)->Trilobite_Eazel_Sample_epv = sample_service_get_epv ();
-
- sample_service_signals[REMEMBER] =
- gtk_signal_new ("remember",
- GTK_RUN_LAST,
- object_class->type,
- GTK_SIGNAL_OFFSET (SampleServiceClass, remember),
- gtk_marshal_NONE__POINTER,
- GTK_TYPE_NONE,1,GTK_TYPE_POINTER);
- sample_service_signals[SAY_IT] =
- gtk_signal_new ("say_it",
- GTK_RUN_LAST,
- object_class->type,
- GTK_SIGNAL_OFFSET (SampleServiceClass, say_it),
- gtk_marshal_NONE__NONE,
- GTK_TYPE_NONE,0);
- gtk_object_class_add_signals (object_class, sample_service_signals, LAST_SIGNAL);
-
- klass->remember = sample_service_remember;
- klass->say_it = sample_service_say_it;
-}
-
-/*
- _corba_object does all the greasy corba building and whatnot.
- */
-static Trilobite_Eazel_Sample
-sample_service_create_corba_object (BonoboObject *service) {
- impl_POA_Sample_Service *servant;
- CORBA_Environment ev;
-
- g_assert (service != NULL);
-
- CORBA_exception_init (&ev);
-
- /* Allocate the POA structure, using our extended version*/
- servant = (impl_POA_Sample_Service*)g_new0 (PortableServer_Servant,1);
-
- /* Set the vepv to the vepv build in sample_service_class_initialize */
- ((POA_Trilobite_Eazel_Sample*) servant)->vepv = SAMPLE_SERVICE_CLASS ( GTK_OBJECT (service)->klass)->servant_vepv;
-
- /* Call the __init method. This is generated by the IDL compiler and
- the name of the method depends on the name of your corba object */
- POA_Trilobite_Eazel_Sample__init (servant, &ev);
-
- /* Magic */
- ORBIT_OBJECT_KEY (((POA_Trilobite_Eazel_Sample*)servant)->_private)->object = NULL;
-
- /* Check to see if things went well */
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_warning ("Cannot instantiate Trilobite_Eazel_Sample corba object");
- g_free (servant);
- CORBA_exception_free (&ev);
- return CORBA_OBJECT_NIL;
- }
-
- CORBA_exception_free (&ev);
-
- /* Return the bonobo activation of the servant */
- return (Trilobite_Eazel_Sample) bonobo_object_activate_servant (service, servant);
-}
-
-/*
- This is the SampleService instance initializer.
- Its responsibility is to create the corba object and
- build the bonobo_object structures using the corba object.
- */
-static void
-sample_service_initialize (SampleService *service) {
- Trilobite_Eazel_Sample corba_service;
-
- g_assert (service != NULL);
- g_assert (SAMPLE_IS_SERVICE (service));
-
- /* This builds the corba object */
- corba_service = sample_service_create_corba_object (BONOBO_OBJECT (service));
-
- /* This sets the bonobo structures in service using the corba object */
- if (!bonobo_object_construct (BONOBO_OBJECT (service), corba_service)) {
- g_warning ("bonobo_object_construct failed");
- }
-}
-
-/*
- The GtkType generator. Again, see GGAD for more
- */
-GtkType
-sample_service_get_type() {
- static GtkType trilobite_service_type = 0;
-
- g_message ("into sample_service_get_type");
-
- /* First time it's called ? */
- if (!trilobite_service_type)
- {
- static const GtkTypeInfo trilobite_service_info =
- {
- "TrilobiteEazelSampleService",
- sizeof (TrilobiteService),
- sizeof (TrilobiteServiceClass),
- (GtkClassInitFunc) sample_service_class_initialize,
- (GtkObjectInitFunc) sample_service_initialize,
- /* reserved_1 */ NULL,
- /* reserved_2 */ NULL,
- (GtkClassInitFunc) NULL,
- };
-
- /* Get a unique GtkType */
- trilobite_service_type = gtk_type_unique (bonobo_object_get_type (), &trilobite_service_info);
- }
-
- return trilobite_service_type;
-}
-
-/*
- The _new method simply builds the service
- using gtk_object_new
-*/
-SampleService*
-sample_service_new()
-{
- SampleService *service;
-
- g_message ("in sample_service_new");
-
- service = SAMPLE_SERVICE (gtk_object_new (SAMPLE_TYPE_SERVICE, NULL));
-
- return service;
-}
-
-/**************************************************/
-/* Signal receivers */
-/**************************************************/
-
-/* Does stuff ... */
-void
-sample_service_remember (SampleService *service,
- const char *something)
-{
- if (service->my_string) g_free (service->my_string);
- service->my_string = g_strdup (something);
-}
-
-/* Does stuff ... */
-void
-sample_service_say_it (SampleService *service)
-{
- if (service->my_string) {
- g_message (service->my_string);
- } else {
- g_message ("call remember first");
- }
-}
diff --git a/components/services/trilobite/utils/.cvsignore b/components/services/trilobite/utils/.cvsignore
deleted file mode 100644
index 99e086a44..000000000
--- a/components/services/trilobite/utils/.cvsignore
+++ /dev/null
@@ -1,5 +0,0 @@
-.deps
-.libs
-Makefile
-Makefile.in
-eazel-helper-test
diff --git a/components/services/trilobite/utils/Makefile.am b/components/services/trilobite/utils/Makefile.am
deleted file mode 100644
index 91ec58da4..000000000
--- a/components/services/trilobite/utils/Makefile.am
+++ /dev/null
@@ -1,40 +0,0 @@
-include $(top_srcdir)/Makefile.shared
-
-INCLUDES = \
- -DPREFIX=\"$(prefix)\" \
- -DG_LOG_DOMAIN=\"EazelHelperTest\" \
- -I$(top_srcdir) \
- -I$(top_builddir) \
- -I$(top_srcdir)/components/services/trilobite/libtrilobite \
- -I$(top_builddir)/components/services/trilobite/libtrilobite \
- -I$(top_srcdir)/components/services/trilobite \
- -I$(top_builddir)/components/services/trilobite \
- -DGNOMELOCALEDIR=\""$(datadir)/locale"\" \
- $(EEL_INCLUDEDIR) \
- $(LIBRSVG_INCLUDEDIR) \
- $(GNOME_CFLAGS) \
- $(GCONF_CFLAGS) \
- $(VFS_CFLAGS) \
- $(XML_CFLAGS) \
- $(GHTTP_CFLAGS) \
- $(NULL)
-
-LDADD = \
- $(top_builddir)/components/services/trilobite/libtrilobite/libtrilobite.la \
- $(EEL_LIBS) \
- $(LIBRSVG_LIBS) \
- $(BONOBO_LIBS) \
- $(GNOME_LIBS) \
- $(GCONF_LIBS) \
- $(VFS_LIBS) \
- $(GHTTP_LIBS) \
- $(RPM_LIBS) \
- $(NULL)
-
-bin_PROGRAMS = eazel-helper-test
-
-eazel_helper_test_SOURCES = \
- eazel-helper-test.c \
- $(NULL)
-
-
diff --git a/components/services/trilobite/utils/eazel-helper-test.c b/components/services/trilobite/utils/eazel-helper-test.c
deleted file mode 100644
index 3903b6367..000000000
--- a/components/services/trilobite/utils/eazel-helper-test.c
+++ /dev/null
@@ -1,136 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Copyright (C) 2001 Eazel, Inc
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Authors: Eskil Heyn Olsen <eskil@eazel.com>
- *
- */
-
-#include <config.h>
-#include <gnome.h>
-#include <liboaf/liboaf.h>
-#include <bonobo.h>
-
-#include <libtrilobite/libtrilobite.h>
-#include <unistd.h>
-
-CORBA_ORB orb;
-CORBA_Environment ev;
-int cli_result = 0;
-
-/* Popt stuff */
-int arg_command = 0;
-
-static const struct poptOption options[] = {
- {"command", '\0', POPT_ARG_INT, &arg_command, 0, N_("Command to run"), NULL},
- {NULL, '\0', 0, NULL, 0}
-};
-
-static char *
-get_password_dude (TrilobiteRootHelper *helper, const char *prompt, void *user_data)
-{
- char * passwd;
-
- passwd = getpass ("root password: ");
- return g_strdup (passwd);
-}
-
-int main(int argc, char *argv[]) {
- poptContext ctxt;
- TrilobiteRootHelper *helper;
- int fd;
- GList *args = NULL;
- char *str;
-
- CORBA_exception_init (&ev);
-
- /* Seems that bonobo_main doens't like
- not having gnome_init called, dies in a
- X call, yech */
-
-#ifdef ENABLE_NLS /* sadly we need this ifdef because otherwise the following get empty statement warnings */
- bindtextdomain (PACKAGE, GNOMELOCALEDIR);
- textdomain (PACKAGE);
-#endif
-
- trilobite_init ("Eazel Root Helper Test", "1.0", NULL, options, argc, argv);
- ctxt = trilobite_get_popt_context ();
-
- helper = trilobite_root_helper_new ();
-
- while ((str = poptGetArg (ctxt)) != NULL) {
- args = g_list_prepend (args, str);
- }
-
- bonobo_activate ();
-
- gtk_signal_connect (GTK_OBJECT (helper),
- "need_password",
- GTK_SIGNAL_FUNC (get_password_dude),
- NULL);
-
- g_message ("Calling start");
- if (trilobite_root_helper_start (helper) == 0) {
- TrilobiteRootHelperStatus res;
-
- g_message ("Calling run");
- res = trilobite_root_helper_run (helper, arg_command, args, &fd);
-
- switch (res) {
- case TRILOBITE_ROOT_HELPER_SUCCESS:
- if (fd>0) {
- char b;
- while (read (fd, &b, 1)) {
- putchar (b);
- }
- } else {
- g_warning ("success, but no fd");
- }
- break;
- case TRILOBITE_ROOT_HELPER_NO_USERHELPER:
- g_error ("No userhelper");
- break;
- case TRILOBITE_ROOT_HELPER_NEED_PASSWORD:
- g_error ("Need password");
- break;
- case TRILOBITE_ROOT_HELPER_BAD_PASSWORD:
- g_error ("Bad password, try again...");
- break;
- case TRILOBITE_ROOT_HELPER_LOST_PIPE:
- g_error ("Lost pipe");
- break;
- case TRILOBITE_ROOT_HELPER_BAD_ARGS:
- g_error ("Bad args");
- break;
- case TRILOBITE_ROOT_HELPER_BAD_COMMAND:
- g_error ("Bad command");
- break;
- case TRILOBITE_ROOT_HELPER_INTERNAL_ERROR:
- g_error ("Internal error");
- break;
- }
- } else {
- g_error ("Cannot start root helper");
- }
-
-
- /* Corba cleanup */
- CORBA_exception_free (&ev);
-
- return cli_result;
-};