[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

New Packager question again: can you point me to a not flawed package?



OK, thanks for the advice yesterday.  I think we are agreeing on
principle, it is just the implementation that's concerning me now.

I'm starting back at the basics.  I'm building stuff for Ubuntu
workstations. Because I don't know how to manage patches (did not
decipher quilt or cdbs yet, but will eventually), I'm starting with a
simple problem.  Here's one of my jobs.  I need to make a package that
will insert a single text file under /etc/emacs/site-lisp.  I think I
need to make a meta package and just add an emacsen-startup file under
the debian directory.  I'm trying to study how to do that by looking
at examples.

You may recall I was the one who asked yesterday "Why do you encourage
packagers to open the source code and fool around?"  I got answers
which indicate that the source code generally should not be changed
directly, and all changes should either be in patches that are stored
in the debian/patches directory or in the other configuration files
like "rules". I say "Yes, I agree"  I am used to that from RPM
building.  I think you should force people to prove they can build
packages by applying patches to an original, untouched tarball or
putting details in a debian directory.

I just need to see some examples of how this can be done.  I wonder if
I'm running into a problem that is peculiar to Ubuntu.  I can't find
packages that follow the principles we were discussing  yesterday.  In
fact, I can't find any that adhere to this guideline in a complete
way. (It appears to me the temptation is too great to make
undocumented changes in source code.)

For example, consider the source for the ess package, an Emacs addon
that I  use ("apt-get source ess").  Peruse the diff file, and you
find several items that are not in debian rules, such as this:

