LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 10-22-2012, 04:22 PM   #1
lopid
Member
 
Registered: Jun 2008
Posts: 107

Rep: Reputation: Disabled
Question src2pkg from $HOME


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.
 
Old 10-23-2012, 11:44 AM   #2
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,763

Rep: Reputation: 472Reputation: 472Reputation: 472Reputation: 472Reputation: 472
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.
 
Old 10-23-2012, 03:27 PM   #3
lopid
Member
 
Registered: Jun 2008
Posts: 107

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by gnashley View Post
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 View Post
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.
 
Old 10-24-2012, 05:09 AM   #4
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,763

Rep: Reputation: 472Reputation: 472Reputation: 472Reputation: 472Reputation: 472
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.
 
1 members found this post helpful.
Old 10-24-2012, 04:36 PM   #5
lopid
Member
 
Registered: Jun 2008
Posts: 107

Original Poster
Rep: Reputation: Disabled
Thanks, I understand now.
 
Old 10-25-2012, 05:40 AM   #6
bnguyen
Member
 
Registered: Jul 2010
Distribution: Slackware
Posts: 125

Rep: Reputation: 32
Quote:
Originally Posted by gnashley View Post
That said, I will see about fixing it so that what you want would work -at least for single builds.
Also, please consider fixing permission bits on
http://distro.ibiblio.org/amigolinux/download/src2pkg/

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).
 
Old 10-26-2012, 04:40 AM   #7
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,763

Rep: Reputation: 472Reputation: 472Reputation: 472Reputation: 472Reputation: 472
bnguyen, the perms don't seem to be the problem:
Code:
[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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[ANNOUNCE] src2pkg-2.0 and src2pkg-ng-0.0.1 gnashley Slackware 11 12-21-2009 11:41 AM
src2pkg can change home permissions. Mol_Bolom Slackware 8 09-16-2009 07:45 PM
New src2pkg release available for download -Introducing the src2pkg WIKI gnashley Slackware 11 05-06-2008 11:09 AM
contents of 'home' directory found at sda5: mounted as /home, and also on sda6:/home leswatson Linux - Newbie 4 04-18-2008 04:02 PM
src2pkg has a new home! gnashley Slackware 19 07-16-2007 09:18 PM


All times are GMT -5. The time now is 06:25 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration