SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm wondering why src2pkg won't work when I run it from $HOME, even though the source tarball and destination package are to be in other directories (PKG_DEST_DIR="/usr/local/packages"), so it shouldn't be doing anything in pwd:
Code:
$ src2pkg ~/downloads/audacious-plugins-3.3.2.tar.bz2
FATAL! Home directory was given as a critical src2pkg variable,
or is the current directory. Please read the src2pkg documentation for help.
I couldn't find the string, "was given as a critical" anywhere in /etc, /usr/local/bin, and /usr/bin, and 'strings makepkg' didn't show anything for "as a critical", so I'm thinking it's in a localised file somewhere else. Anyway, I was just looking for that in order to find out why it had a problem with being in $HOME.
I have read the documentation but the only related mention of the home directory I found is in the tutorial, where it says one can create a directory off there.
It's a safety precaution. Please use a subdir to create packages in. The process can create several temporary files which are unique to the build. Also, working directly in $HOME might leave some files there which would be messy.
The src2pkg program you run is a shell script. It sources most of the main code from files which are in /usr/libexec/src2pkg -that's where grepping will find 'given as a critical' mentioned. In that code you can also see more places listed where src2pkg will not allow you to work -basically any system directories are ruled out. Early on, one user was trying to run src2pkg from /usr/share or /usr/bin, so the checks were implemented.
It really is best to build each package in a separate directory, or use a subdir where you do nothing but builds.
The process can create several temporary files which are unique to the build. Also, working directly in $HOME might leave some files there which would be messy.
It uses pwd as a place for temporary files? Why not /tmp?
Quote:
Originally Posted by gnashley
It really is best to build each package in a separate directory, or use a subdir where you do nothing but builds.
Isn't that what SRC_BUILDS_DIR et al are for?
I always cd into /tmp before running src2pkg, it's just a hassle having to do that.
You have a good point, and it's one I thought about alot. I even did some of the work to make it possible to direct the creation of all temp files to a specific place.
But, there is a reason for using a separate dir -it allows you to run multiple builds at once using src2pkg. The problem is not just the path to where the temporary files are being created, but also one of their naming. To save complexity in naming, generic names can be used instead of having to name files by NAME, VERSION, BUILD, etc. src2pkg looks for existing files like doinst.sh, slack-desc, etc in the PWD. So you don't have to name them like NAME.doinst.sh, NAME-VERSION.slack-desc, etc.
src2pkg, as delivered for Slackware, does use /tmp for the creation of the main bulk of the temp files -I mean where the sources are unpacked and built, and where the package content is assembled. But you might try setting up your src2pkg.conf file the way I do for my use - Use $CWD for all temp files:
[[ $SOURCES_DIR ]] || SOURCES_DIR="$CWD"
[[ $SRC_BUILDS_DIR ]] || SRC_BUILDS_DIR="$CWD"
[[ $PKG_BUILDS_DIR ]] || PKG_BUILDS_DIR="$CWD"
[[ $PKG_DEST_DIR ]] || PKG_DEST_DIR="$CWD"
[[ $BACKUP_DIR ]] || BACKUP_DIR="$CWD"
That way, everything is one place and is much easier to browse through. You cd'ing into /tmp amounts to the same thing, except that there will usually be some 'clutter' in /tmp. I often run concurrent builds, so that won't work for me, plus I like to see 'all and only' the source and build files in the same place.
That said, I will see about fixing it so that what you want would work -at least for single builds.
Seems like almost all files have 'x' bit which makes it difficult to browse the source (e.g. Firefox would not show the content of "ChangeLog" but prompt for download instead).
[src2pkg]$ ls -l
total 3024
-rw-r--r-- 1 amigo users 230910 Feb 16 2012 ChangeLog
-rw-r--r-- 1 amigo users 29059 Feb 15 2012 CHANGES
drwxr-xr-x 29 amigo users 4096 Feb 15 2012 pasture
drwxr-xr-x 4 amigo users 4096 Feb 16 2012 src2pkg-2.7
-rw-r--r-- 1 amigo users 2798492 Feb 16 2012 src2pkg-2.7-noarch-2.txz
drwxr-xr-x 3 amigo users 4096 Jan 29 2009 src2pkg-extensions
drwxr-xr-x 2 amigo users 4096 Dec 20 2009 src2pkg-ng
[src2pkg]$ ls -l src2pkg-2.7
total 12040
-rw-r--r-- 1 amigo users 13691 Jan 25 2012 15-make_package_tar
-rw-r--r-- 1 amigo users 4735 Dec 29 2011 doinst.sh
-rwxr-xr-x 1 amigo users 264 Sep 7 2011 find-broken-links
-rw-r--r-- 1 amigo users 4318 Dec 29 2011 postinst
drwxr-xr-x 9 amigo users 4096 Feb 16 2012 Resources
-rw-r--r-- 1 amigo users 587 Jul 24 2011 slack-desc
-rw-r--r-- 1 amigo users 3050070 Feb 16 2012 src2pkg_2.7-2_all.deb
-rw-r--r-- 1 amigo users 3057195 Feb 16 2012 src2pkg-2.7-2.noarch.rpm
-rw-r--r-- 1 amigo users 3045202 Feb 16 2012 src2pkg-2.7-noarch-2.pet
-rw-r--r-- 1 amigo users 3065344 Feb 16 2012 src2pkg-2.7.tazpkg
-rwxr-xr-x 1 amigo users 19955 Feb 16 2012 src2pkg.build-noarch
drwxr-xr-x 3 amigo users 4096 Feb 16 2012 src2pkg-helpers
I seem to recall having the same behaviour with FF/SM. Try choosing to display the file in a new tab, or tell the browser to open the file with itself -after that it should remember.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.