--- ess-5.3.0.orig/lisp/ess-mode.el
+++ ess-5.3.0/lisp/ess-mode.el
@@ -167,6 +167,8 @@
   (define-key ess-mode-map "{"		'ess-electric-brace)
   (define-key ess-mode-map "}"		'ess-electric-brace)
   (define-key ess-mode-map "\e\C-h"	'ess-mark-function)
+  (if (featurep 'xemacs)
+      (define-key ess-mode-map [(meta backspace)] 'backward-kill-word))
   (define-key ess-mode-map "\e\C-q"	'ess-indent-exp)
   (define-key ess-mode-map "\177"	'backward-delete-char-untabify)
   (define-key ess-mode-map "\t"		'ess-indent-command)


I think this should be a patch.  If Debian guidelines required people
to prove that they can build packages without opening (and exposing
the source to possible editing), things like this would go into
patches. I  think. Isn't that what people were recommending to me
yesterday in here?

I was thinking, well, maybe it is just that one package.  I also use
the emacs addon auctex. So I got the source for that, examined the
diff, and found many changes that were confined to the debian
directory, but also plenty that float about in various parts of the
source code. Consider just a couple, which don't seem trivial to my
eye:


--- auctex-11.84.orig/tex.el
+++ auctex-11.84/tex.el
@@ -1292,11 +1292,14 @@
 		  (directory-files (or master-dir ".") nil regexp))))
     (if files
 	(when (or (not TeX-clean-confirm)
-		  (dired-mark-pop-up " *Deletions*" 'delete
-				     (if (> (length files) 1)
-					 files
-				       (cons t files))
-				     'y-or-n-p "Delete files? "))
+		  (condition-case nil
+		      (dired-mark-pop-up " *Deletions*" 'delete
+					 (if (> (length files) 1)
+					     files
+					   (cons t files))
+					 'y-or-n-p "Delete files? ")
+		    (wrong-type-argument ; e.g. with Emacs 21
+		     (y-or-n-p (format "Delete %S? " (car files))))))
 	  (dolist (file files)
 	    (delete-file (concat master-dir file))))
       (message "No files to be deleted"))))
--- auctex-11.84.orig/preview/Makefile.in
+++ auctex-11.84/preview/Makefile.in
@@ -60,7 +60,7 @@

 install-hint:
 	@echo 'Congratulations!  Build is complete.'
-	@echo
+	@echo
 	@echo 'Now, run "make install" as root, or whatever user has permissions'
 	@echo 'to write to the install directory.'

@@ -130,13 +130,13 @@

 clean:
 	rm -f latex.out testdocstrip.tex preview-latex.el
-	rm -rf *.prv *.elc *~ *.aux *.dvi *.log
+	rm -rf *.prv *.elc *~ *.aux *.dvi *.log
 	(cd latex ; $(MAKE) clean)

 distclean: clean
 	rm -f config.log config.cache config.status
 	rm -f Makefile */Makefile auto.el

-maintainer-clean:
+maintainer-clean: distclean
 	$(MAKE) distclean
 	rm -rf autom4te.cache
--- auctex-11.84.orig/preview/latex/Makefile.in
+++ auctex-11.84/preview/latex/Makefile.in
@@ -65,5 +65,5 @@
 	$(PDFLATEX) '\nonstopmode
\AtBeginDocument{\OnlyDescription}\input{preview.drv}'

 clean:
-	rm -f *~ *.aux *.dvi *.drv *.log
-	rm -f $(TEXMFGEN) preview.ins preview-mk.ins
+	rm -f *~ *.aux *.dvi *.drv *.log *.pdf
+	rm -f $(TEXMFGEN) preview.ins preview-mk.ins
--- auctex-11.84.orig/preview/latex/preview.idx
+++ auctex-11.84/preview/latex/preview.idx
@@ -0,0 +1,12 @@
+\indexentry{preview={\ttfamily preview} (environment)|usage}{6}
+\indexentry{environments:preview=>{\ttfamily preview}|usage}{6}
+\indexentry{nopreview={\ttfamily nopreview} (environment)|usage}{6}
+\indexentry{environments:nopreview=>{\ttfamily nopreview}|usage}{6}
+\indexentry{PreviewMacro=\verb!*+\PreviewMacro+|usage}{6}
+\indexentry{PreviewMacro*=\verb!*+\PreviewMacro*+|usage}{7}
+\indexentry{PreviewEnvironment=\verb!*+\PreviewEnvironment+|usage}{8}
+\indexentry{PreviewEnvironment*=\verb!*+\PreviewEnvironment*+|usage}{8}
+\indexentry{PreviewSnarfEnvironment=\verb!*+\PreviewSnarfEnvironment+|usage}{8}
+\indexentry{PreviewOpen=\verb!*+\PreviewOpen+|usage}{8}
+\indexentry{PreviewClose=\verb!*+\PreviewClose+|usage}{8}
+\indexentry{ifPreview=\verb!*+\ifPreview+|usage}{8}


I like the image viewer "gqview", so I checked out its source
packaging.  The diff has a massive section of stuff that was changed
by automake, "config.guess"  "config.sub" and I THINK "aclocal.m4" and
such.  I gather from what was said yesterday that those things should
be excluded from the diff file.  But look at some of the other changes
in the diff that reach into the guts of gqview's source code itself.
There should have been a patch, right?  Note some of these changes are
purely white-space changes, possibly even mistaken taps of the space
bar by the packager.

--- gqview-2.0.4.orig/src/main.c
+++ gqview-2.0.4/src/main.c
@@ -169,18 +169,18 @@
 */
 static gchar *html_browsers[] =
 {
-	/* Redhat has a nifty htmlview script to start the user's preferred browser */
-	"htmlview",	NULL,
+	/* Debian's sensible-browser is similar to Redhat's htmlview */
+	"sensible-browser",	NULL,
 	/* GNOME 2 */
-	"gconftool-2",	"gconftool-2 -g /desktop/gnome/url-handlers/http/command",
+	"gconftool-2",		"gconftool-2 -g /desktop/gnome/url-handlers/http/command",
 	/* KDE */
-	"kfmclient",	"!kfmclient exec \"%s\"",
+	"kfmclient",		"!kfmclient exec \"%s\"",
 	/* use fallbacks */
 	"firefox",	NULL,
-	"mozilla",	NULL,
-	"konqueror",	NULL,
-	"netscape",	NULL,
-	NULL,		NULL
+	"mozilla",		NULL,
+	"konqueror",		NULL,
+	"netscape",		NULL,
+	NULL,			NULL
 };

 static void help_browser_run(void)
--- gqview-2.0.4.orig/src/editors.c
+++ gqview-2.0.4/src/editors.c
@@ -47,14 +47,14 @@


 static gchar *editor_slot_defaults[] = {
-	N_("The Gimp"), "gimp-remote -n %f",
-	N_("XV"), "xv %f",
+	N_("The Gimp"), "gimp-remote %f",
 	N_("Xpaint"), "xpaint %f",
 	NULL, NULL,
 	NULL, NULL,
 	NULL, NULL,
 	NULL, NULL,
 	NULL, NULL,
+	NULL, NULL,
 	N_("Rotate jpeg clockwise"), "%vif jpegtran -rotate 90 -copy all
-outfile %p_tmp %p; then mv %p_tmp %p;else rm %p_tmp;fi",
 	N_("Rotate jpeg counterclockwise"), "%vif jpegtran -rotate 270 -copy
all -outfile %p_tmp %p; then mv %p_tmp %p;else rm %p_tmp;fi",
....


I'm randomly downloading packages.  If you can point me to one that
has source code patches correctly applied, I'd really appreciate it. I
want to get it right  :-)

PJ

-- 
Paul E. Johnson
Professor, Political Science
1541 Lilac Lane, Room 504
University of Kansas


Reply to: